@nextclaw/ui 0.11.20 → 0.11.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/assets/{ChannelsList-DAx7wv0_.js → ChannelsList-ByHWHkQS.js} +1 -1
- package/dist/assets/ChatPage-FdT3pDnw.js +42 -0
- package/dist/assets/{DocBrowser-DKkE3Y4I.js → DocBrowser-3y_NHZ71.js} +1 -1
- package/dist/assets/DocBrowser-CMdPdbZj.js +1 -0
- package/dist/assets/{DocBrowserContext-BcZRBsCg.js → DocBrowserContext-CVJuwCcw.js} +1 -1
- package/dist/assets/{LogoBadge-BIPDLEwK.js → LogoBadge-D8fyilO-.js} +1 -1
- package/dist/assets/MarketplacePage-9oKmxN2n.js +1 -0
- package/dist/assets/{MarketplacePage-Dlp5BgCh.js → MarketplacePage-CmhsZXr1.js} +1 -1
- package/dist/assets/{McpMarketplacePage-CwKtAil8.js → McpMarketplacePage-C7PkCYbp.js} +1 -1
- package/dist/assets/{ModelConfig-Dg6F3Ldb.js → ModelConfig-DmCY6jWM.js} +1 -1
- package/dist/assets/{ProvidersList-f7bQdRxA.js → ProvidersList-ClT-34aX.js} +1 -1
- package/dist/assets/RemoteAccessPage-B6hUZl1O.js +1 -0
- package/dist/assets/{RuntimeConfig-M4OKjmgU.js → RuntimeConfig-C5aqliGk.js} +1 -1
- package/dist/assets/{SearchConfig-v46R5a2U.js → SearchConfig-Dm7r2yfp.js} +1 -1
- package/dist/assets/{SecretsConfig-CXvUpbB_.js → SecretsConfig-BBP_mbQh.js} +1 -1
- package/dist/assets/{SessionsConfig-7vUHMtOh.js → SessionsConfig-6wNJloZN.js} +1 -1
- package/dist/assets/{book-open-DzSduAaw.js → book-open-B26jGBjY.js} +1 -1
- package/dist/assets/{chat-session-display-CGfXhJoT.js → chat-session-display-Bjmn4aIZ.js} +1 -1
- package/dist/assets/{chunk-JZWAC4HX-C1vpvW4r.js → chunk-JZWAC4HX-B-4B29RN.js} +1 -1
- package/dist/assets/{config-Df97LeLR.js → config-BaC29Qf-.js} +1 -1
- package/dist/assets/{createLucideIcon-CcR5wVoU.js → createLucideIcon-DiFAvXmK.js} +1 -1
- package/dist/assets/{dist-BMlnBah3.js → dist-kW_O3kyZ.js} +1 -1
- package/dist/assets/{dist-Dii9v3X9.js → dist-pCfWPG1A.js} +1 -1
- package/dist/assets/{external-link-CnSDrvJE.js → external-link-D5-p-Gmm.js} +1 -1
- package/dist/assets/{hash-CAnX6PNt.js → hash-BlwrSV0q.js} +1 -1
- package/dist/assets/i18n-CSytxMFI.js +1 -0
- package/dist/assets/{index-BahpXJg8.css → index-CUy6doWo.css} +1 -1
- package/dist/assets/{index-B0DzQqwv.js → index-DvKS3L9j.js} +3 -3
- package/dist/assets/{label-CtIFj7_6.js → label-RyXfZqkP.js} +1 -1
- package/dist/assets/loader-circle-B2J777gj.js +1 -0
- package/dist/assets/{logos-3KFNiOej.js → logos-Bpl8QTgI.js} +1 -1
- package/dist/assets/{page-layout-BMwpn87D.js → page-layout--S0YBU0W.js} +1 -1
- package/dist/assets/plus-CM9XJ0Tf.js +1 -0
- package/dist/assets/{popover-BIzq25oH.js → popover-BEjfbEwy.js} +1 -1
- package/dist/assets/{react-ji6GGP_j.js → react-BuSP2-8B.js} +1 -1
- package/dist/assets/{save-CMgYkJ-y.js → save-DPPPpD_c.js} +1 -1
- package/dist/assets/search-Ctaw34Kp.js +1 -0
- package/dist/assets/{security-config-Xi5DYW7j.js → security-config-6t78Ph-I.js} +1 -1
- package/dist/assets/{select-Cz82gl01.js → select-CT50pzod.js} +1 -1
- package/dist/assets/skeleton-Bycyb0zU.js +1 -0
- package/dist/assets/{status-dot-C7q1HvLH.js → status-dot-BbBqRHfh.js} +1 -1
- package/dist/assets/{switch-DYswvkYj.js → switch-D3l6AcCk.js} +1 -1
- package/dist/assets/{tabs-custom-DKYQxrx1.js → tabs-custom-TZQ5WPWP.js} +1 -1
- package/dist/assets/{trash-2-DfXI7-ap.js → trash-2-B2_AGVE3.js} +1 -1
- package/dist/assets/{useConfirmDialog-CXDAxtRL.js → useConfirmDialog-BDpdjfIO.js} +1 -1
- package/dist/assets/{useMutation-s2sn2yzh.js → useMutation-BzCrO8j-.js} +1 -1
- package/dist/assets/x-CHOBE-63.js +1 -0
- package/dist/index.html +18 -18
- package/package.json +6 -6
- package/src/components/chat/adapters/chat-message-part.adapter.ts +74 -3
- package/src/components/chat/adapters/chat-message.adapter.test.ts +321 -3
- package/src/components/chat/adapters/chat-message.file-operation-card.ts +437 -0
- package/src/components/chat/adapters/chat-message.file-operation-diff.ts +408 -0
- package/src/components/chat/adapters/chat-message.partial-json.ts +89 -0
- package/src/components/chat/containers/chat-input-bar.container.tsx +8 -8
- package/src/components/chat/containers/chat-message-list.container.tsx +1 -0
- package/src/components/chat/ncp/ncp-session-adapter.test.ts +173 -0
- package/src/components/chat/useNcpAgentRuntime.test.tsx +90 -0
- package/src/lib/i18n.chat.ts +2 -1
- package/src/remote/remote-access-feedback.service.test.ts +18 -0
- package/src/remote/remote-access-feedback.service.ts +10 -1
- package/dist/assets/ChatPage-l2PYwCeB.js +0 -38
- package/dist/assets/DocBrowser-CIHLqoIm.js +0 -1
- package/dist/assets/MarketplacePage-TVeyVOuO.js +0 -1
- package/dist/assets/RemoteAccessPage-w_dY7P4T.js +0 -1
- package/dist/assets/i18n-CXBpwAwA.js +0 -1
- package/dist/assets/loader-circle-qgU4zQDw.js +0 -1
- package/dist/assets/plus-C9cYVbL-.js +0 -1
- package/dist/assets/search-sl1OeJFl.js +0 -1
- package/dist/assets/skeleton-rgIt7a5q.js +0 -1
- package/dist/assets/x-MIimOGs6.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DocBrowser-
|
|
2
|
-
import{_ as e,a as t,c as n,h as r,l as i,m as a,o,p as s,r as c,s as l,t as u,u as d}from"./i18n-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DocBrowser-CMdPdbZj.js","assets/DocBrowser-3y_NHZ71.js","assets/i18n-CSytxMFI.js","assets/createLucideIcon-DiFAvXmK.js","assets/book-open-B26jGBjY.js","assets/external-link-D5-p-Gmm.js","assets/plus-CM9XJ0Tf.js","assets/search-Ctaw34Kp.js","assets/x-CHOBE-63.js","assets/DocBrowserContext-CVJuwCcw.js","assets/ModelConfig-DmCY6jWM.js","assets/select-CT50pzod.js","assets/dist-pCfWPG1A.js","assets/loader-circle-B2J777gj.js","assets/page-layout--S0YBU0W.js","assets/label-RyXfZqkP.js","assets/skeleton-Bycyb0zU.js","assets/config-hints-fGnUjDe9.js","assets/provider-models-C8JQUd1E.js","assets/ChatPage-FdT3pDnw.js","assets/chunk-JZWAC4HX-B-4B29RN.js","assets/popover-BEjfbEwy.js","assets/dist-kW_O3kyZ.js","assets/MarketplacePage-CmhsZXr1.js","assets/useMutation-BzCrO8j-.js","assets/marketplace-localization-CXeGRf6E.js","assets/useConfirmDialog-BDpdjfIO.js","assets/tabs-custom-TZQ5WPWP.js","assets/react-BuSP2-8B.js","assets/chat-session-display-Bjmn4aIZ.js","assets/logos-Bpl8QTgI.js","assets/trash-2-B2_AGVE3.js","assets/config-BaC29Qf-.js","assets/LogoBadge-D8fyilO-.js","assets/SearchConfig-Dm7r2yfp.js","assets/config-layout-B-7erZRN.js","assets/ProvidersList-ClT-34aX.js","assets/status-dot-BbBqRHfh.js","assets/switch-D3l6AcCk.js","assets/ChannelsList-ByHWHkQS.js","assets/hash-BlwrSV0q.js","assets/RuntimeConfig-C5aqliGk.js","assets/save-DPPPpD_c.js","assets/security-config-6t78Ph-I.js","assets/SessionsConfig-6wNJloZN.js","assets/SecretsConfig-BBP_mbQh.js","assets/RemoteAccessPage-B6hUZl1O.js","assets/MarketplacePage-9oKmxN2n.js","assets/McpMarketplacePage-C7PkCYbp.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as e,a as t,c as n,h as r,l as i,m as a,o,p as s,r as c,s as l,t as u,u as d}from"./i18n-CSytxMFI.js";import{N as ee,c as f,i as te,l as ne,n as p,o as m,r as h,t as re,u as g}from"./dist-pCfWPG1A.js";import{a as _,i as v,l as y,n as ie,o as ae,r as b,t as oe}from"./chunk-JZWAC4HX-B-4B29RN.js";import{n as x,t as se}from"./react-BuSP2-8B.js";import{t as S}from"./useMutation-BzCrO8j-.js";import{A as ce,B as C,F as le,G as w,H as ue,I as T,L as de,M as fe,N as pe,P as me,U as he,W as E,i as ge,j as _e,n as ve,r as ye,t as be,z as xe}from"./select-CT50pzod.js";import{t as Se}from"./dist-kW_O3kyZ.js";import{t as D}from"./createLucideIcon-DiFAvXmK.js";import{n as Ce}from"./DocBrowser-3y_NHZ71.js";import{t as we}from"./book-open-B26jGBjY.js";import{t as Te}from"./search-Ctaw34Kp.js";import{t as Ee}from"./x-CHOBE-63.js";import{C as De,D as Oe,E as ke,O as Ae,S as je,T as Me,_ as Ne,a as Pe,b as Fe,c as Ie,f as Le,g as Re,h as ze,i as Be,l as Ve,m as He,n as Ue,o as We,p as Ge,r as Ke,s as qe,t as Je,u as Ye,v as Xe,w as Ze,x as Qe,y as $e}from"./config-BaC29Qf-.js";import{i as O,n as et,r as tt}from"./DocBrowserContext-CVJuwCcw.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 nt=r((e=>{var t=ee();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),k=e(a(),1),A=s(),j=`Dialog`,[rt,it]=he(j),[at,M]=rt(j),ot=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=k.useRef(null),c=k.useRef(null),[l,u]=xe({prop:r,defaultProp:i??!1,onChange:a,caller:j});return(0,A.jsx)(at,{scope:t,triggerRef:s,contentRef:c,contentId:C(),titleId:C(),descriptionId:C(),open:l,onOpenChange:u,onOpenToggle:k.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};ot.displayName=j;var st=`DialogTrigger`,ct=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=M(st,n),a=E(t,i.triggerRef);return(0,A.jsx)(T.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":L(i.open),...r,ref:a,onClick:w(e.onClick,i.onOpenToggle)})});ct.displayName=st;var N=`DialogPortal`,[lt,ut]=rt(N,{forceMount:void 0}),dt=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=M(N,t);return(0,A.jsx)(lt,{scope:t,forceMount:n,children:k.Children.map(r,e=>(0,A.jsx)(Se,{present:n||a.open,children:(0,A.jsx)(pe,{asChild:!0,container:i,children:e})}))})};dt.displayName=N;var P=`DialogOverlay`,ft=k.forwardRef((e,t)=>{let n=ut(P,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=M(P,e.__scopeDialog);return a.modal?(0,A.jsx)(Se,{present:r||a.open,children:(0,A.jsx)(mt,{...i,ref:t})}):null});ft.displayName=P;var pt=de(`DialogOverlay.RemoveScroll`),mt=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=M(P,n);return(0,A.jsx)(_e,{as:pt,allowPinchZoom:!0,shards:[i.contentRef],children:(0,A.jsx)(T.div,{"data-state":L(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),F=`DialogContent`,ht=k.forwardRef((e,t)=>{let n=ut(F,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=M(F,e.__scopeDialog);return(0,A.jsx)(Se,{present:r||a.open,children:a.modal?(0,A.jsx)(gt,{...i,ref:t}):(0,A.jsx)(_t,{...i,ref:t})})});ht.displayName=F;var gt=k.forwardRef((e,t)=>{let n=M(F,e.__scopeDialog),r=k.useRef(null),i=E(t,n.contentRef,r);return k.useEffect(()=>{let e=r.current;if(e)return ce(e)},[]),(0,A.jsx)(vt,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:w(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:w(e.onFocusOutside,e=>e.preventDefault())})}),_t=k.forwardRef((e,t)=>{let n=M(F,e.__scopeDialog),r=k.useRef(!1),i=k.useRef(!1);return(0,A.jsx)(vt,{...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()}})}),vt=k.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=M(F,n),c=k.useRef(null),l=E(t,c);return fe(),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(me,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(le,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":L(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Dt,{titleId:s.titleId}),(0,A.jsx)(kt,{contentRef:c,descriptionId:s.descriptionId})]})]})}),I=`DialogTitle`,yt=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=M(I,n);return(0,A.jsx)(T.h2,{id:i.titleId,...r,ref:t})});yt.displayName=I;var bt=`DialogDescription`,xt=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=M(bt,n);return(0,A.jsx)(T.p,{id:i.descriptionId,...r,ref:t})});xt.displayName=bt;var St=`DialogClose`,Ct=k.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=M(St,n);return(0,A.jsx)(T.button,{type:`button`,...r,ref:t,onClick:w(e.onClick,()=>i.onOpenChange(!1))})});Ct.displayName=St;function L(e){return e?`open`:`closed`}var wt=`DialogTitleWarning`,[Tt,Et]=ue(wt,{contentName:F,titleName:I,docsSlug:`dialog`}),Dt=({titleId:e})=>{let t=Et(wt),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 k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ot=`DialogDescriptionWarning`,kt=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Et(Ot).contentName}}.`;return k.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},At=ot,jt=dt,Mt=ft,Nt=ht,Pt=yt,Ft=xt,It=Ct,Lt=D(`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`}]]),Rt=D(`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=D(`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=D(`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`}]]),Vt=D(`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=D(`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`}]]),Ht=D(`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`}]]),Ut=D(`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`}]]),Wt=D(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),Gt=D(`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`}]]),Kt=D(`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`}]]),qt=D(`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`}]]),Jt=D(`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`}]]),Yt=D(`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`}]]),Xt=D(`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`}]]),Zt=D(`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`}]]),Qt=D(`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`}]]),$t=D(`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`}]]),en=At,tn=jt,nn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Mt,{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}));nn.displayName=Mt.displayName;var rn=k.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(tn,{children:[(0,A.jsx)(nn,{}),(0,A.jsxs)(Nt,{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,A.jsxs)(It,{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,A.jsx)(Ee,{className:`h-4 w-4 text-gray-500`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));rn.displayName=Nt.displayName;var an=({className:e,...t})=>(0,A.jsx)(`div`,{className:d(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});an.displayName=`DialogHeader`;var on=({className:e,...t})=>(0,A.jsx)(`div`,{className:d(`flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3`,e),...t});on.displayName=`DialogFooter`;var sn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Pt,{ref:n,className:d(`text-lg font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));sn.displayName=Pt.displayName;var cn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Ft,{ref:n,className:d(`text-sm text-gray-500 leading-relaxed`,e),...t}));cn.displayName=Ft.displayName;async function ln(){let e=await h.get(`/api/remote/status`);if(!e.ok)throw Error(e.error.message);return e.data}async function un(){let e=await h.get(`/api/remote/doctor`);if(!e.ok)throw Error(e.error.message);return e.data}async function dn(e){let t=await h.post(`/api/remote/auth/start`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function fn(e){let t=await h.post(`/api/remote/auth/poll`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function pn(){let e=await h.post(`/api/remote/logout`,{});if(!e.ok)throw Error(e.error.message);return e.data}async function mn(e){let t=await h.put(`/api/remote/settings`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function z(e){let t=await h.post(`/api/remote/service/${e}`,{});if(!t.ok)throw Error(t.error.message);return t.data}var hn=[`remote-status`],gn=`https://platform.nextclaw.io`,_n=`https://nextclaw-platform-console.pages.dev`,B=async()=>await x.fetchQuery({queryKey:hn,queryFn:ln,staleTime:5e3}),V=async()=>(await x.invalidateQueries({queryKey:hn}),await B()),vn=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function H(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 gn;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return _n}var yn=e=>H(e?.account.apiBase)||H(e?.settings.platformApiBase)||H(e?.platformBase)||H(e?.account.platformBase)||void 0;function U(){return f({queryKey:hn,queryFn:ln,staleTime:5e3,refetchOnWindowFocus:!0})}var W=se(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})})),bn=class{constructor(){this.authPollTimerId=null,this.afterSignedIn=null,this.bindSignedInContinuation=e=>{this.afterSignedIn=e},this.openAccountPanel=()=>{W.getState().openPanel()},this.closeAccountPanel=()=>{W.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),W.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=await B();return t.account.loggedIn?!0:(e?.pendingAction&&W.getState().setPendingAction(e.pendingAction),this.openAccountPanel(),await this.startBrowserSignIn({apiBase:e?.apiBase,status:t}),!1)},this.startBrowserSignIn=async e=>{try{let t=e?.status??await B();e?.pendingAction&&W.getState().setPendingAction(e.pendingAction);let n=await dn({apiBase:vn(t,e?.apiBase)});W.getState().beginBrowserAuth({sessionId:n.sessionId,verificationUri:n.verificationUri,expiresAt:n.expiresAt,intervalMs:n.intervalMs,statusMessage:i(`remoteBrowserAuthWaiting`)}),window.open(n.verificationUri,`_blank`,`noopener,noreferrer`)||W.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=W.getState().authVerificationUri;e&&window.open(e,`_blank`,`noopener,noreferrer`)},this.logout=async()=>{try{await pn(),W.getState().clearPendingAction(),W.getState().clearBrowserAuth(),await V(),p.success(i(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:i(`remoteLogoutFailed`);p.error(`${i(`remoteLogoutFailed`)}: ${t}`)}},this.openNextClawWeb=async()=>{let e=yn(await B());if(!e){p.error(i(`remoteOpenWebUnavailable`));return}window.open(e,`_blank`,`noopener,noreferrer`)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=W.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=W.getState();if(e.authSessionId)try{let t=await B(),n=await fn({sessionId:e.authSessionId,apiBase:vn(t)});if(n.status===`pending`){W.getState().updateBrowserAuth({statusMessage:i(`remoteBrowserAuthWaiting`),intervalMs:n.nextPollMs??1500}),this.scheduleBrowserAuthPoll();return}if(n.status===`expired`){this.clearPollTimer(),W.getState().clearBrowserAuth(),p.error(n.message||i(`remoteBrowserAuthExpired`));return}W.getState().setAuthStatusMessage(i(`remoteBrowserAuthCompleted`));let r=await V(),{pendingAction:a}=W.getState();this.clearPollTimer(),W.getState().clearBrowserAuth(),p.success(i(`remoteLoginSuccess`)),a&&this.afterSignedIn&&await this.afterSignedIn(a,r),W.getState().clearPendingAction()}catch(e){this.clearPollTimer(),W.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=W.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?c(e.authExpiresAt):`-`}}}},G=se(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})})),xn=class{constructor(){this.accountManager=null,this.bindAccountManager=e=>{this.accountManager=e},this.syncStatus=e=>{if(!e)return;let t=G.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{G.getState().setEnabled(e)},this.setDeviceName=e=>{G.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{G.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{G.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await V(),n=G.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 V();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await V();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 z(n);let e=await V();this.hydrateDraftFromStatus(e)},successMessage:i(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await V();await this.accountManager?.startBrowserSignIn({status:t,apiBase:G.getState().platformApiBase,pendingAction:{type:`repair-remote`}})},this.saveAdvancedSettings=async e=>{let t=e??await V(),n=G.getState();await this.runManagedAction({actionLabel:i(`remoteActionSavingAdvanced`),job:async()=>{await mn({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await V();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 un();G.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=G.getState();await this.runManagedAction({actionLabel:i(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await mn({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await V();this.hydrateDraftFromStatus(r),e?await z(r.service.running?`restart`:`start`):t.service.running&&await z(`restart`);let i=await V();this.hydrateDraftFromStatus(i)},successMessage:i(e?`remoteEnabledReady`:`remoteDisabledDone`)})},this.runServiceAction=async(e,t)=>{await this.runManagedAction({actionLabel:t,job:async()=>{let t=await z(e),n=await V();this.hydrateDraftFromStatus(n),p.success(t.message)}})},this.hydrateDraftFromStatus=e=>{G.getState().hydrateDraft({enabled:e.settings.enabled,deviceName:e.settings.deviceName,platformApiBase:e.settings.platformApiBase})},this.runManagedAction=async e=>{G.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{G.getState().finishAction()}}}},K=new class{constructor(){this.accountManager=new bn,this.remoteAccessManager=new xn}};K.accountManager.bindSignedInContinuation(K.remoteAccessManager.resumePendingActionAfterSignIn),K.remoteAccessManager.bindAccountManager(K.accountManager);var Sn=(0,k.createContext)(null);function Cn({children:e}){return(0,A.jsx)(Sn.Provider,{value:K,children:e})}function q(){let e=(0,k.useContext)(Sn);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}function J(e){return(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,A.jsx)(`span`,{className:`text-gray-500`,children:e.label}),(0,A.jsx)(`span`,{className:`text-right text-gray-900`,children:e.value?.trim()||`-`})]})}function wn(){let e=q(),t=U(),n=W(e=>e.panelOpen),r=W(e=>e.authSessionId),a=W(e=>e.authVerificationUri),o=W(e=>e.authExpiresAt),s=W(e=>e.authStatusMessage),l=t.data;return(0,k.useEffect)(()=>{e.accountManager.syncRemoteStatus(l)},[e,l]),(0,A.jsx)(en,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,A.jsxs)(rn,{className:`max-w-xl`,children:[(0,A.jsxs)(an,{children:[(0,A.jsxs)(sn,{className:`flex items-center gap-2`,children:[(0,A.jsx)(R,{className:`h-5 w-5 text-primary`}),i(`accountPanelTitle`)]}),(0,A.jsx)(cn,{children:i(`accountPanelDescription`)})]}),l?.account.loggedIn?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium text-emerald-800`,children:i(`accountPanelSignedInTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:i(`accountPanelSignedInDescription`)})]}),(0,A.jsxs)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3`,children:[(0,A.jsx)(J,{label:i(`remoteAccountEmail`),value:l.account.email}),(0,A.jsx)(J,{label:i(`remoteAccountRole`),value:l.account.role})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,A.jsxs)(m,{onClick:()=>void e.accountManager.openNextClawWeb(),children:[(0,A.jsx)(Zt,{className:`mr-2 h-4 w-4`}),i(`remoteOpenDeviceList`)]}),(0,A.jsxs)(m,{variant:`outline`,onClick:()=>void e.accountManager.logout(),children:[(0,A.jsx)(Ut,{className:`mr-2 h-4 w-4`}),i(`remoteLogout`)]})]})]}):(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:i(`accountPanelSignedOutTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:i(`accountPanelSignedOutDescription`)}),r?(0,A.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,A.jsx)(J,{label:i(`remoteBrowserAuthSession`),value:r}),(0,A.jsx)(J,{label:i(`remoteBrowserAuthExpiresAt`),value:o?c(o):`-`})]}):null]}),s?(0,A.jsx)(`p`,{className:`text-sm text-gray-600`,children:s}):null,(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,A.jsx)(m,{onClick:()=>void e.accountManager.startBrowserSignIn(),children:i(r?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),a?(0,A.jsx)(m,{variant:`outline`,onClick:()=>e.accountManager.resumeBrowserSignIn(),children:i(`remoteBrowserAuthResume`)}):null]})]})]})})}var Tn=k.forwardRef(({className:e,hover:t=!0,...n},r)=>(0,A.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}));Tn.displayName=`Card`;var En=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:d(`flex flex-col space-y-1.5 p-6`,e),...t}));En.displayName=`CardHeader`;var Dn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`h3`,{ref:n,className:d(`text-[15px] font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));Dn.displayName=`CardTitle`;var On=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`p`,{ref:n,className:d(`text-[13px] text-gray-400 leading-relaxed`,e),...t}));On.displayName=`CardDescription`;var kn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:d(`p-6 pt-0`,e),...t}));kn.displayName=`CardContent`;var An=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:d(`flex items-center justify-between p-6 pt-0`,e),...t}));An.displayName=`CardFooter`;var Y=k.forwardRef(({className:e,type:t,...n},r)=>(0,A.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}));Y.displayName=`Input`;var jn=40,Mn=400;function Nn(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 Pn(e,t){return e>=jn?!1:Nn(t)}function Fn(){let[e,t]=(0,k.useState)(!1),n=f({queryKey:[`auth-status`],queryFn:()=>We({timeoutMs:e?5e3:Mn}),staleTime:5e3,retry:Pn,retryDelay:250,refetchOnWindowFocus:!0});return(0,k.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 In(){let e=g();return S({mutationFn:Xe,onSuccess:async()=>{await X(e),p.success(i(`authSetupSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Ln(){let e=g();return S({mutationFn:Ge,onSuccess:async()=>{await X(e),p.success(i(`authLoginSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Rn(){let e=g();return S({mutationFn:He,onSuccess:async()=>{await X(e),p.success(i(`authLogoutSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function zn(){let e=g();return S({mutationFn:je,onSuccess:async()=>{await X(e),p.success(i(`authPasswordUpdated`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Bn(){let e=g();return S({mutationFn:Qe,onSuccess:async(t,n)=>{await X(e),p.success(n.enabled?i(`authEnabledSuccess`):i(`authDisabledSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Vn({username:e}){let t=Ln(),[n,r]=(0,k.useState)(e??``),[a,o]=(0,k.useState)(``),s=n.trim().length>0&&a.length>0&&!t.isPending;return(0,A.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,A.jsxs)(Tn,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,A.jsxs)(En,{children:[(0,A.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:i(`authBrand`)}),(0,A.jsx)(Dn,{className:`text-2xl`,children:i(`authLoginTitle`)}),(0,A.jsx)(On,{children:i(`authLoginDescription`)})]}),(0,A.jsx)(kn,{children:(0,A.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),s&&t.mutate({username:n.trim(),password:a})},children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:i(`authUsername`)}),(0,A.jsx)(Y,{value:n,onChange:e=>r(e.target.value),placeholder:i(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:i(`authPassword`)}),(0,A.jsx)(Y,{type:`password`,value:a,onChange:e=>o(e.target.value),placeholder:i(`authPasswordPlaceholder`)})]}),(0,A.jsx)(m,{type:`submit`,className:`w-full`,disabled:!s,children:t.isPending?i(`authLoggingIn`):i(`authLoginAction`)})]})})]})})}var Hn=`nextclaw.ui.theme`,Un=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],Z=`warm`,Wn=!1,Gn=new Set;function Kn(e){return e===`warm`||e===`cool`}function qn(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function Jn(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(Hn);if(Kn(e))return e}catch{}return`warm`}function Yn(){return Wn||=(Z=Jn(),qn(Z),!0),Z}function Xn(){return Wn?Z:Yn()}function Zn(e){if(Yn(),e!==Z){if(Z=e,qn(Z),typeof window<`u`)try{window.localStorage.setItem(Hn,Z)}catch{}Gn.forEach(e=>e(Z))}}function Qn(e){return Gn.add(e),()=>{Gn.delete(e)}}function $n(){let e=O();(0,k.useEffect)(()=>{let t=t=>{let n=t.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`)||``;tt(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 er(e){return[...e].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}function tr(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 nr(e,t){if(!e)return e;let n=e.sessions.findIndex(e=>e.sessionId===t.sessionId),r=er(n>=0?e.sessions.map((e,r)=>r===n&&tr(e,t)?t:e):[...e.sessions,t]);return{...e,sessions:r,total:r.length}}function rr(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 ir(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>nr(e,t))}function ar(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 or(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>ar(e,t))}function sr(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>rr(e,t))}function cr(e,t){if(t.type===`session.run-status`){or(e,t.payload);return}if(t.type===`session.summary.upsert`){ir(e,t.payload.summary);return}sr(e,t.payload.sessionKey)}async function lr(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 h.get(n?`/api/ncp/sessions?${n}`:`/api/ncp/sessions`);if(!r.ok)throw Error(r.error.message);return r.data}async function ur(e,t=200){let n=await h.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 dr(e,t){let n=await h.put(`/api/ncp/sessions/${encodeURIComponent(e)}`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function fr(e){let t=await h.delete(`/api/ncp/sessions/${encodeURIComponent(e)}`);if(!t.ok)throw Error(t.error.message);return t.data}function pr(){return f({queryKey:[`config`],queryFn:qe,staleTime:3e4,refetchOnWindowFocus:!0})}function mr(){return f({queryKey:[`app-meta`],queryFn:Pe,staleTime:1/0})}function hr(){return f({queryKey:[`config-meta`],queryFn:Ie,staleTime:1/0})}function gr(){return f({queryKey:[`config-schema`],queryFn:Ve,staleTime:1/0})}function _r(){let e=g();return S({mutationFn:Ze,onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function vr(){let e=g();return S({mutationFn:({data:e})=>Oe(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function yr(){let e=g();return S({mutationFn:({provider:e,data:t})=>Me(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 br(){let e=g();return S({mutationFn:({data:e})=>Je(e??{}),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function xr(){let e=g();return S({mutationFn:({provider: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 Sr(){return S({mutationFn:({provider:e,data:t})=>Fe(e,t)})}function Cr(){return S({mutationFn:({provider:e,data:t})=>$e(e,t)})}function wr(){return S({mutationFn:({provider:e,data:t})=>ze(e,t)})}function Tr(){return S({mutationFn:({provider:e})=>Le(e)})}function Er(){let e=g();return S({mutationFn:({channel:e,data:t})=>De(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Dr(){let e=g();return S({mutationFn:({data:e})=>ke(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Or(){let e=g();return S({mutationFn:({data:e})=>Ae(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function kr(){return S({mutationFn:({actionId:e,data:t})=>Be(e,t),onError:e=>{p.error(i(`error`)+`: `+e.message)}})}function Ar(e){return f({queryKey:[`ncp-sessions`,e?.limit??null],queryFn:()=>lr(e),staleTime:5e3,retry:!1})}function jr(e,t=200){return f({queryKey:[`ncp-session-messages`,e,t],queryFn:()=>ur(e,t),enabled:!!e,staleTime:5e3,retry:!1})}function Mr(){let e=g();return S({mutationFn:({sessionId:e})=>fr(e),onSuccess:(t,n)=>{sr(e,n.sessionId),e.removeQueries({queryKey:[`ncp-session-messages`,n.sessionId]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Nr(){let e=g();return S({mutationFn:({sessionId:e,data:t})=>dr(e,t),onSuccess:t=>{ir(e,t),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Pr(e={all:!0}){return f({queryKey:[`cron`,e],queryFn:()=>Ye(e),staleTime:1e4})}function Fr(){let e=g();return S({mutationFn:({id:e})=>Ue(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Ir(){let e=g();return S({mutationFn:({id:e,enabled:t})=>Ne(e,{enabled:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Lr(){let e=g();return S({mutationFn:({id:e,force:t})=>Re(e,{force:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Rr({className:e,suffix:t}){let{data:n}=mr(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim();return(0,A.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,A.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,A.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,A.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,A.jsx)(`span`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),i?(0,A.jsxs)(`span`,{className:`text-[13px] font-medium text-gray-500`,children:[`v`,i]}):null,t?(0,A.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:t}):null]})]})}var zr={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 Q(e){return zr[e]}function Br({to:e,label:t,icon:n,density:r=`default`,className:i}){let a=Q(r);return(0,A.jsx)(ie,{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,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(n,{className:d(a.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function Vr({label:e,icon:t,onClick:n,density:r=`default`,className:i,labelClassName:a,trailing:o,trailingClassName:s,testId:c,trailingTestId:l}){let u=Q(r);return(0,A.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,A.jsx)(t,{className:d(u.icon,`shrink-0 text-gray-400`)}),(0,A.jsx)(`span`,{className:d(`min-w-0 flex-1 text-left`,a),children:e}),o?(0,A.jsx)(`span`,{className:d(`shrink-0 text-gray-500`,u.value,s),"data-testid":l,children:o}):null]})}function Hr({label:e,icon:t,value:n,valueLabel:r,onValueChange:i,density:a=`default`,children:o}){let s=Q(a);return(0,A.jsxs)(be,{value:n,onValueChange:i,children:[(0,A.jsxs)(ge,{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,A.jsxs)(`div`,{className:d(`flex min-w-0 items-center`,s.gap),children:[(0,A.jsx)(t,{className:d(s.icon,`text-gray-400`)}),(0,A.jsx)(`span`,{className:`text-left`,children:e})]}),(0,A.jsx)(`span`,{className:d(`ml-auto text-gray-500`,s.value),children:r})]}),(0,A.jsx)(ve,{children:o})]})}var Ur=(0,k.createContext)(null);function Wr({children:e}){let[r,i]=(0,k.useState)(()=>o());(0,k.useEffect)(()=>n(e=>{i(e)}),[]);let a=(0,k.useCallback)(e=>{l(e),i(t())},[]),s=(0,k.useCallback)(()=>{a(r===`en`?`zh`:`en`)},[r,a]),c=(0,k.useMemo)(()=>({language:r,setLanguage:a,toggleLanguage:s}),[r,a,s]);return(0,A.jsx)(Ur.Provider,{value:c,children:e})}function Gr(){let e=(0,k.useContext)(Ur);if(!e)throw Error(`useI18n must be used within I18nProvider`);return{...e,t:i}}var Kr=(0,k.createContext)(null);function qr({children:e}){let[t,n]=(0,k.useState)(()=>Yn());(0,k.useEffect)(()=>Qn(e=>{n(e)}),[]);let r=(0,k.useCallback)(e=>{Zn(e),n(Xn())},[]),i=(0,k.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,A.jsx)(Kr.Provider,{value:i,children:e})}function Jr(){let e=(0,k.useContext)(Kr);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function Yr({mode:e}){let t=q(),n=O(),r=U(),{language:a,setLanguage:o}=Gr(),{theme:s,setTheme:c}=Jr(),l=e===`settings`,ee=u.find(e=>e.value===a)?.label??a,f=i(Un.find(e=>e.value===s)?.labelKey??`themeWarm`),te=r.data?.account.email?.trim(),ne=!!r.data?.account.loggedIn,p=e=>{a!==e&&(o(e),window.location.reload())},m=e=>{s!==e&&c(e)},h=[{target:`/chat`,label:i(`chat`),icon:Wt},{target:`/chat/cron`,label:i(`cron`),icon:Lt},{target:`/chat/skills`,label:i(`marketplaceFilterSkills`),icon:Rt}],re=[{target:`/model`,label:i(`model`),icon:zt},{target:`/providers`,label:i(`providers`),icon:Xt},{target:`/search`,label:i(`searchChannels`),icon:Te},{target:`/channels`,label:i(`channels`),icon:Gt},{target:`/runtime`,label:i(`runtime`),icon:Bt},{target:`/remote`,label:i(`remote`),icon:Qt},{target:`/security`,label:i(`security`),icon:Yt},{target:`/sessions`,label:i(`sessions`),icon:Vt},{target:`/secrets`,label:i(`secrets`),icon:R},{target:`/marketplace/plugins`,label:i(`marketplaceFilterPlugins`),icon:qt},{target:`/marketplace/mcp`,label:i(`marketplaceFilterMcp`),icon:$t}],g=l?re:h,_=l?`compact`:`default`;return(0,A.jsxs)(`aside`,{className:`w-[240px] shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary px-4 py-6`,children:[l?(0,A.jsx)(`div`,{className:`shrink-0 px-2 pb-3`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-1`,"data-testid":`settings-sidebar-header`,children:[(0,A.jsxs)(ie,{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,A.jsx)(Ce,{className:`h-3.5 w-3.5 shrink-0 text-gray-400 group-hover:text-gray-700`}),(0,A.jsx)(`span`,{className:`truncate`,children:i(`backToMain`)})]}),(0,A.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-[#dddfe6]`,"aria-hidden":`true`}),(0,A.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:i(`settings`)})]})}):(0,A.jsx)(`div`,{className:`shrink-0 px-2 pb-8`,children:(0,A.jsx)(Rr,{className:`flex items-center gap-2.5 cursor-pointer`})}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsx)(`nav`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto pr-1`,children:(0,A.jsx)(`ul`,{className:d(l?`space-y-0.5 pb-3`:`space-y-1 pb-4`),children:g.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(Br,{to:e.target,label:e.label,icon:e.icon,density:_})},e.target))})}),(0,A.jsxs)(`div`,{className:d(`shrink-0 border-t border-[#dde0ea] bg-secondary`,l?`mt-2 pt-3`:`mt-3 pt-3`),children:[l?(0,A.jsx)(Vr,{onClick:()=>t.accountManager.openAccountPanel(),icon:R,label:i(`remoteAccountEntryManage`),density:`compact`,className:`mb-1.5`,trailing:ne?te||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,A.jsx)(`div`,{className:`mb-2`,children:(0,A.jsx)(Br,{to:`/settings`,label:i(`settings`),icon:Jt})}),(0,A.jsx)(`div`,{className:`mb-2`,children:(0,A.jsx)(Hr,{value:s,onValueChange:e=>m(e),icon:Kt,label:i(`theme`),valueLabel:f,density:_,children:Un.map(e=>(0,A.jsx)(ye,{value:e.value,className:`text-xs`,children:i(e.labelKey)},e.value))})}),(0,A.jsx)(`div`,{className:`mb-2`,children:(0,A.jsx)(Hr,{value:a,onValueChange:e=>p(e),icon:Ht,label:i(`language`),valueLabel:ee,density:_,children:u.map(e=>(0,A.jsx)(ye,{value:e.value,className:`text-xs`,children:e.label},e.value))})}),(0,A.jsx)(Vr,{onClick:()=>n.open(void 0,{kind:`docs`,newTab:!0,title:`Docs`}),icon:we,label:i(`docBrowserHelp`),density:_})]})]})]})}var Xr=`NextClaw`,Zr=[{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:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/sessions`,key:`sessionsPageTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function Qr(e,t){return e===t||e.startsWith(`${t}/`)}function $r(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of Zr)if(Qr(t,e))return i(n);return i(`settings`)}function ei(e){return`${Xr} - ${$r(e)}`}var ti=(0,k.lazy)(async()=>({default:(await y(async()=>{let{DocBrowser:e}=await import(`./DocBrowser-CIHLqoIm.js`);return{DocBrowser:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).DocBrowser}));function ni(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)}function ri(e){let t=e.toLowerCase();return t===`/channels`||t.startsWith(`/channels/`)}function ii({children:e}){let{isOpen:t,mode:n}=O();$n();let{pathname:r}=ae(),{language:i}=Gr(),a=ni(r),o=ri(r);return(0,k.useEffect)(()=>{document.title=ei(r)},[r,i]),(0,A.jsxs)(`div`,{className:`h-screen flex bg-background font-sans text-foreground`,children:[!a&&(0,A.jsx)(Yr,{mode:`settings`}),(0,A.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,A.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:a?(0,A.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:e}):(0,A.jsx)(`main`,{className:d(`flex-1 custom-scrollbar p-8`,o?`overflow-auto xl:overflow-hidden`:`overflow-auto`),children:(0,A.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,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(ti,{})})]}),t&&n===`floating`&&(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(ti,{})})]})}function ai({children:e}){return(0,A.jsx)(et,{children:(0,A.jsx)(ii,{children:e})})}var oi=se(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 si(e){let t=e.trim().toLowerCase();return t?!(t.startsWith(`plugins`)||t.startsWith(`skills`)):!0}function ci(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 li(e,t){e&&si(t)&&e.invalidateQueries({queryKey:[`config`]}),ci(e,t)}function ui(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`){li(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`){cr(e,r);return}r.type===`error`&&console.error(`Realtime transport error:`,r.payload.message)}function di(e){let{setConnectionStatus:t}=oi(),n=(0,k.useRef)(!1);(0,k.useEffect)(()=>(t(`connecting`),te.subscribe(r=>ui(e,t,n,r))),[e,t])}var fi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{ModelConfig:e}=await import(`./ModelConfig-Dg6F3Ldb.js`);return{ModelConfig:e}},__vite__mapDeps([10,2,11,12,3,4,13,9,14,15,16,17,18]))).ModelConfig})),pi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{ChatPage:e}=await import(`./ChatPage-l2PYwCeB.js`);return{ChatPage:e}},__vite__mapDeps([19,2,20,11,12,3,21,22,23,24,9,14,25,26,16,27,28,4,29,13,5,30,6,7,31,8,32,33,18]))).ChatPage})),mi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{SearchConfig:e}=await import(`./SearchConfig-v46R5a2U.js`);return{SearchConfig:e}},__vite__mapDeps([34,2,11,12,3,5,7,35,14,15]))).SearchConfig})),hi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{ProvidersList:e}=await import(`./ProvidersList-f7bQdRxA.js`);return{ProvidersList:e}},__vite__mapDeps([36,2,11,12,3,21,22,6,7,31,8,33,35,14,15,37,38,27,17]))).ProvidersList})),gi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{ChannelsList:e}=await import(`./ChannelsList-DAx7wv0_.js`);return{ChannelsList:e}},__vite__mapDeps([39,2,11,12,3,24,4,5,30,40,13,7,8,33,35,14,15,37,38,27,17]))).ChannelsList})),_i=(0,k.lazy)(async()=>({default:(await y(async()=>{let{RuntimeConfig:e}=await import(`./RuntimeConfig-M4OKjmgU.js`);return{RuntimeConfig:e}},__vite__mapDeps([41,2,11,12,3,6,42,31,14,38,17]))).RuntimeConfig})),vi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{SecurityConfig:e}=await import(`./security-config-Xi5DYW7j.js`);return{SecurityConfig:e}},__vite__mapDeps([43,2,12,14,15,38]))).SecurityConfig})),yi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{SessionsConfig:e}=await import(`./SessionsConfig-7vUHMtOh.js`);return{SessionsConfig:e}},__vite__mapDeps([44,2,11,12,3,29,13,40,7,14,26]))).SessionsConfig})),bi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{SecretsConfig:e}=await import(`./SecretsConfig-CXvUpbB_.js`);return{SecretsConfig:e}},__vite__mapDeps([45,2,11,12,3,6,42,31,14,15,38]))).SecretsConfig})),xi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{RemoteAccessPage:e}=await import(`./RemoteAccessPage-w_dY7P4T.js`);return{RemoteAccessPage:e}},__vite__mapDeps([46,2,12,3,14,37]))).RemoteAccessPage})),Si=(0,k.lazy)(async()=>({default:(await y(async()=>{let{MarketplacePage:e}=await import(`./MarketplacePage-TVeyVOuO.js`);return{MarketplacePage:e}},__vite__mapDeps([47,23,2,20,11,12,3,22,24,9,14,25,26,16,27]))).MarketplacePage})),Ci=(0,k.lazy)(async()=>({default:(await y(async()=>{let{McpMarketplacePage:e}=await import(`./McpMarketplacePage-CwKtAil8.js`);return{McpMarketplacePage:e}},__vite__mapDeps([48,2,11,12,3,24,9,14,25,26,16,38,27]))).McpMarketplacePage}));function wi(){return(0,A.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function $({children:e}){return(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(wi,{}),children:e})}function Ti(){return di(x),(0,A.jsxs)(Cn,{children:[(0,A.jsx)(ai,{children:(0,A.jsx)(`div`,{className:`w-full h-full`,children:(0,A.jsxs)(_,{children:[(0,A.jsx)(v,{path:`/chat/skills`,element:(0,A.jsx)(b,{to:`/skills`,replace:!0})}),(0,A.jsx)(v,{path:`/chat/cron`,element:(0,A.jsx)(b,{to:`/cron`,replace:!0})}),(0,A.jsx)(v,{path:`/chat/:sessionId?`,element:(0,A.jsx)($,{children:(0,A.jsx)(pi,{view:`chat`})})}),(0,A.jsx)(v,{path:`/skills`,element:(0,A.jsx)($,{children:(0,A.jsx)(pi,{view:`skills`})})}),(0,A.jsx)(v,{path:`/cron`,element:(0,A.jsx)($,{children:(0,A.jsx)(pi,{view:`cron`})})}),(0,A.jsx)(v,{path:`/model`,element:(0,A.jsx)($,{children:(0,A.jsx)(fi,{})})}),(0,A.jsx)(v,{path:`/search`,element:(0,A.jsx)($,{children:(0,A.jsx)(mi,{})})}),(0,A.jsx)(v,{path:`/providers`,element:(0,A.jsx)($,{children:(0,A.jsx)(hi,{})})}),(0,A.jsx)(v,{path:`/channels`,element:(0,A.jsx)($,{children:(0,A.jsx)(gi,{})})}),(0,A.jsx)(v,{path:`/runtime`,element:(0,A.jsx)($,{children:(0,A.jsx)(_i,{})})}),(0,A.jsx)(v,{path:`/remote`,element:(0,A.jsx)($,{children:(0,A.jsx)(xi,{})})}),(0,A.jsx)(v,{path:`/security`,element:(0,A.jsx)($,{children:(0,A.jsx)(vi,{})})}),(0,A.jsx)(v,{path:`/sessions`,element:(0,A.jsx)($,{children:(0,A.jsx)(yi,{})})}),(0,A.jsx)(v,{path:`/secrets`,element:(0,A.jsx)($,{children:(0,A.jsx)(bi,{})})}),(0,A.jsx)(v,{path:`/settings`,element:(0,A.jsx)(b,{to:`/model`,replace:!0})}),(0,A.jsx)(v,{path:`/marketplace/skills`,element:(0,A.jsx)(b,{to:`/skills`,replace:!0})}),(0,A.jsx)(v,{path:`/marketplace`,element:(0,A.jsx)(b,{to:`/marketplace/plugins`,replace:!0})}),(0,A.jsx)(v,{path:`/marketplace/mcp`,element:(0,A.jsx)($,{children:(0,A.jsx)(Ci,{})})}),(0,A.jsx)(v,{path:`/marketplace/:type`,element:(0,A.jsx)($,{children:(0,A.jsx)(Si,{})})}),(0,A.jsx)(v,{path:`/`,element:(0,A.jsx)(b,{to:`/chat`,replace:!0})}),(0,A.jsx)(v,{path:`*`,element:(0,A.jsx)(b,{to:`/chat`,replace:!0})})]})})}),(0,A.jsx)(wn,{})]})}function Ei(){let e=Fn(),t=e.isError&&Nn(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,A.jsx)(Ti,{}):e.data?.enabled&&!e.data.authenticated?(0,A.jsx)(Vn,{username:e.data.username}):(0,A.jsx)(Ti,{})}function Di(){return(0,A.jsxs)(ne,{client:x,children:[(0,A.jsx)(Ei,{}),(0,A.jsx)(re,{position:`top-right`,richColors:!0})]})}(0,nt.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(k.StrictMode,{children:(0,A.jsx)(qr,{children:(0,A.jsx)(Wr,{children:(0,A.jsx)(oe,{children:(0,A.jsx)(Di,{})})})})}));export{en as $,vr as A,In as B,Sr as C,Nr as D,_r as E,sr as F,kn as G,zn as H,ir as I,Dn as J,On as K,Un as L,fr as M,ur as N,yr as O,dr as P,yn as Q,Fn as R,Cr as S,Er as T,Y as U,Bn as V,Tn as W,G as X,q as Y,U as Z,Tr as _,Br as a,$t as at,wr as b,pr as c,Jt as ct,br as d,Wt as dt,rn as et,Pr as f,Ht as ft,kr as g,xr as h,Lt as ht,Vr as i,sn as it,Or as j,Dr as k,hr as l,Kt as lt,Mr as m,Rt as mt,Jr as n,on as nt,Hr as o,Zt as ot,Fr as p,R as pt,En as q,Gr as r,an as rt,Rr as s,Xt as st,oi as t,cn as tt,gr as u,Gt as ut,jr as v,Ir as w,Lr as x,Ar as y,Rn as z};
|
|
6
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return k.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ot=`DialogDescriptionWarning`,kt=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Et(Ot).contentName}}.`;return k.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},At=ot,jt=dt,Mt=ft,Nt=ht,Pt=yt,Ft=xt,It=Ct,Lt=D(`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`}]]),Rt=D(`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=D(`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=D(`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`}]]),Vt=D(`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=D(`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`}]]),Ht=D(`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`}]]),Ut=D(`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`}]]),Wt=D(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),Gt=D(`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`}]]),Kt=D(`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`}]]),qt=D(`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`}]]),Jt=D(`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`}]]),Yt=D(`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`}]]),Xt=D(`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`}]]),Zt=D(`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`}]]),Qt=D(`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`}]]),$t=D(`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`}]]),en=At,tn=jt,nn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Mt,{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}));nn.displayName=Mt.displayName;var rn=k.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(tn,{children:[(0,A.jsx)(nn,{}),(0,A.jsxs)(Nt,{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,A.jsxs)(It,{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,A.jsx)(Ee,{className:`h-4 w-4 text-gray-500`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));rn.displayName=Nt.displayName;var an=({className:e,...t})=>(0,A.jsx)(`div`,{className:d(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});an.displayName=`DialogHeader`;var on=({className:e,...t})=>(0,A.jsx)(`div`,{className:d(`flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-3`,e),...t});on.displayName=`DialogFooter`;var sn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Pt,{ref:n,className:d(`text-lg font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));sn.displayName=Pt.displayName;var cn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Ft,{ref:n,className:d(`text-sm text-gray-500 leading-relaxed`,e),...t}));cn.displayName=Ft.displayName;async function ln(){let e=await h.get(`/api/remote/status`);if(!e.ok)throw Error(e.error.message);return e.data}async function un(){let e=await h.get(`/api/remote/doctor`);if(!e.ok)throw Error(e.error.message);return e.data}async function dn(e){let t=await h.post(`/api/remote/auth/start`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function fn(e){let t=await h.post(`/api/remote/auth/poll`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function pn(){let e=await h.post(`/api/remote/logout`,{});if(!e.ok)throw Error(e.error.message);return e.data}async function mn(e){let t=await h.put(`/api/remote/settings`,e);if(!t.ok)throw Error(t.error.message);return t.data}async function z(e){let t=await h.post(`/api/remote/service/${e}`,{});if(!t.ok)throw Error(t.error.message);return t.data}var hn=[`remote-status`],gn=`https://platform.nextclaw.io`,_n=`https://nextclaw-platform-console.pages.dev`,B=async()=>await x.fetchQuery({queryKey:hn,queryFn:ln,staleTime:5e3}),V=async()=>(await x.invalidateQueries({queryKey:hn}),await B()),vn=(e,t)=>t?.trim()||e?.settings.platformApiBase?.trim()||e?.account.apiBase?.trim()||void 0;function H(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 gn;if(n.hostname.includes(`nextclaw-provider-gateway-api`)&&n.hostname.endsWith(`.workers.dev`))return _n}var yn=e=>H(e?.account.apiBase)||H(e?.settings.platformApiBase)||H(e?.platformBase)||H(e?.account.platformBase)||void 0;function U(){return f({queryKey:hn,queryFn:ln,staleTime:5e3,refetchOnWindowFocus:!0})}var W=se(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})})),bn=class{constructor(){this.authPollTimerId=null,this.afterSignedIn=null,this.bindSignedInContinuation=e=>{this.afterSignedIn=e},this.openAccountPanel=()=>{W.getState().openPanel()},this.closeAccountPanel=()=>{W.getState().closePanel()},this.syncRemoteStatus=e=>{e?.account.loggedIn&&(this.clearPollTimer(),W.getState().clearBrowserAuth())},this.ensureSignedIn=async e=>{let t=await B();return t.account.loggedIn?!0:(e?.pendingAction&&W.getState().setPendingAction(e.pendingAction),this.openAccountPanel(),await this.startBrowserSignIn({apiBase:e?.apiBase,status:t}),!1)},this.startBrowserSignIn=async e=>{try{let t=e?.status??await B();e?.pendingAction&&W.getState().setPendingAction(e.pendingAction);let n=await dn({apiBase:vn(t,e?.apiBase)});W.getState().beginBrowserAuth({sessionId:n.sessionId,verificationUri:n.verificationUri,expiresAt:n.expiresAt,intervalMs:n.intervalMs,statusMessage:i(`remoteBrowserAuthWaiting`)}),window.open(n.verificationUri,`_blank`,`noopener,noreferrer`)||W.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=W.getState().authVerificationUri;e&&window.open(e,`_blank`,`noopener,noreferrer`)},this.logout=async()=>{try{await pn(),W.getState().clearPendingAction(),W.getState().clearBrowserAuth(),await V(),p.success(i(`remoteLogoutSuccess`))}catch(e){let t=e instanceof Error?e.message:i(`remoteLogoutFailed`);p.error(`${i(`remoteLogoutFailed`)}: ${t}`)}},this.openNextClawWeb=async()=>{let e=yn(await B());if(!e){p.error(i(`remoteOpenWebUnavailable`));return}window.open(e,`_blank`,`noopener,noreferrer`)},this.scheduleBrowserAuthPoll=()=>{this.clearPollTimer();let{authSessionId:e,authPollIntervalMs:t}=W.getState();e&&(this.authPollTimerId=window.setTimeout(async()=>{await this.pollBrowserSignIn()},t))},this.pollBrowserSignIn=async()=>{let e=W.getState();if(e.authSessionId)try{let t=await B(),n=await fn({sessionId:e.authSessionId,apiBase:vn(t)});if(n.status===`pending`){W.getState().updateBrowserAuth({statusMessage:i(`remoteBrowserAuthWaiting`),intervalMs:n.nextPollMs??1500}),this.scheduleBrowserAuthPoll();return}if(n.status===`expired`){this.clearPollTimer(),W.getState().clearBrowserAuth(),p.error(n.message||i(`remoteBrowserAuthExpired`));return}W.getState().setAuthStatusMessage(i(`remoteBrowserAuthCompleted`));let r=await V(),{pendingAction:a}=W.getState();this.clearPollTimer(),W.getState().clearBrowserAuth(),p.success(i(`remoteLoginSuccess`)),a&&this.afterSignedIn&&await this.afterSignedIn(a,r),W.getState().clearPendingAction()}catch(e){this.clearPollTimer(),W.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=W.getState();return{sessionId:e.authSessionId,expiresAt:e.authExpiresAt?c(e.authExpiresAt):`-`}}}},G=se(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})})),xn=class{constructor(){this.accountManager=null,this.bindAccountManager=e=>{this.accountManager=e},this.syncStatus=e=>{if(!e)return;let t=G.getState();t.draftTouched||t.actionLabel||this.hydrateDraftFromStatus(e)},this.setEnabled=e=>{G.getState().setEnabled(e)},this.setDeviceName=e=>{G.getState().setDeviceName(e)},this.setPlatformApiBase=e=>{G.getState().setPlatformApiBase(e)},this.setAdvancedOpen=e=>{G.getState().setAdvancedOpen(e)},this.enableRemoteAccess=async e=>{let t=e??await V(),n=G.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 V();await this.applyEnabledState(!1,t)},this.repairRemoteAccess=async e=>{let t=e??await V();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 z(n);let e=await V();this.hydrateDraftFromStatus(e)},successMessage:i(`remoteServiceRecovered`)})},this.reauthorizeRemoteAccess=async e=>{let t=e??await V();await this.accountManager?.startBrowserSignIn({status:t,apiBase:G.getState().platformApiBase,pendingAction:{type:`repair-remote`}})},this.saveAdvancedSettings=async e=>{let t=e??await V(),n=G.getState();await this.runManagedAction({actionLabel:i(`remoteActionSavingAdvanced`),job:async()=>{await mn({enabled:n.enabled,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let e=await V();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 un();G.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=G.getState();await this.runManagedAction({actionLabel:i(e?`remoteActionEnabling`:`remoteActionDisabling`),job:async()=>{await mn({enabled:e,deviceName:n.deviceName.trim(),platformApiBase:n.platformApiBase.trim()});let r=await V();this.hydrateDraftFromStatus(r),e?await z(r.service.running?`restart`:`start`):t.service.running&&await z(`restart`);let i=await V();this.hydrateDraftFromStatus(i)},successMessage:i(e?`remoteEnabledReady`:`remoteDisabledDone`)})},this.runServiceAction=async(e,t)=>{await this.runManagedAction({actionLabel:t,job:async()=>{let t=await z(e),n=await V();this.hydrateDraftFromStatus(n),p.success(t.message)}})},this.hydrateDraftFromStatus=e=>{G.getState().hydrateDraft({enabled:e.settings.enabled,deviceName:e.settings.deviceName,platformApiBase:e.settings.platformApiBase})},this.runManagedAction=async e=>{G.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{G.getState().finishAction()}}}},K=new class{constructor(){this.accountManager=new bn,this.remoteAccessManager=new xn}};K.accountManager.bindSignedInContinuation(K.remoteAccessManager.resumePendingActionAfterSignIn),K.remoteAccessManager.bindAccountManager(K.accountManager);var Sn=(0,k.createContext)(null);function Cn({children:e}){return(0,A.jsx)(Sn.Provider,{value:K,children:e})}function q(){let e=(0,k.useContext)(Sn);if(!e)throw Error(`useAppPresenter must be used inside AppPresenterProvider`);return e}function J(e){return(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-4 py-2 text-sm`,children:[(0,A.jsx)(`span`,{className:`text-gray-500`,children:e.label}),(0,A.jsx)(`span`,{className:`text-right text-gray-900`,children:e.value?.trim()||`-`})]})}function wn(){let e=q(),t=U(),n=W(e=>e.panelOpen),r=W(e=>e.authSessionId),a=W(e=>e.authVerificationUri),o=W(e=>e.authExpiresAt),s=W(e=>e.authStatusMessage),l=t.data;return(0,k.useEffect)(()=>{e.accountManager.syncRemoteStatus(l)},[e,l]),(0,A.jsx)(en,{open:n,onOpenChange:t=>t?e.accountManager.openAccountPanel():e.accountManager.closeAccountPanel(),children:(0,A.jsxs)(rn,{className:`max-w-xl`,children:[(0,A.jsxs)(an,{children:[(0,A.jsxs)(sn,{className:`flex items-center gap-2`,children:[(0,A.jsx)(R,{className:`h-5 w-5 text-primary`}),i(`accountPanelTitle`)]}),(0,A.jsx)(cn,{children:i(`accountPanelDescription`)})]}),l?.account.loggedIn?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`rounded-2xl border border-emerald-200 bg-emerald-50 px-4 py-3`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium text-emerald-800`,children:i(`accountPanelSignedInTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-emerald-700`,children:i(`accountPanelSignedInDescription`)})]}),(0,A.jsxs)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3`,children:[(0,A.jsx)(J,{label:i(`remoteAccountEmail`),value:l.account.email}),(0,A.jsx)(J,{label:i(`remoteAccountRole`),value:l.account.role})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,A.jsxs)(m,{onClick:()=>void e.accountManager.openNextClawWeb(),children:[(0,A.jsx)(Zt,{className:`mr-2 h-4 w-4`}),i(`remoteOpenDeviceList`)]}),(0,A.jsxs)(m,{variant:`outline`,onClick:()=>void e.accountManager.logout(),children:[(0,A.jsx)(Ut,{className:`mr-2 h-4 w-4`}),i(`remoteLogout`)]})]})]}):(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3`,children:[(0,A.jsx)(`p`,{className:`text-sm font-medium text-gray-900`,children:i(`accountPanelSignedOutTitle`)}),(0,A.jsx)(`p`,{className:`mt-1 text-sm text-gray-600`,children:i(`accountPanelSignedOutDescription`)}),r?(0,A.jsxs)(`div`,{className:`mt-3 border-t border-white/80 pt-3`,children:[(0,A.jsx)(J,{label:i(`remoteBrowserAuthSession`),value:r}),(0,A.jsx)(J,{label:i(`remoteBrowserAuthExpiresAt`),value:o?c(o):`-`})]}):null]}),s?(0,A.jsx)(`p`,{className:`text-sm text-gray-600`,children:s}):null,(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,A.jsx)(m,{onClick:()=>void e.accountManager.startBrowserSignIn(),children:i(r?`remoteBrowserAuthActionRetry`:`remoteBrowserAuthAction`)}),a?(0,A.jsx)(m,{variant:`outline`,onClick:()=>e.accountManager.resumeBrowserSignIn(),children:i(`remoteBrowserAuthResume`)}):null]})]})]})})}var Tn=k.forwardRef(({className:e,hover:t=!0,...n},r)=>(0,A.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}));Tn.displayName=`Card`;var En=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:d(`flex flex-col space-y-1.5 p-6`,e),...t}));En.displayName=`CardHeader`;var Dn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`h3`,{ref:n,className:d(`text-[15px] font-semibold leading-tight tracking-tight text-gray-900`,e),...t}));Dn.displayName=`CardTitle`;var On=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`p`,{ref:n,className:d(`text-[13px] text-gray-400 leading-relaxed`,e),...t}));On.displayName=`CardDescription`;var kn=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:d(`p-6 pt-0`,e),...t}));kn.displayName=`CardContent`;var An=k.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:d(`flex items-center justify-between p-6 pt-0`,e),...t}));An.displayName=`CardFooter`;var Y=k.forwardRef(({className:e,type:t,...n},r)=>(0,A.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}));Y.displayName=`Input`;var jn=40,Mn=400;function Nn(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 Pn(e,t){return e>=jn?!1:Nn(t)}function Fn(){let[e,t]=(0,k.useState)(!1),n=f({queryKey:[`auth-status`],queryFn:()=>We({timeoutMs:e?5e3:Mn}),staleTime:5e3,retry:Pn,retryDelay:250,refetchOnWindowFocus:!0});return(0,k.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 In(){let e=g();return S({mutationFn:Xe,onSuccess:async()=>{await X(e),p.success(i(`authSetupSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Ln(){let e=g();return S({mutationFn:Ge,onSuccess:async()=>{await X(e),p.success(i(`authLoginSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Rn(){let e=g();return S({mutationFn:He,onSuccess:async()=>{await X(e),p.success(i(`authLogoutSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function zn(){let e=g();return S({mutationFn:je,onSuccess:async()=>{await X(e),p.success(i(`authPasswordUpdated`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Bn(){let e=g();return S({mutationFn:Qe,onSuccess:async(t,n)=>{await X(e),p.success(n.enabled?i(`authEnabledSuccess`):i(`authDisabledSuccess`))},onError:e=>{p.error(`${i(`authActionFailed`)}: ${e.message}`)}})}function Vn({username:e}){let t=Ln(),[n,r]=(0,k.useState)(e??``),[a,o]=(0,k.useState)(``),s=n.trim().length>0&&a.length>0&&!t.isPending;return(0,A.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-secondary px-6 py-10`,children:(0,A.jsxs)(Tn,{hover:!1,className:`w-full max-w-md shadow-card-hover`,children:[(0,A.jsxs)(En,{children:[(0,A.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-[0.24em] text-gray-500`,children:i(`authBrand`)}),(0,A.jsx)(Dn,{className:`text-2xl`,children:i(`authLoginTitle`)}),(0,A.jsx)(On,{children:i(`authLoginDescription`)})]}),(0,A.jsx)(kn,{children:(0,A.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e?.preventDefault(),s&&t.mutate({username:n.trim(),password:a})},children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:i(`authUsername`)}),(0,A.jsx)(Y,{value:n,onChange:e=>r(e.target.value),placeholder:i(`authUsernamePlaceholder`),autoFocus:!0})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`label`,{className:`text-sm font-medium text-gray-800`,children:i(`authPassword`)}),(0,A.jsx)(Y,{type:`password`,value:a,onChange:e=>o(e.target.value),placeholder:i(`authPasswordPlaceholder`)})]}),(0,A.jsx)(m,{type:`submit`,className:`w-full`,disabled:!s,children:t.isPending?i(`authLoggingIn`):i(`authLoginAction`)})]})})]})})}var Hn=`nextclaw.ui.theme`,Un=[{value:`warm`,labelKey:`themeWarm`},{value:`cool`,labelKey:`themeCool`}],Z=`warm`,Wn=!1,Gn=new Set;function Kn(e){return e===`warm`||e===`cool`}function qn(e){typeof document>`u`||document.documentElement.setAttribute(`data-theme`,e)}function Jn(){if(typeof window>`u`)return`warm`;try{let e=window.localStorage.getItem(Hn);if(Kn(e))return e}catch{}return`warm`}function Yn(){return Wn||=(Z=Jn(),qn(Z),!0),Z}function Xn(){return Wn?Z:Yn()}function Zn(e){if(Yn(),e!==Z){if(Z=e,qn(Z),typeof window<`u`)try{window.localStorage.setItem(Hn,Z)}catch{}Gn.forEach(e=>e(Z))}}function Qn(e){return Gn.add(e),()=>{Gn.delete(e)}}function $n(){let e=O();(0,k.useEffect)(()=>{let t=t=>{let n=t.target.closest(`a[href]`);if(!n)return;let r=n.getAttribute(`href`)||``;tt(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 er(e){return[...e].sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt))}function tr(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 nr(e,t){if(!e)return e;let n=e.sessions.findIndex(e=>e.sessionId===t.sessionId),r=er(n>=0?e.sessions.map((e,r)=>r===n&&tr(e,t)?t:e):[...e.sessions,t]);return{...e,sessions:r,total:r.length}}function rr(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 ir(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>nr(e,t))}function ar(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 or(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>ar(e,t))}function sr(e,t){e?.setQueriesData({queryKey:[`ncp-sessions`]},e=>rr(e,t))}function cr(e,t){if(t.type===`session.run-status`){or(e,t.payload);return}if(t.type===`session.summary.upsert`){ir(e,t.payload.summary);return}sr(e,t.payload.sessionKey)}async function lr(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 h.get(n?`/api/ncp/sessions?${n}`:`/api/ncp/sessions`);if(!r.ok)throw Error(r.error.message);return r.data}async function ur(e,t=200){let n=await h.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 dr(e,t){let n=await h.put(`/api/ncp/sessions/${encodeURIComponent(e)}`,t);if(!n.ok)throw Error(n.error.message);return n.data}async function fr(e){let t=await h.delete(`/api/ncp/sessions/${encodeURIComponent(e)}`);if(!t.ok)throw Error(t.error.message);return t.data}function pr(){return f({queryKey:[`config`],queryFn:qe,staleTime:3e4,refetchOnWindowFocus:!0})}function mr(){return f({queryKey:[`app-meta`],queryFn:Pe,staleTime:1/0})}function hr(){return f({queryKey:[`config-meta`],queryFn:Ie,staleTime:1/0})}function gr(){return f({queryKey:[`config-schema`],queryFn:Ve,staleTime:1/0})}function _r(){let e=g();return S({mutationFn:Ze,onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function vr(){let e=g();return S({mutationFn:({data:e})=>Oe(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function yr(){let e=g();return S({mutationFn:({provider:e,data:t})=>Me(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 br(){let e=g();return S({mutationFn:({data:e})=>Je(e??{}),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),e.invalidateQueries({queryKey:[`config-meta`]}),p.success(i(`configSaved`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function xr(){let e=g();return S({mutationFn:({provider: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 Sr(){return S({mutationFn:({provider:e,data:t})=>Fe(e,t)})}function Cr(){return S({mutationFn:({provider:e,data:t})=>$e(e,t)})}function wr(){return S({mutationFn:({provider:e,data:t})=>ze(e,t)})}function Tr(){return S({mutationFn:({provider:e})=>Le(e)})}function Er(){let e=g();return S({mutationFn:({channel:e,data:t})=>De(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Dr(){let e=g();return S({mutationFn:({data:e})=>ke(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Or(){let e=g();return S({mutationFn:({data:e})=>Ae(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function kr(){return S({mutationFn:({actionId:e,data:t})=>Be(e,t),onError:e=>{p.error(i(`error`)+`: `+e.message)}})}function Ar(e){return f({queryKey:[`ncp-sessions`,e?.limit??null],queryFn:()=>lr(e),staleTime:5e3,retry:!1})}function jr(e,t=200){return f({queryKey:[`ncp-session-messages`,e,t],queryFn:()=>ur(e,t),enabled:!!e,staleTime:5e3,retry:!1})}function Mr(){let e=g();return S({mutationFn:({sessionId:e})=>fr(e),onSuccess:(t,n)=>{sr(e,n.sessionId),e.removeQueries({queryKey:[`ncp-session-messages`,n.sessionId]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Nr(){let e=g();return S({mutationFn:({sessionId:e,data:t})=>dr(e,t),onSuccess:t=>{ir(e,t),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Pr(e={all:!0}){return f({queryKey:[`cron`,e],queryFn:()=>Ye(e),staleTime:1e4})}function Fr(){let e=g();return S({mutationFn:({id:e})=>Ue(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Ir(){let e=g();return S({mutationFn:({id:e,enabled:t})=>Ne(e,{enabled:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Lr(){let e=g();return S({mutationFn:({id:e,force:t})=>Re(e,{force:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`cron`]}),p.success(i(`configSavedApplied`))},onError:e=>{p.error(i(`configSaveFailed`)+`: `+e.message)}})}function Rr({className:e,suffix:t}){let{data:n}=mr(),r=n?.name??`NextClaw`,i=n?.productVersion?.trim();return(0,A.jsxs)(`div`,{className:e??`flex items-center gap-2.5`,children:[(0,A.jsx)(`div`,{className:`h-7 w-7 rounded-lg overflow-hidden flex items-center justify-center`,children:(0,A.jsx)(`img`,{src:`/logo.svg`,alt:r,className:`h-full w-full object-contain`})}),(0,A.jsxs)(`div`,{className:`flex items-baseline gap-2 min-w-0`,children:[(0,A.jsx)(`span`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:r}),i?(0,A.jsxs)(`span`,{className:`text-[13px] font-medium text-gray-500`,children:[`v`,i]}):null,t?(0,A.jsx)(`span`,{className:`inline-flex items-center shrink-0`,children:t}):null]})]})}var zr={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 Q(e){return zr[e]}function Br({to:e,label:t,icon:n,density:r=`default`,className:i}){let a=Q(r);return(0,A.jsx)(ie,{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,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(n,{className:d(a.icon,`transition-colors`,e?`text-gray-900`:`text-gray-500 group-hover:text-gray-800`)}),(0,A.jsx)(`span`,{className:`min-w-0 flex-1 text-left`,children:t})]})})}function Vr({label:e,icon:t,onClick:n,density:r=`default`,className:i,labelClassName:a,trailing:o,trailingClassName:s,testId:c,trailingTestId:l}){let u=Q(r);return(0,A.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,A.jsx)(t,{className:d(u.icon,`shrink-0 text-gray-400`)}),(0,A.jsx)(`span`,{className:d(`min-w-0 flex-1 text-left`,a),children:e}),o?(0,A.jsx)(`span`,{className:d(`shrink-0 text-gray-500`,u.value,s),"data-testid":l,children:o}):null]})}function Hr({label:e,icon:t,value:n,valueLabel:r,onValueChange:i,density:a=`default`,children:o}){let s=Q(a);return(0,A.jsxs)(be,{value:n,onValueChange:i,children:[(0,A.jsxs)(ge,{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,A.jsxs)(`div`,{className:d(`flex min-w-0 items-center`,s.gap),children:[(0,A.jsx)(t,{className:d(s.icon,`text-gray-400`)}),(0,A.jsx)(`span`,{className:`text-left`,children:e})]}),(0,A.jsx)(`span`,{className:d(`ml-auto text-gray-500`,s.value),children:r})]}),(0,A.jsx)(ve,{children:o})]})}var Ur=(0,k.createContext)(null);function Wr({children:e}){let[r,i]=(0,k.useState)(()=>o());(0,k.useEffect)(()=>n(e=>{i(e)}),[]);let a=(0,k.useCallback)(e=>{l(e),i(t())},[]),s=(0,k.useCallback)(()=>{a(r===`en`?`zh`:`en`)},[r,a]),c=(0,k.useMemo)(()=>({language:r,setLanguage:a,toggleLanguage:s}),[r,a,s]);return(0,A.jsx)(Ur.Provider,{value:c,children:e})}function Gr(){let e=(0,k.useContext)(Ur);if(!e)throw Error(`useI18n must be used within I18nProvider`);return{...e,t:i}}var Kr=(0,k.createContext)(null);function qr({children:e}){let[t,n]=(0,k.useState)(()=>Yn());(0,k.useEffect)(()=>Qn(e=>{n(e)}),[]);let r=(0,k.useCallback)(e=>{Zn(e),n(Xn())},[]),i=(0,k.useMemo)(()=>({theme:t,setTheme:r}),[t,r]);return(0,A.jsx)(Kr.Provider,{value:i,children:e})}function Jr(){let e=(0,k.useContext)(Kr);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}function Yr({mode:e}){let t=q(),n=O(),r=U(),{language:a,setLanguage:o}=Gr(),{theme:s,setTheme:c}=Jr(),l=e===`settings`,ee=u.find(e=>e.value===a)?.label??a,f=i(Un.find(e=>e.value===s)?.labelKey??`themeWarm`),te=r.data?.account.email?.trim(),ne=!!r.data?.account.loggedIn,p=e=>{a!==e&&(o(e),window.location.reload())},m=e=>{s!==e&&c(e)},h=[{target:`/chat`,label:i(`chat`),icon:Wt},{target:`/chat/cron`,label:i(`cron`),icon:Lt},{target:`/chat/skills`,label:i(`marketplaceFilterSkills`),icon:Rt}],re=[{target:`/model`,label:i(`model`),icon:zt},{target:`/providers`,label:i(`providers`),icon:Xt},{target:`/search`,label:i(`searchChannels`),icon:Te},{target:`/channels`,label:i(`channels`),icon:Gt},{target:`/runtime`,label:i(`runtime`),icon:Bt},{target:`/remote`,label:i(`remote`),icon:Qt},{target:`/security`,label:i(`security`),icon:Yt},{target:`/sessions`,label:i(`sessions`),icon:Vt},{target:`/secrets`,label:i(`secrets`),icon:R},{target:`/marketplace/plugins`,label:i(`marketplaceFilterPlugins`),icon:qt},{target:`/marketplace/mcp`,label:i(`marketplaceFilterMcp`),icon:$t}],g=l?re:h,_=l?`compact`:`default`;return(0,A.jsxs)(`aside`,{className:`w-[240px] shrink-0 flex h-full min-h-0 flex-col overflow-hidden bg-secondary px-4 py-6`,children:[l?(0,A.jsx)(`div`,{className:`shrink-0 px-2 pb-3`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2 px-1 py-1`,"data-testid":`settings-sidebar-header`,children:[(0,A.jsxs)(ie,{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,A.jsx)(Ce,{className:`h-3.5 w-3.5 shrink-0 text-gray-400 group-hover:text-gray-700`}),(0,A.jsx)(`span`,{className:`truncate`,children:i(`backToMain`)})]}),(0,A.jsx)(`span`,{className:`h-4 w-px shrink-0 bg-[#dddfe6]`,"aria-hidden":`true`}),(0,A.jsx)(`h1`,{className:`truncate text-[15px] font-semibold tracking-[-0.01em] text-gray-800`,children:i(`settings`)})]})}):(0,A.jsx)(`div`,{className:`shrink-0 px-2 pb-8`,children:(0,A.jsx)(Rr,{className:`flex items-center gap-2.5 cursor-pointer`})}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsx)(`nav`,{className:`custom-scrollbar min-h-0 flex-1 overflow-y-auto pr-1`,children:(0,A.jsx)(`ul`,{className:d(l?`space-y-0.5 pb-3`:`space-y-1 pb-4`),children:g.map(e=>(0,A.jsx)(`li`,{children:(0,A.jsx)(Br,{to:e.target,label:e.label,icon:e.icon,density:_})},e.target))})}),(0,A.jsxs)(`div`,{className:d(`shrink-0 border-t border-[#dde0ea] bg-secondary`,l?`mt-2 pt-3`:`mt-3 pt-3`),children:[l?(0,A.jsx)(Vr,{onClick:()=>t.accountManager.openAccountPanel(),icon:R,label:i(`remoteAccountEntryManage`),density:`compact`,className:`mb-1.5`,trailing:ne?te||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,A.jsx)(`div`,{className:`mb-2`,children:(0,A.jsx)(Br,{to:`/settings`,label:i(`settings`),icon:Jt})}),(0,A.jsx)(`div`,{className:`mb-2`,children:(0,A.jsx)(Hr,{value:s,onValueChange:e=>m(e),icon:Kt,label:i(`theme`),valueLabel:f,density:_,children:Un.map(e=>(0,A.jsx)(ye,{value:e.value,className:`text-xs`,children:i(e.labelKey)},e.value))})}),(0,A.jsx)(`div`,{className:`mb-2`,children:(0,A.jsx)(Hr,{value:a,onValueChange:e=>p(e),icon:Ht,label:i(`language`),valueLabel:ee,density:_,children:u.map(e=>(0,A.jsx)(ye,{value:e.value,className:`text-xs`,children:e.label},e.value))})}),(0,A.jsx)(Vr,{onClick:()=>n.open(void 0,{kind:`docs`,newTab:!0,title:`Docs`}),icon:we,label:i(`docBrowserHelp`),density:_})]})]})]})}var Xr=`NextClaw`,Zr=[{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:`/chat`,key:`chat`},{prefix:`/model`,key:`modelPageTitle`},{prefix:`/search`,key:`searchPageTitle`},{prefix:`/providers`,key:`providersPageTitle`},{prefix:`/channels`,key:`channelsPageTitle`},{prefix:`/runtime`,key:`runtimePageTitle`},{prefix:`/remote`,key:`remotePageTitle`},{prefix:`/security`,key:`authSecurityTitle`},{prefix:`/sessions`,key:`sessionsPageTitle`},{prefix:`/secrets`,key:`secretsPageTitle`}];function Qr(e,t){return e===t||e.startsWith(`${t}/`)}function $r(e){let t=e.toLowerCase();for(let{prefix:e,key:n}of Zr)if(Qr(t,e))return i(n);return i(`settings`)}function ei(e){return`${Xr} - ${$r(e)}`}var ti=(0,k.lazy)(async()=>({default:(await y(async()=>{let{DocBrowser:e}=await import(`./DocBrowser-CMdPdbZj.js`);return{DocBrowser:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))).DocBrowser}));function ni(e){let t=e.toLowerCase();return t===`/chat`||t.startsWith(`/chat/`)||t===`/skills`||t.startsWith(`/skills/`)||t===`/cron`||t.startsWith(`/cron/`)}function ri(e){let t=e.toLowerCase();return t===`/channels`||t.startsWith(`/channels/`)}function ii({children:e}){let{isOpen:t,mode:n}=O();$n();let{pathname:r}=ae(),{language:i}=Gr(),a=ni(r),o=ri(r);return(0,k.useEffect)(()=>{document.title=ei(r)},[r,i]),(0,A.jsxs)(`div`,{className:`h-screen flex bg-background font-sans text-foreground`,children:[!a&&(0,A.jsx)(Yr,{mode:`settings`}),(0,A.jsxs)(`div`,{className:`flex-1 flex min-w-0 overflow-hidden relative`,children:[(0,A.jsx)(`div`,{className:`flex-1 flex flex-col min-w-0 overflow-hidden`,children:a?(0,A.jsx)(`div`,{className:`flex-1 h-full overflow-hidden`,children:e}):(0,A.jsx)(`main`,{className:d(`flex-1 custom-scrollbar p-8`,o?`overflow-auto xl:overflow-hidden`:`overflow-auto`),children:(0,A.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,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(ti,{})})]}),t&&n===`floating`&&(0,A.jsx)(k.Suspense,{fallback:null,children:(0,A.jsx)(ti,{})})]})}function ai({children:e}){return(0,A.jsx)(et,{children:(0,A.jsx)(ii,{children:e})})}var oi=se(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 si(e){let t=e.trim().toLowerCase();return t?!(t.startsWith(`plugins`)||t.startsWith(`skills`)):!0}function ci(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 li(e,t){e&&si(t)&&e.invalidateQueries({queryKey:[`config`]}),ci(e,t)}function ui(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`){li(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`){cr(e,r);return}r.type===`error`&&console.error(`Realtime transport error:`,r.payload.message)}function di(e){let{setConnectionStatus:t}=oi(),n=(0,k.useRef)(!1);(0,k.useEffect)(()=>(t(`connecting`),te.subscribe(r=>ui(e,t,n,r))),[e,t])}var fi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{ModelConfig:e}=await import(`./ModelConfig-DmCY6jWM.js`);return{ModelConfig:e}},__vite__mapDeps([10,2,11,12,3,4,13,9,14,15,16,17,18]))).ModelConfig})),pi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{ChatPage:e}=await import(`./ChatPage-FdT3pDnw.js`);return{ChatPage:e}},__vite__mapDeps([19,2,20,11,12,3,21,22,23,24,9,14,25,26,16,27,28,4,29,13,5,30,6,7,31,8,32,33,18]))).ChatPage})),mi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{SearchConfig:e}=await import(`./SearchConfig-Dm7r2yfp.js`);return{SearchConfig:e}},__vite__mapDeps([34,2,11,12,3,5,7,35,14,15]))).SearchConfig})),hi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{ProvidersList:e}=await import(`./ProvidersList-ClT-34aX.js`);return{ProvidersList:e}},__vite__mapDeps([36,2,11,12,3,21,22,6,7,31,8,33,35,14,15,37,38,27,17]))).ProvidersList})),gi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{ChannelsList:e}=await import(`./ChannelsList-ByHWHkQS.js`);return{ChannelsList:e}},__vite__mapDeps([39,2,11,12,3,24,4,5,30,40,13,7,8,33,35,14,15,37,38,27,17]))).ChannelsList})),_i=(0,k.lazy)(async()=>({default:(await y(async()=>{let{RuntimeConfig:e}=await import(`./RuntimeConfig-C5aqliGk.js`);return{RuntimeConfig:e}},__vite__mapDeps([41,2,11,12,3,6,42,31,14,38,17]))).RuntimeConfig})),vi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{SecurityConfig:e}=await import(`./security-config-6t78Ph-I.js`);return{SecurityConfig:e}},__vite__mapDeps([43,2,12,14,15,38]))).SecurityConfig})),yi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{SessionsConfig:e}=await import(`./SessionsConfig-6wNJloZN.js`);return{SessionsConfig:e}},__vite__mapDeps([44,2,11,12,3,29,13,40,7,14,26]))).SessionsConfig})),bi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{SecretsConfig:e}=await import(`./SecretsConfig-BBP_mbQh.js`);return{SecretsConfig:e}},__vite__mapDeps([45,2,11,12,3,6,42,31,14,15,38]))).SecretsConfig})),xi=(0,k.lazy)(async()=>({default:(await y(async()=>{let{RemoteAccessPage:e}=await import(`./RemoteAccessPage-B6hUZl1O.js`);return{RemoteAccessPage:e}},__vite__mapDeps([46,2,12,3,14,37]))).RemoteAccessPage})),Si=(0,k.lazy)(async()=>({default:(await y(async()=>{let{MarketplacePage:e}=await import(`./MarketplacePage-9oKmxN2n.js`);return{MarketplacePage:e}},__vite__mapDeps([47,23,2,20,11,12,3,22,24,9,14,25,26,16,27]))).MarketplacePage})),Ci=(0,k.lazy)(async()=>({default:(await y(async()=>{let{McpMarketplacePage:e}=await import(`./McpMarketplacePage-C7PkCYbp.js`);return{McpMarketplacePage:e}},__vite__mapDeps([48,2,11,12,3,24,9,14,25,26,16,38,27]))).McpMarketplacePage}));function wi(){return(0,A.jsx)(`div`,{className:`h-full w-full animate-pulse rounded-2xl border border-border/40 bg-card/40`})}function $({children:e}){return(0,A.jsx)(k.Suspense,{fallback:(0,A.jsx)(wi,{}),children:e})}function Ti(){return di(x),(0,A.jsxs)(Cn,{children:[(0,A.jsx)(ai,{children:(0,A.jsx)(`div`,{className:`w-full h-full`,children:(0,A.jsxs)(_,{children:[(0,A.jsx)(v,{path:`/chat/skills`,element:(0,A.jsx)(b,{to:`/skills`,replace:!0})}),(0,A.jsx)(v,{path:`/chat/cron`,element:(0,A.jsx)(b,{to:`/cron`,replace:!0})}),(0,A.jsx)(v,{path:`/chat/:sessionId?`,element:(0,A.jsx)($,{children:(0,A.jsx)(pi,{view:`chat`})})}),(0,A.jsx)(v,{path:`/skills`,element:(0,A.jsx)($,{children:(0,A.jsx)(pi,{view:`skills`})})}),(0,A.jsx)(v,{path:`/cron`,element:(0,A.jsx)($,{children:(0,A.jsx)(pi,{view:`cron`})})}),(0,A.jsx)(v,{path:`/model`,element:(0,A.jsx)($,{children:(0,A.jsx)(fi,{})})}),(0,A.jsx)(v,{path:`/search`,element:(0,A.jsx)($,{children:(0,A.jsx)(mi,{})})}),(0,A.jsx)(v,{path:`/providers`,element:(0,A.jsx)($,{children:(0,A.jsx)(hi,{})})}),(0,A.jsx)(v,{path:`/channels`,element:(0,A.jsx)($,{children:(0,A.jsx)(gi,{})})}),(0,A.jsx)(v,{path:`/runtime`,element:(0,A.jsx)($,{children:(0,A.jsx)(_i,{})})}),(0,A.jsx)(v,{path:`/remote`,element:(0,A.jsx)($,{children:(0,A.jsx)(xi,{})})}),(0,A.jsx)(v,{path:`/security`,element:(0,A.jsx)($,{children:(0,A.jsx)(vi,{})})}),(0,A.jsx)(v,{path:`/sessions`,element:(0,A.jsx)($,{children:(0,A.jsx)(yi,{})})}),(0,A.jsx)(v,{path:`/secrets`,element:(0,A.jsx)($,{children:(0,A.jsx)(bi,{})})}),(0,A.jsx)(v,{path:`/settings`,element:(0,A.jsx)(b,{to:`/model`,replace:!0})}),(0,A.jsx)(v,{path:`/marketplace/skills`,element:(0,A.jsx)(b,{to:`/skills`,replace:!0})}),(0,A.jsx)(v,{path:`/marketplace`,element:(0,A.jsx)(b,{to:`/marketplace/plugins`,replace:!0})}),(0,A.jsx)(v,{path:`/marketplace/mcp`,element:(0,A.jsx)($,{children:(0,A.jsx)(Ci,{})})}),(0,A.jsx)(v,{path:`/marketplace/:type`,element:(0,A.jsx)($,{children:(0,A.jsx)(Si,{})})}),(0,A.jsx)(v,{path:`/`,element:(0,A.jsx)(b,{to:`/chat`,replace:!0})}),(0,A.jsx)(v,{path:`*`,element:(0,A.jsx)(b,{to:`/chat`,replace:!0})})]})})}),(0,A.jsx)(wn,{})]})}function Ei(){let e=Fn(),t=e.isError&&Nn(e.error);return e.isLoading&&!e.isError||t||e.isError?(0,A.jsx)(Ti,{}):e.data?.enabled&&!e.data.authenticated?(0,A.jsx)(Vn,{username:e.data.username}):(0,A.jsx)(Ti,{})}function Di(){return(0,A.jsxs)(ne,{client:x,children:[(0,A.jsx)(Ei,{}),(0,A.jsx)(re,{position:`top-right`,richColors:!0})]})}(0,nt.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(k.StrictMode,{children:(0,A.jsx)(qr,{children:(0,A.jsx)(Wr,{children:(0,A.jsx)(oe,{children:(0,A.jsx)(Di,{})})})})}));export{en as $,vr as A,In as B,Sr as C,Nr as D,_r as E,sr as F,kn as G,zn as H,ir as I,Dn as J,On as K,Un as L,fr as M,ur as N,yr as O,dr as P,yn as Q,Fn as R,Cr as S,Er as T,Y as U,Bn as V,Tn as W,G as X,q as Y,U as Z,Tr as _,Br as a,$t as at,wr as b,pr as c,Jt as ct,br as d,Wt as dt,rn as et,Pr as f,Ht as ft,kr as g,xr as h,Lt as ht,Vr as i,sn as it,Or as j,Dr as k,hr as l,Kt as lt,Mr as m,Rt as mt,Jr as n,on as nt,Hr as o,Zt as ot,Fr as p,R as pt,En as q,Gr as r,an as rt,Rr as s,Xt as st,oi as t,cn as tt,gr as u,Gt as ut,jr as v,Ir as w,Lr as x,Ar as y,Rn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,m as t,p as n,u as r}from"./i18n-
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-CSytxMFI.js";var i=e(t(),1),a=n(),o=i.forwardRef(({className:e,...t},n)=>(0,a.jsx)(`label`,{ref:n,className:r(`text-sm font-medium leading-none text-gray-700 peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,e),...t}));o.displayName=`Label`;export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DiFAvXmK.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-
|
|
1
|
+
import{t as e}from"./createLucideIcon-DiFAvXmK.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-
|
|
1
|
+
import{m as e,p as t,u as n}from"./i18n-CSytxMFI.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-DiFAvXmK.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-
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-CSytxMFI.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-CT50pzod.js";import{t as x}from"./dist-kW_O3kyZ.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{_ as e,m as t}from"./i18n-
|
|
1
|
+
import{_ as e,m as t}from"./i18n-CSytxMFI.js";import{C as n,D as r,E as i,M as a,O as o,S as s,T as c,_ as l,b as u,d,g as f,h as p,j as m,m as h,p as g,v as _,w as v,x as y,y as b}from"./dist-pCfWPG1A.js";function x(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,d=async()=>{let n=!1,d=e=>{l(e,()=>t.signal,()=>n=!0)},f=u(t.options,t.fetchOptions),p=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await f((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return d(e),e})()),{maxPages:o}=t.options,s=i?b:_;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?C:S,n={pages:a,pageParams:o};s=await p(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:S(r,s);if(c>0&&e==null)break;s=await p(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=d}}}function S(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 C(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var w=class extends a{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new d({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=T(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=T(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=T(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=T(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){p.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>v(t,e))}findAll(e={}){return this.getAll().filter(t=>v(e,t))}notify(e){p.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return p.batch(()=>Promise.all(e.map(e=>e.continue().catch(i))))}};function T(e){return e.options.scope?.id}var E=class extends a{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let i=t.queryKey,a=t.queryHash??n(i,t),o=this.get(a);return o||(o=new g({client:e,queryKey:i,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){p.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>c(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>c(e,t)):t}notify(e){p.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){p.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){p.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},D=new class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new E,this.#t=e.mutationCache||new w,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=f.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=h.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(o(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=y(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return p.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;p.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return p.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=p.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(i).catch(i)}invalidateQueries(e,t={}){return p.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=p.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(i)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(i)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(o(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i).catch(i)}fetchInfiniteQuery(e){return e.behavior=x(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i).catch(i)}ensureInfiniteQueryData(e){return e.behavior=x(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(s(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{r(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(s(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{r(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=n(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===m&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}}({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!0}}}),O=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},k=(e=>e?O(e):O),A=e(t(),1),j=e=>e;function M(e,t=j){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 N=e=>{let t=k(e),n=e=>M(t,e);return Object.assign(n,t),n},P=(e=>e?N(e):N);export{D as n,P as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-DiFAvXmK.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-DiFAvXmK.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,l as t,m as n,p as r}from"./i18n-
|
|
1
|
+
import{_ as e,l as t,m as n,p as r}from"./i18n-CSytxMFI.js";import{n as i,o as a}from"./dist-pCfWPG1A.js";import{B as o,G as s,H as c,J as l,K as u,R as d,U as f,V as p,W as m,q as h,z as g}from"./index-DvKS3L9j.js";import{n as _,t as v}from"./page-layout--S0YBU0W.js";import{t as y}from"./label-RyXfZqkP.js";import{t as b}from"./switch-D3l6AcCk.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=d(),n=o(),r=p(),i=c(),_=g(),[v,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=v.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:v.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 _.mutateAsync()}catch{}};return e.isLoading&&!P?(0,S.jsxs)(m,{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)(m,{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)(m,{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)(y,{htmlFor:`auth-password-next`,children:t(`authPassword`)}),(0,S.jsx)(f,{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)(y,{htmlFor:`auth-password-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(f,{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:_.isPending,onClick:()=>void B(),children:_.isPending?t(`authLoggingOut`):t(`authLogoutAction`)}):null]}),(0,S.jsx)(`p`,{className:`text-xs text-gray-500`,children:t(`authSessionMemoryNotice`)})]})]})]}):(0,S.jsxs)(m,{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)(y,{htmlFor:`auth-setup-username`,children:t(`authUsername`)}),(0,S.jsx)(f,{id:`auth-setup-username`,value:v,onChange:e=>C(e.target.value),placeholder:t(`authUsernamePlaceholder`)})]}),(0,S.jsxs)(`div`,{className:`space-y-2`,children:[(0,S.jsx)(y,{htmlFor:`auth-setup-password`,children:t(`authPassword`)}),(0,S.jsx)(f,{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)(y,{htmlFor:`auth-setup-confirm`,children:t(`authConfirmPassword`)}),(0,S.jsx)(f,{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)(_,{className:`space-y-6`,children:[(0,S.jsx)(v,{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-CXBpwAwA.js";import{N as i}from"./dist-Dii9v3X9.js";import{t as a}from"./createLucideIcon-CcR5wVoU.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-CSytxMFI.js";import{N as i}from"./dist-pCfWPG1A.js";import{t as a}from"./createLucideIcon-DiFAvXmK.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-CSytxMFI.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-
|
|
1
|
+
import{p as e,u as t}from"./i18n-CSytxMFI.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-
|
|
1
|
+
import{_ as e,m as t,p as n,u as r}from"./i18n-CSytxMFI.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{i as e,m as t,p as n,u as r}from"./i18n-
|
|
1
|
+
import{i as e,m as t,p as n,u as r}from"./i18n-CSytxMFI.js";t();var i=n();function a({tabs:t,activeTab:n,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:t.map(t=>{let o=n===t.id;return(0,i.jsxs)(`button`,{onClick:()=>a(t.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:[t.label,t.count!==void 0&&(0,i.jsx)(`span`,{className:r(`text-[11px] font-medium`,`text-gray-500`),children:e(t.count)}),o&&(0,i.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full`})]},t.id)})})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./createLucideIcon-
|
|
1
|
+
import{t as e}from"./createLucideIcon-DiFAvXmK.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 +1 @@
|
|
|
1
|
-
import{_ as e,l as t,m as n,p as r}from"./i18n-
|
|
1
|
+
import{_ as e,l as t,m as n,p as r}from"./i18n-CSytxMFI.js";import{o as i}from"./dist-pCfWPG1A.js";import{$ as a,et as o,it as s,nt as c,rt as l,tt as u}from"./index-DvKS3L9j.js";var d=e(n(),1),f=r(),p=({open:e,onOpenChange:n,title:r,description:d,confirmLabel:p=t(`confirm`),cancelLabel:m=t(`cancel`),variant:h=`default`,onConfirm:g,onCancel:_})=>(0,f.jsx)(a,{open:e,onOpenChange:n,children:(0,f.jsxs)(o,{className:`[&>:last-child]:hidden`,onCloseAutoFocus:e=>e.preventDefault(),children:[(0,f.jsxs)(l,{children:[(0,f.jsx)(s,{children:r}),d?(0,f.jsx)(u,{children:d}):null]}),(0,f.jsxs)(c,{className:`gap-2 sm:gap-0`,children:[(0,f.jsx)(i,{type:`button`,variant:`outline`,onClick:()=>{_(),n(!1)},children:m}),(0,f.jsx)(i,{type:`button`,variant:h===`destructive`?`destructive`:`default`,onClick:()=>{g(),n(!1)},children:p})]})]})}),m={open:!1,title:``,description:``,confirmLabel:t(`confirm`),cancelLabel:t(`cancel`),variant:`default`,resolve:null};function h(){let[e,n]=(0,d.useState)(m),r=(0,d.useCallback)(e=>new Promise(r=>{n({open:!0,title:e.title,description:e.description??``,confirmLabel:e.confirmLabel??t(`confirm`),cancelLabel:e.cancelLabel??t(`cancel`),variant:e.variant??`default`,resolve:e=>{r(e),n(e=>({...e,open:!1,resolve:null}))}})}),[]),i=(0,d.useCallback)(e=>{n(t=>(!e&&t.resolve&&t.resolve(!1),{...t,open:e,resolve:e?t.resolve:null}))},[]);return{confirm:r,ConfirmDialog:(0,d.useCallback)(()=>(0,f.jsx)(p,{open:e.open,onOpenChange:i,title:e.title,description:e.description||void 0,confirmLabel:e.confirmLabel,cancelLabel:e.cancelLabel,variant:e.variant,onConfirm:()=>e.resolve?.(!0),onCancel:()=>e.resolve?.(!1)}),[e,i])}}export{h as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,m as t}from"./i18n-
|
|
1
|
+
import{_ as e,m as t}from"./i18n-CSytxMFI.js";import{A as n,E as r,M as i,S as a,f as o,h as s,k as c,u as l}from"./dist-pCfWPG1A.js";var u=class extends i{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),c(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&a(t.mutationKey)!==a(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??o();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){s.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},d=e(t(),1);function f(e,t){let i=l(t),[a]=d.useState(()=>new u(i,e));d.useEffect(()=>{a.setOptions(e)},[a,e]);let o=d.useSyncExternalStore(d.useCallback(e=>a.subscribe(s.batchCalls(e)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=d.useCallback((e,t)=>{a.mutate(e,t).catch(r)},[a]);if(o.error&&n(a.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:c,mutateAsync:o.mutate}}export{f as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./createLucideIcon-DiFAvXmK.js";var t=e(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t};
|