@nextclaw/ui 0.12.6 → 0.12.8

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 (115) hide show
  1. package/CHANGELOG.md +90 -0
  2. package/dist/assets/{ChannelsList-D8p4OlM6.js → ChannelsList-KIQIxluX.js} +1 -1
  3. package/dist/assets/{DocBrowser-Cse_F8Nn.js → DocBrowser-BMxf9CIK.js} +1 -1
  4. package/dist/assets/DocBrowser-CyDgAtO9.js +1 -0
  5. package/dist/assets/{DocBrowserContext-Bai1WU2H.js → DocBrowserContext-Ce28gRXt.js} +1 -1
  6. package/dist/assets/{LogoBadge-BdxMPc9v.js → LogoBadge-o92MOA2L.js} +1 -1
  7. package/dist/assets/{MarketplacePage-BbpAkllU.js → MarketplacePage-BySqkYDh.js} +1 -1
  8. package/dist/assets/MarketplacePage-C0olZaek.js +1 -0
  9. package/dist/assets/{McpMarketplacePage-CxPFOgxv.js → McpMarketplacePage-DqKaiXO9.js} +1 -1
  10. package/dist/assets/{ModelConfig-3GLqQ5GY.js → ModelConfig-IrmzoslW.js} +1 -1
  11. package/dist/assets/{ProviderScopedModelInput-BYNouw-i.js → ProviderScopedModelInput-CmTIzgI7.js} +1 -1
  12. package/dist/assets/{ProvidersList-BR1gJ4Dm.js → ProvidersList-8_Kalfwl.js} +1 -1
  13. package/dist/assets/{RemoteAccessPage-DyYVWsyK.js → RemoteAccessPage-CyQlSjPf.js} +1 -1
  14. package/dist/assets/RuntimeConfig-Bk0uYBhf.js +1 -0
  15. package/dist/assets/{SearchConfig-DTeJvp8m.js → SearchConfig-DNBR-UbE.js} +1 -1
  16. package/dist/assets/{SecretsConfig-CCYO6NcV.js → SecretsConfig-Ba1RPJaG.js} +1 -1
  17. package/dist/assets/{SessionsConfig-Du39vDgt.js → SessionsConfig-Doqp5ghH.js} +1 -1
  18. package/dist/assets/{app-query-client-Dr5d-K8d.js → app-query-client-DniXoIN5.js} +1 -1
  19. package/dist/assets/{book-open-Da4OEPqB.js → book-open-DocgeQtR.js} +1 -1
  20. package/dist/assets/chat-page-Bph8M5zo.js +58 -0
  21. package/dist/assets/chat-session-display-CoN3Wmn-.js +1 -0
  22. package/dist/assets/{chunk-JZWAC4HX-CoFVxHXV.js → chunk-JZWAC4HX-BvKvh1R8.js} +1 -1
  23. package/dist/assets/{client-CSk58DcF.js → client-CVqPF5ie.js} +1 -1
  24. package/dist/assets/{config-D8KzikVB.js → config-Bop2oB18.js} +1 -1
  25. package/dist/assets/{createLucideIcon-83gaZMtv.js → createLucideIcon-DVv8taGY.js} +1 -1
  26. package/dist/assets/desktop-update-config-1KBrqLBC.js +1 -0
  27. package/dist/assets/{dist-toEYs-MZ.js → dist-Da5Gm_pO.js} +1 -1
  28. package/dist/assets/{dist-aTmhMDVh.js → dist-DmAlInRu.js} +1 -1
  29. package/dist/assets/{external-link-QQ0TC6X4.js → external-link-DFjw3x1B.js} +1 -1
  30. package/dist/assets/{hash-DaFBEkmi.js → hash-DJtaCejM.js} +1 -1
  31. package/dist/assets/i18n-CwHZ-9vt.js +1 -0
  32. package/dist/assets/{index-CE4N7ItL.css → index-DafCdM4F.css} +1 -1
  33. package/dist/assets/{index-riX7Sg0_.js → index-DdksE6U3.js} +3 -3
  34. package/dist/assets/{infiniteQueryBehavior-BmHX_ayZ.js → infiniteQueryBehavior-DHSEQ3OH.js} +1 -1
  35. package/dist/assets/loader-circle-PsSP0H9n.js +1 -0
  36. package/dist/assets/{logos-Dzlz30M3.js → logos-DEFUIR12.js} +1 -1
  37. package/dist/assets/{page-layout-D2eRufRQ.js → page-layout-Da3i3r6G.js} +1 -1
  38. package/dist/assets/play-DBQbBxTA.js +1 -0
  39. package/dist/assets/plus-DUOVbsyQ.js +1 -0
  40. package/dist/assets/{popover-BSXxm5bj.js → popover-C_mWOFzI.js} +1 -1
  41. package/dist/assets/{refresh-ccw-B3zMtN-_.js → refresh-ccw-D6HkNtfz.js} +1 -1
  42. package/dist/assets/{refresh-cw-DlZkIHnJ.js → refresh-cw-DRcvRrnc.js} +1 -1
  43. package/dist/assets/rotate-cw-BmDKfXtH.js +1 -0
  44. package/dist/assets/{save-Us9fg4Sj.js → save-DHGmi2e9.js} +1 -1
  45. package/dist/assets/search-MChQRYR1.js +1 -0
  46. package/dist/assets/{security-config-BGWYwxNr.js → security-config-CbXfPZzr.js} +1 -1
  47. package/dist/assets/{select-DLYqySQK.js → select-Caud8QvU.js} +1 -1
  48. package/dist/assets/skeleton-B-4vRq_Z.js +1 -0
  49. package/dist/assets/{status-dot-DGayudyB.js → status-dot-DurKKSwA.js} +1 -1
  50. package/dist/assets/{switch-Dz2ScsKx.js → switch-0rmPBRKI.js} +1 -1
  51. package/dist/assets/{tabs-custom-CdKyjiGk.js → tabs-custom-5JLVL6v8.js} +1 -1
  52. package/dist/assets/{trash-2-Db-mZOZs.js → trash-2-C6caKPoz.js} +1 -1
  53. package/dist/assets/{use-infinite-scroll-loader-DBJX5hj0.js → use-infinite-scroll-loader-dwnaa_qi.js} +1 -1
  54. package/dist/assets/{useConfirmDialog-DL0a-oGC.js → useConfirmDialog-mMeWD_yo.js} +1 -1
  55. package/dist/assets/{useMutation-BdZm-9PL.js → useMutation-BmxxvCNf.js} +1 -1
  56. package/dist/assets/x-DuMhMATD.js +1 -0
  57. package/dist/index.html +20 -20
  58. package/package.json +6 -6
  59. package/src/api/runtime-control.ts +34 -0
  60. package/src/api/runtime-control.types.ts +58 -0
  61. package/src/api/types.ts +13 -0
  62. package/src/{App.test.tsx → app.test.tsx} +1 -1
  63. package/src/{App.tsx → app.tsx} +1 -1
  64. package/src/components/chat/ChatConversationPanel.test.tsx +78 -16
  65. package/src/components/chat/ChatSidebar.test.tsx +36 -7
  66. package/src/components/chat/ChatSidebar.tsx +19 -26
  67. package/src/components/chat/chat-child-session-panel.tsx +16 -8
  68. package/src/components/chat/chat-page-runtime.test.ts +1 -1
  69. package/src/components/chat/{ChatPage.tsx → chat-page.tsx} +1 -1
  70. package/src/components/chat/managers/chat-session-list.manager.test.ts +82 -31
  71. package/src/components/chat/managers/chat-session-list.manager.ts +79 -14
  72. package/src/components/chat/managers/chat-ui.manager.ts +2 -0
  73. package/src/components/chat/ncp/README.md +1 -1
  74. package/src/components/chat/ncp/ncp-chat-input.manager.ts +7 -1
  75. package/src/components/chat/ncp/ncp-chat-page-data.test.ts +1 -1
  76. package/src/components/chat/ncp/ncp-session-adapter.test.ts +5 -1
  77. package/src/components/chat/ncp/ncp-session-adapter.ts +12 -0
  78. package/src/components/chat/ncp/session-conversation/use-ncp-child-session-tabs-view.ts +4 -0
  79. package/src/components/chat/ncp/tests/ncp-chat-input.manager.test.ts +99 -0
  80. package/src/components/chat/stores/chat-session-list.store.ts +25 -54
  81. package/src/components/common/ProviderScopedModelInput.tsx +12 -2
  82. package/src/components/config/ModelConfig.test.tsx +108 -2
  83. package/src/components/config/RuntimeConfig.tsx +14 -6
  84. package/src/components/config/desktop-update-config.test.tsx +85 -0
  85. package/src/components/config/desktop-update-config.tsx +44 -3
  86. package/src/components/config/runtime-control-card.test.tsx +255 -0
  87. package/src/components/config/runtime-control-card.tsx +301 -0
  88. package/src/components/config/runtime-presence-card.test.tsx +154 -0
  89. package/src/components/config/runtime-presence-card.tsx +163 -0
  90. package/src/desktop/desktop-update.types.ts +25 -0
  91. package/src/desktop/managers/desktop-presence.manager.ts +91 -0
  92. package/src/desktop/managers/desktop-update.manager.ts +37 -1
  93. package/src/desktop/stores/desktop-presence.store.ts +18 -0
  94. package/src/desktop/stores/desktop-update.store.ts +7 -1
  95. package/src/hooks/use-runtime-control.ts +24 -0
  96. package/src/lib/desktop-update-labels.utils.ts +28 -2
  97. package/src/lib/i18n.runtime-control.ts +120 -0
  98. package/src/lib/i18n.ts +2 -4
  99. package/src/main.tsx +1 -1
  100. package/src/runtime-control/runtime-control.manager.ts +118 -0
  101. package/dist/assets/ChatPage-A45t1Rmf.js +0 -58
  102. package/dist/assets/DocBrowser-B2MpsnU9.js +0 -1
  103. package/dist/assets/MarketplacePage-BNZ3Jx5d.js +0 -1
  104. package/dist/assets/RuntimeConfig-ChdfK4Y_.js +0 -1
  105. package/dist/assets/chat-session-display-CAlPrnlV.js +0 -1
  106. package/dist/assets/desktop-update-config-CfoVwf-w.js +0 -1
  107. package/dist/assets/i18n-C3jb83S6.js +0 -1
  108. package/dist/assets/loader-circle-BjMg63eu.js +0 -1
  109. package/dist/assets/plus-CIXME2pD.js +0 -1
  110. package/dist/assets/search-B_Qr0f6C.js +0 -1
  111. package/dist/assets/skeleton-CYQJazv6.js +0 -1
  112. package/dist/assets/x-B8Tho_xC.js +0 -1
  113. /package/dist/assets/{config-hints-GSUMvmSo.js → config-hints-BZoDjXye.js} +0 -0
  114. /package/dist/assets/{config-layout-CgBMG7OL.js → config-layout-DmlGaay2.js} +0 -0
  115. /package/src/components/chat/ncp/{NcpChatPage.tsx → ncp-chat-page.tsx} +0 -0
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DocBrowser-B2MpsnU9.js","assets/DocBrowser-Cse_F8Nn.js","assets/i18n-C3jb83S6.js","assets/createLucideIcon-83gaZMtv.js","assets/book-open-Da4OEPqB.js","assets/external-link-QQ0TC6X4.js","assets/plus-CIXME2pD.js","assets/search-B_Qr0f6C.js","assets/x-B8Tho_xC.js","assets/DocBrowserContext-Bai1WU2H.js","assets/ModelConfig-3GLqQ5GY.js","assets/dist-aTmhMDVh.js","assets/ProviderScopedModelInput-BYNouw-i.js","assets/select-DLYqySQK.js","assets/loader-circle-BjMg63eu.js","assets/page-layout-D2eRufRQ.js","assets/skeleton-CYQJazv6.js","assets/config-hints-GSUMvmSo.js","assets/ChatPage-A45t1Rmf.js","assets/chunk-JZWAC4HX-CoFVxHXV.js","assets/popover-BSXxm5bj.js","assets/dist-toEYs-MZ.js","assets/MarketplacePage-BbpAkllU.js","assets/client-CSk58DcF.js","assets/use-infinite-scroll-loader-DBJX5hj0.js","assets/infiniteQueryBehavior-BmHX_ayZ.js","assets/useMutation-BdZm-9PL.js","assets/useConfirmDialog-DL0a-oGC.js","assets/tabs-custom-CdKyjiGk.js","assets/app-query-client-Dr5d-K8d.js","assets/logos-Dzlz30M3.js","assets/refresh-ccw-B3zMtN-_.js","assets/refresh-cw-DlZkIHnJ.js","assets/trash-2-Db-mZOZs.js","assets/chat-session-display-CAlPrnlV.js","assets/config-D8KzikVB.js","assets/LogoBadge-BdxMPc9v.js","assets/SearchConfig-DTeJvp8m.js","assets/config-layout-CgBMG7OL.js","assets/ProvidersList-BR1gJ4Dm.js","assets/status-dot-DGayudyB.js","assets/switch-Dz2ScsKx.js","assets/ChannelsList-D8p4OlM6.js","assets/hash-DaFBEkmi.js","assets/RuntimeConfig-ChdfK4Y_.js","assets/save-Us9fg4Sj.js","assets/desktop-update-config-CfoVwf-w.js","assets/security-config-BGWYwxNr.js","assets/SessionsConfig-Du39vDgt.js","assets/SecretsConfig-CCYO6NcV.js","assets/RemoteAccessPage-DyYVWsyK.js","assets/MarketplacePage-BNZ3Jx5d.js","assets/McpMarketplacePage-CxPFOgxv.js"])))=>i.map(i=>d[i]);
2
- import{_ as e,a as t,c as n,h as r,i,l as a,m as o,n as s,o as c,p as l,s as u,u as d}from"./i18n-C3jb83S6.js";import{a as f,n as p,r as m,t as h}from"./dist-aTmhMDVh.js";import{a as ee,i as g,l as _,n as te,o as ne,r as v,t as y}from"./chunk-JZWAC4HX-CoFVxHXV.js";import{i as b,n as re,o as ie,s as x,t as S}from"./client-CSk58DcF.js";import{t as C}from"./app-query-client-Dr5d-K8d.js";import{t as w}from"./useMutation-BdZm-9PL.js";import{A as ae,B as T,F as oe,G as E,H as se,I as D,L as ce,M as le,N as ue,P as de,U as fe,W as pe,i as me,j as he,n as ge,r as _e,t as ve,z as ye}from"./select-DLYqySQK.js";import{t as be}from"./dist-toEYs-MZ.js";import{t as O}from"./createLucideIcon-83gaZMtv.js";import{n as xe}from"./DocBrowser-Cse_F8Nn.js";import{t as Se}from"./book-open-Da4OEPqB.js";import{t as Ce}from"./search-B_Qr0f6C.js";import{t as we}from"./x-B8Tho_xC.js";import{C as Te,D as Ee,E as De,O as Oe,S as ke,T as Ae,_ as je,a as Me,b as Ne,c as Pe,f as Fe,g as Ie,h as Le,i as Re,l as ze,m as Be,n as Ve,o as He,p as Ue,r as We,s as Ge,t as Ke,u as qe,v as Je,w as Ye,x as Xe,y as Ze}from"./config-D8KzikVB.js";import{i as k,n as Qe,r as $e}from"./DocBrowserContext-Bai1WU2H.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var et=r((e=>{var t=f();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),A=e(o(),1),j=l(),M=`Dialog`,[tt,nt]=fe(M),[rt,N]=tt(M),it=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=A.useRef(null),c=A.useRef(null),[l,u]=ye({prop:r,defaultProp:i??!1,onChange:a,caller:M});return(0,j.jsx)(rt,{scope:t,triggerRef:s,contentRef:c,contentId:T(),titleId:T(),descriptionId:T(),open:l,onOpenChange:u,onOpenToggle:A.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};it.displayName=M;var at=`DialogTrigger`,ot=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(at,n),a=pe(t,i.triggerRef);return(0,j.jsx)(D.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":St(i.open),...r,ref:a,onClick:E(e.onClick,i.onOpenToggle)})});ot.displayName=at;var P=`DialogPortal`,[st,ct]=tt(P,{forceMount:void 0}),lt=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=N(P,t);return(0,j.jsx)(st,{scope:t,forceMount:n,children:A.Children.map(r,e=>(0,j.jsx)(be,{present:n||a.open,children:(0,j.jsx)(ue,{asChild:!0,container:i,children:e})}))})};lt.displayName=P;var F=`DialogOverlay`,ut=A.forwardRef((e,t)=>{let n=ct(F,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=N(F,e.__scopeDialog);return a.modal?(0,j.jsx)(be,{present:r||a.open,children:(0,j.jsx)(ft,{...i,ref:t})}):null});ut.displayName=F;var dt=ce(`DialogOverlay.RemoveScroll`),ft=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(F,n);return(0,j.jsx)(he,{as:dt,allowPinchZoom:!0,shards:[i.contentRef],children:(0,j.jsx)(D.div,{"data-state":St(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),I=`DialogContent`,pt=A.forwardRef((e,t)=>{let n=ct(I,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=N(I,e.__scopeDialog);return(0,j.jsx)(be,{present:r||a.open,children:a.modal?(0,j.jsx)(mt,{...i,ref:t}):(0,j.jsx)(ht,{...i,ref:t})})});pt.displayName=I;var mt=A.forwardRef((e,t)=>{let n=N(I,e.__scopeDialog),r=A.useRef(null),i=pe(t,n.contentRef,r);return A.useEffect(()=>{let e=r.current;if(e)return ae(e)},[]),(0,j.jsx)(gt,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:E(e.onFocusOutside,e=>e.preventDefault())})}),ht=A.forwardRef((e,t)=>{let n=N(I,e.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return(0,j.jsx)(gt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),gt=A.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=N(I,n),c=A.useRef(null),l=pe(t,c);return le(),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(de,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,j.jsx)(oe,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":St(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Et,{titleId:s.titleId}),(0,j.jsx)(Ot,{contentRef:c,descriptionId:s.descriptionId})]})]})}),L=`DialogTitle`,_t=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(L,n);return(0,j.jsx)(D.h2,{id:i.titleId,...r,ref:t})});_t.displayName=L;var vt=`DialogDescription`,yt=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(vt,n);return(0,j.jsx)(D.p,{id:i.descriptionId,...r,ref:t})});yt.displayName=vt;var bt=`DialogClose`,xt=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(bt,n);return(0,j.jsx)(D.button,{type:`button`,...r,ref:t,onClick:E(e.onClick,()=>i.onOpenChange(!1))})});xt.displayName=bt;function St(e){return e?`open`:`closed`}var Ct=`DialogTitleWarning`,[wt,Tt]=se(Ct,{contentName:I,titleName:L,docsSlug:`dialog`}),Et=({titleId:e})=>{let t=Tt(Ct),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DocBrowser-CyDgAtO9.js","assets/DocBrowser-BMxf9CIK.js","assets/i18n-CwHZ-9vt.js","assets/createLucideIcon-DVv8taGY.js","assets/book-open-DocgeQtR.js","assets/external-link-DFjw3x1B.js","assets/plus-DUOVbsyQ.js","assets/search-MChQRYR1.js","assets/x-DuMhMATD.js","assets/DocBrowserContext-Ce28gRXt.js","assets/ModelConfig-IrmzoslW.js","assets/dist-DmAlInRu.js","assets/ProviderScopedModelInput-CmTIzgI7.js","assets/select-Caud8QvU.js","assets/loader-circle-PsSP0H9n.js","assets/page-layout-Da3i3r6G.js","assets/skeleton-B-4vRq_Z.js","assets/config-hints-BZoDjXye.js","assets/chat-page-Bph8M5zo.js","assets/chunk-JZWAC4HX-BvKvh1R8.js","assets/popover-C_mWOFzI.js","assets/dist-Da5Gm_pO.js","assets/MarketplacePage-BySqkYDh.js","assets/client-CVqPF5ie.js","assets/use-infinite-scroll-loader-dwnaa_qi.js","assets/infiniteQueryBehavior-DHSEQ3OH.js","assets/useMutation-BmxxvCNf.js","assets/useConfirmDialog-mMeWD_yo.js","assets/tabs-custom-5JLVL6v8.js","assets/app-query-client-DniXoIN5.js","assets/logos-DEFUIR12.js","assets/play-DBQbBxTA.js","assets/refresh-ccw-D6HkNtfz.js","assets/refresh-cw-DRcvRrnc.js","assets/trash-2-C6caKPoz.js","assets/chat-session-display-CoN3Wmn-.js","assets/config-Bop2oB18.js","assets/LogoBadge-o92MOA2L.js","assets/SearchConfig-DNBR-UbE.js","assets/config-layout-DmlGaay2.js","assets/ProvidersList-8_Kalfwl.js","assets/status-dot-DurKKSwA.js","assets/switch-0rmPBRKI.js","assets/ChannelsList-KIQIxluX.js","assets/hash-DJtaCejM.js","assets/RuntimeConfig-Bk0uYBhf.js","assets/rotate-cw-BmDKfXtH.js","assets/save-DHGmi2e9.js","assets/desktop-update-config-1KBrqLBC.js","assets/security-config-CbXfPZzr.js","assets/SessionsConfig-Doqp5ghH.js","assets/SecretsConfig-Ba1RPJaG.js","assets/RemoteAccessPage-CyQlSjPf.js","assets/MarketplacePage-C0olZaek.js","assets/McpMarketplacePage-DqKaiXO9.js"])))=>i.map(i=>d[i]);
2
+ import{_ as e,a as t,c as n,h as r,i,l as a,m as o,n as s,o as c,p as l,s as u,u as d}from"./i18n-CwHZ-9vt.js";import{a as f,n as p,r as m,t as h}from"./dist-DmAlInRu.js";import{a as ee,i as g,l as _,n as te,o as ne,r as v,t as y}from"./chunk-JZWAC4HX-BvKvh1R8.js";import{i as b,n as re,o as ie,s as x,t as S}from"./client-CVqPF5ie.js";import{t as C}from"./app-query-client-DniXoIN5.js";import{t as w}from"./useMutation-BmxxvCNf.js";import{A as ae,B as T,F as oe,G as E,H as se,I as D,L as ce,M as le,N as ue,P as de,U as fe,W as pe,i as me,j as he,n as ge,r as _e,t as ve,z as ye}from"./select-Caud8QvU.js";import{t as be}from"./dist-Da5Gm_pO.js";import{t as O}from"./createLucideIcon-DVv8taGY.js";import{n as xe}from"./DocBrowser-BMxf9CIK.js";import{t as Se}from"./book-open-DocgeQtR.js";import{t as Ce}from"./search-MChQRYR1.js";import{t as we}from"./x-DuMhMATD.js";import{C as Te,D as Ee,E as De,O as Oe,S as ke,T as Ae,_ as je,a as Me,b as Ne,c as Pe,f as Fe,g as Ie,h as Le,i as Re,l as ze,m as Be,n as Ve,o as He,p as Ue,r as We,s as Ge,t as Ke,u as qe,v as Je,w as Ye,x as Xe,y as Ze}from"./config-Bop2oB18.js";import{i as k,n as Qe,r as $e}from"./DocBrowserContext-Ce28gRXt.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var et=r((e=>{var t=f();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),A=e(o(),1),j=l(),M=`Dialog`,[tt,nt]=fe(M),[rt,N]=tt(M),it=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=A.useRef(null),c=A.useRef(null),[l,u]=ye({prop:r,defaultProp:i??!1,onChange:a,caller:M});return(0,j.jsx)(rt,{scope:t,triggerRef:s,contentRef:c,contentId:T(),titleId:T(),descriptionId:T(),open:l,onOpenChange:u,onOpenToggle:A.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};it.displayName=M;var at=`DialogTrigger`,ot=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(at,n),a=pe(t,i.triggerRef);return(0,j.jsx)(D.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":St(i.open),...r,ref:a,onClick:E(e.onClick,i.onOpenToggle)})});ot.displayName=at;var P=`DialogPortal`,[st,ct]=tt(P,{forceMount:void 0}),lt=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=N(P,t);return(0,j.jsx)(st,{scope:t,forceMount:n,children:A.Children.map(r,e=>(0,j.jsx)(be,{present:n||a.open,children:(0,j.jsx)(ue,{asChild:!0,container:i,children:e})}))})};lt.displayName=P;var F=`DialogOverlay`,ut=A.forwardRef((e,t)=>{let n=ct(F,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=N(F,e.__scopeDialog);return a.modal?(0,j.jsx)(be,{present:r||a.open,children:(0,j.jsx)(ft,{...i,ref:t})}):null});ut.displayName=F;var dt=ce(`DialogOverlay.RemoveScroll`),ft=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(F,n);return(0,j.jsx)(he,{as:dt,allowPinchZoom:!0,shards:[i.contentRef],children:(0,j.jsx)(D.div,{"data-state":St(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),I=`DialogContent`,pt=A.forwardRef((e,t)=>{let n=ct(I,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=N(I,e.__scopeDialog);return(0,j.jsx)(be,{present:r||a.open,children:a.modal?(0,j.jsx)(mt,{...i,ref:t}):(0,j.jsx)(ht,{...i,ref:t})})});pt.displayName=I;var mt=A.forwardRef((e,t)=>{let n=N(I,e.__scopeDialog),r=A.useRef(null),i=pe(t,n.contentRef,r);return A.useEffect(()=>{let e=r.current;if(e)return ae(e)},[]),(0,j.jsx)(gt,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:E(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:E(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:E(e.onFocusOutside,e=>e.preventDefault())})}),ht=A.forwardRef((e,t)=>{let n=N(I,e.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return(0,j.jsx)(gt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),gt=A.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=N(I,n),c=A.useRef(null),l=pe(t,c);return le(),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(de,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,j.jsx)(oe,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":St(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(Et,{titleId:s.titleId}),(0,j.jsx)(Ot,{contentRef:c,descriptionId:s.descriptionId})]})]})}),L=`DialogTitle`,_t=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(L,n);return(0,j.jsx)(D.h2,{id:i.titleId,...r,ref:t})});_t.displayName=L;var vt=`DialogDescription`,yt=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(vt,n);return(0,j.jsx)(D.p,{id:i.descriptionId,...r,ref:t})});yt.displayName=vt;var bt=`DialogClose`,xt=A.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=N(bt,n);return(0,j.jsx)(D.button,{type:`button`,...r,ref:t,onClick:E(e.onClick,()=>i.onOpenChange(!1))})});xt.displayName=bt;function St(e){return e?`open`:`closed`}var Ct=`DialogTitleWarning`,[wt,Tt]=se(Ct,{contentName:I,titleName:L,docsSlug:`dialog`}),Et=({titleId:e})=>{let t=Tt(Ct),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
3
3
 
4
4
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
5
5
 
6
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Dt=`DialogDescriptionWarning`,Ot=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tt(Dt).contentName}}.`;return A.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},kt=it,At=lt,jt=ut,Mt=pt,Nt=_t,Pt=yt,Ft=xt,It=O(`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`}]]),Lt=O(`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`}]]),Rt=O(`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`}]]),zt=O(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),Bt=O(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),Vt=O(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Ht=O(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),R=O(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ut=O(`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`}]]),Wt=O(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),Gt=O(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),Kt=O(`MessageSquare`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),qt=O(`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`}]]),Jt=O(`Plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Yt=O(`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`}]]),Xt=O(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Zt=O(`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`}]]),Qt=O(`SquareArrowOutUpRight`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),$t=O(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),en=O(`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`}]]),tn=kt,nn=At,rn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(jt,{ref:n,className:d(`fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));rn.displayName=jt.displayName;var an=A.forwardRef(({className:e,children:t,...n},r)=>(0,j.jsxs)(nn,{children:[(0,j.jsx)(rn,{}),(0,j.jsxs)(Mt,{ref:r,className:d(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200/50 bg-white p-6 shadow-xl duration-base data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-2xl`,e),...n,children:[t,(0,j.jsxs)(Ft,{className:`absolute right-4 top-4 rounded-lg p-1 opacity-70 ring-offset-white transition-all duration-fast hover:opacity-100 hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none`,children:[(0,j.jsx)(we,{className:`h-4 w-4 text-gray-500`}),(0,j.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));an.displayName=Mt.displayName;var z=({className:e,...t})=>(0,j.jsx)(`div`,{className:d(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});z.displayName=`DialogHeader`;var on=({className:e,...t})=>(0,j.jsx)(`div`,{className:d(`flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3`,e),...t});on.displayName=`DialogFooter`;var sn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(Nt,{ref:n,className:d(`text-lg font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));sn.displayName=Nt.displayName;var cn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(Pt,{ref:n,className:d(`text-sm text-gray-500 leading-relaxed`,e),...t}));cn.displayName=Pt.displayName;var B=A.forwardRef(({className:e,type:t,...n},r)=>(0,j.jsx)(`input`,{type:t,className:d(`flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-900 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-300 placeholder:font-normal focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/40 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));B.displayName=`Input`;var ln=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`label`,{ref:n,className:d(`text-sm font-medium leading-none text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t}));ln.displayName=`Label`;async function un(){let e=await S.get(`/api/remote/status`);if(!e.ok)throw Error(e.error.message);return e.data}async function dn(){let e=await S.get(`/api/remote/doctor`);if(!e.ok)throw Error(e.error.message);return e.data}async function fn(e){let t=await S.post(`/api/remote/auth/start`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function pn(e){let t=await S.post(`/api/remote/auth/poll`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function mn(){let e=await S.post(`/api/remote/logout`,{});if(!e.ok)throw Error(e.error.message);return e.data}async function hn(e){let t=await S.put(`/api/remote/account/profile`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function gn(e){let t=await S.put(`/api/remote/settings`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function V(e){let t=await S.post(`/api/remote/service/${e}`,{});if(!t.ok)throw Error(t.error.message);return t.data}var _n=[`remote-status`],vn=`https://platform.nextclaw.io`,yn=`https://nextclaw-platform-console.pages.dev`,H=async()=>await C.fetchQuery({queryKey:_n,queryFn:un,staleTime:5e3}),U=async()=>(await C.invalidateQueries({queryKey:_n}),await H()),bn=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function W(e){let t=e?.trim();if(!t)return;let n;try{n=new URL(t)}catch{return}if(n.hostname===`platform.nextclaw.io`||n.hostname===`nextclaw-platform-console.pages.dev`)return n.origin;if(n.hostname===`ai-gateway-api.nextclaw.io`)return vn;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return yn}var xn=e=>W(e?.account.apiBase)||W(e?.settings.platformApiBase)||W(e?.platformBase)||W(e?.account.platformBase)||void 0;function Sn(){return b({queryKey:_n,queryFn:un,staleTime:5e3,refetchOnWindowFocus:!0})}var Cn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},wn=(e=>e?Cn(e):Cn),Tn=e=>e;function En(e,t=Tn){let n=A.useSyncExternalStore(e.subscribe,A.useCallback(()=>t(e.getState()),[e,t]),A.useCallback(()=>t(e.getInitialState()),[e,t]));return A.useDebugValue(n),n}var Dn=e=>{let t=wn(e),n=e=>En(t,e);return Object.assign(n,t),n},G=(e=>e?Dn(e):Dn),K=G(e=>({panelOpen:!1,authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500,pendingAction:null,openPanel:()=>e({panelOpen:!0}),closePanel:()=>e({panelOpen:!1}),setPendingAction:t=>e({pendingAction:t}),clearPendingAction:()=>e({pendingAction:null}),beginBrowserAuth:({sessionId:t,verificationUri:n,expiresAt:r,intervalMs:i,statusMessage:a})=>e({panelOpen:!0,authSessionId:t,authVerificationUri:n,authExpiresAt:r,authPollIntervalMs:i,authStatusMessage:a}),updateBrowserAuth:({statusMessage:t,intervalMs:n})=>e(e=>({authStatusMessage:t??e.authStatusMessage,authPollIntervalMs:n??e.authPollIntervalMs})),clearBrowserAuth:()=>e({authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500}),setAuthStatusMessage:t=>e({authStatusMessage:t})})),On=class{constructor(){this.authPollTimerId=null,this.afterSignedIn=null,this.bindSignedInContinuation=e=>{this.afterSignedIn=e},this.openAccountPanel=()=>{K.getState().openPanel()},this.closeAccountPanel=()=>{K.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),K.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=await H();return t.account.loggedIn?!0:(e?.pendingAction&&K.getState().setPendingAction(e.pendingAction),this.openAccountPanel(),await this.startBrowserSignIn({apiBase:e?.apiBase,status:t}),!1)},this.startBrowserSignIn=async e=>{try{let t=e?.apiBase,n=e?.pendingAction,r=e?.status??await H();n&&K.getState().setPendingAction(n);let a=await fn({apiBase:bn(r,t)});K.getState().beginBrowserAuth({sessionId:a.sessionId,verificationUri:a.verificationUri,expiresAt:a.expiresAt,intervalMs:a.intervalMs,statusMessage:i(`remoteBrowserAuthWaiting`)}),window.open(a.verificationUri,`_blank`,`noopener,noreferrer`)||K.getState().setAuthStatusMessage(i(`remoteBrowserAuthPopupBlocked`)),this.scheduleBrowserAuthPoll()}catch(e){let t=e instanceof Error?e.message:i(`remoteBrowserAuthStartFailed`);p.error(`${i(`remoteBrowserAuthStartFailed`)}: ${t}`)}},this.resumeBrowserSignIn=()=>{let e=K.getState().authVerificationUri;e&&window.open(e,`_blank`,`noopener,noreferrer`)},this.logout=async()=>{try{await mn(),K.getState().clearPendingAction(),K.getState().clearBrowserAuth(),await U(),p.success(i(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:i(`remoteLogoutFailed`);p.error(`${i(`remoteLogoutFailed`)}: ${t}`)}},this.updateUsername=async e=>{try{await hn({username:e.trim()}),await U(),p.success(i(`remoteAccountUsernameSetSuccess`))}catch(e){let t=e instanceof Error?e.message:i(`remoteAccountUsernameSetFailed`);p.error(`${i(`remoteAccountUsernameSetFailed`)}: ${t}`)}},this.openNextClawWeb=async()=>{let e=xn(await H());if(!e){p.error(i(`remoteOpenWebUnavailable`));return}window.open(e,`_blank`,`noopener,noreferrer`)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=K.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=K.getState();if(e.authSessionId)try{let t=await H(),n=await pn({sessionId:e.authSessionId,apiBase:bn(t)});if(n.status===`pending`){K.getState().updateBrowserAuth({statusMessage:i(`remoteBrowserAuthWaiting`),intervalMs:n.nextPollMs??1500}),this.scheduleBrowserAuthPoll();return}if(n.status===`expired`){this.clearPollTimer(),K.getState().clearBrowserAuth(),p.error(n.message||i(`remoteBrowserAuthExpired`));return}K.getState().setAuthStatusMessage(i(`remoteBrowserAuthCompleted`));let r=await U(),{pendingAction:a}=K.getState();this.clearPollTimer(),K.getState().clearBrowserAuth(),p.success(i(`remoteLoginSuccess`)),a&&this.afterSignedIn&&await this.afterSignedIn(a,r),K.getState().clearPendingAction()}catch(e){this.clearPollTimer(),K.getState().clearBrowserAuth();let t=e instanceof Error?e.message:i(`remoteBrowserAuthPollFailed`);p.error(`${i(`remoteBrowserAuthPollFailed`)}: ${t}`)}},this.clearPollTimer=()=>{this.authPollTimerId!==null&&(window.clearTimeout(this.authPollTimerId),this.authPollTimerId=null)},this.getBrowserAuthSummary=()=>{let e=K.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?s(e.authExpiresAt):`-`}}}},q=G(e=>({enabled:!1,deviceName:``,platformApiBase:``,advancedOpen:!1,draftTouched:!1,actionLabel:null,doctor:null,setEnabled:t=>e({enabled:t,draftTouched:!0}),setDeviceName:t=>e({deviceName:t,draftTouched:!0}),setPlatformApiBase:t=>e({platformApiBase:t,draftTouched:!0}),setAdvancedOpen:t=>e({advancedOpen:t}),hydrateDraft:({enabled:t,deviceName:n,platformApiBase:r})=>e({enabled:t,deviceName:n,platformApiBase:r,draftTouched:!1}),beginAction:t=>e({actionLabel:t}),finishAction:()=>e({actionLabel:null}),setDoctor:t=>e({doctor:t})})),kn=class{constructor(){this.accountManager=null,this.bindAccountManager=e=>{this.accountManager=e},this.syncStatus=e=>{if(!e)return;let t=q.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{q.getState().setEnabled(e)},this.setDeviceName=e=>{q.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{q.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{q.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await U(),n=q.getState();if(!t.account.loggedIn){await this.accountManager?.ensureSignedIn({pendingAction:{type:`enable-remote`},apiBase:n.platformApiBase});return}await this.applyEnabledState(!0,t)},this.disableRemoteAccess=async e=>{let t=e??await U();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await U();if(!t.account.loggedIn){await this.accountManager?.ensureSignedIn({pendingAction:{type:`enable-remote`}});return}let n=t.service.running?`restart`:`start`;await this.runManagedAction({actionLabel:i(n===`restart`?`remoteActionRestarting`:`remoteActionStarting`),job:async()=>{await V(n);let e=await U();this.hydrateDraftFromStatus(e)},successMessage:i(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await U();await this.accountManager?.startBrowserSignIn({status:t,apiBase:q.getState().platformApiBase,pendingAction:{type:`repair-remote`}})},this.saveAdvancedSettings=async e=>{let t=e??await U(),n=q.getState();await this.runManagedAction({actionLabel:i(`remoteActionSavingAdvanced`),job:async()=>{await gn({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await U();this.hydrateDraftFromStatus(e)},successMessage:t.settings.enabled===n.enabled?i(`remoteSettingsSaved`):i(`remoteAdvancedSaved`)})},this.runDoctor=async()=>{await this.runManagedAction({actionLabel:i(`remoteDoctorRunning`),job:async()=>{let e=await dn();q.getState().setDoctor(e)},successMessage:i(`remoteDoctorCompleted`)})},this.startService=async()=>{await this.runServiceAction(`start`,i(`remoteActionStarting`))},this.restartService=async()=>{await this.runServiceAction(`restart`,i(`remoteActionRestarting`))},this.stopService=async()=>{await this.runServiceAction(`stop`,i(`remoteActionStopping`))},this.resumePendingActionAfterSignIn=async(e,t)=>{if(e){if(e.type===`enable-remote`){await this.applyEnabledState(!0,t);return}e.type===`repair-remote`&&await this.repairRemoteAccess(t)}},this.applyEnabledState=async(e,t)=>{let n=q.getState();await this.runManagedAction({actionLabel:i(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await gn({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await U();this.hydrateDraftFromStatus(r),e?await V(r.service.running?`restart`:`start`):t.service.running&&await V(`restart`);let i=await U();this.hydrateDraftFromStatus(i)},successMessage:i(e?`remoteEnabledReady`:`remoteDisabledDone`)})},this.runServiceAction=async(e,t)=>{await this.runManagedAction({actionLabel:t,job:async()=>{let t=await V(e),n=await U();this.hydrateDraftFromStatus(n),p.success(t.message)}})},this.hydrateDraftFromStatus=e=>{q.getState().hydrateDraft({enabled:e.settings.enabled,deviceName:e.settings.deviceName,platformApiBase:e.settings.platformApiBase})},this.runManagedAction=async e=>{q.getState().beginAction(e.actionLabel);try{await e.job(),e.successMessage&&p.success(e.successMessage)}catch(e){let t=e instanceof Error?e.message:i(`error`);throw p.error(t),e}finally{q.getState().finishAction()}}}},J=new class{constructor(){this.accountManager=new On,this.remoteAccessManager=new kn}};J.accountManager.bindSignedInContinuation(J.remoteAccessManager.resumePendingActionAfterSignIn),J.remoteAccessManager.bindAccountManager(J.accountManager);var An=(0,A.createContext)(null);function jn({children:e}){return(0,j.jsx)(An.Provider,{value:J,children:e})}function Mn(){let e=(0,A.useContext)(An);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}function Y({label:e,value:t}){return(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,j.jsx)(`span`,{className:`text-gray-500`,children:e}),(0,j.jsx)(`span`,{className:`text-right text-gray-900`,children:t?.trim()||`-`})]})}function Nn(){let e=Mn(),t=Sn(),n=K(e=>e.panelOpen),r=K(e=>e.authSessionId),a=K(e=>e.authVerificationUri),o=K(e=>e.authExpiresAt),c=K(e=>e.authStatusMessage),l=t.data,[u,d]=(0,A.useState)(``),[f,p]=(0,A.useState)(!1);(0,A.useEffect)(()=>{e.accountManager.syncRemoteStatus(l)},[e,l]);let h=!f&&u.trim().length>0&&!l?.account.username;return(0,j.jsx)(tn,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,j.jsxs)(an,{className:`max-w-xl`,children:[(0,j.jsxs)(z,{children:[(0,j.jsxs)(sn,{className:`flex items-center gap-2`,children:[(0,j.jsx)(R,{className:`h-5 w-5 text-primary`}),i(`accountPanelTitle`)]}),(0,j.jsx)(cn,{children:i(`accountPanelDescription`)})]}),l?.account.loggedIn?(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-emerald-800`,children:i(`accountPanelSignedInTitle`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:i(`accountPanelSignedInDescription`)})]}),(0,j.jsxs)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3`,children:[(0,j.jsx)(Y,{label:i(`remoteAccountEmail`),value:l.account.email}),(0,j.jsx)(Y,{label:i(`remoteAccountUsername`),value:l.account.username}),(0,j.jsx)(Y,{label:i(`remoteAccountRole`),value:l.account.role})]}),l.account.username?(0,j.jsx)(`p`,{className:`text-xs text-gray-500`,children:i(`remoteAccountUsernameLockedHelp`)}):(0,j.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50 px-4 py-4`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-amber-900`,children:i(`remoteAccountUsernameRequiredTitle`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-amber-800`,children:i(`remoteAccountUsernameRequiredDescription`)}),(0,j.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,j.jsx)(ln,{htmlFor:`account-panel-username`,children:i(`remoteAccountUsername`)}),(0,j.jsx)(B,{id:`account-panel-username`,value:u,onChange:e=>d(e.target.value),placeholder:i(`remoteAccountUsernamePlaceholder`),autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1})]}),(0,j.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:(0,j.jsx)(m,{disabled:!h,onClick:async()=>{p(!0);try{await e.accountManager.updateUsername(u)}finally{p(!1)}},children:i(f?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,j.jsxs)(m,{onClick:()=>void e.accountManager.openNextClawWeb(),children:[(0,j.jsx)(Qt,{className:`mr-2 h-4 w-4`}),i(`remoteOpenDeviceList`)]}),(0,j.jsxs)(m,{variant:`outline`,onClick:()=>void e.accountManager.logout(),children:[(0,j.jsx)(Wt,{className:`mr-2 h-4 w-4`}),i(`remoteLogout`)]})]})]}):(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsxs)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:i(`accountPanelSignedOutTitle`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:i(`accountPanelSignedOutDescription`)}),r?(0,j.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,j.jsx)(Y,{label:i(`remoteBrowserAuthSession`),value:r}),(0,j.jsx)(Y,{label:i(`remoteBrowserAuthExpiresAt`),value:o?s(o):`-`})]}):null]}),c?(0,j.jsx)(`p`,{className:`text-sm text-gray-600`,children:c}):null,(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,j.jsx)(m,{onClick:()=>void e.accountManager.startBrowserSignIn(),children:i(r?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),a?(0,j.jsx)(m,{variant:`outline`,onClick:()=>e.accountManager.resumeBrowserSignIn(),children:i(`remoteBrowserAuthResume`)}):null]})]})]})})}var Pn=A.forwardRef(({className:e,hover:t=!0,...n},r)=>(0,j.jsx)(`div`,{ref:r,className:d(`rounded-2xl border border-gray-200/50 bg-white text-card-foreground shadow-card transition-all duration-base`,t&&`hover:shadow-card-hover hover:border-gray-200`,e),...n}));Pn.displayName=`Card`;var Fn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`div`,{ref:n,className:d(`flex flex-col space-y-1.5 p-6`,e),...t}));Fn.displayName=`CardHeader`;var In=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`h3`,{ref:n,className:d(`text-[15px] font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));In.displayName=`CardTitle`;var Ln=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`p`,{ref:n,className:d(`text-[13px] text-gray-400 leading-relaxed`,e),...t}));Ln.displayName=`CardDescription`;var Rn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`div`,{ref:n,className:d(`p-6 pt-0`,e),...t}));Rn.displayName=`CardContent`;var zn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`div`,{ref:n,className:d(`flex items-center justify-between p-6 pt-0`,e),...t}));zn.displayName=`CardFooter`;var Bn=40,Vn=400;function Hn(e){if(!(e instanceof Error))return!1;let t=e.message.trim().toLowerCase();return t?t.includes(`failed to fetch`)||t.includes(`networkerror`)||t.includes(`network request failed`)||t.includes(`load failed`)||t.includes(`request timed out`)||t.includes(`timed out waiting for remote request response`)||t.includes(`remote transport connection closed`):!1}function Un(e,t){return e>=Bn?!1:Hn(t)}function Wn(){let[e,t]=(0,A.useState)(!1),n=b({queryKey:[`auth-status`],queryFn:()=>He({timeoutMs:e?5e3:Vn}),staleTime:5e3,retry:Un,retryDelay:250,refetchOnWindowFocus:!0});return(0,A.useEffect)(()=>{n.isSuccess&&!e&&t(!0)},[e,n.isSuccess]),n}function X(e){return Promise.all([e.invalidateQueries({queryKey:[`auth-status`]}),e.invalidateQueries({queryKey:[`app-meta`]}),e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),e.invalidateQueries({queryKey:[`config-schema`]}),e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`session-history`]}),e.invalidateQueries({queryKey:[`chat-runs`]}),e.invalidateQueries({queryKey:[`cron-jobs`]})])}function Gn(){let e=x();return w({mutationFn:Je,onSuccess:async()=>{await X(e),p.success(i(`authSetupSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Kn(){let e=x();return w({mutationFn:Ue,onSuccess:async()=>{await X(e),p.success(i(`authLoginSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function qn(){let e=x();return w({mutationFn:Be,onSuccess:async()=>{await X(e),p.success(i(`authLogoutSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Jn(){let e=x();return w({mutationFn:ke,onSuccess:async()=>{await X(e),p.success(i(`authPasswordUpdated`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Yn(){let e=x();return w({mutationFn:Xe,onSuccess:async(t,n)=>{await X(e),p.success(n.enabled?i(`authEnabledSuccess`):i(`authDisabledSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Xn({username:e}){let t=Kn(),[n,r]=(0,A.useState)(e??``),[a,o]=(0,A.useState)(``),s=n.trim().length>0&&a.length>0&&!t.isPending;return(0,j.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,j.jsxs)(Pn,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,j.jsxs)(Fn,{children:[(0,j.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:i(`authBrand`)}),(0,j.jsx)(In,{className:`text-2xl`,children:i(`authLoginTitle`)}),(0,j.jsx)(Ln,{children:i(`authLoginDescription`)})]}),(0,j.jsx)(Rn,{children:(0,j.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),s&&t.mutate({username:n.trim(),password:a})},children:[(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:i(`authUsername`)}),(0,j.jsx)(B,{value:n,onChange:e=>r(e.target.value),placeholder:i(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:i(`authPassword`)}),(0,j.jsx)(B,{type:`password`,value:a,onChange:e=>o(e.target.value),placeholder:i(`authPasswordPlaceholder`)})]}),(0,j.jsx)(m,{type:`submit`,className:`w-full`,disabled:!s,children:t.isPending?i(`authLoggingIn`):i(`authLoginAction`)})]})})]})})}var Zn=`nextclaw.ui.theme`,Qn=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],Z=`warm`,$n=!1,er=new Set;function tr(e){return e===`warm`||e===`cool`}function nr(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function rr(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(Zn);if(tr(e))return e}catch{}return`warm`}function ir(){return $n||=(Z=rr(),nr(Z),!0),Z}function ar(){return $n?Z:ir()}function or(e){if(ir(),e!==Z){if(Z=e,nr(Z),typeof window<`u`)try{window.localStorage.setItem(Zn,Z)}catch{}er.forEach(e=>e(Z))}}function sr(e){return er.add(e),()=>{er.delete(e)}}function cr(){let e=k();(0,A.useEffect)(()=>{let t=t=>{let n=t.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`)||``;$e(r)&&(n.hasAttribute(`data-doc-external`)||t.ctrlKey||t.metaKey||t.shiftKey||(t.preventDefault(),t.stopPropagation(),e.open(r)))};return document.addEventListener(`click`,t,!0),()=>document.removeEventListener(`click`,t,!0)},[e])}function lr(e){return[...e].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}function ur(e,t){let n=t.updatedAt.localeCompare(e.updatedAt);return n>0?!0:n<0?!1:e.status===t.status?!0:t.status===`idle`}function dr(e,t){if(!e)return e;let n=e.sessions.findIndex(e=>e.sessionId===t.sessionId),r=lr(n>=0?e.sessions.map((e,r)=>r===n&&ur(e,t)?t:e):[...e.sessions,t]);return{...e,sessions:r,total:r.length}}function fr(e,t){if(!e)return e;let n=t.trim();if(!n)return e;let r=e.sessions.filter(e=>e.sessionId!==n);return r.length===e.sessions.length?e:{...e,sessions:r,total:r.length}}function pr(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>dr(e,t))}function mr(e,t){if(!e)return e;let n=t.sessionKey.trim();if(!n)return e;let r=!1,i=e.sessions.map(e=>e.sessionId!==n||e.status===t.status?e:(r=!0,{...e,status:t.status}));return r?{...e,sessions:i}:e}function hr(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>mr(e,t))}function gr(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>fr(e,t))}function _r(e,t){if(t.type===`session.run-status`){hr(e,t.payload);return}if(t.type===`session.summary.upsert`){pr(e,t.payload.summary);return}gr(e,t.payload.sessionKey)}async function vr(e){let t=new URLSearchParams;typeof e?.limit==`number`&&Number.isFinite(e.limit)&&t.set(`limit`,String(Math.max(1,Math.trunc(e.limit))));let n=t.toString(),r=await S.get(n?`/api/ncp/sessions?${n}`:`/api/ncp/sessions`);if(!r.ok)throw Error(r.error.message);return r.data}async function yr(e,t=200){let n=await S.get(`/api/ncp/sessions/${encodeURIComponent(e)}/messages?limit=${Math.max(1,Math.trunc(t))}`);if(!n.ok)throw Error(n.error.message);return n.data}async function br(e,t){let n=new URLSearchParams,r=t?.projectRoot?.trim();r&&n.set(`projectRoot`,r);let i=n.toString(),a=await S.get(i?`/api/ncp/sessions/${encodeURIComponent(e)}/skills?${i}`:`/api/ncp/sessions/${encodeURIComponent(e)}/skills`);if(!a.ok)throw Error(a.error.message);return a.data}async function xr(e,t){let n=await S.put(`/api/ncp/sessions/${encodeURIComponent(e)}`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function Sr(e){let t=await S.delete(`/api/ncp/sessions/${encodeURIComponent(e)}`);if(!t.ok)throw Error(t.error.message);return t.data}function Cr(){return b({queryKey:[`config`],queryFn:Ge,staleTime:3e4,refetchOnWindowFocus:!0})}function wr(){return b({queryKey:[`app-meta`],queryFn:Me,staleTime:1/0})}function Tr(){return b({queryKey:[`config-meta`],queryFn:Pe,staleTime:1/0})}function Er(){return b({queryKey:[`config-schema`],queryFn:ze,staleTime:1/0})}function Dr(){let e=x();return w({mutationFn:Ye,onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Or(){let e=x();return w({mutationFn:({data:e})=>Ee(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function kr(){let e=x();return w({mutationFn:({provider:e,data:t})=>Ae(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Ar(){let e=x();return w({mutationFn:({data:e})=>Ke(e??{}),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function jr(){let e=x();return w({mutationFn:({provider:e})=>We(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Mr(){return w({mutationFn:({provider:e,data:t})=>Ne(e,t)})}function Nr(){return w({mutationFn:({provider:e,data:t})=>Ze(e,t)})}function Pr(){return w({mutationFn:({provider:e,data:t})=>Le(e,t)})}function Fr(){return w({mutationFn:({provider:e})=>Fe(e)})}function Ir(){let e=x();return w({mutationFn:({channel:e,data:t})=>Te(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Lr(){let e=x();return w({mutationFn:({data:e})=>De(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Rr(){let e=x();return w({mutationFn:({data:e})=>Oe(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function zr(){return w({mutationFn:({actionId:e,data:t})=>Re(e,t),onError:e=>{p.error(i(`error`)+`: `+e.message)}})}function Br(e){return b({queryKey:[`ncp-sessions`,e?.limit??null],queryFn:()=>vr(e),staleTime:5e3,retry:!1})}function Vr(e,t=200){return b({queryKey:[`ncp-session-messages`,e,t],queryFn:()=>yr(e,t),enabled:!!e,staleTime:5e3,retry:!1})}function Hr(e){return b({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>br(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,staleTime:5e3,retry:!1})}function Ur(){let e=x();return w({mutationFn:({sessionId:e})=>Sr(e),onSuccess:(t,n)=>{gr(e,n.sessionId),e.removeQueries({queryKey:[`ncp-session-messages`,n.sessionId]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Wr(){let e=x();return w({mutationFn:({sessionId:e,data:t})=>xr(e,t),onSuccess:t=>{pr(e,t),e.invalidateQueries({queryKey:[`ncp-session-skills`,t.sessionId]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Gr(e={all:!0}){return b({queryKey:[`cron`,e],queryFn:()=>qe(e),staleTime:1e4})}function Kr(){let e=x();return w({mutationFn:({id:e})=>Ve(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function qr(){let e=x();return w({mutationFn:({id:e,enabled:t})=>je(e,{enabled:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Jr(){let e=x();return w({mutationFn:({id:e,force:t})=>Ie(e,{force:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Yr({className:e,suffix:t}){let{data:n}=wr(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim();return(0,j.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,j.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,j.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,j.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,j.jsx)(`span`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),i?(0,j.jsxs)(`span`,{className:`text-[13px] font-medium text-gray-500`,children:[`v`,i]}):null,t?(0,j.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:t}):null]})]})}var Xr={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 Zr(e){return Xr[e]}function Qr({to:e,label:t,icon:n,density:r=`default`,className:i}){let a=Zr(r);return(0,j.jsx)(te,{to:e,className:({isActive:e})=>d(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base`,a.row,e?`bg-gray-200 text-gray-900 shadow-sm`:`text-gray-600 hover:bg-gray-200/60 hover:text-gray-900`,i),children:({isActive:e})=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(n,{className:d(a.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function $r({label:e,icon:t,onClick:n,density:r=`default`,className:i,labelClassName:a,trailing:o,trailingClassName:s,testId:c,trailingTestId:l}){let u=Zr(r);return(0,j.jsxs)(`button`,{type:`button`,onClick:n,className:d(`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`,u.row,i),"data-testid":c,children:[(0,j.jsx)(t,{className:d(u.icon,`shrink-0 text-gray-400`)}),(0,j.jsx)(`span`,{className:d(`min-w-0 flex-1 text-left`,a),children:e}),o?(0,j.jsx)(`span`,{className:d(`shrink-0 text-gray-500`,u.value,s),"data-testid":l,children:o}):null]})}function ei({label:e,icon:t,value:n,valueLabel:r,onValueChange:i,density:a=`default`,children:o}){let s=Zr(a);return(0,j.jsxs)(ve,{value:n,onValueChange:i,children:[(0,j.jsxs)(me,{className:d(`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`,s.row),children:[(0,j.jsxs)(`div`,{className:d(`flex min-w-0 items-center`,s.gap),children:[(0,j.jsx)(t,{className:d(s.icon,`text-gray-400`)}),(0,j.jsx)(`span`,{className:`text-left`,children:e})]}),(0,j.jsx)(`span`,{className:d(`ml-auto text-gray-500`,s.value),children:r})]}),(0,j.jsx)(ge,{children:o})]})}var ti=(0,A.createContext)(null);function ni({children:e}){let[t,r]=(0,A.useState)(()=>u());(0,A.useEffect)(()=>a(e=>{r(e)}),[]);let i=(0,A.useCallback)(e=>{n(e),r(c())},[]),o=(0,A.useCallback)(()=>{i(t===`en`?`zh`:`en`)},[t,i]),s=(0,A.useMemo)(()=>({language:t,setLanguage:i,toggleLanguage:o}),[t,i,o]);return(0,j.jsx)(ti.Provider,{value:s,children:e})}function ri(){let e=(0,A.useContext)(ti);if(!e)throw Error(`useI18n must be used within I18nProvider`);return{...e,t:i}}var ii=(0,A.createContext)(null);function ai({children:e}){let[t,n]=(0,A.useState)(()=>ir());(0,A.useEffect)(()=>sr(e=>{n(e)}),[]);let r=(0,A.useCallback)(e=>{or(e),n(ar())},[]),i=(0,A.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,j.jsx)(ii.Provider,{value:i,children:e})}function oi(){let e=(0,A.useContext)(ii);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function si({mode:e}){let n=Mn(),r=k(),a=Sn(),{language:o,setLanguage:s}=ri(),{theme:c,setTheme:l}=oi(),u=e===`settings`,f=t.find(e=>e.value===o)?.label??o,p=i(Qn.find(e=>e.value===c)?.labelKey??`themeWarm`),m=a.data?.account.email?.trim(),h=!!a.data?.account.loggedIn,ee=e=>{o!==e&&(s(e),window.location.reload())},g=e=>{c!==e&&l(e)},_=[{target:`/chat`,label:i(`chat`),icon:Gt},{target:`/chat/cron`,label:i(`cron`),icon:It},{target:`/chat/skills`,label:i(`marketplaceFilterSkills`),icon:Rt},{target:`/agents`,label:i(`agentsPageTitle`),icon:Lt}],ne=[{target:`/model`,label:i(`model`),icon:zt},{target:`/providers`,label:i(`providers`),icon:Zt},{target:`/channels`,label:i(`channels`),icon:Kt},{target:`/search`,label:i(`searchChannels`),icon:Ce},{target:`/marketplace/plugins`,label:i(`marketplaceFilterPlugins`),icon:Jt},{target:`/marketplace/mcp`,label:i(`marketplaceFilterMcp`),icon:en},{target:`/runtime`,label:i(`runtime`),icon:Vt},{target:`/updates`,label:i(`updates`),icon:Bt},{target:`/remote`,label:i(`remote`),icon:$t},{target:`/security`,label:i(`security`),icon:Xt},{target:`/sessions`,label:i(`sessions`),icon:Ht},{target:`/secrets`,label:i(`secrets`),icon:R}],v=u?ne:_,y=u?`compact`:`default`;return(0,j.jsxs)(`aside`,{className:`w-[240px] shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary px-4 py-6`,children:[u?(0,j.jsx)(`div`,{className:`shrink-0 px-2 pb-3`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-1`,"data-testid":`settings-sidebar-header`,children:[(0,j.jsxs)(te,{to:`/chat`,className:`group inline-flex min-w-0 items-center gap-1.5 rounded-lg px-1 py-1 text-[12px] font-medium text-gray-500 transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,j.jsx)(xe,{className:`h-3.5 w-3.5 shrink-0 text-gray-400 group-hover:text-gray-700`}),(0,j.jsx)(`span`,{className:`truncate`,children:i(`backToMain`)})]}),(0,j.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-[#dddfe6]`,"aria-hidden":`true`}),(0,j.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:i(`settings`)})]})}):(0,j.jsx)(`div`,{className:`shrink-0 px-2 pb-8`,children:(0,j.jsx)(Yr,{className:`flex items-center gap-2.5 cursor-pointer`})}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,j.jsx)(`nav`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto pr-1`,children:(0,j.jsx)(`ul`,{className:d(u?`space-y-0.5 pb-3`:`space-y-1 pb-4`),children:v.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(Qr,{to:e.target,label:e.label,icon:e.icon,density:y})},e.target))})}),(0,j.jsxs)(`div`,{className:d(`shrink-0 border-t border-[#dde0ea] bg-secondary`,u?`mt-2 pt-3`:`mt-3 pt-3`),children:[u?(0,j.jsx)($r,{onClick:()=>n.accountManager.openAccountPanel(),icon:R,label:i(`remoteAccountEntryManage`),density:`compact`,className:`mb-1.5`,trailing:h?m||i(`remoteAccountEntryConnected`):i(`remoteAccountEntryDisconnected`),trailingClassName:`max-w-[92px] truncate text-right`,testId:`settings-sidebar-account-entry`,trailingTestId:`settings-sidebar-account-status`}):null,e===`main`&&(0,j.jsx)(`div`,{className:`mb-2`,children:(0,j.jsx)(Qr,{to:`/settings`,label:i(`settings`),icon:Yt})}),(0,j.jsx)(`div`,{className:`mb-2`,children:(0,j.jsx)(ei,{value:c,onValueChange:e=>g(e),icon:qt,label:i(`theme`),valueLabel:p,density:y,children:Qn.map(e=>(0,j.jsx)(_e,{value:e.value,className:`text-xs`,children:i(e.labelKey)},e.value))})}),(0,j.jsx)(`div`,{className:`mb-2`,children:(0,j.jsx)(ei,{value:o,onValueChange:e=>ee(e),icon:Ut,label:i(`language`),valueLabel:f,density:y,children:t.map(e=>(0,j.jsx)(_e,{value:e.value,className:`text-xs`,children:e.label},e.value))})}),(0,j.jsx)($r,{onClick:()=>r.open(void 0,{kind:`docs`,newTab:!0,title:`Docs`}),icon:Se,label:i(`docBrowserHelp`),density:y})]})]})]})}var ci=`NextClaw`,li=[{prefix:`/marketplace/mcp`,key:`marketplaceMcpPageTitle`},{prefix:`/marketplace/plugins`,key:`marketplacePluginsPageTitle`},{prefix:`/marketplace/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/marketplace`,key:`marketplace`},{prefix:`/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/cron`,key:`cronPageTitle`},{prefix:`/agents`,key:`agentsPageTitle`},{prefix:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/updates`,key:`desktopUpdatesPageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/sessions`,key:`sessionsPageTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function ui(e,t){return e===t||e.startsWith(`${t}/`)}function di(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of li)if(ui(t,e))return i(n);return i(`settings`)}function fi(e){return`${ci} - ${di(e)}`}var pi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{DocBrowser:e}=await import(`./DocBrowser-B2MpsnU9.js`);return{DocBrowser:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).DocBrowser}));function mi(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)||t===`/agents`||t.startsWith(`/agents/`)}function hi(e){let t=e.toLowerCase();return t===`/channels`||t.startsWith(`/channels/`)}function gi({children:e}){let{isOpen:t,mode:n}=k();cr();let{pathname:r}=ne(),{language:i}=ri(),a=mi(r),o=hi(r);return(0,A.useEffect)(()=>{document.title=fi(r)},[r,i]),(0,j.jsxs)(`div`,{className:`h-screen flex bg-background font-sans text-foreground`,children:[!a&&(0,j.jsx)(si,{mode:`settings`}),(0,j.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,j.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:a?(0,j.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:e}):(0,j.jsx)(`main`,{className:d(`flex-1 custom-scrollbar p-8`,o?`overflow-auto xl:overflow-hidden`:`overflow-auto`),children:(0,j.jsx)(`div`,{className:d(`max-w-6xl mx-auto animate-fade-in h-full`,o&&`min-h-0 xl:overflow-hidden`),children:e})})}),t&&n===`docked`&&(0,j.jsx)(A.Suspense,{fallback:null,children:(0,j.jsx)(pi,{})})]}),t&&n===`floating`&&(0,j.jsx)(A.Suspense,{fallback:null,children:(0,j.jsx)(pi,{})})]})}function _i({children:e}){return(0,j.jsx)(Qe,{children:(0,j.jsx)(gi,{children:e})})}var vi=G(e=>({connectionStatus:`disconnected`,setConnectionStatus:t=>e({connectionStatus:t}),channelModal:{open:!1},openChannelModal:t=>e({channelModal:{open:!0,channel:t}}),closeChannelModal:()=>e({channelModal:{open:!1}})}));function yi(e){let t=e.trim().toLowerCase();return t?!(t.startsWith(`plugins`)||t.startsWith(`skills`)):!0}function bi(e,t){t.startsWith(`plugins`)&&(e?.invalidateQueries({queryKey:[`ncp-session-types`]}),e?.invalidateQueries({queryKey:[`marketplace-installed`,`plugin`]}),e?.invalidateQueries({queryKey:[`marketplace-items`]})),t.startsWith(`mcp`)&&(e?.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}))}function xi(e,t){e&&yi(t)&&e.invalidateQueries({queryKey:[`config`]}),bi(e,t)}function Si(e,t,n,r){if(r.type===`connection.open`){t(`connected`),n.current&&(n.current=!1,e?.invalidateQueries({queryKey:[`ncp-sessions`]}));return}if(r.type===`connection.close`||r.type===`connection.error`){t(`disconnected`),n.current=!0;return}if(r.type===`config.updated`){xi(e,typeof r.payload?.path==`string`?r.payload.path:``);return}if(r.type===`session.run-status`||r.type===`session.summary.upsert`||r.type===`session.summary.delete`){_r(e,r);return}r.type===`error`&&console.error(`Realtime transport error:`,r.payload.message)}function Ci(e){let{setConnectionStatus:t}=vi(),n=(0,A.useRef)(!1);(0,A.useEffect)(()=>(t(`connecting`),re.subscribe(r=>Si(e,t,n,r))),[e,t])}var wi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{ModelConfig:e}=await import(`./ModelConfig-3GLqQ5GY.js`);return{ModelConfig:e}},__vite__mapDeps([10,2,11,4,3,12,13,14,9,15,16,17]))).ModelConfig})),Q=(0,A.lazy)(async()=>({default:(await _(async()=>{let{ChatPage:e}=await import(`./ChatPage-A45t1Rmf.js`);return{ChatPage:e}},__vite__mapDeps([18,2,19,13,11,3,20,21,22,23,24,25,16,26,9,15,27,28,29,1,4,5,6,7,8,12,30,14,31,32,33,34,35,36]))).ChatPage})),Ti=(0,A.lazy)(async()=>({default:(await _(async()=>{let{SearchConfig:e}=await import(`./SearchConfig-DTeJvp8m.js`);return{SearchConfig:e}},__vite__mapDeps([37,2,13,11,3,5,7,38,15]))).SearchConfig})),Ei=(0,A.lazy)(async()=>({default:(await _(async()=>{let{ProvidersList:e}=await import(`./ProvidersList-BR1gJ4Dm.js`);return{ProvidersList:e}},__vite__mapDeps([39,2,13,11,3,20,21,23,6,7,33,8,36,38,15,40,41,28,17]))).ProvidersList})),Di=(0,A.lazy)(async()=>({default:(await _(async()=>{let{ChannelsList:e}=await import(`./ChannelsList-D8p4OlM6.js`);return{ChannelsList:e}},__vite__mapDeps([42,2,13,11,3,23,26,4,5,30,43,14,7,8,36,38,15,40,41,28,17]))).ChannelsList})),Oi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{RuntimeConfig:e}=await import(`./RuntimeConfig-ChdfK4Y_.js`);return{RuntimeConfig:e}},__vite__mapDeps([44,2,13,11,3,6,45,33,15,41,17]))).RuntimeConfig})),ki=(0,A.lazy)(async()=>({default:(await _(async()=>{let{DesktopUpdateConfig:e}=await import(`./desktop-update-config-CfoVwf-w.js`);return{DesktopUpdateConfig:e}},__vite__mapDeps([46,2,11,3,5,32,15,41]))).DesktopUpdateConfig})),Ai=(0,A.lazy)(async()=>({default:(await _(async()=>{let{SecurityConfig:e}=await import(`./security-config-BGWYwxNr.js`);return{SecurityConfig:e}},__vite__mapDeps([47,2,11,15,41]))).SecurityConfig})),ji=(0,A.lazy)(async()=>({default:(await _(async()=>{let{SessionsConfig:e}=await import(`./SessionsConfig-Du39vDgt.js`);return{SessionsConfig:e}},__vite__mapDeps([48,2,13,11,3,43,32,7,34,14,15,27]))).SessionsConfig})),Mi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{SecretsConfig:e}=await import(`./SecretsConfig-CCYO6NcV.js`);return{SecretsConfig:e}},__vite__mapDeps([49,2,13,11,3,6,45,33,15,41]))).SecretsConfig})),Ni=(0,A.lazy)(async()=>({default:(await _(async()=>{let{RemoteAccessPage:e}=await import(`./RemoteAccessPage-DyYVWsyK.js`);return{RemoteAccessPage:e}},__vite__mapDeps([50,2,11,3,31,15,40]))).RemoteAccessPage})),Pi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{MarketplacePage:e}=await import(`./MarketplacePage-BNZ3Jx5d.js`);return{MarketplacePage:e}},__vite__mapDeps([51,22,2,19,13,11,3,21,23,24,25,16,26,9,15,27,28]))).MarketplacePage})),Fi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{McpMarketplacePage:e}=await import(`./McpMarketplacePage-CxPFOgxv.js`);return{McpMarketplacePage:e}},__vite__mapDeps([52,2,13,11,3,23,24,25,16,26,9,15,27,41,28]))).McpMarketplacePage}));function Ii(){return(0,j.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function $({children:e}){return(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(Ii,{}),children:e})}function Li(){return Ci(C),(0,j.jsxs)(jn,{children:[(0,j.jsx)(_i,{children:(0,j.jsx)(`div`,{className:`w-full h-full`,children:(0,j.jsxs)(ee,{children:[(0,j.jsx)(g,{path:`/chat/skills`,element:(0,j.jsx)(v,{to:`/skills`,replace:!0})}),(0,j.jsx)(g,{path:`/chat/cron`,element:(0,j.jsx)(v,{to:`/cron`,replace:!0})}),(0,j.jsx)(g,{path:`/chat/agents`,element:(0,j.jsx)(v,{to:`/agents`,replace:!0})}),(0,j.jsx)(g,{path:`/chat/:sessionId?`,element:(0,j.jsx)($,{children:(0,j.jsx)(Q,{view:`chat`})})}),(0,j.jsx)(g,{path:`/agents`,element:(0,j.jsx)($,{children:(0,j.jsx)(Q,{view:`agents`})})}),(0,j.jsx)(g,{path:`/skills`,element:(0,j.jsx)($,{children:(0,j.jsx)(Q,{view:`skills`})})}),(0,j.jsx)(g,{path:`/cron`,element:(0,j.jsx)($,{children:(0,j.jsx)(Q,{view:`cron`})})}),(0,j.jsx)(g,{path:`/model`,element:(0,j.jsx)($,{children:(0,j.jsx)(wi,{})})}),(0,j.jsx)(g,{path:`/search`,element:(0,j.jsx)($,{children:(0,j.jsx)(Ti,{})})}),(0,j.jsx)(g,{path:`/providers`,element:(0,j.jsx)($,{children:(0,j.jsx)(Ei,{})})}),(0,j.jsx)(g,{path:`/channels`,element:(0,j.jsx)($,{children:(0,j.jsx)(Di,{})})}),(0,j.jsx)(g,{path:`/runtime`,element:(0,j.jsx)($,{children:(0,j.jsx)(Oi,{})})}),(0,j.jsx)(g,{path:`/updates`,element:(0,j.jsx)($,{children:(0,j.jsx)(ki,{})})}),(0,j.jsx)(g,{path:`/remote`,element:(0,j.jsx)($,{children:(0,j.jsx)(Ni,{})})}),(0,j.jsx)(g,{path:`/security`,element:(0,j.jsx)($,{children:(0,j.jsx)(Ai,{})})}),(0,j.jsx)(g,{path:`/sessions`,element:(0,j.jsx)($,{children:(0,j.jsx)(ji,{})})}),(0,j.jsx)(g,{path:`/secrets`,element:(0,j.jsx)($,{children:(0,j.jsx)(Mi,{})})}),(0,j.jsx)(g,{path:`/settings`,element:(0,j.jsx)(v,{to:`/model`,replace:!0})}),(0,j.jsx)(g,{path:`/marketplace/skills`,element:(0,j.jsx)(v,{to:`/skills`,replace:!0})}),(0,j.jsx)(g,{path:`/marketplace`,element:(0,j.jsx)(v,{to:`/marketplace/plugins`,replace:!0})}),(0,j.jsx)(g,{path:`/marketplace/mcp`,element:(0,j.jsx)($,{children:(0,j.jsx)(Fi,{})})}),(0,j.jsx)(g,{path:`/marketplace/:type`,element:(0,j.jsx)($,{children:(0,j.jsx)(Pi,{})})}),(0,j.jsx)(g,{path:`/`,element:(0,j.jsx)(v,{to:`/chat`,replace:!0})}),(0,j.jsx)(g,{path:`*`,element:(0,j.jsx)(v,{to:`/chat`,replace:!0})})]})})}),(0,j.jsx)(Nn,{})]})}function Ri(){let e=Wn(),t=e.isError&&Hn(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,j.jsx)(Li,{}):e.data?.enabled&&!e.data.authenticated?(0,j.jsx)(Xn,{username:e.data.username}):(0,j.jsx)(Li,{})}function zi(){return(0,j.jsxs)(ie,{client:C,children:[(0,j.jsx)(Ri,{}),(0,j.jsx)(h,{position:`top-right`,richColors:!0})]})}(0,et.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(A.StrictMode,{children:(0,j.jsx)(ai,{children:(0,j.jsx)(ni,{children:(0,j.jsx)(y,{children:(0,j.jsx)(zi,{})})})})}));export{xn as $,Lr as A,qn as B,Nr as C,Dr as D,Ir as E,xr as F,Rn as G,Yn as H,gr as I,In as J,Ln as K,pr as L,Rr as M,Sr as N,Wr as O,yr as P,Sn as Q,Qn as R,Jr as S,qr as T,Jn as U,Gn as V,Pn as W,q as X,Mn as Y,G as Z,Fr as _,Bt as _t,Qr as a,on as at,Br as b,It as bt,Cr as c,en as ct,Ar as d,Yt as dt,ln as et,Gr as f,qt as ft,zr as g,R as gt,jr as h,Ut as ht,$r as i,cn as it,Or as j,kr as k,Tr as l,Qt as lt,Ur as m,Gt as mt,oi as n,tn as nt,ei as o,z as ot,Kr as p,Kt as pt,Fn as q,ri as r,an as rt,Yr as s,sn as st,vi as t,B as tt,Er as u,Zt as ut,Vr as v,Rt as vt,Mr as w,Pr as x,Hr as y,Lt as yt,Wn as z};
6
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Dt=`DialogDescriptionWarning`,Ot=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Tt(Dt).contentName}}.`;return A.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},kt=it,At=lt,jt=ut,Mt=pt,Nt=_t,Pt=yt,Ft=xt,It=O(`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`}]]),Lt=O(`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`}]]),Rt=O(`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`}]]),zt=O(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),Bt=O(`Download`,[[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`polyline`,{points:`7 10 12 15 17 10`,key:`2ggqvy`}],[`line`,{x1:`12`,x2:`12`,y1:`15`,y2:`3`,key:`1vk2je`}]]),Vt=O(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Ht=O(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),R=O(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ut=O(`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`}]]),Wt=O(`LogOut`,[[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}],[`polyline`,{points:`16 17 21 12 16 7`,key:`1gabdz`}],[`line`,{x1:`21`,x2:`9`,y1:`12`,y2:`12`,key:`1uyos4`}]]),Gt=O(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),Kt=O(`MessageSquare`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),qt=O(`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`}]]),Jt=O(`Plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M9 8V2`,key:`14iosj`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z`,key:`osxo6l`}]]),Yt=O(`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`}]]),Xt=O(`Shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Zt=O(`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`}]]),Qt=O(`SquareArrowOutUpRight`,[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]]),$t=O(`Wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),en=O(`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`}]]),tn=kt,nn=At,rn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(jt,{ref:n,className:d(`fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));rn.displayName=jt.displayName;var an=A.forwardRef(({className:e,children:t,...n},r)=>(0,j.jsxs)(nn,{children:[(0,j.jsx)(rn,{}),(0,j.jsxs)(Mt,{ref:r,className:d(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-gray-200/50 bg-white p-6 shadow-xl duration-base data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-2xl`,e),...n,children:[t,(0,j.jsxs)(Ft,{className:`absolute right-4 top-4 rounded-lg p-1 opacity-70 ring-offset-white transition-all duration-fast hover:opacity-100 hover:bg-gray-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:pointer-events-none`,children:[(0,j.jsx)(we,{className:`h-4 w-4 text-gray-500`}),(0,j.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));an.displayName=Mt.displayName;var z=({className:e,...t})=>(0,j.jsx)(`div`,{className:d(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});z.displayName=`DialogHeader`;var on=({className:e,...t})=>(0,j.jsx)(`div`,{className:d(`flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3`,e),...t});on.displayName=`DialogFooter`;var sn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(Nt,{ref:n,className:d(`text-lg font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));sn.displayName=Nt.displayName;var cn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(Pt,{ref:n,className:d(`text-sm text-gray-500 leading-relaxed`,e),...t}));cn.displayName=Pt.displayName;var B=A.forwardRef(({className:e,type:t,...n},r)=>(0,j.jsx)(`input`,{type:t,className:d(`flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-900 file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-300 placeholder:font-normal focus:outline-none focus:ring-1 focus:ring-primary/40 focus:border-primary/40 transition-colors disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));B.displayName=`Input`;var ln=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`label`,{ref:n,className:d(`text-sm font-medium leading-none text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t}));ln.displayName=`Label`;async function un(){let e=await S.get(`/api/remote/status`);if(!e.ok)throw Error(e.error.message);return e.data}async function dn(){let e=await S.get(`/api/remote/doctor`);if(!e.ok)throw Error(e.error.message);return e.data}async function fn(e){let t=await S.post(`/api/remote/auth/start`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function pn(e){let t=await S.post(`/api/remote/auth/poll`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function mn(){let e=await S.post(`/api/remote/logout`,{});if(!e.ok)throw Error(e.error.message);return e.data}async function hn(e){let t=await S.put(`/api/remote/account/profile`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function gn(e){let t=await S.put(`/api/remote/settings`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function V(e){let t=await S.post(`/api/remote/service/${e}`,{});if(!t.ok)throw Error(t.error.message);return t.data}var _n=[`remote-status`],vn=`https://platform.nextclaw.io`,yn=`https://nextclaw-platform-console.pages.dev`,H=async()=>await C.fetchQuery({queryKey:_n,queryFn:un,staleTime:5e3}),U=async()=>(await C.invalidateQueries({queryKey:_n}),await H()),bn=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function W(e){let t=e?.trim();if(!t)return;let n;try{n=new URL(t)}catch{return}if(n.hostname===`platform.nextclaw.io`||n.hostname===`nextclaw-platform-console.pages.dev`)return n.origin;if(n.hostname===`ai-gateway-api.nextclaw.io`)return vn;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return yn}var xn=e=>W(e?.account.apiBase)||W(e?.settings.platformApiBase)||W(e?.platformBase)||W(e?.account.platformBase)||void 0;function Sn(){return b({queryKey:_n,queryFn:un,staleTime:5e3,refetchOnWindowFocus:!0})}var Cn=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},wn=(e=>e?Cn(e):Cn),Tn=e=>e;function En(e,t=Tn){let n=A.useSyncExternalStore(e.subscribe,A.useCallback(()=>t(e.getState()),[e,t]),A.useCallback(()=>t(e.getInitialState()),[e,t]));return A.useDebugValue(n),n}var Dn=e=>{let t=wn(e),n=e=>En(t,e);return Object.assign(n,t),n},G=(e=>e?Dn(e):Dn),K=G(e=>({panelOpen:!1,authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500,pendingAction:null,openPanel:()=>e({panelOpen:!0}),closePanel:()=>e({panelOpen:!1}),setPendingAction:t=>e({pendingAction:t}),clearPendingAction:()=>e({pendingAction:null}),beginBrowserAuth:({sessionId:t,verificationUri:n,expiresAt:r,intervalMs:i,statusMessage:a})=>e({panelOpen:!0,authSessionId:t,authVerificationUri:n,authExpiresAt:r,authPollIntervalMs:i,authStatusMessage:a}),updateBrowserAuth:({statusMessage:t,intervalMs:n})=>e(e=>({authStatusMessage:t??e.authStatusMessage,authPollIntervalMs:n??e.authPollIntervalMs})),clearBrowserAuth:()=>e({authSessionId:null,authVerificationUri:null,authExpiresAt:null,authStatusMessage:``,authPollIntervalMs:1500}),setAuthStatusMessage:t=>e({authStatusMessage:t})})),On=class{constructor(){this.authPollTimerId=null,this.afterSignedIn=null,this.bindSignedInContinuation=e=>{this.afterSignedIn=e},this.openAccountPanel=()=>{K.getState().openPanel()},this.closeAccountPanel=()=>{K.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),K.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=await H();return t.account.loggedIn?!0:(e?.pendingAction&&K.getState().setPendingAction(e.pendingAction),this.openAccountPanel(),await this.startBrowserSignIn({apiBase:e?.apiBase,status:t}),!1)},this.startBrowserSignIn=async e=>{try{let t=e?.apiBase,n=e?.pendingAction,r=e?.status??await H();n&&K.getState().setPendingAction(n);let a=await fn({apiBase:bn(r,t)});K.getState().beginBrowserAuth({sessionId:a.sessionId,verificationUri:a.verificationUri,expiresAt:a.expiresAt,intervalMs:a.intervalMs,statusMessage:i(`remoteBrowserAuthWaiting`)}),window.open(a.verificationUri,`_blank`,`noopener,noreferrer`)||K.getState().setAuthStatusMessage(i(`remoteBrowserAuthPopupBlocked`)),this.scheduleBrowserAuthPoll()}catch(e){let t=e instanceof Error?e.message:i(`remoteBrowserAuthStartFailed`);p.error(`${i(`remoteBrowserAuthStartFailed`)}: ${t}`)}},this.resumeBrowserSignIn=()=>{let e=K.getState().authVerificationUri;e&&window.open(e,`_blank`,`noopener,noreferrer`)},this.logout=async()=>{try{await mn(),K.getState().clearPendingAction(),K.getState().clearBrowserAuth(),await U(),p.success(i(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:i(`remoteLogoutFailed`);p.error(`${i(`remoteLogoutFailed`)}: ${t}`)}},this.updateUsername=async e=>{try{await hn({username:e.trim()}),await U(),p.success(i(`remoteAccountUsernameSetSuccess`))}catch(e){let t=e instanceof Error?e.message:i(`remoteAccountUsernameSetFailed`);p.error(`${i(`remoteAccountUsernameSetFailed`)}: ${t}`)}},this.openNextClawWeb=async()=>{let e=xn(await H());if(!e){p.error(i(`remoteOpenWebUnavailable`));return}window.open(e,`_blank`,`noopener,noreferrer`)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=K.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=K.getState();if(e.authSessionId)try{let t=await H(),n=await pn({sessionId:e.authSessionId,apiBase:bn(t)});if(n.status===`pending`){K.getState().updateBrowserAuth({statusMessage:i(`remoteBrowserAuthWaiting`),intervalMs:n.nextPollMs??1500}),this.scheduleBrowserAuthPoll();return}if(n.status===`expired`){this.clearPollTimer(),K.getState().clearBrowserAuth(),p.error(n.message||i(`remoteBrowserAuthExpired`));return}K.getState().setAuthStatusMessage(i(`remoteBrowserAuthCompleted`));let r=await U(),{pendingAction:a}=K.getState();this.clearPollTimer(),K.getState().clearBrowserAuth(),p.success(i(`remoteLoginSuccess`)),a&&this.afterSignedIn&&await this.afterSignedIn(a,r),K.getState().clearPendingAction()}catch(e){this.clearPollTimer(),K.getState().clearBrowserAuth();let t=e instanceof Error?e.message:i(`remoteBrowserAuthPollFailed`);p.error(`${i(`remoteBrowserAuthPollFailed`)}: ${t}`)}},this.clearPollTimer=()=>{this.authPollTimerId!==null&&(window.clearTimeout(this.authPollTimerId),this.authPollTimerId=null)},this.getBrowserAuthSummary=()=>{let e=K.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?s(e.authExpiresAt):`-`}}}},q=G(e=>({enabled:!1,deviceName:``,platformApiBase:``,advancedOpen:!1,draftTouched:!1,actionLabel:null,doctor:null,setEnabled:t=>e({enabled:t,draftTouched:!0}),setDeviceName:t=>e({deviceName:t,draftTouched:!0}),setPlatformApiBase:t=>e({platformApiBase:t,draftTouched:!0}),setAdvancedOpen:t=>e({advancedOpen:t}),hydrateDraft:({enabled:t,deviceName:n,platformApiBase:r})=>e({enabled:t,deviceName:n,platformApiBase:r,draftTouched:!1}),beginAction:t=>e({actionLabel:t}),finishAction:()=>e({actionLabel:null}),setDoctor:t=>e({doctor:t})})),kn=class{constructor(){this.accountManager=null,this.bindAccountManager=e=>{this.accountManager=e},this.syncStatus=e=>{if(!e)return;let t=q.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{q.getState().setEnabled(e)},this.setDeviceName=e=>{q.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{q.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{q.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await U(),n=q.getState();if(!t.account.loggedIn){await this.accountManager?.ensureSignedIn({pendingAction:{type:`enable-remote`},apiBase:n.platformApiBase});return}await this.applyEnabledState(!0,t)},this.disableRemoteAccess=async e=>{let t=e??await U();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await U();if(!t.account.loggedIn){await this.accountManager?.ensureSignedIn({pendingAction:{type:`enable-remote`}});return}let n=t.service.running?`restart`:`start`;await this.runManagedAction({actionLabel:i(n===`restart`?`remoteActionRestarting`:`remoteActionStarting`),job:async()=>{await V(n);let e=await U();this.hydrateDraftFromStatus(e)},successMessage:i(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await U();await this.accountManager?.startBrowserSignIn({status:t,apiBase:q.getState().platformApiBase,pendingAction:{type:`repair-remote`}})},this.saveAdvancedSettings=async e=>{let t=e??await U(),n=q.getState();await this.runManagedAction({actionLabel:i(`remoteActionSavingAdvanced`),job:async()=>{await gn({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await U();this.hydrateDraftFromStatus(e)},successMessage:t.settings.enabled===n.enabled?i(`remoteSettingsSaved`):i(`remoteAdvancedSaved`)})},this.runDoctor=async()=>{await this.runManagedAction({actionLabel:i(`remoteDoctorRunning`),job:async()=>{let e=await dn();q.getState().setDoctor(e)},successMessage:i(`remoteDoctorCompleted`)})},this.startService=async()=>{await this.runServiceAction(`start`,i(`remoteActionStarting`))},this.restartService=async()=>{await this.runServiceAction(`restart`,i(`remoteActionRestarting`))},this.stopService=async()=>{await this.runServiceAction(`stop`,i(`remoteActionStopping`))},this.resumePendingActionAfterSignIn=async(e,t)=>{if(e){if(e.type===`enable-remote`){await this.applyEnabledState(!0,t);return}e.type===`repair-remote`&&await this.repairRemoteAccess(t)}},this.applyEnabledState=async(e,t)=>{let n=q.getState();await this.runManagedAction({actionLabel:i(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await gn({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await U();this.hydrateDraftFromStatus(r),e?await V(r.service.running?`restart`:`start`):t.service.running&&await V(`restart`);let i=await U();this.hydrateDraftFromStatus(i)},successMessage:i(e?`remoteEnabledReady`:`remoteDisabledDone`)})},this.runServiceAction=async(e,t)=>{await this.runManagedAction({actionLabel:t,job:async()=>{let t=await V(e),n=await U();this.hydrateDraftFromStatus(n),p.success(t.message)}})},this.hydrateDraftFromStatus=e=>{q.getState().hydrateDraft({enabled:e.settings.enabled,deviceName:e.settings.deviceName,platformApiBase:e.settings.platformApiBase})},this.runManagedAction=async e=>{q.getState().beginAction(e.actionLabel);try{await e.job(),e.successMessage&&p.success(e.successMessage)}catch(e){let t=e instanceof Error?e.message:i(`error`);throw p.error(t),e}finally{q.getState().finishAction()}}}},J=new class{constructor(){this.accountManager=new On,this.remoteAccessManager=new kn}};J.accountManager.bindSignedInContinuation(J.remoteAccessManager.resumePendingActionAfterSignIn),J.remoteAccessManager.bindAccountManager(J.accountManager);var An=(0,A.createContext)(null);function jn({children:e}){return(0,j.jsx)(An.Provider,{value:J,children:e})}function Mn(){let e=(0,A.useContext)(An);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}function Y({label:e,value:t}){return(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,j.jsx)(`span`,{className:`text-gray-500`,children:e}),(0,j.jsx)(`span`,{className:`text-right text-gray-900`,children:t?.trim()||`-`})]})}function Nn(){let e=Mn(),t=Sn(),n=K(e=>e.panelOpen),r=K(e=>e.authSessionId),a=K(e=>e.authVerificationUri),o=K(e=>e.authExpiresAt),c=K(e=>e.authStatusMessage),l=t.data,[u,d]=(0,A.useState)(``),[f,p]=(0,A.useState)(!1);(0,A.useEffect)(()=>{e.accountManager.syncRemoteStatus(l)},[e,l]);let h=!f&&u.trim().length>0&&!l?.account.username;return(0,j.jsx)(tn,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,j.jsxs)(an,{className:`max-w-xl`,children:[(0,j.jsxs)(z,{children:[(0,j.jsxs)(sn,{className:`flex items-center gap-2`,children:[(0,j.jsx)(R,{className:`h-5 w-5 text-primary`}),i(`accountPanelTitle`)]}),(0,j.jsx)(cn,{children:i(`accountPanelDescription`)})]}),l?.account.loggedIn?(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-emerald-800`,children:i(`accountPanelSignedInTitle`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:i(`accountPanelSignedInDescription`)})]}),(0,j.jsxs)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3`,children:[(0,j.jsx)(Y,{label:i(`remoteAccountEmail`),value:l.account.email}),(0,j.jsx)(Y,{label:i(`remoteAccountUsername`),value:l.account.username}),(0,j.jsx)(Y,{label:i(`remoteAccountRole`),value:l.account.role})]}),l.account.username?(0,j.jsx)(`p`,{className:`text-xs text-gray-500`,children:i(`remoteAccountUsernameLockedHelp`)}):(0,j.jsxs)(`div`,{className:`rounded-2xl border border-amber-200 bg-amber-50 px-4 py-4`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-amber-900`,children:i(`remoteAccountUsernameRequiredTitle`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-amber-800`,children:i(`remoteAccountUsernameRequiredDescription`)}),(0,j.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,j.jsx)(ln,{htmlFor:`account-panel-username`,children:i(`remoteAccountUsername`)}),(0,j.jsx)(B,{id:`account-panel-username`,value:u,onChange:e=>d(e.target.value),placeholder:i(`remoteAccountUsernamePlaceholder`),autoCapitalize:`none`,autoCorrect:`off`,spellCheck:!1})]}),(0,j.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-3`,children:(0,j.jsx)(m,{disabled:!h,onClick:async()=>{p(!0);try{await e.accountManager.updateUsername(u)}finally{p(!1)}},children:i(f?`remoteAccountUsernameSaving`:`remoteAccountUsernameSave`)})})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,j.jsxs)(m,{onClick:()=>void e.accountManager.openNextClawWeb(),children:[(0,j.jsx)(Qt,{className:`mr-2 h-4 w-4`}),i(`remoteOpenDeviceList`)]}),(0,j.jsxs)(m,{variant:`outline`,onClick:()=>void e.accountManager.logout(),children:[(0,j.jsx)(Wt,{className:`mr-2 h-4 w-4`}),i(`remoteLogout`)]})]})]}):(0,j.jsxs)(`div`,{className:`space-y-4`,children:[(0,j.jsxs)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3`,children:[(0,j.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:i(`accountPanelSignedOutTitle`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:i(`accountPanelSignedOutDescription`)}),r?(0,j.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,j.jsx)(Y,{label:i(`remoteBrowserAuthSession`),value:r}),(0,j.jsx)(Y,{label:i(`remoteBrowserAuthExpiresAt`),value:o?s(o):`-`})]}):null]}),c?(0,j.jsx)(`p`,{className:`text-sm text-gray-600`,children:c}):null,(0,j.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,j.jsx)(m,{onClick:()=>void e.accountManager.startBrowserSignIn(),children:i(r?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),a?(0,j.jsx)(m,{variant:`outline`,onClick:()=>e.accountManager.resumeBrowserSignIn(),children:i(`remoteBrowserAuthResume`)}):null]})]})]})})}var Pn=A.forwardRef(({className:e,hover:t=!0,...n},r)=>(0,j.jsx)(`div`,{ref:r,className:d(`rounded-2xl border border-gray-200/50 bg-white text-card-foreground shadow-card transition-all duration-base`,t&&`hover:shadow-card-hover hover:border-gray-200`,e),...n}));Pn.displayName=`Card`;var Fn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`div`,{ref:n,className:d(`flex flex-col space-y-1.5 p-6`,e),...t}));Fn.displayName=`CardHeader`;var In=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`h3`,{ref:n,className:d(`text-[15px] font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));In.displayName=`CardTitle`;var Ln=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`p`,{ref:n,className:d(`text-[13px] text-gray-400 leading-relaxed`,e),...t}));Ln.displayName=`CardDescription`;var Rn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`div`,{ref:n,className:d(`p-6 pt-0`,e),...t}));Rn.displayName=`CardContent`;var zn=A.forwardRef(({className:e,...t},n)=>(0,j.jsx)(`div`,{ref:n,className:d(`flex items-center justify-between p-6 pt-0`,e),...t}));zn.displayName=`CardFooter`;var Bn=40,Vn=400;function Hn(e){if(!(e instanceof Error))return!1;let t=e.message.trim().toLowerCase();return t?t.includes(`failed to fetch`)||t.includes(`networkerror`)||t.includes(`network request failed`)||t.includes(`load failed`)||t.includes(`request timed out`)||t.includes(`timed out waiting for remote request response`)||t.includes(`remote transport connection closed`):!1}function Un(e,t){return e>=Bn?!1:Hn(t)}function Wn(){let[e,t]=(0,A.useState)(!1),n=b({queryKey:[`auth-status`],queryFn:()=>He({timeoutMs:e?5e3:Vn}),staleTime:5e3,retry:Un,retryDelay:250,refetchOnWindowFocus:!0});return(0,A.useEffect)(()=>{n.isSuccess&&!e&&t(!0)},[e,n.isSuccess]),n}function X(e){return Promise.all([e.invalidateQueries({queryKey:[`auth-status`]}),e.invalidateQueries({queryKey:[`app-meta`]}),e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),e.invalidateQueries({queryKey:[`config-schema`]}),e.invalidateQueries({queryKey:[`sessions`]}),e.invalidateQueries({queryKey:[`session-history`]}),e.invalidateQueries({queryKey:[`chat-runs`]}),e.invalidateQueries({queryKey:[`cron-jobs`]})])}function Gn(){let e=x();return w({mutationFn:Je,onSuccess:async()=>{await X(e),p.success(i(`authSetupSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Kn(){let e=x();return w({mutationFn:Ue,onSuccess:async()=>{await X(e),p.success(i(`authLoginSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function qn(){let e=x();return w({mutationFn:Be,onSuccess:async()=>{await X(e),p.success(i(`authLogoutSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Jn(){let e=x();return w({mutationFn:ke,onSuccess:async()=>{await X(e),p.success(i(`authPasswordUpdated`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Yn(){let e=x();return w({mutationFn:Xe,onSuccess:async(t,n)=>{await X(e),p.success(n.enabled?i(`authEnabledSuccess`):i(`authDisabledSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Xn({username:e}){let t=Kn(),[n,r]=(0,A.useState)(e??``),[a,o]=(0,A.useState)(``),s=n.trim().length>0&&a.length>0&&!t.isPending;return(0,j.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,j.jsxs)(Pn,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,j.jsxs)(Fn,{children:[(0,j.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:i(`authBrand`)}),(0,j.jsx)(In,{className:`text-2xl`,children:i(`authLoginTitle`)}),(0,j.jsx)(Ln,{children:i(`authLoginDescription`)})]}),(0,j.jsx)(Rn,{children:(0,j.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),s&&t.mutate({username:n.trim(),password:a})},children:[(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:i(`authUsername`)}),(0,j.jsx)(B,{value:n,onChange:e=>r(e.target.value),placeholder:i(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:i(`authPassword`)}),(0,j.jsx)(B,{type:`password`,value:a,onChange:e=>o(e.target.value),placeholder:i(`authPasswordPlaceholder`)})]}),(0,j.jsx)(m,{type:`submit`,className:`w-full`,disabled:!s,children:t.isPending?i(`authLoggingIn`):i(`authLoginAction`)})]})})]})})}var Zn=`nextclaw.ui.theme`,Qn=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],Z=`warm`,$n=!1,er=new Set;function tr(e){return e===`warm`||e===`cool`}function nr(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function rr(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(Zn);if(tr(e))return e}catch{}return`warm`}function ir(){return $n||=(Z=rr(),nr(Z),!0),Z}function ar(){return $n?Z:ir()}function or(e){if(ir(),e!==Z){if(Z=e,nr(Z),typeof window<`u`)try{window.localStorage.setItem(Zn,Z)}catch{}er.forEach(e=>e(Z))}}function sr(e){return er.add(e),()=>{er.delete(e)}}function cr(){let e=k();(0,A.useEffect)(()=>{let t=t=>{let n=t.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`)||``;$e(r)&&(n.hasAttribute(`data-doc-external`)||t.ctrlKey||t.metaKey||t.shiftKey||(t.preventDefault(),t.stopPropagation(),e.open(r)))};return document.addEventListener(`click`,t,!0),()=>document.removeEventListener(`click`,t,!0)},[e])}function lr(e){return[...e].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}function ur(e,t){let n=t.updatedAt.localeCompare(e.updatedAt);return n>0?!0:n<0?!1:e.status===t.status?!0:t.status===`idle`}function dr(e,t){if(!e)return e;let n=e.sessions.findIndex(e=>e.sessionId===t.sessionId),r=lr(n>=0?e.sessions.map((e,r)=>r===n&&ur(e,t)?t:e):[...e.sessions,t]);return{...e,sessions:r,total:r.length}}function fr(e,t){if(!e)return e;let n=t.trim();if(!n)return e;let r=e.sessions.filter(e=>e.sessionId!==n);return r.length===e.sessions.length?e:{...e,sessions:r,total:r.length}}function pr(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>dr(e,t))}function mr(e,t){if(!e)return e;let n=t.sessionKey.trim();if(!n)return e;let r=!1,i=e.sessions.map(e=>e.sessionId!==n||e.status===t.status?e:(r=!0,{...e,status:t.status}));return r?{...e,sessions:i}:e}function hr(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>mr(e,t))}function gr(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>fr(e,t))}function _r(e,t){if(t.type===`session.run-status`){hr(e,t.payload);return}if(t.type===`session.summary.upsert`){pr(e,t.payload.summary);return}gr(e,t.payload.sessionKey)}async function vr(e){let t=new URLSearchParams;typeof e?.limit==`number`&&Number.isFinite(e.limit)&&t.set(`limit`,String(Math.max(1,Math.trunc(e.limit))));let n=t.toString(),r=await S.get(n?`/api/ncp/sessions?${n}`:`/api/ncp/sessions`);if(!r.ok)throw Error(r.error.message);return r.data}async function yr(e,t=200){let n=await S.get(`/api/ncp/sessions/${encodeURIComponent(e)}/messages?limit=${Math.max(1,Math.trunc(t))}`);if(!n.ok)throw Error(n.error.message);return n.data}async function br(e,t){let n=new URLSearchParams,r=t?.projectRoot?.trim();r&&n.set(`projectRoot`,r);let i=n.toString(),a=await S.get(i?`/api/ncp/sessions/${encodeURIComponent(e)}/skills?${i}`:`/api/ncp/sessions/${encodeURIComponent(e)}/skills`);if(!a.ok)throw Error(a.error.message);return a.data}async function xr(e,t){let n=await S.put(`/api/ncp/sessions/${encodeURIComponent(e)}`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function Sr(e){let t=await S.delete(`/api/ncp/sessions/${encodeURIComponent(e)}`);if(!t.ok)throw Error(t.error.message);return t.data}function Cr(){return b({queryKey:[`config`],queryFn:Ge,staleTime:3e4,refetchOnWindowFocus:!0})}function wr(){return b({queryKey:[`app-meta`],queryFn:Me,staleTime:1/0})}function Tr(){return b({queryKey:[`config-meta`],queryFn:Pe,staleTime:1/0})}function Er(){return b({queryKey:[`config-schema`],queryFn:ze,staleTime:1/0})}function Dr(){let e=x();return w({mutationFn:Ye,onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Or(){let e=x();return w({mutationFn:({data:e})=>Ee(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function kr(){let e=x();return w({mutationFn:({provider:e,data:t})=>Ae(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Ar(){let e=x();return w({mutationFn:({data:e})=>Ke(e??{}),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function jr(){let e=x();return w({mutationFn:({provider:e})=>We(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Mr(){return w({mutationFn:({provider:e,data:t})=>Ne(e,t)})}function Nr(){return w({mutationFn:({provider:e,data:t})=>Ze(e,t)})}function Pr(){return w({mutationFn:({provider:e,data:t})=>Le(e,t)})}function Fr(){return w({mutationFn:({provider:e})=>Fe(e)})}function Ir(){let e=x();return w({mutationFn:({channel:e,data:t})=>Te(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Lr(){let e=x();return w({mutationFn:({data:e})=>De(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Rr(){let e=x();return w({mutationFn:({data:e})=>Oe(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function zr(){return w({mutationFn:({actionId:e,data:t})=>Re(e,t),onError:e=>{p.error(i(`error`)+`: `+e.message)}})}function Br(e){return b({queryKey:[`ncp-sessions`,e?.limit??null],queryFn:()=>vr(e),staleTime:5e3,retry:!1})}function Vr(e,t=200){return b({queryKey:[`ncp-session-messages`,e,t],queryFn:()=>yr(e,t),enabled:!!e,staleTime:5e3,retry:!1})}function Hr(e){return b({queryKey:[`ncp-session-skills`,e.sessionId,e.projectRoot??null],queryFn:()=>br(e.sessionId,{...Object.prototype.hasOwnProperty.call(e,`projectRoot`)?{projectRoot:e.projectRoot??null}:{}}),enabled:!!e.sessionId,staleTime:5e3,retry:!1})}function Ur(){let e=x();return w({mutationFn:({sessionId:e})=>Sr(e),onSuccess:(t,n)=>{gr(e,n.sessionId),e.removeQueries({queryKey:[`ncp-session-messages`,n.sessionId]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Wr(){let e=x();return w({mutationFn:({sessionId:e,data:t})=>xr(e,t),onSuccess:t=>{pr(e,t),e.invalidateQueries({queryKey:[`ncp-session-skills`,t.sessionId]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Gr(e={all:!0}){return b({queryKey:[`cron`,e],queryFn:()=>qe(e),staleTime:1e4})}function Kr(){let e=x();return w({mutationFn:({id:e})=>Ve(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function qr(){let e=x();return w({mutationFn:({id:e,enabled:t})=>je(e,{enabled:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Jr(){let e=x();return w({mutationFn:({id:e,force:t})=>Ie(e,{force:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Yr({className:e,suffix:t}){let{data:n}=wr(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim();return(0,j.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,j.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,j.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,j.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,j.jsx)(`span`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),i?(0,j.jsxs)(`span`,{className:`text-[13px] font-medium text-gray-500`,children:[`v`,i]}):null,t?(0,j.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:t}):null]})]})}var Xr={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 Zr(e){return Xr[e]}function Qr({to:e,label:t,icon:n,density:r=`default`,className:i}){let a=Zr(r);return(0,j.jsx)(te,{to:e,className:({isActive:e})=>d(`group flex w-full items-center rounded-xl font-medium transition-colors duration-base`,a.row,e?`bg-gray-200 text-gray-900 shadow-sm`:`text-gray-600 hover:bg-gray-200/60 hover:text-gray-900`,i),children:({isActive:e})=>(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(n,{className:d(a.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,j.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function $r({label:e,icon:t,onClick:n,density:r=`default`,className:i,labelClassName:a,trailing:o,trailingClassName:s,testId:c,trailingTestId:l}){let u=Zr(r);return(0,j.jsxs)(`button`,{type:`button`,onClick:n,className:d(`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`,u.row,i),"data-testid":c,children:[(0,j.jsx)(t,{className:d(u.icon,`shrink-0 text-gray-400`)}),(0,j.jsx)(`span`,{className:d(`min-w-0 flex-1 text-left`,a),children:e}),o?(0,j.jsx)(`span`,{className:d(`shrink-0 text-gray-500`,u.value,s),"data-testid":l,children:o}):null]})}function ei({label:e,icon:t,value:n,valueLabel:r,onValueChange:i,density:a=`default`,children:o}){let s=Zr(a);return(0,j.jsxs)(ve,{value:n,onValueChange:i,children:[(0,j.jsxs)(me,{className:d(`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`,s.row),children:[(0,j.jsxs)(`div`,{className:d(`flex min-w-0 items-center`,s.gap),children:[(0,j.jsx)(t,{className:d(s.icon,`text-gray-400`)}),(0,j.jsx)(`span`,{className:`text-left`,children:e})]}),(0,j.jsx)(`span`,{className:d(`ml-auto text-gray-500`,s.value),children:r})]}),(0,j.jsx)(ge,{children:o})]})}var ti=(0,A.createContext)(null);function ni({children:e}){let[t,r]=(0,A.useState)(()=>u());(0,A.useEffect)(()=>a(e=>{r(e)}),[]);let i=(0,A.useCallback)(e=>{n(e),r(c())},[]),o=(0,A.useCallback)(()=>{i(t===`en`?`zh`:`en`)},[t,i]),s=(0,A.useMemo)(()=>({language:t,setLanguage:i,toggleLanguage:o}),[t,i,o]);return(0,j.jsx)(ti.Provider,{value:s,children:e})}function ri(){let e=(0,A.useContext)(ti);if(!e)throw Error(`useI18n must be used within I18nProvider`);return{...e,t:i}}var ii=(0,A.createContext)(null);function ai({children:e}){let[t,n]=(0,A.useState)(()=>ir());(0,A.useEffect)(()=>sr(e=>{n(e)}),[]);let r=(0,A.useCallback)(e=>{or(e),n(ar())},[]),i=(0,A.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,j.jsx)(ii.Provider,{value:i,children:e})}function oi(){let e=(0,A.useContext)(ii);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function si({mode:e}){let n=Mn(),r=k(),a=Sn(),{language:o,setLanguage:s}=ri(),{theme:c,setTheme:l}=oi(),u=e===`settings`,f=t.find(e=>e.value===o)?.label??o,p=i(Qn.find(e=>e.value===c)?.labelKey??`themeWarm`),m=a.data?.account.email?.trim(),h=!!a.data?.account.loggedIn,ee=e=>{o!==e&&(s(e),window.location.reload())},g=e=>{c!==e&&l(e)},_=[{target:`/chat`,label:i(`chat`),icon:Gt},{target:`/chat/cron`,label:i(`cron`),icon:It},{target:`/chat/skills`,label:i(`marketplaceFilterSkills`),icon:Rt},{target:`/agents`,label:i(`agentsPageTitle`),icon:Lt}],ne=[{target:`/model`,label:i(`model`),icon:zt},{target:`/providers`,label:i(`providers`),icon:Zt},{target:`/channels`,label:i(`channels`),icon:Kt},{target:`/search`,label:i(`searchChannels`),icon:Ce},{target:`/marketplace/plugins`,label:i(`marketplaceFilterPlugins`),icon:Jt},{target:`/marketplace/mcp`,label:i(`marketplaceFilterMcp`),icon:en},{target:`/runtime`,label:i(`runtime`),icon:Vt},{target:`/updates`,label:i(`updates`),icon:Bt},{target:`/remote`,label:i(`remote`),icon:$t},{target:`/security`,label:i(`security`),icon:Xt},{target:`/sessions`,label:i(`sessions`),icon:Ht},{target:`/secrets`,label:i(`secrets`),icon:R}],v=u?ne:_,y=u?`compact`:`default`;return(0,j.jsxs)(`aside`,{className:`w-[240px] shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary px-4 py-6`,children:[u?(0,j.jsx)(`div`,{className:`shrink-0 px-2 pb-3`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-1`,"data-testid":`settings-sidebar-header`,children:[(0,j.jsxs)(te,{to:`/chat`,className:`group inline-flex min-w-0 items-center gap-1.5 rounded-lg px-1 py-1 text-[12px] font-medium text-gray-500 transition-colors hover:bg-gray-200/60 hover:text-gray-900`,children:[(0,j.jsx)(xe,{className:`h-3.5 w-3.5 shrink-0 text-gray-400 group-hover:text-gray-700`}),(0,j.jsx)(`span`,{className:`truncate`,children:i(`backToMain`)})]}),(0,j.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-[#dddfe6]`,"aria-hidden":`true`}),(0,j.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:i(`settings`)})]})}):(0,j.jsx)(`div`,{className:`shrink-0 px-2 pb-8`,children:(0,j.jsx)(Yr,{className:`flex items-center gap-2.5 cursor-pointer`})}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,j.jsx)(`nav`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto pr-1`,children:(0,j.jsx)(`ul`,{className:d(u?`space-y-0.5 pb-3`:`space-y-1 pb-4`),children:v.map(e=>(0,j.jsx)(`li`,{children:(0,j.jsx)(Qr,{to:e.target,label:e.label,icon:e.icon,density:y})},e.target))})}),(0,j.jsxs)(`div`,{className:d(`shrink-0 border-t border-[#dde0ea] bg-secondary`,u?`mt-2 pt-3`:`mt-3 pt-3`),children:[u?(0,j.jsx)($r,{onClick:()=>n.accountManager.openAccountPanel(),icon:R,label:i(`remoteAccountEntryManage`),density:`compact`,className:`mb-1.5`,trailing:h?m||i(`remoteAccountEntryConnected`):i(`remoteAccountEntryDisconnected`),trailingClassName:`max-w-[92px] truncate text-right`,testId:`settings-sidebar-account-entry`,trailingTestId:`settings-sidebar-account-status`}):null,e===`main`&&(0,j.jsx)(`div`,{className:`mb-2`,children:(0,j.jsx)(Qr,{to:`/settings`,label:i(`settings`),icon:Yt})}),(0,j.jsx)(`div`,{className:`mb-2`,children:(0,j.jsx)(ei,{value:c,onValueChange:e=>g(e),icon:qt,label:i(`theme`),valueLabel:p,density:y,children:Qn.map(e=>(0,j.jsx)(_e,{value:e.value,className:`text-xs`,children:i(e.labelKey)},e.value))})}),(0,j.jsx)(`div`,{className:`mb-2`,children:(0,j.jsx)(ei,{value:o,onValueChange:e=>ee(e),icon:Ut,label:i(`language`),valueLabel:f,density:y,children:t.map(e=>(0,j.jsx)(_e,{value:e.value,className:`text-xs`,children:e.label},e.value))})}),(0,j.jsx)($r,{onClick:()=>r.open(void 0,{kind:`docs`,newTab:!0,title:`Docs`}),icon:Se,label:i(`docBrowserHelp`),density:y})]})]})]})}var ci=`NextClaw`,li=[{prefix:`/marketplace/mcp`,key:`marketplaceMcpPageTitle`},{prefix:`/marketplace/plugins`,key:`marketplacePluginsPageTitle`},{prefix:`/marketplace/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/marketplace`,key:`marketplace`},{prefix:`/skills`,key:`marketplaceSkillsPageTitle`},{prefix:`/cron`,key:`cronPageTitle`},{prefix:`/agents`,key:`agentsPageTitle`},{prefix:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/updates`,key:`desktopUpdatesPageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/sessions`,key:`sessionsPageTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function ui(e,t){return e===t||e.startsWith(`${t}/`)}function di(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of li)if(ui(t,e))return i(n);return i(`settings`)}function fi(e){return`${ci} - ${di(e)}`}var pi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{DocBrowser:e}=await import(`./DocBrowser-CyDgAtO9.js`);return{DocBrowser:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).DocBrowser}));function mi(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)||t===`/agents`||t.startsWith(`/agents/`)}function hi(e){let t=e.toLowerCase();return t===`/channels`||t.startsWith(`/channels/`)}function gi({children:e}){let{isOpen:t,mode:n}=k();cr();let{pathname:r}=ne(),{language:i}=ri(),a=mi(r),o=hi(r);return(0,A.useEffect)(()=>{document.title=fi(r)},[r,i]),(0,j.jsxs)(`div`,{className:`h-screen flex bg-background font-sans text-foreground`,children:[!a&&(0,j.jsx)(si,{mode:`settings`}),(0,j.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,j.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:a?(0,j.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:e}):(0,j.jsx)(`main`,{className:d(`flex-1 custom-scrollbar p-8`,o?`overflow-auto xl:overflow-hidden`:`overflow-auto`),children:(0,j.jsx)(`div`,{className:d(`max-w-6xl mx-auto animate-fade-in h-full`,o&&`min-h-0 xl:overflow-hidden`),children:e})})}),t&&n===`docked`&&(0,j.jsx)(A.Suspense,{fallback:null,children:(0,j.jsx)(pi,{})})]}),t&&n===`floating`&&(0,j.jsx)(A.Suspense,{fallback:null,children:(0,j.jsx)(pi,{})})]})}function _i({children:e}){return(0,j.jsx)(Qe,{children:(0,j.jsx)(gi,{children:e})})}var vi=G(e=>({connectionStatus:`disconnected`,setConnectionStatus:t=>e({connectionStatus:t}),channelModal:{open:!1},openChannelModal:t=>e({channelModal:{open:!0,channel:t}}),closeChannelModal:()=>e({channelModal:{open:!1}})}));function yi(e){let t=e.trim().toLowerCase();return t?!(t.startsWith(`plugins`)||t.startsWith(`skills`)):!0}function bi(e,t){t.startsWith(`plugins`)&&(e?.invalidateQueries({queryKey:[`ncp-session-types`]}),e?.invalidateQueries({queryKey:[`marketplace-installed`,`plugin`]}),e?.invalidateQueries({queryKey:[`marketplace-items`]})),t.startsWith(`mcp`)&&(e?.invalidateQueries({queryKey:[`marketplace-mcp-installed`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-items`]}),e?.invalidateQueries({queryKey:[`marketplace-mcp-doctor`]}))}function xi(e,t){e&&yi(t)&&e.invalidateQueries({queryKey:[`config`]}),bi(e,t)}function Si(e,t,n,r){if(r.type===`connection.open`){t(`connected`),n.current&&(n.current=!1,e?.invalidateQueries({queryKey:[`ncp-sessions`]}));return}if(r.type===`connection.close`||r.type===`connection.error`){t(`disconnected`),n.current=!0;return}if(r.type===`config.updated`){xi(e,typeof r.payload?.path==`string`?r.payload.path:``);return}if(r.type===`session.run-status`||r.type===`session.summary.upsert`||r.type===`session.summary.delete`){_r(e,r);return}r.type===`error`&&console.error(`Realtime transport error:`,r.payload.message)}function Ci(e){let{setConnectionStatus:t}=vi(),n=(0,A.useRef)(!1);(0,A.useEffect)(()=>(t(`connecting`),re.subscribe(r=>Si(e,t,n,r))),[e,t])}var wi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{ModelConfig:e}=await import(`./ModelConfig-IrmzoslW.js`);return{ModelConfig:e}},__vite__mapDeps([10,2,11,4,3,12,13,14,9,15,16,17]))).ModelConfig})),Q=(0,A.lazy)(async()=>({default:(await _(async()=>{let{ChatPage:e}=await import(`./chat-page-Bph8M5zo.js`);return{ChatPage:e}},__vite__mapDeps([18,2,19,13,11,3,20,21,22,23,24,25,16,26,9,15,27,28,29,1,4,5,6,7,8,12,30,14,31,32,33,34,35,36,37]))).ChatPage})),Ti=(0,A.lazy)(async()=>({default:(await _(async()=>{let{SearchConfig:e}=await import(`./SearchConfig-DNBR-UbE.js`);return{SearchConfig:e}},__vite__mapDeps([38,2,13,11,3,5,7,39,15]))).SearchConfig})),Ei=(0,A.lazy)(async()=>({default:(await _(async()=>{let{ProvidersList:e}=await import(`./ProvidersList-8_Kalfwl.js`);return{ProvidersList:e}},__vite__mapDeps([40,2,13,11,3,20,21,23,6,7,34,8,37,39,15,41,42,28,17]))).ProvidersList})),Di=(0,A.lazy)(async()=>({default:(await _(async()=>{let{ChannelsList:e}=await import(`./ChannelsList-KIQIxluX.js`);return{ChannelsList:e}},__vite__mapDeps([43,2,13,11,3,23,26,4,5,30,44,14,7,8,37,39,15,41,42,28,17]))).ChannelsList})),Oi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{RuntimeConfig:e}=await import(`./RuntimeConfig-Bk0uYBhf.js`);return{RuntimeConfig:e}},__vite__mapDeps([45,2,13,11,3,23,26,14,31,6,46,47,34,15,42,17]))).RuntimeConfig})),ki=(0,A.lazy)(async()=>({default:(await _(async()=>{let{DesktopUpdateConfig:e}=await import(`./desktop-update-config-1KBrqLBC.js`);return{DesktopUpdateConfig:e}},__vite__mapDeps([48,2,13,11,3,5,33,46,15,42]))).DesktopUpdateConfig})),Ai=(0,A.lazy)(async()=>({default:(await _(async()=>{let{SecurityConfig:e}=await import(`./security-config-CbXfPZzr.js`);return{SecurityConfig:e}},__vite__mapDeps([49,2,11,15,42]))).SecurityConfig})),ji=(0,A.lazy)(async()=>({default:(await _(async()=>{let{SessionsConfig:e}=await import(`./SessionsConfig-Doqp5ghH.js`);return{SessionsConfig:e}},__vite__mapDeps([50,2,13,11,3,44,33,7,35,14,15,27]))).SessionsConfig})),Mi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{SecretsConfig:e}=await import(`./SecretsConfig-Ba1RPJaG.js`);return{SecretsConfig:e}},__vite__mapDeps([51,2,13,11,3,6,47,34,15,42]))).SecretsConfig})),Ni=(0,A.lazy)(async()=>({default:(await _(async()=>{let{RemoteAccessPage:e}=await import(`./RemoteAccessPage-CyQlSjPf.js`);return{RemoteAccessPage:e}},__vite__mapDeps([52,2,11,3,32,15,41]))).RemoteAccessPage})),Pi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{MarketplacePage:e}=await import(`./MarketplacePage-C0olZaek.js`);return{MarketplacePage:e}},__vite__mapDeps([53,22,2,19,13,11,3,21,23,24,25,16,26,9,15,27,28]))).MarketplacePage})),Fi=(0,A.lazy)(async()=>({default:(await _(async()=>{let{McpMarketplacePage:e}=await import(`./McpMarketplacePage-DqKaiXO9.js`);return{McpMarketplacePage:e}},__vite__mapDeps([54,2,13,11,3,23,24,25,16,26,9,15,27,42,28]))).McpMarketplacePage}));function Ii(){return(0,j.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function $({children:e}){return(0,j.jsx)(A.Suspense,{fallback:(0,j.jsx)(Ii,{}),children:e})}function Li(){return Ci(C),(0,j.jsxs)(jn,{children:[(0,j.jsx)(_i,{children:(0,j.jsx)(`div`,{className:`w-full h-full`,children:(0,j.jsxs)(ee,{children:[(0,j.jsx)(g,{path:`/chat/skills`,element:(0,j.jsx)(v,{to:`/skills`,replace:!0})}),(0,j.jsx)(g,{path:`/chat/cron`,element:(0,j.jsx)(v,{to:`/cron`,replace:!0})}),(0,j.jsx)(g,{path:`/chat/agents`,element:(0,j.jsx)(v,{to:`/agents`,replace:!0})}),(0,j.jsx)(g,{path:`/chat/:sessionId?`,element:(0,j.jsx)($,{children:(0,j.jsx)(Q,{view:`chat`})})}),(0,j.jsx)(g,{path:`/agents`,element:(0,j.jsx)($,{children:(0,j.jsx)(Q,{view:`agents`})})}),(0,j.jsx)(g,{path:`/skills`,element:(0,j.jsx)($,{children:(0,j.jsx)(Q,{view:`skills`})})}),(0,j.jsx)(g,{path:`/cron`,element:(0,j.jsx)($,{children:(0,j.jsx)(Q,{view:`cron`})})}),(0,j.jsx)(g,{path:`/model`,element:(0,j.jsx)($,{children:(0,j.jsx)(wi,{})})}),(0,j.jsx)(g,{path:`/search`,element:(0,j.jsx)($,{children:(0,j.jsx)(Ti,{})})}),(0,j.jsx)(g,{path:`/providers`,element:(0,j.jsx)($,{children:(0,j.jsx)(Ei,{})})}),(0,j.jsx)(g,{path:`/channels`,element:(0,j.jsx)($,{children:(0,j.jsx)(Di,{})})}),(0,j.jsx)(g,{path:`/runtime`,element:(0,j.jsx)($,{children:(0,j.jsx)(Oi,{})})}),(0,j.jsx)(g,{path:`/updates`,element:(0,j.jsx)($,{children:(0,j.jsx)(ki,{})})}),(0,j.jsx)(g,{path:`/remote`,element:(0,j.jsx)($,{children:(0,j.jsx)(Ni,{})})}),(0,j.jsx)(g,{path:`/security`,element:(0,j.jsx)($,{children:(0,j.jsx)(Ai,{})})}),(0,j.jsx)(g,{path:`/sessions`,element:(0,j.jsx)($,{children:(0,j.jsx)(ji,{})})}),(0,j.jsx)(g,{path:`/secrets`,element:(0,j.jsx)($,{children:(0,j.jsx)(Mi,{})})}),(0,j.jsx)(g,{path:`/settings`,element:(0,j.jsx)(v,{to:`/model`,replace:!0})}),(0,j.jsx)(g,{path:`/marketplace/skills`,element:(0,j.jsx)(v,{to:`/skills`,replace:!0})}),(0,j.jsx)(g,{path:`/marketplace`,element:(0,j.jsx)(v,{to:`/marketplace/plugins`,replace:!0})}),(0,j.jsx)(g,{path:`/marketplace/mcp`,element:(0,j.jsx)($,{children:(0,j.jsx)(Fi,{})})}),(0,j.jsx)(g,{path:`/marketplace/:type`,element:(0,j.jsx)($,{children:(0,j.jsx)(Pi,{})})}),(0,j.jsx)(g,{path:`/`,element:(0,j.jsx)(v,{to:`/chat`,replace:!0})}),(0,j.jsx)(g,{path:`*`,element:(0,j.jsx)(v,{to:`/chat`,replace:!0})})]})})}),(0,j.jsx)(Nn,{})]})}function Ri(){let e=Wn(),t=e.isError&&Hn(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,j.jsx)(Li,{}):e.data?.enabled&&!e.data.authenticated?(0,j.jsx)(Xn,{username:e.data.username}):(0,j.jsx)(Li,{})}function zi(){return(0,j.jsxs)(ie,{client:C,children:[(0,j.jsx)(Ri,{}),(0,j.jsx)(h,{position:`top-right`,richColors:!0})]})}(0,et.createRoot)(document.getElementById(`root`)).render((0,j.jsx)(A.StrictMode,{children:(0,j.jsx)(ai,{children:(0,j.jsx)(ni,{children:(0,j.jsx)(y,{children:(0,j.jsx)(zi,{})})})})}));export{xn as $,Lr as A,qn as B,Nr as C,Dr as D,Ir as E,xr as F,Rn as G,Yn as H,gr as I,In as J,Ln as K,pr as L,Rr as M,Sr as N,Wr as O,yr as P,Sn as Q,Qn as R,Jr as S,qr as T,Jn as U,Gn as V,Pn as W,q as X,Mn as Y,G as Z,Fr as _,Bt as _t,Qr as a,on as at,Br as b,It as bt,Cr as c,en as ct,Ar as d,Yt as dt,ln as et,Gr as f,qt as ft,zr as g,R as gt,jr as h,Ut as ht,$r as i,cn as it,Or as j,kr as k,Tr as l,Qt as lt,Ur as m,Gt as mt,oi as n,tn as nt,ei as o,z as ot,Kr as p,Kt as pt,Fn as q,ri as r,an as rt,Yr as s,sn as st,vi as t,B as tt,Er as u,Zt as ut,Vr as v,Rt as vt,Mr as w,Pr as x,Hr as y,Lt as yt,Wn as z};
@@ -1 +1 @@
1
- import{_ as e,g as t,h as n,v as r}from"./client-CSk58DcF.js";function i(i){return{onFetch:(s,c)=>{let l=s.options,u=s.fetchOptions?.meta?.fetchMore?.direction,d=s.state.data?.pages||[],f=s.state.data?.pageParams||[],p={pages:[],pageParams:[]},m=0,h=async()=>{let c=!1,h=e=>{n(e,()=>s.signal,()=>c=!0)},g=r(s.options,s.fetchOptions),_=async(n,r,i)=>{if(c)return Promise.reject();if(r==null&&n.pages.length)return Promise.resolve(n);let a=await g((()=>{let e={client:s.client,queryKey:s.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:s.options.meta};return h(e),e})()),{maxPages:o}=s.options,l=i?e:t;return{pages:l(n.pages,a,o),pageParams:l(n.pageParams,r,o)}};if(u&&d.length){let e=u===`backward`,t=e?o:a,n={pages:d,pageParams:f};p=await _(n,t(l,n),e)}else{let e=i??d.length;do{let e=m===0?f[0]??l.initialPageParam:a(l,p);if(m>0&&e==null)break;p=await _(p,e),m++}while(m<e)}return p};s.options.persister?s.fetchFn=()=>s.options.persister?.(h,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},c):s.fetchFn=h}}}function a(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function o(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function s(e,t){return t?a(e,t)!=null:!1}function c(e,t){return!t||!e.getPreviousPageParam?!1:o(e,t)!=null}export{c as n,i as r,s as t};
1
+ import{_ as e,g as t,h as n,v as r}from"./client-CVqPF5ie.js";function i(i){return{onFetch:(s,c)=>{let l=s.options,u=s.fetchOptions?.meta?.fetchMore?.direction,d=s.state.data?.pages||[],f=s.state.data?.pageParams||[],p={pages:[],pageParams:[]},m=0,h=async()=>{let c=!1,h=e=>{n(e,()=>s.signal,()=>c=!0)},g=r(s.options,s.fetchOptions),_=async(n,r,i)=>{if(c)return Promise.reject();if(r==null&&n.pages.length)return Promise.resolve(n);let a=await g((()=>{let e={client:s.client,queryKey:s.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:s.options.meta};return h(e),e})()),{maxPages:o}=s.options,l=i?e:t;return{pages:l(n.pages,a,o),pageParams:l(n.pageParams,r,o)}};if(u&&d.length){let e=u===`backward`,t=e?o:a,n={pages:d,pageParams:f};p=await _(n,t(l,n),e)}else{let e=i??d.length;do{let e=m===0?f[0]??l.initialPageParam:a(l,p);if(m>0&&e==null)break;p=await _(p,e),m++}while(m<e)}return p};s.options.persister?s.fetchFn=()=>s.options.persister?.(h,{client:s.client,queryKey:s.queryKey,meta:s.options.meta,signal:s.signal},c):s.fetchFn=h}}}function a(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function o(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function s(e,t){return t?a(e,t)!=null:!1}function c(e,t){return!t||!e.getPreviousPageParam?!1:o(e,t)!=null}export{c as n,i as r,s as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-83gaZMtv.js";var t=e(`Globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),n={telegram:`telegram.svg`,slack:`slack.svg`,discord:`discord.svg`,whatsapp:`whatsapp.svg`,qq:`qq.svg`,feishu:`feishu.svg`,dingtalk:`dingtalk.svg`,wecom:`wecom.svg`,weixin:`weixin.svg`,mochat:`mochat.svg`,email:`email.svg`};function r(e,t){let n=e[t.toLowerCase()];return n?`/logos/${n}`:null}function i(e){return r(n,e)}export{t as n,i as t};
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`Globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),n={telegram:`telegram.svg`,slack:`slack.svg`,discord:`discord.svg`,whatsapp:`whatsapp.svg`,qq:`qq.svg`,feishu:`feishu.svg`,dingtalk:`dingtalk.svg`,wecom:`wecom.svg`,weixin:`weixin.svg`,mochat:`mochat.svg`,email:`email.svg`};function r(e,t){let n=e[t.toLowerCase()];return n?`/logos/${n}`:null}function i(e){return r(n,e)}export{t as n,i as t};
@@ -1 +1 @@
1
- import{m as e,p as t,u as n}from"./i18n-C3jb83S6.js";e();var r=t();function i({children:e,fullHeight:t=!1,className:i}){return(0,r.jsx)(`div`,{className:n(`animate-fade-in`,t?`h-[calc(100vh-80px)] w-full flex flex-col`:`pb-16`,i),children:e})}function a({title:e,description:t,actions:i,className:a}){return(0,r.jsxs)(`div`,{className:n(`flex items-center justify-between mb-6 shrink-0`,a),children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`h2`,{className:`text-xl font-semibold text-gray-900`,children:e}),t&&(0,r.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:t})]}),i&&(0,r.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:i})]})}export{i as n,a as t};
1
+ import{m as e,p as t,u as n}from"./i18n-CwHZ-9vt.js";e();var r=t();function i({children:e,fullHeight:t=!1,className:i}){return(0,r.jsx)(`div`,{className:n(`animate-fade-in`,t?`h-[calc(100vh-80px)] w-full flex flex-col`:`pb-16`,i),children:e})}function a({title:e,description:t,actions:i,className:a}){return(0,r.jsxs)(`div`,{className:n(`flex items-center justify-between mb-6 shrink-0`,a),children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`h2`,{className:`text-xl font-semibold text-gray-900`,children:e}),t&&(0,r.jsx)(`p`,{className:`text-sm text-gray-500 mt-1`,children:t})]}),i&&(0,r.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:i})]})}export{i as n,a as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
@@ -1 +1 @@
1
- import{_ as e,m as t,p as n,u as r}from"./i18n-C3jb83S6.js";import{A as i,B as a,C as o,E as s,F as c,G as l,I as u,L as d,M as f,N as p,P as m,S as h,T as g,U as _,W as v,j as ee,w as y,z as b}from"./select-DLYqySQK.js";import{t as x}from"./dist-toEYs-MZ.js";var S=e(t(),1),C=n(),w=`Popover`,[T,te]=_(w,[s]),E=s(),[D,O]=T(w),k=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,c=E(t),l=S.useRef(null),[u,d]=S.useState(!1),[f,p]=b({prop:r,defaultProp:i??!1,onChange:o,caller:w});return(0,C.jsx)(g,{...c,children:(0,C.jsx)(D,{scope:t,contentId:a(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:S.useCallback(()=>d(!0),[]),onCustomAnchorRemove:S.useCallback(()=>d(!1),[]),modal:s,children:n})})};k.displayName=w;var A=`PopoverAnchor`,j=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(A,n),a=E(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return S.useEffect(()=>(o(),()=>s()),[o,s]),(0,C.jsx)(h,{...a,...r,ref:t})});j.displayName=A;var M=`PopoverTrigger`,N=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(M,n),a=E(n),o=v(t,i.triggerRef),s=(0,C.jsx)(u.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":q(i.open),...r,ref:o,onClick:l(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,C.jsx)(h,{asChild:!0,...a,children:s})});N.displayName=M;var P=`PopoverPortal`,[F,I]=T(P,{forceMount:void 0}),L=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=O(P,t);return(0,C.jsx)(F,{scope:t,forceMount:n,children:(0,C.jsx)(x,{present:n||a.open,children:(0,C.jsx)(p,{asChild:!0,container:i,children:r})})})};L.displayName=P;var R=`PopoverContent`,z=S.forwardRef((e,t)=>{let n=I(R,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=O(R,e.__scopePopover);return(0,C.jsx)(x,{present:r||a.open,children:a.modal?(0,C.jsx)(B,{...i,ref:t}):(0,C.jsx)(V,{...i,ref:t})})});z.displayName=R;var ne=d(`PopoverContent.RemoveScroll`),B=S.forwardRef((e,t)=>{let n=O(R,e.__scopePopover),r=S.useRef(null),a=v(t,r),o=S.useRef(!1);return S.useEffect(()=>{let e=r.current;if(e)return i(e)},[]),(0,C.jsx)(ee,{as:ne,allowPinchZoom:!0,children:(0,C.jsx)(H,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:l(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;o.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),V=S.forwardRef((e,t)=>{let n=O(R,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),H=S.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...p}=e,h=O(R,n),g=E(n);return f(),(0,C.jsx)(m,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,C.jsx)(c,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:(0,C.jsx)(y,{"data-state":q(h.open),role:`dialog`,id:h.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),U=`PopoverClose`,W=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(U,n);return(0,C.jsx)(u.button,{type:`button`,...r,ref:t,onClick:l(e.onClick,()=>i.onOpenChange(!1))})});W.displayName=U;var G=`PopoverArrow`,K=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=E(n);return(0,C.jsx)(o,{...i,...r,ref:t})});K.displayName=G;function q(e){return e?`open`:`closed`}var J=k,Y=j,X=N,Z=L,Q=z,re=J,ie=X,$=S.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,...i},a)=>(0,C.jsx)(Z,{children:(0,C.jsx)(Q,{ref:a,sideOffset:t,align:n,className:r(`z-[var(--z-popover,50)] w-72 overflow-hidden rounded-2xl border border-gray-200/50 bg-white p-4 shadow-lg 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),...i})}));$.displayName=Q.displayName;export{Q as a,X as c,Y as i,$ as n,Z as o,ie as r,J as s,re as t};
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-CwHZ-9vt.js";import{A as i,B as a,C as o,E as s,F as c,G as l,I as u,L as d,M as f,N as p,P as m,S as h,T as g,U as _,W as v,j as ee,w as y,z as b}from"./select-Caud8QvU.js";import{t as x}from"./dist-Da5Gm_pO.js";var S=e(t(),1),C=n(),w=`Popover`,[T,te]=_(w,[s]),E=s(),[D,O]=T(w),k=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,c=E(t),l=S.useRef(null),[u,d]=S.useState(!1),[f,p]=b({prop:r,defaultProp:i??!1,onChange:o,caller:w});return(0,C.jsx)(g,{...c,children:(0,C.jsx)(D,{scope:t,contentId:a(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:u,onCustomAnchorAdd:S.useCallback(()=>d(!0),[]),onCustomAnchorRemove:S.useCallback(()=>d(!1),[]),modal:s,children:n})})};k.displayName=w;var A=`PopoverAnchor`,j=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(A,n),a=E(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return S.useEffect(()=>(o(),()=>s()),[o,s]),(0,C.jsx)(h,{...a,...r,ref:t})});j.displayName=A;var M=`PopoverTrigger`,N=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(M,n),a=E(n),o=v(t,i.triggerRef),s=(0,C.jsx)(u.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":q(i.open),...r,ref:o,onClick:l(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,C.jsx)(h,{asChild:!0,...a,children:s})});N.displayName=M;var P=`PopoverPortal`,[F,I]=T(P,{forceMount:void 0}),L=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=O(P,t);return(0,C.jsx)(F,{scope:t,forceMount:n,children:(0,C.jsx)(x,{present:n||a.open,children:(0,C.jsx)(p,{asChild:!0,container:i,children:r})})})};L.displayName=P;var R=`PopoverContent`,z=S.forwardRef((e,t)=>{let n=I(R,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=O(R,e.__scopePopover);return(0,C.jsx)(x,{present:r||a.open,children:a.modal?(0,C.jsx)(B,{...i,ref:t}):(0,C.jsx)(V,{...i,ref:t})})});z.displayName=R;var ne=d(`PopoverContent.RemoveScroll`),B=S.forwardRef((e,t)=>{let n=O(R,e.__scopePopover),r=S.useRef(null),a=v(t,r),o=S.useRef(!1);return S.useEffect(()=>{let e=r.current;if(e)return i(e)},[]),(0,C.jsx)(ee,{as:ne,allowPinchZoom:!0,children:(0,C.jsx)(H,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:l(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;o.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),V=S.forwardRef((e,t)=>{let n=O(R,e.__scopePopover),r=S.useRef(!1),i=S.useRef(!1);return(0,C.jsx)(H,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),H=S.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...p}=e,h=O(R,n),g=E(n);return f(),(0,C.jsx)(m,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,C.jsx)(c,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:(0,C.jsx)(y,{"data-state":q(h.open),role:`dialog`,id:h.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})}),U=`PopoverClose`,W=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=O(U,n);return(0,C.jsx)(u.button,{type:`button`,...r,ref:t,onClick:l(e.onClick,()=>i.onOpenChange(!1))})});W.displayName=U;var G=`PopoverArrow`,K=S.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=E(n);return(0,C.jsx)(o,{...i,...r,ref:t})});K.displayName=G;function q(e){return e?`open`:`closed`}var J=k,Y=j,X=N,Z=L,Q=z,re=J,ie=X,$=S.forwardRef(({className:e,sideOffset:t=8,align:n=`start`,...i},a)=>(0,C.jsx)(Z,{children:(0,C.jsx)(Q,{ref:a,sideOffset:t,align:n,className:r(`z-[var(--z-popover,50)] w-72 overflow-hidden rounded-2xl border border-gray-200/50 bg-white p-4 shadow-lg 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),...i})}));$.displayName=Q.displayName;export{Q as a,X as c,Y as i,$ as n,Z as o,ie as r,J as s,re as t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-83gaZMtv.js";var t=e(`RefreshCcw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`RefreshCcw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]);export{t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-83gaZMtv.js";var t=e(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`RefreshCw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`RotateCw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]);export{t};
@@ -1 +1 @@
1
- import{t as e}from"./createLucideIcon-83gaZMtv.js";var t=e(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`Save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-DVv8taGY.js";var t=e(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]);export{t};
@@ -1 +1 @@
1
- import{_ as e,i as t,m as n,p as r}from"./i18n-C3jb83S6.js";import{n as i,r as a}from"./dist-aTmhMDVh.js";import{B as o,G as s,H as c,J as l,K as u,U as d,V as f,W as p,et as m,q as h,tt as g,z as _}from"./index-riX7Sg0_.js";import{n as v,t as y}from"./page-layout-D2eRufRQ.js";import{t as b}from"./switch-Dz2ScsKx.js";var x=e(n(),1),S=r(),C=8;function w(e){return e.trim().length>=C}function T(e,n){return e===n?!0:(i.error(t(`authPasswordMismatch`)),!1)}function E(){let e=_(),n=f(),r=c(),i=d(),v=o(),[y,C]=(0,x.useState)(``),[E,D]=(0,x.useState)(``),[O,k]=(0,x.useState)(``),[A,j]=(0,x.useState)(``),[M,N]=(0,x.useState)(``),P=e.data,F=y.trim().length>0&&w(E)&&E===O&&!n.isPending,I=w(A)&&A===M&&!i.isPending,L=async()=>{if(T(E,O))try{await n.mutateAsync({username:y.trim(),password:E}),D(``),k(``)}catch{}},R=async()=>{if(T(A,M))try{await i.mutateAsync({password:A}),j(``),N(``)}catch{}},z=async e=>{try{await r.mutateAsync({enabled:e})}catch{}},B=async()=>{try{await v.mutateAsync()}catch{}};return e.isLoading&&!P?(0,S.jsxs)(p,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsx)(s,{className:`text-sm text-gray-500`,children:t(`loading`)})]}):e.isError||!P?(0,S.jsxs)(p,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{className:`space-y-4`,children:[(0,S.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`authStatusLoadFailed`)}),(0,S.jsx)(a,{variant:`outline`,onClick:()=>{e.refetch()},children:t(`authRetryStatus`)})]})]}):P.configured?(0,S.jsxs)(p,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-4`,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-start md:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authStatusLabel`)}),(0,S.jsx)(`p`,{className:`text-sm text-gray-600`,children:t(`authStatusConfiguredUser`).replace(`{username}`,P.username??``)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authUsernameFixedHelp`)})]}),(0,S.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700`,children:P.enabled?t(`enabled`):t(`disabled`)})]}),(0,S.jsxs)(`div`,{className:`mt-4 flex flex-col gap-4 border-t border-gray-200 pt-4 md:flex-row md:items-center md:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authEnableLabel`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:P.enabled?t(`authEnableOnHelp`):t(`authEnableOffHelp`)})]}),(0,S.jsx)(b,{checked:P.enabled,disabled:r.isPending,onCheckedChange:e=>{z(e)}})]})]}),(0,S.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-4 space-y-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authPasswordSectionTitle`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authPasswordSectionDescription`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-password-next`,children:t(`authPassword`)}),(0,S.jsx)(g,{id:`auth-password-next`,type:`password`,value:A,onChange:e=>j(e.target.value),placeholder:t(`authPasswordPlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-password-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(g,{id:`auth-password-confirm`,type:`password`,value:M,onChange:e=>N(e.target.value),placeholder:t(`authConfirmPasswordPlaceholder`)})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,S.jsx)(a,{type:`button`,disabled:!I,onClick:()=>void R(),children:i.isPending?t(`authPasswordUpdating`):t(`authPasswordAction`)}),P.enabled&&P.authenticated?(0,S.jsx)(a,{type:`button`,variant:`outline`,disabled:v.isPending,onClick:()=>void B(),children:v.isPending?t(`authLoggingOut`):t(`authLogoutAction`)}):null]}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authSessionMemoryNotice`)})]})]})]}):(0,S.jsxs)(p,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{className:`space-y-5`,children:[(0,S.jsxs)(`div`,{className:`rounded-xl border border-dashed border-gray-200 bg-gray-50/70 p-4`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authSetupTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:t(`authSetupDescription`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-setup-username`,children:t(`authUsername`)}),(0,S.jsx)(g,{id:`auth-setup-username`,value:y,onChange:e=>C(e.target.value),placeholder:t(`authUsernamePlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-setup-password`,children:t(`authPassword`)}),(0,S.jsx)(g,{id:`auth-setup-password`,type:`password`,value:E,onChange:e=>D(e.target.value),placeholder:t(`authPasswordPlaceholder`)})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-setup-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(g,{id:`auth-setup-confirm`,type:`password`,value:O,onChange:e=>k(e.target.value),placeholder:t(`authConfirmPasswordPlaceholder`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authPasswordMinLengthHint`)})]}),(0,S.jsx)(a,{type:`button`,disabled:!F,onClick:()=>void L(),children:n.isPending?t(`authSettingUp`):t(`authSetupAction`)})]})]})}function D(){return(0,S.jsxs)(v,{className:`space-y-6`,children:[(0,S.jsx)(y,{title:t(`authSecurityTitle`),description:t(`authSecurityDescription`)}),(0,S.jsx)(E,{})]})}export{D as SecurityConfig};
1
+ import{_ as e,i as t,m as n,p as r}from"./i18n-CwHZ-9vt.js";import{n as i,r as a}from"./dist-DmAlInRu.js";import{B as o,G as s,H as c,J as l,K as u,U as d,V as f,W as p,et as m,q as h,tt as g,z as _}from"./index-DdksE6U3.js";import{n as v,t as y}from"./page-layout-Da3i3r6G.js";import{t as b}from"./switch-0rmPBRKI.js";var x=e(n(),1),S=r(),C=8;function w(e){return e.trim().length>=C}function T(e,n){return e===n?!0:(i.error(t(`authPasswordMismatch`)),!1)}function E(){let e=_(),n=f(),r=c(),i=d(),v=o(),[y,C]=(0,x.useState)(``),[E,D]=(0,x.useState)(``),[O,k]=(0,x.useState)(``),[A,j]=(0,x.useState)(``),[M,N]=(0,x.useState)(``),P=e.data,F=y.trim().length>0&&w(E)&&E===O&&!n.isPending,I=w(A)&&A===M&&!i.isPending,L=async()=>{if(T(E,O))try{await n.mutateAsync({username:y.trim(),password:E}),D(``),k(``)}catch{}},R=async()=>{if(T(A,M))try{await i.mutateAsync({password:A}),j(``),N(``)}catch{}},z=async e=>{try{await r.mutateAsync({enabled:e})}catch{}},B=async()=>{try{await v.mutateAsync()}catch{}};return e.isLoading&&!P?(0,S.jsxs)(p,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsx)(s,{className:`text-sm text-gray-500`,children:t(`loading`)})]}):e.isError||!P?(0,S.jsxs)(p,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{className:`space-y-4`,children:[(0,S.jsx)(`p`,{className:`text-sm text-gray-500`,children:t(`authStatusLoadFailed`)}),(0,S.jsx)(a,{variant:`outline`,onClick:()=>{e.refetch()},children:t(`authRetryStatus`)})]})]}):P.configured?(0,S.jsxs)(p,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{className:`space-y-6`,children:[(0,S.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-4`,children:[(0,S.jsxs)(`div`,{className:`flex flex-col gap-4 md:flex-row md:items-start md:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authStatusLabel`)}),(0,S.jsx)(`p`,{className:`text-sm text-gray-600`,children:t(`authStatusConfiguredUser`).replace(`{username}`,P.username??``)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authUsernameFixedHelp`)})]}),(0,S.jsx)(`span`,{className:`inline-flex items-center rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700`,children:P.enabled?t(`enabled`):t(`disabled`)})]}),(0,S.jsxs)(`div`,{className:`mt-4 flex flex-col gap-4 border-t border-gray-200 pt-4 md:flex-row md:items-center md:justify-between`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authEnableLabel`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:P.enabled?t(`authEnableOnHelp`):t(`authEnableOffHelp`)})]}),(0,S.jsx)(b,{checked:P.enabled,disabled:r.isPending,onCheckedChange:e=>{z(e)}})]})]}),(0,S.jsxs)(`div`,{className:`rounded-xl border border-gray-200 p-4 space-y-4`,children:[(0,S.jsxs)(`div`,{className:`space-y-1`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authPasswordSectionTitle`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authPasswordSectionDescription`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-password-next`,children:t(`authPassword`)}),(0,S.jsx)(g,{id:`auth-password-next`,type:`password`,value:A,onChange:e=>j(e.target.value),placeholder:t(`authPasswordPlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-password-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(g,{id:`auth-password-confirm`,type:`password`,value:M,onChange:e=>N(e.target.value),placeholder:t(`authConfirmPasswordPlaceholder`)})]})]}),(0,S.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,S.jsx)(a,{type:`button`,disabled:!I,onClick:()=>void R(),children:i.isPending?t(`authPasswordUpdating`):t(`authPasswordAction`)}),P.enabled&&P.authenticated?(0,S.jsx)(a,{type:`button`,variant:`outline`,disabled:v.isPending,onClick:()=>void B(),children:v.isPending?t(`authLoggingOut`):t(`authLogoutAction`)}):null]}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authSessionMemoryNotice`)})]})]})]}):(0,S.jsxs)(p,{children:[(0,S.jsxs)(h,{children:[(0,S.jsx)(l,{children:t(`authSecurityTitle`)}),(0,S.jsx)(u,{children:t(`authSecurityDescription`)})]}),(0,S.jsxs)(s,{className:`space-y-5`,children:[(0,S.jsxs)(`div`,{className:`rounded-xl border border-dashed border-gray-200 bg-gray-50/70 p-4`,children:[(0,S.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:t(`authSetupTitle`)}),(0,S.jsx)(`p`,{className:`mt-1 text-sm text-gray-500`,children:t(`authSetupDescription`)})]}),(0,S.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-setup-username`,children:t(`authUsername`)}),(0,S.jsx)(g,{id:`auth-setup-username`,value:y,onChange:e=>C(e.target.value),placeholder:t(`authUsernamePlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-setup-password`,children:t(`authPassword`)}),(0,S.jsx)(g,{id:`auth-setup-password`,type:`password`,value:E,onChange:e=>D(e.target.value),placeholder:t(`authPasswordPlaceholder`)})]})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(m,{htmlFor:`auth-setup-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(g,{id:`auth-setup-confirm`,type:`password`,value:O,onChange:e=>k(e.target.value),placeholder:t(`authConfirmPasswordPlaceholder`)}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authPasswordMinLengthHint`)})]}),(0,S.jsx)(a,{type:`button`,disabled:!F,onClick:()=>void L(),children:n.isPending?t(`authSettingUp`):t(`authSetupAction`)})]})]})}function D(){return(0,S.jsxs)(v,{className:`space-y-6`,children:[(0,S.jsx)(y,{title:t(`authSecurityTitle`),description:t(`authSecurityDescription`)}),(0,S.jsx)(E,{})]})}export{D as SecurityConfig};
@@ -1,4 +1,4 @@
1
- import{_ as e,m as t,p as n,u as r}from"./i18n-C3jb83S6.js";import{a as i}from"./dist-aTmhMDVh.js";import{t as a}from"./createLucideIcon-83gaZMtv.js";typeof window<`u`&&window.document&&window.document.createElement;function o(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var s=e(t(),1);function c(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function l(...e){return t=>{let n=!1,r=e.map(e=>{let r=c(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():c(e[t],null)}}}}function u(...e){return s.useCallback(l(...e),e)}var d=n();function f(e,t){let n=s.createContext(t),r=e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,d.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=s.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function p(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,d.jsx)(c.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function c(n,o){let c=o?.[e]?.[a]||i,l=s.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,c]}let i=()=>{let t=n.map(e=>s.createContext(e));return function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,m(i,...t)]}function m(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var h=globalThis?.document?s.useLayoutEffect:()=>{},g=s.useId||(()=>void 0),_=0;function v(e){let[t,n]=s.useState(g());return h(()=>{e||n(e=>e??String(_++))},[e]),e||(t?`radix-${t}`:``)}var y=s.useInsertionEffect||h;function b({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=x({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=s.useRef(e!==void 0);s.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,s.useCallback(t=>{if(c){let n=S(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}function x({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return y(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function S(e){return typeof e==`function`}function C(e){let t=w(e),n=s.forwardRef((e,n)=>{let{children:r,...i}=e,a=s.Children.toArray(r),o=a.find(D);if(o){let e=o.props.children,r=a.map(t=>t===o?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t);return(0,d.jsx)(t,{...i,ref:n,children:s.isValidElement(e)?s.cloneElement(e,void 0,r):null})}return(0,d.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function w(e){let t=s.forwardRef((e,t)=>{let{children:n,...r}=e;if(s.isValidElement(n)){let e=k(n),i=O(r,n.props);return n.type!==s.Fragment&&(i.ref=t?l(t,e):e),s.cloneElement(n,i)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T=Symbol(`radix.slottable`);function E(e){let t=({children:e})=>(0,d.jsx)(d.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=T,t}function D(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===T}function O(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var A=e(i(),1),j=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=C(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,d.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function M(e,t){e&&A.flushSync(()=>e.dispatchEvent(t))}function N(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>t.current?.(...e),[])}function P(e,t=globalThis?.document){let n=N(e);s.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var F=`DismissableLayer`,ee=`dismissableLayer.update`,te=`dismissableLayer.pointerDownOutside`,ne=`dismissableLayer.focusOutside`,I,L=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),re=s.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...f}=e,p=s.useContext(L),[m,h]=s.useState(null),g=m?.ownerDocument??globalThis?.document,[,_]=s.useState({}),v=u(t,e=>h(e)),y=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),S=m?y.indexOf(m):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=oe(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!w||n||(i?.(e),c?.(e),e.defaultPrevented||l?.())},g),E=se(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(a?.(e),c?.(e),e.defaultPrevented||l?.())},g);return P(e=>{S===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},g),s.useEffect(()=>{if(m)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(I=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),ce(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=I)}},[m,g,n,p]),s.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),ce())},[m,p]),s.useEffect(()=>{let e=()=>_({});return document.addEventListener(ee,e),()=>document.removeEventListener(ee,e)},[]),(0,d.jsx)(j.div,{...f,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:o(e.onFocusCapture,E.onFocusCapture),onBlurCapture:o(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:o(e.onPointerDownCapture,T.onPointerDownCapture)})});re.displayName=F;var ie=`DismissableLayerBranch`,ae=s.forwardRef((e,t)=>{let n=s.useContext(L),r=s.useRef(null),i=u(t,r);return s.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,d.jsx)(j.div,{...e,ref:i})});ae.displayName=ie;function oe(e,t=globalThis?.document){let n=N(e),r=s.useRef(!1),i=s.useRef(()=>{});return s.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){le(te,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function se(e,t=globalThis?.document){let n=N(e),r=s.useRef(!1);return s.useEffect(()=>{let e=e=>{e.target&&!r.current&&le(ne,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ce(){let e=new CustomEvent(ee);document.dispatchEvent(e)}function le(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?M(i,a):i.dispatchEvent(a)}var ue=`focusScope.autoFocusOnMount`,de=`focusScope.autoFocusOnUnmount`,fe={bubbles:!1,cancelable:!0},pe=`FocusScope`,me=s.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=s.useState(null),f=N(i),p=N(a),m=s.useRef(null),h=u(t,e=>l(e)),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;c.contains(t)?m.current=t:R(m.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||R(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&R(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused]),s.useEffect(()=>{if(c){xe.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ue,fe);c.addEventListener(ue,f),c.dispatchEvent(t),t.defaultPrevented||(he(we(_e(c)),{select:!0}),document.activeElement===e&&R(c))}return()=>{c.removeEventListener(ue,f),setTimeout(()=>{let t=new CustomEvent(de,fe);c.addEventListener(de,p),c.dispatchEvent(t),t.defaultPrevented||R(e??document.body,{select:!0}),c.removeEventListener(de,p),xe.remove(g)},0)}}},[c,f,p,g]);let _=s.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ge(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&R(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&R(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,d.jsx)(j.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});me.displayName=pe;function he(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(R(r,{select:t}),document.activeElement!==n)return}function ge(e){let t=_e(e);return[ve(t,e),ve(t.reverse(),e)]}function _e(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(let n of e)if(!ye(n,{upTo:t}))return n}function ye(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function be(e){return e instanceof HTMLInputElement&&`select`in e}function R(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&be(e)&&t&&e.select()}}var xe=Se();function Se(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ce(e,t),e.unshift(t)},remove(t){e=Ce(e,t),e[0]?.resume()}}}function Ce(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function we(e){return e.filter(e=>e.tagName!==`A`)}var Te=`Portal`,Ee=s.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=s.useState(!1);h(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?A.createPortal((0,d.jsx)(j.div,{...r,ref:t}),o):null});Ee.displayName=Te;var De=0;function Oe(){s.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ke()),document.body.insertAdjacentElement(`beforeend`,e[1]??ke()),De++,()=>{De===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),De--}},[])}function ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function Ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function je(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Me=`right-scroll-bar-position`,Ne=`width-before-scroll-bar`,Pe=`with-scroll-bars-hidden`,Fe=`--removed-body-scroll-bar-size`;function Ie(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Le(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Re=typeof window<`u`?s.useLayoutEffect:s.useEffect,ze=new WeakMap;function Be(e,t){var n=Le(t||null,function(t){return e.forEach(function(e){return Ie(e,t)})});return Re(function(){var t=ze.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ie(e,null)}),i.forEach(function(e){r.has(e)||Ie(e,a)})}ze.set(n,e)},[e]),n}function Ve(e){return e}function He(e,t){t===void 0&&(t=Ve);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ue(e){e===void 0&&(e={});var t=He(null);return t.options=z({async:!0,ssr:!1},e),t}var We=function(e){var t=e.sideCar,n=Ae(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,z({},n))};We.isSideCarExport=!0;function Ge(e,t){return e.useMedium(t),We}var Ke=Ue(),qe=function(){},Je=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:qe,onWheelCapture:qe,onTouchMoveCapture:qe}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ae(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Be([n,t]),w=z(z({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ke,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),z(z({},w),{ref:C})):s.createElement(y,z({},w,{className:l,ref:C}),c))});Je.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Je.classNames={fullWidth:Ne,zeroRight:Me};var Ye,Xe=function(){if(Ye)return Ye;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ze(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Xe();return t&&e.setAttribute(`nonce`,t),e}function Qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $e(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var et=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ze())&&(Qe(t,n),$e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tt=function(){var e=et();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nt=function(){var e=tt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},rt={left:0,top:0,right:0,gap:0},it=function(e){return parseInt(e||``,10)||0},at=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[it(n),it(r),it(i)]},ot=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return rt;var t=at(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},st=nt(),ct=`data-scroll-locked`,lt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-CwHZ-9vt.js";import{a as i}from"./dist-DmAlInRu.js";import{t as a}from"./createLucideIcon-DVv8taGY.js";typeof window<`u`&&window.document&&window.document.createElement;function o(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var s=e(t(),1);function c(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function l(...e){return t=>{let n=!1,r=e.map(e=>{let r=c(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():c(e[t],null)}}}}function u(...e){return s.useCallback(l(...e),e)}var d=n();function f(e,t){let n=s.createContext(t),r=e=>{let{children:t,...r}=e,i=s.useMemo(()=>r,Object.values(r));return(0,d.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=s.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function p(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,c=n?.[e]?.[a]||i,l=s.useMemo(()=>o,Object.values(o));return(0,d.jsx)(c.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function c(n,o){let c=o?.[e]?.[a]||i,l=s.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,c]}let i=()=>{let t=n.map(e=>s.createContext(e));return function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,m(i,...t)]}function m(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var h=globalThis?.document?s.useLayoutEffect:()=>{},g=s.useId||(()=>void 0),_=0;function v(e){let[t,n]=s.useState(g());return h(()=>{e||n(e=>e??String(_++))},[e]),e||(t?`radix-${t}`:``)}var y=s.useInsertionEffect||h;function b({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=x({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=s.useRef(e!==void 0);s.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,s.useCallback(t=>{if(c){let n=S(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}function x({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return y(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function S(e){return typeof e==`function`}function C(e){let t=w(e),n=s.forwardRef((e,n)=>{let{children:r,...i}=e,a=s.Children.toArray(r),o=a.find(D);if(o){let e=o.props.children,r=a.map(t=>t===o?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t);return(0,d.jsx)(t,{...i,ref:n,children:s.isValidElement(e)?s.cloneElement(e,void 0,r):null})}return(0,d.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function w(e){let t=s.forwardRef((e,t)=>{let{children:n,...r}=e;if(s.isValidElement(n)){let e=k(n),i=O(r,n.props);return n.type!==s.Fragment&&(i.ref=t?l(t,e):e),s.cloneElement(n,i)}return s.Children.count(n)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T=Symbol(`radix.slottable`);function E(e){let t=({children:e})=>(0,d.jsx)(d.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=T,t}function D(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===T}function O(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function k(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var A=e(i(),1),j=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=C(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,d.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function M(e,t){e&&A.flushSync(()=>e.dispatchEvent(t))}function N(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>t.current?.(...e),[])}function P(e,t=globalThis?.document){let n=N(e);s.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var F=`DismissableLayer`,ee=`dismissableLayer.update`,te=`dismissableLayer.pointerDownOutside`,ne=`dismissableLayer.focusOutside`,I,L=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),re=s.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:c,onDismiss:l,...f}=e,p=s.useContext(L),[m,h]=s.useState(null),g=m?.ownerDocument??globalThis?.document,[,_]=s.useState({}),v=u(t,e=>h(e)),y=Array.from(p.layers),[b]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),S=m?y.indexOf(m):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,w=S>=x,T=oe(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!w||n||(i?.(e),c?.(e),e.defaultPrevented||l?.())},g),E=se(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(a?.(e),c?.(e),e.defaultPrevented||l?.())},g);return P(e=>{S===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},g),s.useEffect(()=>{if(m)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(I=g.body.style.pointerEvents,g.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),ce(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=I)}},[m,g,n,p]),s.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),ce())},[m,p]),s.useEffect(()=>{let e=()=>_({});return document.addEventListener(ee,e),()=>document.removeEventListener(ee,e)},[]),(0,d.jsx)(j.div,{...f,ref:v,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:o(e.onFocusCapture,E.onFocusCapture),onBlurCapture:o(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:o(e.onPointerDownCapture,T.onPointerDownCapture)})});re.displayName=F;var ie=`DismissableLayerBranch`,ae=s.forwardRef((e,t)=>{let n=s.useContext(L),r=s.useRef(null),i=u(t,r);return s.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,d.jsx)(j.div,{...e,ref:i})});ae.displayName=ie;function oe(e,t=globalThis?.document){let n=N(e),r=s.useRef(!1),i=s.useRef(()=>{});return s.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){le(te,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function se(e,t=globalThis?.document){let n=N(e),r=s.useRef(!1);return s.useEffect(()=>{let e=e=>{e.target&&!r.current&&le(ne,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ce(){let e=new CustomEvent(ee);document.dispatchEvent(e)}function le(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?M(i,a):i.dispatchEvent(a)}var ue=`focusScope.autoFocusOnMount`,de=`focusScope.autoFocusOnUnmount`,fe={bubbles:!1,cancelable:!0},pe=`FocusScope`,me=s.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[c,l]=s.useState(null),f=N(i),p=N(a),m=s.useRef(null),h=u(t,e=>l(e)),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;c.contains(t)?m.current=t:R(m.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(c.contains(t)||R(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&R(c)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused]),s.useEffect(()=>{if(c){xe.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ue,fe);c.addEventListener(ue,f),c.dispatchEvent(t),t.defaultPrevented||(he(we(_e(c)),{select:!0}),document.activeElement===e&&R(c))}return()=>{c.removeEventListener(ue,f),setTimeout(()=>{let t=new CustomEvent(de,fe);c.addEventListener(de,p),c.dispatchEvent(t),t.defaultPrevented||R(e??document.body,{select:!0}),c.removeEventListener(de,p),xe.remove(g)},0)}}},[c,f,p,g]);let _=s.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=ge(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&R(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&R(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,d.jsx)(j.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});me.displayName=pe;function he(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(R(r,{select:t}),document.activeElement!==n)return}function ge(e){let t=_e(e);return[ve(t,e),ve(t.reverse(),e)]}function _e(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(let n of e)if(!ye(n,{upTo:t}))return n}function ye(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function be(e){return e instanceof HTMLInputElement&&`select`in e}function R(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&be(e)&&t&&e.select()}}var xe=Se();function Se(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ce(e,t),e.unshift(t)},remove(t){e=Ce(e,t),e[0]?.resume()}}}function Ce(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function we(e){return e.filter(e=>e.tagName!==`A`)}var Te=`Portal`,Ee=s.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=s.useState(!1);h(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?A.createPortal((0,d.jsx)(j.div,{...r,ref:t}),o):null});Ee.displayName=Te;var De=0;function Oe(){s.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ke()),document.body.insertAdjacentElement(`beforeend`,e[1]??ke()),De++,()=>{De===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),De--}},[])}function ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},z.apply(this,arguments)};function Ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function je(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Me=`right-scroll-bar-position`,Ne=`width-before-scroll-bar`,Pe=`with-scroll-bars-hidden`,Fe=`--removed-body-scroll-bar-size`;function Ie(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Le(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Re=typeof window<`u`?s.useLayoutEffect:s.useEffect,ze=new WeakMap;function Be(e,t){var n=Le(t||null,function(t){return e.forEach(function(e){return Ie(e,t)})});return Re(function(){var t=ze.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ie(e,null)}),i.forEach(function(e){r.has(e)||Ie(e,a)})}ze.set(n,e)},[e]),n}function Ve(e){return e}function He(e,t){t===void 0&&(t=Ve);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ue(e){e===void 0&&(e={});var t=He(null);return t.options=z({async:!0,ssr:!1},e),t}var We=function(e){var t=e.sideCar,n=Ae(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,z({},n))};We.isSideCarExport=!0;function Ge(e,t){return e.useMedium(t),We}var Ke=Ue(),qe=function(){},Je=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:qe,onWheelCapture:qe,onTouchMoveCapture:qe}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ae(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Be([n,t]),w=z(z({},x),i);return s.createElement(s.Fragment,null,d&&s.createElement(S,{sideCar:Ke,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?s.cloneElement(s.Children.only(c),z(z({},w),{ref:C})):s.createElement(y,z({},w,{className:l,ref:C}),c))});Je.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Je.classNames={fullWidth:Ne,zeroRight:Me};var Ye,Xe=function(){if(Ye)return Ye;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ze(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Xe();return t&&e.setAttribute(`nonce`,t),e}function Qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $e(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var et=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ze())&&(Qe(t,n),$e(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tt=function(){var e=et();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nt=function(){var e=tt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},rt={left:0,top:0,right:0,gap:0},it=function(e){return parseInt(e||``,10)||0},at=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[it(n),it(r),it(i)]},ot=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return rt;var t=at(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},st=nt(),ct=`data-scroll-locked`,lt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
2
  .${Pe} {
3
3
  overflow: hidden ${r};
4
4
  padding-right: ${s}px ${r};
@@ -0,0 +1 @@
1
+ import{p as e,u as t}from"./i18n-CwHZ-9vt.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{p as e,u as t}from"./i18n-C3jb83S6.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-CwHZ-9vt.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{_ as e,m as t,p as n,u as r}from"./i18n-C3jb83S6.js";var i=e(t(),1),a=n(),o=i.forwardRef(({className:e,checked:t=!1,onCheckedChange:n,...i},o)=>(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,ref:o,className:r(`peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-gray-200/80 hover:bg-gray-300/80`,e),onClick:()=>n?.(!t),...i,children:(0,a.jsx)(`span`,{className:r(`pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast`,t?`translate-x-5`:`translate-x-0`)})}));o.displayName=`Switch`;export{o as t};
1
+ import{_ as e,m as t,p as n,u as r}from"./i18n-CwHZ-9vt.js";var i=e(t(),1),a=n(),o=i.forwardRef(({className:e,checked:t=!1,onCheckedChange:n,...i},o)=>(0,a.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,ref:o,className:r(`peer inline-flex h-[22px] w-10 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors duration-fast focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50`,t?`bg-primary`:`bg-gray-200/80 hover:bg-gray-300/80`,e),onClick:()=>n?.(!t),...i,children:(0,a.jsx)(`span`,{className:r(`pointer-events-none block h-5 w-5 rounded-full bg-white shadow-md ring-0 transition-transform duration-fast`,t?`translate-x-5`:`translate-x-0`)})}));o.displayName=`Switch`;export{o as t};
@@ -1 +1 @@
1
- import{m as e,p as t,r as n,u as r}from"./i18n-C3jb83S6.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-CwHZ-9vt.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{t as e}from"./createLucideIcon-83gaZMtv.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-DVv8taGY.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};