@undefineds.co/xpod 0.4.25 → 0.4.28
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/dist/api/ApiServer.d.ts +1 -0
- package/dist/api/ApiServer.js +38 -0
- package/dist/api/ai-config/AiConfigStore.js +18 -6
- package/dist/api/ai-gateway/connect/index.d.ts +1 -0
- package/dist/api/ai-gateway/connect/index.js +39 -18
- package/dist/api/ai-gateway/models/ProviderModelsAdapter.js +5 -2
- package/dist/api/container/common.js +8 -2
- package/dist/api/container/index.js +2 -2
- package/dist/api/container/local.js +6 -3
- package/dist/api/handlers/AiGatewayHandler.d.ts +1 -0
- package/dist/api/handlers/AiGatewayHandler.js +53 -3
- package/dist/api/handlers/AiGatewayManagementHandler.js +9 -0
- package/dist/api/handlers/TaskHandler.js +15 -10
- package/dist/api/network/NetworkEnvironmentConfigurationStore.js +1 -1
- package/dist/api/runs/ManagedRunWorker.d.ts +0 -1
- package/dist/api/runs/ManagedRunWorker.js +2 -14
- package/dist/api/runs/PiAgentRuntimeDriver.d.ts +0 -8
- package/dist/api/runs/PiAgentRuntimeDriver.js +65 -21
- package/dist/api/runs/RunStateCenter.js +1 -0
- package/dist/api/runs/store.d.ts +1 -0
- package/dist/api/runs/store.js +13 -0
- package/dist/api/tasks/TaskMaterializer.js +13 -6
- package/dist/api/tasks/TaskResumeDiagnostics.d.ts +28 -0
- package/dist/api/tasks/TaskResumeDiagnostics.js +148 -0
- package/dist/api/tasks/TaskService.js +40 -23
- package/dist/storage/conditions/StorageETagHandler.d.ts +1 -1
- package/dist/storage/conditions/StorageETagHandler.js +13 -4
- package/dist/util/task-model-diagnostics.d.ts +67 -0
- package/dist/util/task-model-diagnostics.js +118 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.d.ts +1 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiApiKeyPool.js +2 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiConnectDialog.d.ts +1 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.d.ts +1 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiCredentialPoolSection.js +10 -10
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.d.ts +3 -1
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeyRow.js +2 -2
- package/node_modules/@undefineds.co/ai-connections/dist/AiGatewayKeysSection.js +77 -23
- package/node_modules/@undefineds.co/ai-connections/dist/AiProviderCard.d.ts +1 -0
- package/node_modules/@undefineds.co/ai-connections/dist/AiSortableCredentialList.js +59 -59
- package/node_modules/@undefineds.co/ai-connections/dist/collection-runtime.js +2 -0
- package/node_modules/@undefineds.co/ai-connections/dist/collections.js +14 -6
- package/node_modules/@undefineds.co/ai-connections/dist/contract/ai-connections-client.d.ts +2 -1
- package/node_modules/@undefineds.co/ai-connections/dist/contract/ai-connections-client.js +1 -0
- package/node_modules/@undefineds.co/ai-connections/dist/contract/client/gateway-model-roles.d.ts +11 -0
- package/node_modules/@undefineds.co/ai-connections/dist/contract/client/gateway-model-roles.js +11 -0
- package/node_modules/@undefineds.co/ai-connections/dist/contract/client/normalize.d.ts +2 -1
- package/node_modules/@undefineds.co/ai-connections/dist/contract/client/normalize.js +12 -5
- package/node_modules/@undefineds.co/ai-connections/dist/contract/client/request.js +10 -2
- package/node_modules/@undefineds.co/ai-connections/dist/contract/client/types.d.ts +10 -0
- package/node_modules/@undefineds.co/ai-connections/package.json +1 -1
- package/node_modules/@undefineds.co/extension-sdk/dist/web.d.ts +1 -0
- package/node_modules/@undefineds.co/extension-sdk/package.json +1 -1
- package/node_modules/@undefineds.co/pod-collections/dist/index.cjs +60 -13
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.d.ts +16 -1
- package/node_modules/@undefineds.co/pod-collections/dist/mapping.js +51 -0
- package/node_modules/@undefineds.co/pod-collections/dist/mutations.js +14 -18
- package/node_modules/@undefineds.co/pod-collections/package.json +1 -1
- package/node_modules/@undefineds.co/shared-ui/dist/list.d.ts +8 -1
- package/node_modules/@undefineds.co/shared-ui/dist/list.js +4 -1
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/IdpChrome.d.ts +1 -1
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/IdpChrome.js +2 -2
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/IdpViews.js +2 -2
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/PodSignInFrame.d.ts +3 -3
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/PodSignInFrame.js +5 -5
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/parts.d.ts +5 -5
- package/node_modules/@undefineds.co/shared-ui/dist/pod-sign-in/parts.js +5 -5
- package/node_modules/@undefineds.co/shared-ui/dist/section-header.js +1 -1
- package/node_modules/@undefineds.co/shared-ui/dist/theme.css +5 -32
- package/node_modules/@undefineds.co/shared-ui/package.json +1 -1
- package/node_modules/@undefineds.co/solid-sdk/package.json +1 -1
- package/package.json +2 -2
- package/static/app/assets/main.css +1 -1
- package/static/app/assets/main.js +1 -1
- package/static/dashboard/assets/AccountAuthBoundary-Dv52SZc6.js +1 -0
- package/static/dashboard/assets/DesktopOidcCallback-DaT_Rumf.js +1 -0
- package/static/dashboard/assets/DevicePages-HjclpIVm.js +2 -0
- package/static/dashboard/assets/ModelsPage-Be2TPd-x.js +11 -0
- package/static/dashboard/assets/{PaneListHeader-Dn5O0mwy.js → PaneListHeader-DtvnRmFq.js} +1 -1
- package/static/dashboard/assets/{PodDeletionAuthorizationPanel-D3NOG6ZM.js → PodDeletionAuthorizationPanel-BJk_8rJq.js} +3 -3
- package/static/dashboard/assets/PodPage-C4gzEspV.js +1 -0
- package/static/dashboard/assets/{SystemSettingsPage-BNQP_Yuc.js → SystemSettingsPage-HaNrP1H1.js} +1 -1
- package/static/dashboard/assets/TasksPage-BdO5K2L7.js +1 -0
- package/static/dashboard/assets/{WebDesktopEntry-vnb4CZWp.js → WebDesktopEntry-Cj9_ZfJU.js} +1 -1
- package/static/dashboard/assets/XpodAiConnectionsPodStore-B7gmXBmC.js +3 -0
- package/static/dashboard/assets/XpodShellApp-D_KY4nCW.js +4 -0
- package/static/dashboard/assets/{account-session-DCUmCop1.js → account-session-DlcKNG7k.js} +1 -1
- package/static/dashboard/assets/{button-By5Bgvmb.js → button-wslF55uZ.js} +1 -1
- package/static/dashboard/assets/collection-runtime-uxxgEu13.js +1 -0
- package/static/dashboard/assets/{createLucideIcon-bunMzPms.js → createLucideIcon-BJQl82Qk.js} +1 -1
- package/static/dashboard/assets/dashboard-CbJ-JkrI.css +1 -0
- package/static/dashboard/assets/{dashboard-mlsg3yaw.js → dashboard-Or0gnkou.js} +2 -2
- package/static/dashboard/assets/index-BqFeOML9.js +1 -0
- package/static/dashboard/assets/{index-DvMG5pHk.js → index-DgKn1twH.js} +2 -2
- package/static/dashboard/assets/{label-Bj03L9xs.js → label-CS6Sx6Zb.js} +1 -1
- package/static/dashboard/assets/list-UyhlCFKk.js +1 -0
- package/static/dashboard/assets/{nav-item-style-BNqWQY6p.js → nav-item-style-CW1Nnorq.js} +1 -1
- package/static/dashboard/assets/{pod-collections-host-KnnGFZHL.js → pod-collections-host-DjK2xf-b.js} +6 -6
- package/static/dashboard/assets/{safe-continuation-D9AhcWiB.js → safe-continuation-ClWAhcma.js} +1 -1
- package/static/dashboard/assets/{section-header-CLCzbOp_.js → section-header-CEIEcco-.js} +1 -1
- package/static/dashboard/assets/{setting-row-DTCec8A2.js → setting-row-CaYv3dfF.js} +1 -1
- package/static/dashboard/assets/xpod-remembered-login-BUF9fin1.js +310 -0
- package/static/dashboard/dashboard.html +2 -2
- package/static/settings/assets/{AccountAuthBoundary-C0og_gIA.js → AccountAuthBoundary-Chqd38oU.js} +1 -1
- package/static/settings/assets/{DesktopOidcCallback-C5q4oFZ0.js → DesktopOidcCallback-VUrOSM_q.js} +1 -1
- package/static/settings/assets/DevicePages-C6qwvWwu.js +2 -0
- package/static/settings/assets/ModelsPage-Ry_dObRQ.js +11 -0
- package/static/settings/assets/{PaneListHeader-DqVlMe2D.js → PaneListHeader-B5RkRqr4.js} +1 -1
- package/static/settings/assets/{PodDeletionAuthorizationPanel-DgVvarVY.js → PodDeletionAuthorizationPanel-DPM-5Izt.js} +3 -3
- package/static/settings/assets/PodPage-CxND6wwc.js +1 -0
- package/static/settings/assets/{SystemSettingsPage-Crzm_DrI.js → SystemSettingsPage-C8EdMkW7.js} +1 -1
- package/static/settings/assets/TasksPage-DuqptEm8.js +1 -0
- package/static/settings/assets/{WebDesktopEntry-BGC5eRF2.js → WebDesktopEntry-BRcyktkv.js} +1 -1
- package/static/settings/assets/XpodAiConnectionsPodStore-CyA_BJVC.js +3 -0
- package/static/settings/assets/XpodShellApp-CsivHJl0.js +4 -0
- package/static/settings/assets/XpodThemeProvider-CbJ-JkrI.css +1 -0
- package/static/settings/assets/{XpodThemeProvider-CB6LepTA.js → XpodThemeProvider-DK3pIdRG.js} +2 -2
- package/static/settings/assets/{account-session-BcLjCj0x.js → account-session-DJOZ03xr.js} +1 -1
- package/static/settings/assets/auth-callback-GIBYEz_7.js +1 -0
- package/static/settings/assets/{button-BObT8pTE.js → button-D3yW-2o1.js} +1 -1
- package/static/settings/assets/collection-runtime-DfGo25mh.js +1 -0
- package/static/settings/assets/{createLucideIcon-BVsUxXpZ.js → createLucideIcon-CacwLsmB.js} +1 -1
- package/static/settings/assets/{index-ktjMkj7-.js → index-r5KRYsKC.js} +1 -1
- package/static/settings/assets/{label-BrqO8_m_.js → label-MJjUmvzG.js} +1 -1
- package/static/settings/assets/list-Ce-5k1MX.js +1 -0
- package/static/settings/assets/{nav-item-style-Di2CxkDU.js → nav-item-style-ZUbL8KOZ.js} +1 -1
- package/static/settings/assets/{pod-collections-host-KnnGFZHL.js → pod-collections-host-DjK2xf-b.js} +6 -6
- package/static/settings/assets/{safe-continuation-Dx6ceJpY.js → safe-continuation-vlBZFSlU.js} +1 -1
- package/static/settings/assets/{section-header-Dtl7yjVr.js → section-header-DGJdEvQw.js} +1 -1
- package/static/settings/assets/{setting-row-BL6Hhe8N.js → setting-row-C7tuFiho.js} +1 -1
- package/static/settings/assets/{settings-DaRBxoZk.js → settings-CyQPih1O.js} +1 -1
- package/static/settings/assets/xpod-remembered-login-D-TzzT5K.js +567 -0
- package/static/settings/auth-callback.html +3 -3
- package/static/settings/settings.html +3 -3
- package/static/dashboard/assets/AccountAuthBoundary-BvoDydRz.js +0 -1
- package/static/dashboard/assets/DesktopOidcCallback-BwIj874x.js +0 -1
- package/static/dashboard/assets/DevicePages-jOjMcvsr.js +0 -2
- package/static/dashboard/assets/ModelsPage-CMTdfqBR.js +0 -11
- package/static/dashboard/assets/PodPage-BueBdJ9_.js +0 -1
- package/static/dashboard/assets/TasksPage-CxtLJiSF.js +0 -1
- package/static/dashboard/assets/XpodAiConnectionsPodStore-wx3Ttupm.js +0 -18
- package/static/dashboard/assets/XpodShellApp-5FWY8-d5.js +0 -4
- package/static/dashboard/assets/collection-runtime-BnomuB0E.js +0 -1
- package/static/dashboard/assets/dashboard-C64R553B.css +0 -1
- package/static/dashboard/assets/xpod-remembered-login-Dr69A0Rv.js +0 -295
- package/static/settings/assets/DevicePages-fyHjjucT.js +0 -2
- package/static/settings/assets/ModelsPage-EyOByLyE.js +0 -11
- package/static/settings/assets/PodPage-DY4Oi9wg.js +0 -1
- package/static/settings/assets/TasksPage-CfXJbnlt.js +0 -1
- package/static/settings/assets/XpodAiConnectionsPodStore-CXcmgKmQ.js +0 -3
- package/static/settings/assets/XpodShellApp-D1PS3Iut.js +0 -4
- package/static/settings/assets/XpodThemeProvider-C64R553B.css +0 -1
- package/static/settings/assets/auth-callback-DSPQ28ar.js +0 -1
- package/static/settings/assets/collection-runtime-DzNbdZGe.js +0 -1
- package/static/settings/assets/index-browser-3WfrNbcG.js +0 -273
- package/static/settings/assets/xpod-remembered-login-Q66DH12t.js +0 -295
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./dashboard-
|
|
1
|
+
import{j as t}from"./dashboard-Or0gnkou.js";function s({title:e}){return t.jsx("div",{className:"flex h-full items-center px-4 text-sm font-semibold text-foreground",children:e})}export{s as P};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AccountAuthBoundary-
|
|
2
|
-
import{c as cn,r as o,j as u,R as ye,b as be,O as He,d as un,_ as rt}from"./dashboard-mlsg3yaw.js";import{b as ot,c as T,u as se,i as ln,B as te,d as dn}from"./button-By5Bgvmb.js";var at=cn(),fn=Object.defineProperty,k=(e,t)=>fn(e,"name",{value:t,configurable:!0});function mn(e,t){const n=o.createContext(t);n.displayName=e+"Context";const r=k(s=>{const{children:i,...c}=s,l=o.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:l,children:i})},"Provider");r.displayName=e+"Provider";function a(s,i={}){const{optional:c=!1}=i,l=o.useContext(n);if(l)return l;if(t!==void 0)return t;if(!c)throw new Error(`\`${s}\` must be used within \`${e}\``)}return k(a,"useContext"),[r,a]}k(mn,"createContext");function st(e,t=[]){let n=[];function r(s,i){const c=o.createContext(i);c.displayName=s+"Context";const l=n.length;n=[...n,i];const h=k(d=>{const{scope:f,children:y,...g}=d,v=f?.[e]?.[l]||c,m=o.useMemo(()=>g,Object.values(g));return u.jsx(v.Provider,{value:m,children:y})},"Provider");h.displayName=s+"Provider";function p(d,f,y={}){const{optional:g=!1}=y,v=f?.[e]?.[l]||c,m=o.useContext(v);if(m)return m;if(i!==void 0)return i;if(!g)throw new Error(`\`${d}\` must be used within \`${s}\``)}return k(p,"useContext"),[h,p]}k(r,"createContext");const a=k(()=>{const s=n.map(i=>o.createContext(i));return k(function(c){const l=c?.[e]||s;return o.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])},"useScope")},"createScope");return a.scopeName=e,[r,it(a,...t)]}k(st,"createContextScope");function it(...e){const t=e[0];if(e.length===1)return t;const n=k(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return k(function(s){const i=r.reduce((c,{useScope:l,scopeName:h})=>{const d=l(s)[`__scope${h}`];return{...c,...d}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}k(it,"composeContextScopes");var pn=Object.defineProperty,vn=(e,t)=>pn(e,"name",{value:t,configurable:!0});function re(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...n)=>t.current?.(...n)),[])}vn(re,"useCallbackRef");var G=globalThis?.document?o.useLayoutEffect:()=>{},hn=Object.defineProperty,gn=(e,t)=>hn(e,"name",{value:t,configurable:!0}),yn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K=yn.reduce((e,t)=>{const n=ot(`Primitive.${t}`),r=o.forwardRef((a,s)=>{const{asChild:i,...c}=a,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ct(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}gn(ct,"dispatchDiscreteCustomEvent");const ut=o.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:T("rounded-2xl border border-border/50 bg-card shadow-lg shadow-black/5 transition-all duration-200",e),...t}));ut.displayName="Card";const lt=o.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:T("flex flex-col gap-1 p-6",e),...t}));lt.displayName="CardHeader";const dt=o.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:T("text-2xl font-semibold tracking-tight",e),...t}));dt.displayName="CardTitle";const ft=o.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:T("text-sm text-muted-foreground",e),...t}));ft.displayName="CardDescription";const mt=o.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:T("p-6 pt-0",e),...t}));mt.displayName="CardContent";const bn=o.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:T("flex items-center p-6 pt-0",e),...t}));bn.displayName="CardFooter";const En=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Ve=e=>{const t=Cn(e);return t.charAt(0).toUpperCase()+t.slice(1)},pt=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),wn=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var xn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Pn=o.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:i,...c},l)=>o.createElement("svg",{ref:l,...xn,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:pt("lucide",a),...!s&&!wn(c)&&{"aria-hidden":"true"},...c},[...i.map(([h,p])=>o.createElement(h,p)),...Array.isArray(s)?s:[s]]));const Dn=(e,t)=>{const n=o.forwardRef(({className:r,...a},s)=>o.createElement(Pn,{ref:s,iconNode:t,className:pt(`lucide-${En(Ve(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Ve(e),n};const Sn=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Rn=Dn("x",Sn);var On=Object.defineProperty,oe=(e,t)=>On(e,"name",{value:t,configurable:!0}),vt=!!(typeof window<"u"&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return oe(function(a){if(e?.(a),n===!1||!a||!a.defaultPrevented)return t?.(a)},"handleEvent")}oe(B,"composeEventHandlers");function Nn(e){if(!vt)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}oe(Nn,"getOwnerWindow");function Oe(e){if(!vt)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}oe(Oe,"getOwnerDocument");function ht(e,t=!1){const{activeElement:n}=Oe(e);if(!n?.nodeName)return null;if(gt(n)&&n.contentDocument)return ht(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=Oe(n).getElementById(r);if(a)return a}}return n}oe(ht,"getActiveElement");function gt(e){return e.tagName==="IFRAME"}oe(gt,"isFrame");var _n=Object.defineProperty,R=(e,t)=>_n(e,"name",{value:t,configurable:!0}),Ne="dismissableLayer.update",An="dismissableLayer.pointerDownOutside",Tn="dismissableLayer.focusOutside",Xe,yt=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),In=o.forwardRef(R(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:l,onDismiss:h,...p}=t,d=o.useContext(yt),[f,y]=o.useState(null),g=f?.ownerDocument??globalThis?.document,[,v]=o.useState({}),m=se(n,y),E=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=C?E.indexOf(C):-1,P=f?E.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,D=P>=w,N=o.useRef(!1),H=Et(b=>{i?.(b),l?.(b),b.defaultPrevented||h?.()},{ownerDocument:g,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(b=>{if(!(b instanceof Node))return!1;const S=[...d.branches].some(O=>O.contains(b));return D&&!S},[d.branches,D])}),V=Ct(b=>{if(a&&N.current)return;const S=b.target;[...d.branches].some(j=>j.contains(S))||(c?.(b),l?.(b),b.defaultPrevented||h?.())},g),q=f?P===E.length-1:!1,M=re(b=>{b.key==="Escape"&&(s?.(b),!b.defaultPrevented&&h&&(b.preventDefault(),h()))});return o.useEffect(()=>{if(q)return g.addEventListener("keydown",M,{capture:!0}),()=>g.removeEventListener("keydown",M,{capture:!0})},[g,q,M]),o.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Xe=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),_e(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Xe))}},[f,g,r,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),_e())},[f,d]),o.useEffect(()=>{const b=R(()=>v({}),"handleUpdate");return document.addEventListener(Ne,b),()=>document.removeEventListener(Ne,b)},[]),u.jsx(K.div,{...p,ref:m,style:{pointerEvents:x?D?"auto":"none":void 0,...t.style},onFocusCapture:B(t.onFocusCapture,V.onFocusCapture),onBlurCapture:B(t.onBlurCapture,V.onBlurCapture),onPointerDownCapture:B(t.onPointerDownCapture,H.onPointerDownCapture)})},"DismissableLayer"));function bt(){const e=o.useContext(yt),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}R(bt,"useDismissableLayerSurface");var jn=R(()=>!0,"IS_TRUE");function Et(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=jn}=t,c=re(e),l=o.useRef(!1),h=o.useRef(!1),p=o.useRef(new Map),d=o.useRef(()=>{});return o.useEffect(()=>{function f(){h.current=!1,a.current=!1,p.current.clear()}R(f,"resetOutsideInteraction");function y(){return Array.from(p.current.values()).some(Boolean)}R(y,"isOutsideInteractionIntercepted");function g(w){if(!h.current)return;const P=w.target;P instanceof Node&&[...s].some(D=>D.contains(P))||p.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{h.current&&d.current()},0)}R(g,"handleInteractionCapture");function v(w){h.current&&p.current.set(w.type,!1)}R(v,"handleInteractionBubble");const m=R(w=>{if(w.target&&!l.current){let P=function(){n.removeEventListener("click",d.current);const D=y();f(),D||Me(An,c,x,{discrete:!0})};if(R(P,"handleAndDispatchPointerDownOutsideEvent"),!i(w.target)){n.removeEventListener("click",d.current),f(),l.current=!1;return}const x={originalEvent:w};h.current=!0,a.current=r&&w.button===0,p.current.clear(),!r||w.button!==0?P():(n.removeEventListener("click",d.current),d.current=P,n.addEventListener("click",d.current,{once:!0}))}else n.removeEventListener("click",d.current),f();l.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of E)n.addEventListener(w,g,!0),n.addEventListener(w,v);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",m),n.removeEventListener("click",d.current);for(const w of E)n.removeEventListener(w,g,!0),n.removeEventListener(w,v)}},[n,c,r,a,s,i]),{onPointerDownCapture:R(()=>l.current=!0,"onPointerDownCapture")}}R(Et,"usePointerDownOutside");function Ct(e,t=globalThis?.document){const n=re(e),r=o.useRef(!1);return o.useEffect(()=>{const a=R(s=>{s.target&&!r.current&&Me(Tn,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:R(()=>r.current=!0,"onFocusCapture"),onBlurCapture:R(()=>r.current=!1,"onBlurCapture")}}R(Ct,"useFocusOutside");function _e(){const e=new CustomEvent(Ne);document.dispatchEvent(e)}R(_e,"dispatchUpdate");function Me(e,t,n,{discrete:r}){const a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?ct(a,s):a.dispatchEvent(s)}R(Me,"handleAndDispatchCustomEvent");var Ln=Object.defineProperty,kn=(e,t)=>Ln(e,"name",{value:t,configurable:!0}),Mn=ye[" useId ".trim().toString()]||(()=>{}),Fn=0;function ve(e){const[t,n]=o.useState(Mn());return G(()=>{e||n(r=>r??String(Fn++))},[e]),e||(t?`radix-${t}`:"")}kn(ve,"useId");var Un=Object.defineProperty,$n=(e,t)=>Un(e,"name",{value:t,configurable:!0}),Wn=o.forwardRef($n(function(t,n){const{container:r,...a}=t,[s,i]=o.useState(!1);G(()=>i(!0),[]);const c=r||s&&globalThis?.document?.body;return c?at.createPortal(u.jsx(K.div,{...a,ref:n}),c):null},"Portal")),Bn=Object.defineProperty,z=(e,t)=>Bn(e,"name",{value:t,configurable:!0});function wt(e,t){return o.useReducer((n,r)=>t[n][r]??n,e)}z(wt,"useStateMachine");var Fe=z(e=>{const{present:t,children:n}=e,r=xt(t),a=typeof n=="function"?n({present:r.isPresent}):o.Children.only(n),s=Pt(r.ref,Dt(a));return typeof n=="function"||r.isPresent?o.cloneElement(a,{ref:s}):null},"Presence");function xt(e){const[t,n]=o.useState(),r=o.useRef(null),a=o.useRef(e),s=o.useRef("none"),i=o.useRef(void 0),c=e?"mounted":"unmounted",[l,h]=wt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{l==="mounted"?(s.current=i.current??ee(r.current),i.current=void 0):s.current="none"},[l]),G(()=>{const p=r.current,d=a.current;if(d!==e){const y=s.current,g=ee(p);e?(i.current=g,h("MOUNT")):g==="none"||p?.display==="none"?h("UNMOUNT"):h(d&&y!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),G(()=>{if(t){let p;const d=t.ownerDocument.defaultView??window,f=z(g=>{const m=ee(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&m&&(h("ANIMATION_END"),!a.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",p=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},"handleAnimationEnd"),y=z(g=>{g.target===t&&(s.current=ee(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(p),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:o.useCallback(p=>{if(p){const d=getComputedStyle(p);r.current=d,i.current=ee(d)}else r.current=null;n(p)},[])}}z(xt,"usePresence");function Ae(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}z(Ae,"setRef");function Pt(...e){const t=o.useRef(e);return t.current=e,o.useCallback(n=>{const r=t.current;let a=!1;const s=r.map(i=>{const c=Ae(i,n);return!a&&typeof c=="function"&&(a=!0),c});if(a)return()=>{for(let i=0;i<s.length;i++){const c=s[i];typeof c=="function"?c():Ae(r[i],null)}}},[])}z(Pt,"useStableComposedRefs");function ee(e){return e?.animationName||"none"}z(ee,"getAnimationName");function Dt(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)}z(Dt,"getElementRef");var zn=Object.defineProperty,Hn=(e,t)=>zn(e,"name",{value:t,configurable:!0}),Ge=ye[" useEffectEvent ".trim().toString()],Ke=ye[" useInsertionEffect ".trim().toString()];function St(e){if(typeof Ge=="function")return Ge(e);const t=o.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ke=="function"?Ke(()=>{t.current=e}):G(()=>{t.current=e}),o.useMemo(()=>((...n)=>t.current?.(...n)),[])}Hn(St,"useEffectEvent");var Vn=Object.defineProperty,ie=(e,t)=>Vn(e,"name",{value:t,configurable:!0}),Xn=ye[" useInsertionEffect ".trim().toString()]||G;function Rt({prop:e,defaultProp:t,onChange:n=ie(()=>{},"onChange"),caller:r}){const[a,s,i]=Ot({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:a,h=o.useCallback(p=>{if(c){const d=Nt(p)?p(e):p;d!==e&&i.current?.(d)}else s(p)},[c,e,s,i]);return[l,h]}ie(Rt,"useControllableState");function Ot({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),a=o.useRef(n),s=o.useRef(t);return Xn(()=>{s.current=t},[t]),o.useEffect(()=>{a.current!==n&&(s.current?.(n),a.current=n)},[n,a]),[n,r,s]}ie(Ot,"useUncontrolledState");function Nt(e){return typeof e=="function"}ie(Nt,"isFunction");var qe=Symbol("RADIX:SYNC_STATE");function Gn(e,t,n,r){const{prop:a,defaultProp:s,onChange:i,caller:c}=t,l=a!==void 0,h=St(i),p=[{...n,state:s}];r&&p.push(r);const[d,f]=o.useReducer((m,E)=>{if(E.type===qe)return{...m,state:E.state};const C=e(m,E);return l&&!Object.is(C.state,m.state)&&h(C.state),C},...p),y=d.state,g=o.useRef(y);o.useEffect(()=>{g.current!==y&&(g.current=y,l||h(y))},[y,g,l]);const v=o.useMemo(()=>a!==void 0?{...d,state:a}:d,[d,a]);return o.useEffect(()=>{l&&!Object.is(a,d.state)&&f({type:qe,state:a})},[a,d.state,l]),[v,f]}ie(Gn,"useControllableStateReducer");var Kn=Object.defineProperty,A=(e,t)=>Kn(e,"name",{value:t,configurable:!0}),we="focusScope.autoFocusOnMount",xe="focusScope.autoFocusOnUnmount",Ye={bubbles:!1,cancelable:!0},qn=o.forwardRef(A(function(t,n){const{loop:r=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=t,[l,h]=o.useState(null),p=re(s),d=re(i),f=o.useRef(null),y=se(n,h),g=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(a){let m=function(P){if(g.paused||!l)return;const x=P.target;l.contains(x)?f.current=x:W(f.current,{select:!0})},E=function(P){if(g.paused||!l)return;const x=P.relatedTarget;x!==null&&(l.contains(x)||W(f.current,{select:!0}))},C=function(P){if(document.activeElement===document.body)for(const D of P)D.removedNodes.length>0&&W(l)};A(m,"handleFocusIn"),A(E,"handleFocusOut"),A(C,"handleMutations"),document.addEventListener("focusin",m),document.addEventListener("focusout",E);const w=new MutationObserver(C);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",E),w.disconnect()}}},[a,l,g.paused]),o.useEffect(()=>{if(l){Ze.add(g);const m=document.activeElement;if(!l.contains(m)){const C=new CustomEvent(we,Ye);l.addEventListener(we,p),l.dispatchEvent(C),C.defaultPrevented||(_t(Lt(Ue(l)),{select:!0}),document.activeElement===m&&W(l))}return()=>{l.removeEventListener(we,p),setTimeout(()=>{const C=new CustomEvent(xe,Ye);l.addEventListener(xe,d),l.dispatchEvent(C),C.defaultPrevented||W(m??document.body,{select:!0}),l.removeEventListener(xe,d),Ze.remove(g)},0)}}},[l,p,d,g]);const v=o.useCallback(m=>{if(!r&&!a||g.paused)return;const E=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,C=document.activeElement;if(E&&C){const w=m.currentTarget,[P,x]=At(w);P&&x?!m.shiftKey&&C===x?(m.preventDefault(),r&&W(P,{select:!0})):m.shiftKey&&C===P&&(m.preventDefault(),r&&W(x,{select:!0})):C===w&&m.preventDefault()}},[r,a,g.paused]);return u.jsx(K.div,{tabIndex:-1,...c,ref:y,onKeyDown:v})},"FocusScope"));function _t(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(W(r,{select:t}),document.activeElement!==n)return}A(_t,"focusFirst");function At(e){const t=Ue(e),n=Te(t,e),r=Te(t.reverse(),e);return[n,r]}A(At,"getTabbableEdges");function Ue(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:A(r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}A(Ue,"getTabbableCandidates");function Te(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Tt(r,{upTo:t})))return r}A(Te,"findVisible");function Tt(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}A(Tt,"isHidden");function It(e){return e instanceof HTMLInputElement&&"select"in e}A(It,"isSelectableInput");function W(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&It(e)&&t&&e.select()}}A(W,"focus");var Ze=jt();function jt(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ie(e,t),e.unshift(t)},remove(t){e=Ie(e,t),e[0]?.resume()}}}A(jt,"createFocusScopesStack");function Ie(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}A(Ie,"arrayRemove");function Lt(e){return e.filter(t=>t.tagName!=="A")}A(Lt,"removeLinks");var Yn=Object.defineProperty,$e=(e,t)=>Yn(e,"name",{value:t,configurable:!0}),ue=0,Y=null;function Zn(e){return We(),e.children}$e(Zn,"FocusGuards");function We(){o.useEffect(()=>{Y||(Y={start:je(),end:je()});const{start:e,end:t}=Y;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ue++,()=>{ue===1&&(Y?.start.remove(),Y?.end.remove(),Y=null),ue=Math.max(0,ue-1)}},[])}$e(We,"useFocusGuards");function je(){const 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}$e(je,"createFocusGuard");var U=function(){return U=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},U.apply(this,arguments)};function kt(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function Qn(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,s;r<a;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var he="right-scroll-bar-position",ge="width-before-scroll-bar",Jn="with-scroll-bars-hidden",er="--removed-body-scroll-bar-size";function Pe(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tr(e,t){var n=o.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var nr=typeof window<"u"?o.useLayoutEffect:o.useEffect,Qe=new WeakMap;function rr(e,t){var n=tr(null,function(r){return e.forEach(function(a){return Pe(a,r)})});return nr(function(){var r=Qe.get(n);if(r){var a=new Set(r),s=new Set(e),i=n.current;a.forEach(function(c){s.has(c)||Pe(c,null)}),s.forEach(function(c){a.has(c)||Pe(c,i)})}Qe.set(n,e)},[e]),n}function or(e){return e}function ar(e,t){t===void 0&&(t=or);var n=[],r=!1,a={read:function(){if(r)throw new 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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var l=function(){var p=i;i=[],p.forEach(s)},h=function(){return Promise.resolve().then(l)};h(),n={push:function(p){i.push(p),h()},filter:function(p){return i=i.filter(p),n}}}};return a}function sr(e){e===void 0&&(e={});var t=ar(null);return t.options=U({async:!0,ssr:!1},e),t}var Mt=function(e){var t=e.sideCar,n=kt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return o.createElement(r,U({},n))};Mt.isSideCarExport=!0;function ir(e,t){return e.useMedium(t),Mt}var Ft=sr(),De=function(){},Ee=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:De,onWheelCapture:De,onTouchMoveCapture:De}),a=r[0],s=r[1],i=e.forwardProps,c=e.children,l=e.className,h=e.removeScrollBar,p=e.enabled,d=e.shards,f=e.sideCar,y=e.noRelative,g=e.noIsolation,v=e.inert,m=e.allowPinchZoom,E=e.as,C=E===void 0?"div":E,w=e.gapMode,P=kt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=f,D=rr([n,t]),N=U(U({},P),a);return o.createElement(o.Fragment,null,p&&o.createElement(x,{sideCar:Ft,removeScrollBar:h,shards:d,noRelative:y,noIsolation:g,inert:v,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:w}),i?o.cloneElement(o.Children.only(c),U(U({},N),{ref:D})):o.createElement(C,U({},N,{className:l,ref:D}),c))});Ee.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ee.classNames={fullWidth:ge,zeroRight:he};var cr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ur(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cr();return t&&e.setAttribute("nonce",t),e}function lr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dr(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ur())&&(lr(t,n),dr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mr=function(){var e=fr();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ut=function(){var e=mr(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},pr={left:0,top:0,right:0,gap:0},Se=function(e){return parseInt(e||"",10)||0},vr=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Se(n),Se(r),Se(a)]},hr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pr;var t=vr(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])}},gr=Ut(),ne="data-scroll-locked",yr=function(e,t,n,r){var a=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AccountAuthBoundary-Dv52SZc6.js","assets/dashboard-Or0gnkou.js","assets/dashboard-CbJ-JkrI.css","assets/button-wslF55uZ.js","assets/account-session-DlcKNG7k.js","assets/xpod-remembered-login-BUF9fin1.js","assets/createLucideIcon-BJQl82Qk.js","assets/label-CS6Sx6Zb.js","assets/SystemSettingsPage-HaNrP1H1.js","assets/nav-item-style-CW1Nnorq.js","assets/PaneListHeader-DtvnRmFq.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as cn,r as o,j as u,R as ye,b as be,O as He,d as un,_ as rt}from"./dashboard-Or0gnkou.js";import{b as ot,c as T,u as se,i as ln,B as te,d as dn}from"./button-wslF55uZ.js";var at=cn(),fn=Object.defineProperty,k=(e,t)=>fn(e,"name",{value:t,configurable:!0});function mn(e,t){const n=o.createContext(t);n.displayName=e+"Context";const r=k(s=>{const{children:i,...c}=s,l=o.useMemo(()=>c,Object.values(c));return u.jsx(n.Provider,{value:l,children:i})},"Provider");r.displayName=e+"Provider";function a(s,i={}){const{optional:c=!1}=i,l=o.useContext(n);if(l)return l;if(t!==void 0)return t;if(!c)throw new Error(`\`${s}\` must be used within \`${e}\``)}return k(a,"useContext"),[r,a]}k(mn,"createContext");function st(e,t=[]){let n=[];function r(s,i){const c=o.createContext(i);c.displayName=s+"Context";const l=n.length;n=[...n,i];const h=k(d=>{const{scope:f,children:y,...g}=d,v=f?.[e]?.[l]||c,m=o.useMemo(()=>g,Object.values(g));return u.jsx(v.Provider,{value:m,children:y})},"Provider");h.displayName=s+"Provider";function p(d,f,y={}){const{optional:g=!1}=y,v=f?.[e]?.[l]||c,m=o.useContext(v);if(m)return m;if(i!==void 0)return i;if(!g)throw new Error(`\`${d}\` must be used within \`${s}\``)}return k(p,"useContext"),[h,p]}k(r,"createContext");const a=k(()=>{const s=n.map(i=>o.createContext(i));return k(function(c){const l=c?.[e]||s;return o.useMemo(()=>({[`__scope${e}`]:{...c,[e]:l}}),[c,l])},"useScope")},"createScope");return a.scopeName=e,[r,it(a,...t)]}k(st,"createContextScope");function it(...e){const t=e[0];if(e.length===1)return t;const n=k(()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return k(function(s){const i=r.reduce((c,{useScope:l,scopeName:h})=>{const d=l(s)[`__scope${h}`];return{...c,...d}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}k(it,"composeContextScopes");var pn=Object.defineProperty,vn=(e,t)=>pn(e,"name",{value:t,configurable:!0});function re(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...n)=>t.current?.(...n)),[])}vn(re,"useCallbackRef");var G=globalThis?.document?o.useLayoutEffect:()=>{},hn=Object.defineProperty,gn=(e,t)=>hn(e,"name",{value:t,configurable:!0}),yn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],K=yn.reduce((e,t)=>{const n=ot(`Primitive.${t}`),r=o.forwardRef((a,s)=>{const{asChild:i,...c}=a,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ct(e,t){e&&at.flushSync(()=>e.dispatchEvent(t))}gn(ct,"dispatchDiscreteCustomEvent");const ut=o.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:T("rounded-2xl border border-border/50 bg-card shadow-lg shadow-black/5 transition-all duration-200",e),...t}));ut.displayName="Card";const lt=o.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:T("flex flex-col gap-1 p-6",e),...t}));lt.displayName="CardHeader";const dt=o.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:T("text-2xl font-semibold tracking-tight",e),...t}));dt.displayName="CardTitle";const ft=o.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:T("text-sm text-muted-foreground",e),...t}));ft.displayName="CardDescription";const mt=o.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:T("p-6 pt-0",e),...t}));mt.displayName="CardContent";const bn=o.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:T("flex items-center p-6 pt-0",e),...t}));bn.displayName="CardFooter";const En=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cn=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Ve=e=>{const t=Cn(e);return t.charAt(0).toUpperCase()+t.slice(1)},pt=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),wn=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var xn={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Pn=o.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:s,iconNode:i,...c},l)=>o.createElement("svg",{ref:l,...xn,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:pt("lucide",a),...!s&&!wn(c)&&{"aria-hidden":"true"},...c},[...i.map(([h,p])=>o.createElement(h,p)),...Array.isArray(s)?s:[s]]));const Dn=(e,t)=>{const n=o.forwardRef(({className:r,...a},s)=>o.createElement(Pn,{ref:s,iconNode:t,className:pt(`lucide-${En(Ve(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Ve(e),n};const Sn=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Rn=Dn("x",Sn);var On=Object.defineProperty,oe=(e,t)=>On(e,"name",{value:t,configurable:!0}),vt=!!(typeof window<"u"&&window.document&&window.document.createElement);function B(e,t,{checkForDefaultPrevented:n=!0}={}){return oe(function(a){if(e?.(a),n===!1||!a||!a.defaultPrevented)return t?.(a)},"handleEvent")}oe(B,"composeEventHandlers");function Nn(e){if(!vt)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}oe(Nn,"getOwnerWindow");function Oe(e){if(!vt)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}oe(Oe,"getOwnerDocument");function ht(e,t=!1){const{activeElement:n}=Oe(e);if(!n?.nodeName)return null;if(gt(n)&&n.contentDocument)return ht(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const a=Oe(n).getElementById(r);if(a)return a}}return n}oe(ht,"getActiveElement");function gt(e){return e.tagName==="IFRAME"}oe(gt,"isFrame");var _n=Object.defineProperty,R=(e,t)=>_n(e,"name",{value:t,configurable:!0}),Ne="dismissableLayer.update",An="dismissableLayer.pointerDownOutside",Tn="dismissableLayer.focusOutside",Xe,yt=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),In=o.forwardRef(R(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:a=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:l,onDismiss:h,...p}=t,d=o.useContext(yt),[f,y]=o.useState(null),g=f?.ownerDocument??globalThis?.document,[,v]=o.useState({}),m=se(n,y),E=Array.from(d.layers),[C]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=C?E.indexOf(C):-1,P=f?E.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,D=P>=w,N=o.useRef(!1),H=Et(b=>{i?.(b),l?.(b),b.defaultPrevented||h?.()},{ownerDocument:g,deferPointerDownOutside:a,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(b=>{if(!(b instanceof Node))return!1;const S=[...d.branches].some(O=>O.contains(b));return D&&!S},[d.branches,D])}),V=Ct(b=>{if(a&&N.current)return;const S=b.target;[...d.branches].some(j=>j.contains(S))||(c?.(b),l?.(b),b.defaultPrevented||h?.())},g),q=f?P===E.length-1:!1,M=re(b=>{b.key==="Escape"&&(s?.(b),!b.defaultPrevented&&h&&(b.preventDefault(),h()))});return o.useEffect(()=>{if(q)return g.addEventListener("keydown",M,{capture:!0}),()=>g.removeEventListener("keydown",M,{capture:!0})},[g,q,M]),o.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Xe=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),_e(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=Xe))}},[f,g,r,d]),o.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),_e())},[f,d]),o.useEffect(()=>{const b=R(()=>v({}),"handleUpdate");return document.addEventListener(Ne,b),()=>document.removeEventListener(Ne,b)},[]),u.jsx(K.div,{...p,ref:m,style:{pointerEvents:x?D?"auto":"none":void 0,...t.style},onFocusCapture:B(t.onFocusCapture,V.onFocusCapture),onBlurCapture:B(t.onBlurCapture,V.onBlurCapture),onPointerDownCapture:B(t.onPointerDownCapture,H.onPointerDownCapture)})},"DismissableLayer"));function bt(){const e=o.useContext(yt),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}R(bt,"useDismissableLayerSurface");var jn=R(()=>!0,"IS_TRUE");function Et(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=jn}=t,c=re(e),l=o.useRef(!1),h=o.useRef(!1),p=o.useRef(new Map),d=o.useRef(()=>{});return o.useEffect(()=>{function f(){h.current=!1,a.current=!1,p.current.clear()}R(f,"resetOutsideInteraction");function y(){return Array.from(p.current.values()).some(Boolean)}R(y,"isOutsideInteractionIntercepted");function g(w){if(!h.current)return;const P=w.target;P instanceof Node&&[...s].some(D=>D.contains(P))||p.current.set(w.type,!0),w.type==="click"&&window.setTimeout(()=>{h.current&&d.current()},0)}R(g,"handleInteractionCapture");function v(w){h.current&&p.current.set(w.type,!1)}R(v,"handleInteractionBubble");const m=R(w=>{if(w.target&&!l.current){let P=function(){n.removeEventListener("click",d.current);const D=y();f(),D||Me(An,c,x,{discrete:!0})};if(R(P,"handleAndDispatchPointerDownOutsideEvent"),!i(w.target)){n.removeEventListener("click",d.current),f(),l.current=!1;return}const x={originalEvent:w};h.current=!0,a.current=r&&w.button===0,p.current.clear(),!r||w.button!==0?P():(n.removeEventListener("click",d.current),d.current=P,n.addEventListener("click",d.current,{once:!0}))}else n.removeEventListener("click",d.current),f();l.current=!1},"handlePointerDown"),E=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const w of E)n.addEventListener(w,g,!0),n.addEventListener(w,v);const C=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(C),n.removeEventListener("pointerdown",m),n.removeEventListener("click",d.current);for(const w of E)n.removeEventListener(w,g,!0),n.removeEventListener(w,v)}},[n,c,r,a,s,i]),{onPointerDownCapture:R(()=>l.current=!0,"onPointerDownCapture")}}R(Et,"usePointerDownOutside");function Ct(e,t=globalThis?.document){const n=re(e),r=o.useRef(!1);return o.useEffect(()=>{const a=R(s=>{s.target&&!r.current&&Me(Tn,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:R(()=>r.current=!0,"onFocusCapture"),onBlurCapture:R(()=>r.current=!1,"onBlurCapture")}}R(Ct,"useFocusOutside");function _e(){const e=new CustomEvent(Ne);document.dispatchEvent(e)}R(_e,"dispatchUpdate");function Me(e,t,n,{discrete:r}){const a=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?ct(a,s):a.dispatchEvent(s)}R(Me,"handleAndDispatchCustomEvent");var Ln=Object.defineProperty,kn=(e,t)=>Ln(e,"name",{value:t,configurable:!0}),Mn=ye[" useId ".trim().toString()]||(()=>{}),Fn=0;function ve(e){const[t,n]=o.useState(Mn());return G(()=>{e||n(r=>r??String(Fn++))},[e]),e||(t?`radix-${t}`:"")}kn(ve,"useId");var Un=Object.defineProperty,$n=(e,t)=>Un(e,"name",{value:t,configurable:!0}),Wn=o.forwardRef($n(function(t,n){const{container:r,...a}=t,[s,i]=o.useState(!1);G(()=>i(!0),[]);const c=r||s&&globalThis?.document?.body;return c?at.createPortal(u.jsx(K.div,{...a,ref:n}),c):null},"Portal")),Bn=Object.defineProperty,z=(e,t)=>Bn(e,"name",{value:t,configurable:!0});function wt(e,t){return o.useReducer((n,r)=>t[n][r]??n,e)}z(wt,"useStateMachine");var Fe=z(e=>{const{present:t,children:n}=e,r=xt(t),a=typeof n=="function"?n({present:r.isPresent}):o.Children.only(n),s=Pt(r.ref,Dt(a));return typeof n=="function"||r.isPresent?o.cloneElement(a,{ref:s}):null},"Presence");function xt(e){const[t,n]=o.useState(),r=o.useRef(null),a=o.useRef(e),s=o.useRef("none"),i=o.useRef(void 0),c=e?"mounted":"unmounted",[l,h]=wt(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return o.useEffect(()=>{l==="mounted"?(s.current=i.current??ee(r.current),i.current=void 0):s.current="none"},[l]),G(()=>{const p=r.current,d=a.current;if(d!==e){const y=s.current,g=ee(p);e?(i.current=g,h("MOUNT")):g==="none"||p?.display==="none"?h("UNMOUNT"):h(d&&y!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,h]),G(()=>{if(t){let p;const d=t.ownerDocument.defaultView??window,f=z(g=>{const m=ee(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&m&&(h("ANIMATION_END"),!a.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",p=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},"handleAnimationEnd"),y=z(g=>{g.target===t&&(s.current=ee(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(p),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:o.useCallback(p=>{if(p){const d=getComputedStyle(p);r.current=d,i.current=ee(d)}else r.current=null;n(p)},[])}}z(xt,"usePresence");function Ae(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}z(Ae,"setRef");function Pt(...e){const t=o.useRef(e);return t.current=e,o.useCallback(n=>{const r=t.current;let a=!1;const s=r.map(i=>{const c=Ae(i,n);return!a&&typeof c=="function"&&(a=!0),c});if(a)return()=>{for(let i=0;i<s.length;i++){const c=s[i];typeof c=="function"?c():Ae(r[i],null)}}},[])}z(Pt,"useStableComposedRefs");function ee(e){return e?.animationName||"none"}z(ee,"getAnimationName");function Dt(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)}z(Dt,"getElementRef");var zn=Object.defineProperty,Hn=(e,t)=>zn(e,"name",{value:t,configurable:!0}),Ge=ye[" useEffectEvent ".trim().toString()],Ke=ye[" useInsertionEffect ".trim().toString()];function St(e){if(typeof Ge=="function")return Ge(e);const t=o.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ke=="function"?Ke(()=>{t.current=e}):G(()=>{t.current=e}),o.useMemo(()=>((...n)=>t.current?.(...n)),[])}Hn(St,"useEffectEvent");var Vn=Object.defineProperty,ie=(e,t)=>Vn(e,"name",{value:t,configurable:!0}),Xn=ye[" useInsertionEffect ".trim().toString()]||G;function Rt({prop:e,defaultProp:t,onChange:n=ie(()=>{},"onChange"),caller:r}){const[a,s,i]=Ot({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:a,h=o.useCallback(p=>{if(c){const d=Nt(p)?p(e):p;d!==e&&i.current?.(d)}else s(p)},[c,e,s,i]);return[l,h]}ie(Rt,"useControllableState");function Ot({defaultProp:e,onChange:t}){const[n,r]=o.useState(e),a=o.useRef(n),s=o.useRef(t);return Xn(()=>{s.current=t},[t]),o.useEffect(()=>{a.current!==n&&(s.current?.(n),a.current=n)},[n,a]),[n,r,s]}ie(Ot,"useUncontrolledState");function Nt(e){return typeof e=="function"}ie(Nt,"isFunction");var qe=Symbol("RADIX:SYNC_STATE");function Gn(e,t,n,r){const{prop:a,defaultProp:s,onChange:i,caller:c}=t,l=a!==void 0,h=St(i),p=[{...n,state:s}];r&&p.push(r);const[d,f]=o.useReducer((m,E)=>{if(E.type===qe)return{...m,state:E.state};const C=e(m,E);return l&&!Object.is(C.state,m.state)&&h(C.state),C},...p),y=d.state,g=o.useRef(y);o.useEffect(()=>{g.current!==y&&(g.current=y,l||h(y))},[y,g,l]);const v=o.useMemo(()=>a!==void 0?{...d,state:a}:d,[d,a]);return o.useEffect(()=>{l&&!Object.is(a,d.state)&&f({type:qe,state:a})},[a,d.state,l]),[v,f]}ie(Gn,"useControllableStateReducer");var Kn=Object.defineProperty,A=(e,t)=>Kn(e,"name",{value:t,configurable:!0}),we="focusScope.autoFocusOnMount",xe="focusScope.autoFocusOnUnmount",Ye={bubbles:!1,cancelable:!0},qn=o.forwardRef(A(function(t,n){const{loop:r=!1,trapped:a=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=t,[l,h]=o.useState(null),p=re(s),d=re(i),f=o.useRef(null),y=se(n,h),g=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(a){let m=function(P){if(g.paused||!l)return;const x=P.target;l.contains(x)?f.current=x:W(f.current,{select:!0})},E=function(P){if(g.paused||!l)return;const x=P.relatedTarget;x!==null&&(l.contains(x)||W(f.current,{select:!0}))},C=function(P){if(document.activeElement===document.body)for(const D of P)D.removedNodes.length>0&&W(l)};A(m,"handleFocusIn"),A(E,"handleFocusOut"),A(C,"handleMutations"),document.addEventListener("focusin",m),document.addEventListener("focusout",E);const w=new MutationObserver(C);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",E),w.disconnect()}}},[a,l,g.paused]),o.useEffect(()=>{if(l){Ze.add(g);const m=document.activeElement;if(!l.contains(m)){const C=new CustomEvent(we,Ye);l.addEventListener(we,p),l.dispatchEvent(C),C.defaultPrevented||(_t(Lt(Ue(l)),{select:!0}),document.activeElement===m&&W(l))}return()=>{l.removeEventListener(we,p),setTimeout(()=>{const C=new CustomEvent(xe,Ye);l.addEventListener(xe,d),l.dispatchEvent(C),C.defaultPrevented||W(m??document.body,{select:!0}),l.removeEventListener(xe,d),Ze.remove(g)},0)}}},[l,p,d,g]);const v=o.useCallback(m=>{if(!r&&!a||g.paused)return;const E=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,C=document.activeElement;if(E&&C){const w=m.currentTarget,[P,x]=At(w);P&&x?!m.shiftKey&&C===x?(m.preventDefault(),r&&W(P,{select:!0})):m.shiftKey&&C===P&&(m.preventDefault(),r&&W(x,{select:!0})):C===w&&m.preventDefault()}},[r,a,g.paused]);return u.jsx(K.div,{tabIndex:-1,...c,ref:y,onKeyDown:v})},"FocusScope"));function _t(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(W(r,{select:t}),document.activeElement!==n)return}A(_t,"focusFirst");function At(e){const t=Ue(e),n=Te(t,e),r=Te(t.reverse(),e);return[n,r]}A(At,"getTabbableEdges");function Ue(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:A(r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}A(Ue,"getTabbableCandidates");function Te(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Tt(r,{upTo:t})))return r}A(Te,"findVisible");function Tt(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}A(Tt,"isHidden");function It(e){return e instanceof HTMLInputElement&&"select"in e}A(It,"isSelectableInput");function W(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&It(e)&&t&&e.select()}}A(W,"focus");var Ze=jt();function jt(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Ie(e,t),e.unshift(t)},remove(t){e=Ie(e,t),e[0]?.resume()}}}A(jt,"createFocusScopesStack");function Ie(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}A(Ie,"arrayRemove");function Lt(e){return e.filter(t=>t.tagName!=="A")}A(Lt,"removeLinks");var Yn=Object.defineProperty,$e=(e,t)=>Yn(e,"name",{value:t,configurable:!0}),ue=0,Y=null;function Zn(e){return We(),e.children}$e(Zn,"FocusGuards");function We(){o.useEffect(()=>{Y||(Y={start:je(),end:je()});const{start:e,end:t}=Y;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),ue++,()=>{ue===1&&(Y?.start.remove(),Y?.end.remove(),Y=null),ue=Math.max(0,ue-1)}},[])}$e(We,"useFocusGuards");function je(){const 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}$e(je,"createFocusGuard");var U=function(){return U=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},U.apply(this,arguments)};function kt(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function Qn(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,s;r<a;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var he="right-scroll-bar-position",ge="width-before-scroll-bar",Jn="with-scroll-bars-hidden",er="--removed-body-scroll-bar-size";function Pe(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function tr(e,t){var n=o.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var nr=typeof window<"u"?o.useLayoutEffect:o.useEffect,Qe=new WeakMap;function rr(e,t){var n=tr(null,function(r){return e.forEach(function(a){return Pe(a,r)})});return nr(function(){var r=Qe.get(n);if(r){var a=new Set(r),s=new Set(e),i=n.current;a.forEach(function(c){s.has(c)||Pe(c,null)}),s.forEach(function(c){a.has(c)||Pe(c,i)})}Qe.set(n,e)},[e]),n}function or(e){return e}function ar(e,t){t===void 0&&(t=or);var n=[],r=!1,a={read:function(){if(r)throw new 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(s){var i=t(s,r);return n.push(i),function(){n=n.filter(function(c){return c!==i})}},assignSyncMedium:function(s){for(r=!0;n.length;){var i=n;n=[],i.forEach(s)}n={push:function(c){return s(c)},filter:function(){return n}}},assignMedium:function(s){r=!0;var i=[];if(n.length){var c=n;n=[],c.forEach(s),i=n}var l=function(){var p=i;i=[],p.forEach(s)},h=function(){return Promise.resolve().then(l)};h(),n={push:function(p){i.push(p),h()},filter:function(p){return i=i.filter(p),n}}}};return a}function sr(e){e===void 0&&(e={});var t=ar(null);return t.options=U({async:!0,ssr:!1},e),t}var Mt=function(e){var t=e.sideCar,n=kt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return o.createElement(r,U({},n))};Mt.isSideCarExport=!0;function ir(e,t){return e.useMedium(t),Mt}var Ft=sr(),De=function(){},Ee=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:De,onWheelCapture:De,onTouchMoveCapture:De}),a=r[0],s=r[1],i=e.forwardProps,c=e.children,l=e.className,h=e.removeScrollBar,p=e.enabled,d=e.shards,f=e.sideCar,y=e.noRelative,g=e.noIsolation,v=e.inert,m=e.allowPinchZoom,E=e.as,C=E===void 0?"div":E,w=e.gapMode,P=kt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=f,D=rr([n,t]),N=U(U({},P),a);return o.createElement(o.Fragment,null,p&&o.createElement(x,{sideCar:Ft,removeScrollBar:h,shards:d,noRelative:y,noIsolation:g,inert:v,setCallbacks:s,allowPinchZoom:!!m,lockRef:n,gapMode:w}),i?o.cloneElement(o.Children.only(c),U(U({},N),{ref:D})):o.createElement(C,U({},N,{className:l,ref:D}),c))});Ee.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ee.classNames={fullWidth:ge,zeroRight:he};var cr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ur(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=cr();return t&&e.setAttribute("nonce",t),e}function lr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function dr(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var fr=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ur())&&(lr(t,n),dr(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mr=function(){var e=fr();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ut=function(){var e=mr(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},pr={left:0,top:0,right:0,gap:0},Se=function(e){return parseInt(e||"",10)||0},vr=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Se(n),Se(r),Se(a)]},hr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return pr;var t=vr(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])}},gr=Ut(),ne="data-scroll-locked",yr=function(e,t,n,r){var a=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),`
|
|
3
3
|
.`.concat(Jn,` {
|
|
4
4
|
overflow: hidden `).concat(r,`;
|
|
5
5
|
padding-right: `).concat(c,"px ").concat(r,`;
|
|
@@ -39,4 +39,4 @@ import{c as cn,r as o,j as u,R as ye,b as be,O as He,d as un,_ as rt}from"./dash
|
|
|
39
39
|
`)},Je=function(){var e=parseInt(document.body.getAttribute(ne)||"0",10);return isFinite(e)?e:0},br=function(){o.useEffect(function(){return document.body.setAttribute(ne,(Je()+1).toString()),function(){var e=Je()-1;e<=0?document.body.removeAttribute(ne):document.body.setAttribute(ne,e.toString())}},[])},Er=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;br();var s=o.useMemo(function(){return hr(a)},[a]);return o.createElement(gr,{styles:yr(s,!t,a,n?"":"!important")})},Le=!1;if(typeof window<"u")try{var le=Object.defineProperty({},"passive",{get:function(){return Le=!0,!0}});window.addEventListener("test",le,le),window.removeEventListener("test",le,le)}catch{Le=!1}var Z=Le?{passive:!1}:!1,Cr=function(e){return e.tagName==="TEXTAREA"},$t=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Cr(e)&&n[t]==="visible")},wr=function(e){return $t(e,"overflowY")},xr=function(e){return $t(e,"overflowX")},et=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=Wt(e,r);if(a){var s=Bt(e,r),i=s[1],c=s[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Pr=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Dr=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Wt=function(e,t){return e==="v"?wr(t):xr(t)},Bt=function(e,t){return e==="v"?Pr(t):Dr(t)},Sr=function(e,t){return e==="h"&&t==="rtl"?-1:1},Rr=function(e,t,n,r,a){var s=Sr(e,window.getComputedStyle(t).direction),i=s*r,c=n.target,l=t.contains(c),h=!1,p=i>0,d=0,f=0;do{if(!c)break;var y=Bt(e,c),g=y[0],v=y[1],m=y[2],E=v-m-s*g;(g||E)&&Wt(e,c)&&(d+=E,f+=g);var C=c.parentNode;c=C&&C.nodeType===Node.DOCUMENT_FRAGMENT_NODE?C.host:C}while(!l&&c!==document.body||l&&(t.contains(c)||t===c));return(p&&Math.abs(d)<1||!p&&Math.abs(f)<1)&&(h=!0),h},de=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tt=function(e){return[e.deltaX,e.deltaY]},nt=function(e){return e&&"current"in e?e.current:e},Or=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Nr=function(e){return`
|
|
40
40
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
41
41
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
42
|
-
`)},_r=0,Q=[];function Ar(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),a=o.useState(_r++)[0],s=o.useState(Ut)[0],i=o.useRef(e);o.useEffect(function(){i.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Qn([e.lockRef.current],(e.shards||[]).map(nt),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(v,m){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var E=de(v),C=n.current,w="deltaX"in v?v.deltaX:C[0]-E[0],P="deltaY"in v?v.deltaY:C[1]-E[1],x,D=v.target,N=Math.abs(w)>Math.abs(P)?"h":"v";if("touches"in v&&N==="h"&&D.type==="range")return!1;var H=window.getSelection(),V=H&&H.anchorNode,q=V?V===D||V.contains(D):!1;if(q)return!1;var M=et(N,D);if(!M)return!0;if(M?x=N:(x=N==="v"?"h":"v",M=et(N,D)),!M)return!1;if(!r.current&&"changedTouches"in v&&(w||P)&&(r.current=x),!x)return!0;var b=r.current||x;return Rr(b,m,v,b==="h"?w:P)},[]),l=o.useCallback(function(v){var m=v;if(!(!Q.length||Q[Q.length-1]!==s)){var E="deltaY"in m?tt(m):de(m),C=t.current.filter(function(x){return x.name===m.type&&(x.target===m.target||m.target===x.shadowParent)&&Or(x.delta,E)})[0];if(C&&C.should){m.cancelable&&m.preventDefault();return}if(!C){var w=(i.current.shards||[]).map(nt).filter(Boolean).filter(function(x){return x.contains(m.target)}),P=w.length>0?c(m,w[0]):!i.current.noIsolation;P&&m.cancelable&&m.preventDefault()}}},[]),h=o.useCallback(function(v,m,E,C){var w={name:v,delta:m,target:E,should:C,shadowParent:Tr(E)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(P){return P!==w})},1)},[]),p=o.useCallback(function(v){n.current=de(v),r.current=void 0},[]),d=o.useCallback(function(v){h(v.type,tt(v),v.target,c(v,e.lockRef.current))},[]),f=o.useCallback(function(v){h(v.type,de(v),v.target,c(v,e.lockRef.current))},[]);o.useEffect(function(){return Q.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Z),document.addEventListener("touchmove",l,Z),document.addEventListener("touchstart",p,Z),function(){Q=Q.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,Z),document.removeEventListener("touchmove",l,Z),document.removeEventListener("touchstart",p,Z)}},[]);var y=e.removeScrollBar,g=e.inert;return o.createElement(o.Fragment,null,g?o.createElement(s,{styles:Nr(a)}):null,y?o.createElement(Er,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Tr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ir=ir(Ft,Ar);var zt=o.forwardRef(function(e,t){return o.createElement(Ee,U({},e,{ref:t,sideCar:Ir}))});zt.classNames=Ee.classNames;var jr=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},J=new WeakMap,fe=new WeakMap,me={},Re=0,Ht=function(e){return e&&(e.host||Ht(e.parentNode))},Lr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ht(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kr=function(e,t,n,r){var a=Lr(t,Array.isArray(e)?e:[e]);me[n]||(me[n]=new WeakMap);var s=me[n],i=[],c=new Set,l=new Set(a),h=function(d){!d||c.has(d)||(c.add(d),h(d.parentNode))};a.forEach(h);var p=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(c.has(f))p(f);else try{var y=f.getAttribute(r),g=y!==null&&y!=="false",v=(J.get(f)||0)+1,m=(s.get(f)||0)+1;J.set(f,v),s.set(f,m),i.push(f),v===1&&g&&fe.set(f,!0),m===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",f,E)}})};return p(t),c.clear(),Re++,function(){i.forEach(function(d){var f=J.get(d)-1,y=s.get(d)-1;J.set(d,f),s.set(d,y),f||(fe.has(d)||d.removeAttribute(r),fe.delete(d)),y||d.removeAttribute(n)}),Re--,Re||(J=new WeakMap,J=new WeakMap,fe=new WeakMap,me={})}},Mr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=jr(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),kr(r,a,n,"aria-hidden")):function(){return null}},Fr=Object.defineProperty,I=(e,t)=>Fr(e,"name",{value:t,configurable:!0}),Be="Dialog",[Vt,mo]=st(Be),[Ur,F]=Vt(Be),$r=I(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,c=o.useRef(null),l=o.useRef(null),[h,p]=Rt({prop:r,defaultProp:a??!1,onChange:s,caller:Be}),[d,f]=o.useState(0),[y,g]=o.useState(0);return u.jsx(Ur,{scope:t,triggerRef:c,contentRef:l,contentId:ve(),titleId:ve(),descriptionId:ve(),titlePresent:d>0,descriptionPresent:y>0,setTitleCount:f,setDescriptionCount:g,open:h,onOpenChange:p,onOpenToggle:o.useCallback(()=>p(v=>!v),[p]),modal:i,children:n})},"Dialog"),Wr="DialogTrigger",Br=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(Wr,r),i=se(n,s.triggerRef);return u.jsx(K.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Ce(s.open),...a,ref:i,onClick:B(t.onClick,s.onOpenToggle)})},"DialogTrigger")),Xt="DialogPortal",[zr,Gt]=Vt(Xt,{forceMount:void 0}),Hr=I(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,s=F(Xt,t);return u.jsx(zr,{scope:t,forceMount:n,children:o.Children.map(r,i=>u.jsx(Fe,{present:n||s.open,children:u.jsx(Wn,{asChild:!0,container:a,children:i})}))})},"DialogPortal"),ke="DialogOverlay",Kt=o.forwardRef(I(function(t,n){const r=Gt(ke,t.__scopeDialog),{forceMount:a=r.forceMount,...s}=t,i=F(ke,t.__scopeDialog);return i.modal?u.jsx(Fe,{present:a||i.open,children:u.jsx(Xr,{...s,ref:n})}):null},"DialogOverlay")),Vr=ot("DialogOverlay.RemoveScroll"),Xr=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(ke,r),i=bt(),c=se(n,i);return u.jsx(zt,{as:Vr,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(K.div,{"data-state":Ce(s.open),...a,ref:c,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),ae="DialogContent",qt=o.forwardRef(I(function(t,n){const r=Gt(ae,t.__scopeDialog),{forceMount:a=r.forceMount,...s}=t,i=F(ae,t.__scopeDialog);return u.jsx(Fe,{present:a||i.open,children:i.modal?u.jsx(Gr,{...s,ref:n}):u.jsx(Kr,{...s,ref:n})})},"DialogContent")),Gr=o.forwardRef(I(function(t,n){const r=F(ae,t.__scopeDialog),a=o.useRef(null),s=se(n,r.contentRef,a);return o.useEffect(()=>{const i=a.current;if(i)return Mr(i)},[]),u.jsx(Yt,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:B(t.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:B(t.onPointerDownOutside,i=>{const c=i.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&i.preventDefault()}),onFocusOutside:B(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),Kr=o.forwardRef(I(function(t,n){const r=F(ae,t.__scopeDialog),a=o.useRef(!1),s=o.useRef(!1);return u.jsx(Yt,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(a.current||r.triggerRef.current?.focus(),i.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(a.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;r.triggerRef.current?.contains(c)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Yt=o.forwardRef(I(function(t,n){const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=t,l=F(ae,r);return We(),u.jsx(u.Fragment,{children:u.jsx(qn,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:u.jsx(In,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":Ce(l.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),qr="DialogTitle",Zt=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(qr,r),{setTitleCount:i}=s;return G(()=>(i(c=>c+1),()=>i(c=>c-1)),[i]),u.jsx(K.h2,{id:s.titleId,...a,ref:n})},"DialogTitle")),Yr="DialogDescription",Qt=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(Yr,r),{setDescriptionCount:i}=s;return G(()=>(i(c=>c+1),()=>i(c=>c-1)),[i]),u.jsx(K.p,{id:s.descriptionId,...a,ref:n})},"DialogDescription")),Zr="DialogClose",Qr=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(Zr,r);return u.jsx(K.button,{type:"button",...a,ref:n,onClick:B(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Ce(e){return e?"open":"closed"}I(Ce,"getState");const Jr=$r,po=Br,eo=Hr,Jt=o.forwardRef(({className:e,...t},n)=>u.jsx(Kt,{ref:n,className:T("fixed inset-0 z-[var(--layer-backdrop)] xpod-overlay-scrim","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Jt.displayName=Kt.displayName;const en=o.forwardRef(({className:e,children:t,variant:n="center",closeLabel:r="Close",closeDisabled:a=!1,hideCloseButton:s=!1,...i},c)=>u.jsxs(eo,{children:[u.jsx(Jt,{}),u.jsxs(qt,{ref:c,className:T(n==="sheet-left"?"fixed inset-y-0 left-0 z-[var(--layer-modal)] flex h-dvh w-[min(88vw,320px)] flex-col border-r bg-background p-0 shadow-[16px_0_30px_rgba(15,23,42,0.08)] duration-200 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]:slide-out-to-left-full data-[state=open]:slide-in-from-left-full rounded-none":n==="sheet-right"?"fixed inset-y-0 right-0 z-[var(--layer-modal)] flex h-dvh w-full max-w-4xl flex-col border-l bg-background p-0 shadow-[-16px_0_30px_rgba(15,23,42,0.08)] duration-200 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]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full rounded-none":"fixed left-[50%] top-[50%] z-[var(--layer-modal)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-lg",e),...i,children:[t,s?null:u.jsxs(Qr,{disabled:a,className:T("absolute right-4 top-4 rounded-xl opacity-70 transition-all hover:opacity-100 hover:bg-muted/50 p-1 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",ln),children:[u.jsx(Rn,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:r})]})]})]}));en.displayName=qt.displayName;const tn=({className:e,...t})=>u.jsx("div",{className:T("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});tn.displayName="DialogHeader";const nn=({className:e,...t})=>u.jsx("div",{className:T("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});nn.displayName="DialogFooter";const rn=o.forwardRef(({className:e,...t},n)=>u.jsx(Zt,{ref:n,className:T("text-lg font-semibold leading-none tracking-tight",e),...t}));rn.displayName=Zt.displayName;const on=o.forwardRef(({className:e,...t},n)=>u.jsx(Qt,{ref:n,className:T("text-sm text-muted-foreground",e),...t}));on.displayName=Qt.displayName;function to({open:e,onOpenChange:t,title:n,description:r,children:a,confirmLabel:s,cancelLabel:i,pending:c=!1,error:l,onConfirm:h,confirmVariant:p="destructive"}){const d=o.useRef(null),f=o.useRef(null);return u.jsx(Jr,{open:e,onOpenChange:y=>{c||t(y)},children:u.jsxs(en,{hideCloseButton:!0,className:"w-[calc(100%_-_2rem)] max-h-[calc(100dvh_-_2rem)] overflow-y-auto","aria-busy":c,onOpenAutoFocus:y=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,y.preventDefault(),d.current?.focus()},onCloseAutoFocus:y=>{f.current?.isConnected&&(y.preventDefault(),f.current.focus())},onEscapeKeyDown:y=>{c&&y.preventDefault()},onInteractOutside:y=>{c&&y.preventDefault()},children:[u.jsxs(tn,{children:[u.jsx(rn,{children:n}),u.jsx(on,{children:r})]}),a,l?u.jsx("p",{role:"alert",className:"text-sm text-destructive",children:l}):null,u.jsxs(nn,{className:"gap-2",children:[u.jsx(te,{ref:d,variant:"outline",disabled:c,onClick:()=>t(!1),children:i}),u.jsx(te,{variant:p,disabled:c,onClick:h,children:s})]})]})})}const no=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm transition-[border-color] placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 ${dn}`,an=o.forwardRef(({className:e,type:t="text",...n},r)=>u.jsx("input",{ref:r,type:t,className:T(no,"flex min-h-10 file:border-0 file:bg-transparent file:text-sm file:font-medium",e),...n}));an.displayName="Input";function sn({children:e}){return u.jsx(ro,{children:u.jsx(o.Suspense,{fallback:u.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"正在打开…"}),children:e})})}class ro extends o.Component{state={};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("Route module failed to load",t,n.componentStack)}render(){if(!this.state.error)return this.props.children;const t=/Failed to fetch dynamically imported module|Importing a module script failed|Loading chunk .* failed/i.test(this.state.error.message);return u.jsxs("div",{className:"mx-auto flex min-h-64 max-w-md flex-col items-start justify-center gap-3 p-6",children:[u.jsx("div",{className:"text-base font-medium",children:t?"页面已更新":"页面暂时无法打开"}),u.jsx("div",{className:"text-sm text-muted-foreground",children:t?"当前窗口仍在使用旧版页面资源,请重新载入。":"页面加载遇到了问题,请重试。这不表示登录已失效。"}),!1,u.jsx("button",{type:"button",className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",onClick:()=>window.location.reload(),children:"重新载入"})]})}}const vo={productName:"Xpod 账号",loginTitle:"登录",registerTitle:"创建账号",usernameLabel:"Pod 名称",usernamePlaceholder:"选择 Pod 名称",emailLabel:"邮箱",emailPlaceholder:"you@example.com",passwordLabel:"密码",passwordPlaceholder:"输入密码",confirmationLabel:"确认密码",confirmationPlaceholder:"再次输入密码",loginAction:"登录",registerAction:"创建账号",switchToRegister:"切换用户",switchToLogin:"返回登录",usernameChecking:"正在检查 Pod 名称…",usernameAvailable:"Pod 名称可用",usernameUnavailable:"Pod 名称不可用",suggestionsLabel:"可用建议",mismatchError:"两次输入的密码不一致"},ho={forgotPassword:"忘记密码?"},go={emailAlreadyRegisteredPasswordMismatch:"该邮箱已注册,但密码不正确,请登录或重置密码。"};function yo(e){return e===401||e===403?"邮箱或密码不正确。":e===429?"尝试次数过多,请稍后再试。":"登录失败,请重试。"}const oo={"zh-CN":{title:"启用 Pod 删除",lead:"允许这个账号管理下方当前的 Pod。授权成功后,请返回账号页面;删除数据仍需另行确认。",account:"授权给账号",address:"当前 Pod 地址",identities:"当前 Pod 的身份",allow:"允许这个账号删除此 Pod",cancel:"取消",loading:"正在核对设备与 Pod…",pending:"正在授权…",retry:"重新核对",back:"返回账号页面",done:"已启用删除。这个 Pod 的数据尚未删除。",operator:"请在存放这个 Pod 的设备上打开 Xpod,再完成授权。当前访问没有设备管理权限。",localAddress:"本机 Xpod 管理地址",localHint:"仅当这台电脑就是存放这个 Pod 的设备时继续。请从这台设备上的 Xpod 复制管理地址;不会自动探测本机服务。",localContinue:"在本机继续",localInvalid:"请输入本机 localhost、127.0.0.1 或 [::1] 的 HTTP(S) 地址,不得包含账号密码、查询参数或片段。",invalid:"授权请求已失效,请返回账号页面重新开始。",changed:"这个地址的 Pod 已发生变化。请返回账号页面重新发起授权。",unavailable:"暂时无法连接账号服务,请稍后重试。",failed:"未能完成授权,请重试。"},en:{title:"Enable Pod deletion",lead:"Allow this account to manage the current Pod below. Return to the account page afterwards; deleting data still requires a separate confirmation.",account:"Authorize account",address:"Current Pod address",identities:"Current Pod identities",allow:"Allow this account to delete this Pod",cancel:"Cancel",loading:"Checking the device and Pod…",pending:"Authorizing…",retry:"Check again",back:"Return to account",done:"Deletion is enabled. The Pod data has not been deleted.",operator:"Open Xpod on the device hosting this Pod to authorize it. This connection has no device management access.",localAddress:"Xpod address on this device",localHint:"Continue only if this computer hosts the Pod. Copy the management address from Xpod on this device. Local services are not probed automatically.",localContinue:"Continue on this device",localInvalid:"Enter an HTTP(S) address on localhost, 127.0.0.1, or [::1], without credentials, query parameters, or a fragment.",invalid:"This authorization request is no longer valid. Start again from your account page.",changed:"The Pod at this address has changed. Start a new authorization from your account page.",unavailable:"Cannot reach the account service. Try again later.",failed:"Could not authorize this Pod. Try again."}},ao=o.lazy(()=>rt(()=>import("./AccountAuthBoundary-BvoDydRz.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>({default:e.AccountAuthBoundary}))),so=o.lazy(()=>rt(()=>import("./SystemSettingsPage-BNQP_Yuc.js"),__vite__mapDeps([8,1,2,6,9,3,10])));function io({to:e}){return new URLSearchParams(be().search).has("deletionAuthorization")?u.jsx(ze,{}):u.jsx(un,{to:e,replace:!0})}function co(){return new URLSearchParams(be().search).has("deletionAuthorization")?u.jsx(He,{}):u.jsx(sn,{children:u.jsx(ao,{surface:"embedded",children:u.jsx(He,{})})})}function uo(){return new URLSearchParams(be().search).has("deletionAuthorization")?u.jsx(ze,{}):u.jsx(sn,{children:u.jsx(so,{})})}function pe(e){if(typeof e!="string")return null;try{const t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password&&!t.search&&!t.hash&&t.pathname.endsWith("/.account/account/")?t.href:null}catch{return null}}function ze({locale:e="zh-CN"}){const{search:t}=be(),n=oo[e],[r,a]=o.useState(null),[s,i]=o.useState(!1),[c,l]=o.useState(""),[h,p]=o.useState(!1),[d,f]=o.useState(!1),[y,g]=o.useState(null),[v,m]=o.useState(!1),[E,C]=o.useState(""),[w,P]=o.useState(""),x=o.useRef(!1),D=o.useRef(0),N=o.useCallback(b=>{switch(b){case"POD_DELETE_OPERATOR_REQUIRED":case"POD_DELETE_ORIGIN_REQUIRED":return n.operator;case"POD_DELETE_AUTHORIZATION_INVALID":return n.invalid;case"POD_DELETE_GENERATION_CHANGED":case"POD_DELETE_AUTHORIZATION_CONFLICT":case"POD_DELETE_NOT_FOUND":return n.changed;case"POD_DELETE_NODE_UNAVAILABLE":return n.unavailable;default:return n.failed}},[n]),H=o.useCallback(async()=>{if(x.current)return;const b=++D.current,S=new URLSearchParams(t),O=S.get("deletionAuthorization"),j=S.get("podName");if(a(null),g(null),l(""),f(!1),p(!1),m(!1),P(""),!O||O.length>2048||!j||!/^[a-zA-Z0-9_-]{1,64}$/.test(j)){l(n.invalid);return}x.current=!0,i(!0);try{const $=await fetch("/provision/pods",{method:"POST",credentials:"same-origin",redirect:"error",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"inspectDeletionAuthorization",challenge:O,podName:j})}),X=await $.json().catch(()=>({}));if(b!==D.current)return;if(!$.ok){const L=X.code??X.error??X.message,ce=$.status===401||L==="POD_DELETE_OPERATOR_REQUIRED"||L==="POD_DELETE_ORIGIN_REQUIRED";m(ce),l(ce?n.operator:N(L));return}const _=X.deletionAuthorization;if(!_||_.challenge!==O||_.podName!==j||!(_.expiresAt>Date.now())||!pe(_.returnUrl)||!["cloudAccountId","cloudPodId","nodeId","storageUrl","currentLocalPodId"].every(L=>typeof _[L]=="string"&&_[L])||!Array.isArray(_.ownerWebIds)||_.ownerWebIds.some(L=>typeof L!="string")){l(n.invalid);return}a(_),g(pe(_.returnUrl))}catch{b===D.current&&l(n.unavailable)}finally{b===D.current&&(x.current=!1,i(!1))}},[t,n,N]);o.useEffect(()=>{let b=!0;queueMicrotask(()=>{b&&H()});const S=()=>{D.current++,x.current=!1};return()=>{b=!1,S()}},[H]);const V=async()=>{if(!r||x.current)return;if(r.expiresAt<=Date.now()){a(null),p(!1),l(n.invalid);return}const b=D.current;x.current=!0,i(!0),l("");try{const S=await fetch("/provision/pods",{method:"POST",credentials:"same-origin",redirect:"error",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"authorizeDeletion",challenge:r.challenge,podName:r.podName,expectedLocalPodId:r.currentLocalPodId})}),O=await S.json().catch(()=>({}));if(b!==D.current)return;if(!S.ok){const j=O.code??O.error??O.message,$=S.status===401||j==="POD_DELETE_OPERATOR_REQUIRED"||j==="POD_DELETE_ORIGIN_REQUIRED";m($),l($?n.operator:N(j)),(S.status===401||S.status===403||S.status===404||S.status===409)&&(a(null),p(!1));return}if(O.success!==!0||pe(O.returnUrl)!==pe(r.returnUrl)){l(n.invalid);return}f(!0),p(!1)}catch{b===D.current&&l(n.unavailable)}finally{b===D.current&&(x.current=!1,i(!1))}},q=b=>{b.preventDefault(),P("");try{const S=new URL(E.trim()),O=S.hostname.toLowerCase(),j=/^127(?:\.\d{1,3}){3}$/.test(O)&&O.split(".").every(ce=>Number(ce)<=255);if(!["http:","https:"].includes(S.protocol)||!(["localhost","[::1]"].includes(O)||j)||S.username||S.password||S.search||S.hash||E.includes("?")||E.includes("#")||/^https?:\/\/[^/]*@/i.test(E.trim()))throw new Error("invalid-local-address");const $=new URLSearchParams(t),X=$.get("deletionAuthorization"),_=$.get("podName");if(!X||X.length>2048||!_||!/^[a-zA-Z0-9_-]{1,64}$/.test(_))throw new Error("invalid-request");const L=S.pathname.replace(/\/+$/,"");S.pathname=L.endsWith("/settings/pod")?L:`${L}/settings/pod`,S.searchParams.set("deletionAuthorization",X),S.searchParams.set("podName",_),window.location.assign(S.href)}catch{P(n.localInvalid)}},M=r?u.jsxs("dl",{className:"space-y-3 text-sm",children:[u.jsxs("div",{children:[u.jsx("dt",{className:"text-muted-foreground",children:n.account}),u.jsx("dd",{className:"break-all",children:r.cloudAccountId})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"text-muted-foreground",children:n.address}),u.jsx("dd",{className:"break-all font-mono",children:r.storageUrl})]}),r.ownerWebIds.length?u.jsxs("div",{children:[u.jsx("dt",{className:"text-muted-foreground",children:n.identities}),u.jsx("dd",{className:"space-y-1 break-all",children:r.ownerWebIds.map(b=>u.jsx("p",{children:b},b))})]}):null]}):null;return u.jsxs("section",{className:"mx-auto w-full max-w-2xl p-4 sm:p-6","aria-label":n.title,children:[u.jsxs(ut,{children:[u.jsxs(lt,{children:[u.jsx(dt,{children:n.title}),u.jsx(ft,{children:n.lead})]}),u.jsxs(mt,{className:"space-y-4",children:[s&&!r?u.jsx("p",{role:"status",children:n.loading}):null,c&&!h?u.jsx("p",{role:"alert",className:"text-sm text-destructive",children:c}):null,M,v?u.jsxs("form",{onSubmit:q,className:"space-y-3",children:[u.jsx("p",{className:"text-sm text-muted-foreground",id:"local-xpod-hint",children:n.localHint}),u.jsx("label",{htmlFor:"local-xpod-address",className:"block text-sm font-medium",children:n.localAddress}),u.jsx(an,{id:"local-xpod-address",value:E,onChange:b=>C(b.target.value),"aria-describedby":"local-xpod-hint",autoComplete:"off",spellCheck:!1,required:!0}),w?u.jsx("p",{role:"alert",className:"text-sm text-destructive",children:w}):null,u.jsx(te,{type:"submit",children:n.localContinue})]}):null,d?u.jsx("p",{role:"status",children:n.done}):null,u.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&!d?u.jsx(te,{disabled:s,onClick:()=>p(!0),children:n.allow}):null,y&&!s?u.jsx(te,{asChild:!0,variant:"outline",children:u.jsx("a",{href:y,children:d||!r?n.back:n.cancel})}):null,!r&&!s?u.jsx(te,{variant:"outline",onClick:()=>{H()},children:n.retry}):null]})]})]}),u.jsx(to,{open:h,onOpenChange:p,title:n.title,description:n.lead,confirmVariant:"default",confirmLabel:s?n.pending:n.allow,cancelLabel:n.cancel,pending:s,error:c,onConfirm:()=>{V()},children:M})]})}const bo=Object.freeze(Object.defineProperty({__proto__:null,PodDeletionAuthorizationPanel:ze,PodManagementBoundary:co,PodManagementFrame:uo,PodManagementTaskRoute:io},Symbol.toStringTag,{value:"Module"}));export{io as A,bo as B,lt as C,Jr as D,an as I,K as P,sn as R,Rn as X,B as a,dt as b,st as c,ft as d,mt as e,ut as f,vo as g,ho as h,no as i,po as j,en as k,tn as l,rn as m,on as n,nn as o,Dn as p,re as q,G as r,yo as s,at as t,Rt as u,Fe as v,In as w,go as x,ve as y,Wn as z};
|
|
42
|
+
`)},_r=0,Q=[];function Ar(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),a=o.useState(_r++)[0],s=o.useState(Ut)[0],i=o.useRef(e);o.useEffect(function(){i.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var v=Qn([e.lockRef.current],(e.shards||[]).map(nt),!0).filter(Boolean);return v.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),v.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(v,m){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!i.current.allowPinchZoom;var E=de(v),C=n.current,w="deltaX"in v?v.deltaX:C[0]-E[0],P="deltaY"in v?v.deltaY:C[1]-E[1],x,D=v.target,N=Math.abs(w)>Math.abs(P)?"h":"v";if("touches"in v&&N==="h"&&D.type==="range")return!1;var H=window.getSelection(),V=H&&H.anchorNode,q=V?V===D||V.contains(D):!1;if(q)return!1;var M=et(N,D);if(!M)return!0;if(M?x=N:(x=N==="v"?"h":"v",M=et(N,D)),!M)return!1;if(!r.current&&"changedTouches"in v&&(w||P)&&(r.current=x),!x)return!0;var b=r.current||x;return Rr(b,m,v,b==="h"?w:P)},[]),l=o.useCallback(function(v){var m=v;if(!(!Q.length||Q[Q.length-1]!==s)){var E="deltaY"in m?tt(m):de(m),C=t.current.filter(function(x){return x.name===m.type&&(x.target===m.target||m.target===x.shadowParent)&&Or(x.delta,E)})[0];if(C&&C.should){m.cancelable&&m.preventDefault();return}if(!C){var w=(i.current.shards||[]).map(nt).filter(Boolean).filter(function(x){return x.contains(m.target)}),P=w.length>0?c(m,w[0]):!i.current.noIsolation;P&&m.cancelable&&m.preventDefault()}}},[]),h=o.useCallback(function(v,m,E,C){var w={name:v,delta:m,target:E,should:C,shadowParent:Tr(E)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(P){return P!==w})},1)},[]),p=o.useCallback(function(v){n.current=de(v),r.current=void 0},[]),d=o.useCallback(function(v){h(v.type,tt(v),v.target,c(v,e.lockRef.current))},[]),f=o.useCallback(function(v){h(v.type,de(v),v.target,c(v,e.lockRef.current))},[]);o.useEffect(function(){return Q.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Z),document.addEventListener("touchmove",l,Z),document.addEventListener("touchstart",p,Z),function(){Q=Q.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,Z),document.removeEventListener("touchmove",l,Z),document.removeEventListener("touchstart",p,Z)}},[]);var y=e.removeScrollBar,g=e.inert;return o.createElement(o.Fragment,null,g?o.createElement(s,{styles:Nr(a)}):null,y?o.createElement(Er,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Tr(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ir=ir(Ft,Ar);var zt=o.forwardRef(function(e,t){return o.createElement(Ee,U({},e,{ref:t,sideCar:Ir}))});zt.classNames=Ee.classNames;var jr=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},J=new WeakMap,fe=new WeakMap,me={},Re=0,Ht=function(e){return e&&(e.host||Ht(e.parentNode))},Lr=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Ht(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},kr=function(e,t,n,r){var a=Lr(t,Array.isArray(e)?e:[e]);me[n]||(me[n]=new WeakMap);var s=me[n],i=[],c=new Set,l=new Set(a),h=function(d){!d||c.has(d)||(c.add(d),h(d.parentNode))};a.forEach(h);var p=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(c.has(f))p(f);else try{var y=f.getAttribute(r),g=y!==null&&y!=="false",v=(J.get(f)||0)+1,m=(s.get(f)||0)+1;J.set(f,v),s.set(f,m),i.push(f),v===1&&g&&fe.set(f,!0),m===1&&f.setAttribute(n,"true"),g||f.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",f,E)}})};return p(t),c.clear(),Re++,function(){i.forEach(function(d){var f=J.get(d)-1,y=s.get(d)-1;J.set(d,f),s.set(d,y),f||(fe.has(d)||d.removeAttribute(r),fe.delete(d)),y||d.removeAttribute(n)}),Re--,Re||(J=new WeakMap,J=new WeakMap,fe=new WeakMap,me={})}},Mr=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=jr(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),kr(r,a,n,"aria-hidden")):function(){return null}},Fr=Object.defineProperty,I=(e,t)=>Fr(e,"name",{value:t,configurable:!0}),Be="Dialog",[Vt,mo]=st(Be),[Ur,F]=Vt(Be),$r=I(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:s,modal:i=!0}=e,c=o.useRef(null),l=o.useRef(null),[h,p]=Rt({prop:r,defaultProp:a??!1,onChange:s,caller:Be}),[d,f]=o.useState(0),[y,g]=o.useState(0);return u.jsx(Ur,{scope:t,triggerRef:c,contentRef:l,contentId:ve(),titleId:ve(),descriptionId:ve(),titlePresent:d>0,descriptionPresent:y>0,setTitleCount:f,setDescriptionCount:g,open:h,onOpenChange:p,onOpenToggle:o.useCallback(()=>p(v=>!v),[p]),modal:i,children:n})},"Dialog"),Wr="DialogTrigger",Br=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(Wr,r),i=se(n,s.triggerRef);return u.jsx(K.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":Ce(s.open),...a,ref:i,onClick:B(t.onClick,s.onOpenToggle)})},"DialogTrigger")),Xt="DialogPortal",[zr,Gt]=Vt(Xt,{forceMount:void 0}),Hr=I(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,s=F(Xt,t);return u.jsx(zr,{scope:t,forceMount:n,children:o.Children.map(r,i=>u.jsx(Fe,{present:n||s.open,children:u.jsx(Wn,{asChild:!0,container:a,children:i})}))})},"DialogPortal"),ke="DialogOverlay",Kt=o.forwardRef(I(function(t,n){const r=Gt(ke,t.__scopeDialog),{forceMount:a=r.forceMount,...s}=t,i=F(ke,t.__scopeDialog);return i.modal?u.jsx(Fe,{present:a||i.open,children:u.jsx(Xr,{...s,ref:n})}):null},"DialogOverlay")),Vr=ot("DialogOverlay.RemoveScroll"),Xr=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(ke,r),i=bt(),c=se(n,i);return u.jsx(zt,{as:Vr,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(K.div,{"data-state":Ce(s.open),...a,ref:c,style:{pointerEvents:"auto",...a.style}})})},"DialogOverlayImpl")),ae="DialogContent",qt=o.forwardRef(I(function(t,n){const r=Gt(ae,t.__scopeDialog),{forceMount:a=r.forceMount,...s}=t,i=F(ae,t.__scopeDialog);return u.jsx(Fe,{present:a||i.open,children:i.modal?u.jsx(Gr,{...s,ref:n}):u.jsx(Kr,{...s,ref:n})})},"DialogContent")),Gr=o.forwardRef(I(function(t,n){const r=F(ae,t.__scopeDialog),a=o.useRef(null),s=se(n,r.contentRef,a);return o.useEffect(()=>{const i=a.current;if(i)return Mr(i)},[]),u.jsx(Yt,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:B(t.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:B(t.onPointerDownOutside,i=>{const c=i.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&i.preventDefault()}),onFocusOutside:B(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),Kr=o.forwardRef(I(function(t,n){const r=F(ae,t.__scopeDialog),a=o.useRef(!1),s=o.useRef(!1);return u.jsx(Yt,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(a.current||r.triggerRef.current?.focus(),i.preventDefault()),a.current=!1,s.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(a.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;r.triggerRef.current?.contains(c)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Yt=o.forwardRef(I(function(t,n){const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=t,l=F(ae,r);return We(),u.jsx(u.Fragment,{children:u.jsx(qn,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:u.jsx(In,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":Ce(l.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),qr="DialogTitle",Zt=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(qr,r),{setTitleCount:i}=s;return G(()=>(i(c=>c+1),()=>i(c=>c-1)),[i]),u.jsx(K.h2,{id:s.titleId,...a,ref:n})},"DialogTitle")),Yr="DialogDescription",Qt=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(Yr,r),{setDescriptionCount:i}=s;return G(()=>(i(c=>c+1),()=>i(c=>c-1)),[i]),u.jsx(K.p,{id:s.descriptionId,...a,ref:n})},"DialogDescription")),Zr="DialogClose",Qr=o.forwardRef(I(function(t,n){const{__scopeDialog:r,...a}=t,s=F(Zr,r);return u.jsx(K.button,{type:"button",...a,ref:n,onClick:B(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function Ce(e){return e?"open":"closed"}I(Ce,"getState");const Jr=$r,po=Br,eo=Hr,Jt=o.forwardRef(({className:e,...t},n)=>u.jsx(Kt,{ref:n,className:T("fixed inset-0 z-[var(--layer-backdrop)] xpod-overlay-scrim","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Jt.displayName=Kt.displayName;const en=o.forwardRef(({className:e,children:t,variant:n="center",closeLabel:r="Close",closeDisabled:a=!1,hideCloseButton:s=!1,...i},c)=>u.jsxs(eo,{children:[u.jsx(Jt,{}),u.jsxs(qt,{ref:c,className:T(n==="sheet-left"?"fixed inset-y-0 left-0 z-[var(--layer-modal)] flex h-dvh w-[min(88vw,320px)] flex-col border-r bg-background p-0 shadow-[16px_0_30px_rgba(15,23,42,0.08)] duration-200 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]:slide-out-to-left-full data-[state=open]:slide-in-from-left-full rounded-none":n==="sheet-right"?"fixed inset-y-0 right-0 z-[var(--layer-modal)] flex h-dvh w-full max-w-4xl flex-col border-l bg-background p-0 shadow-[-16px_0_30px_rgba(15,23,42,0.08)] duration-200 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]:slide-out-to-right-full data-[state=open]:slide-in-from-right-full rounded-none":"fixed left-[50%] top-[50%] z-[var(--layer-modal)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-lg",e),...i,children:[t,s?null:u.jsxs(Qr,{disabled:a,className:T("absolute right-4 top-4 rounded-xl opacity-70 transition-all hover:opacity-100 hover:bg-muted/50 p-1 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",ln),children:[u.jsx(Rn,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:r})]})]})]}));en.displayName=qt.displayName;const tn=({className:e,...t})=>u.jsx("div",{className:T("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});tn.displayName="DialogHeader";const nn=({className:e,...t})=>u.jsx("div",{className:T("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});nn.displayName="DialogFooter";const rn=o.forwardRef(({className:e,...t},n)=>u.jsx(Zt,{ref:n,className:T("text-lg font-semibold leading-none tracking-tight",e),...t}));rn.displayName=Zt.displayName;const on=o.forwardRef(({className:e,...t},n)=>u.jsx(Qt,{ref:n,className:T("text-sm text-muted-foreground",e),...t}));on.displayName=Qt.displayName;function to({open:e,onOpenChange:t,title:n,description:r,children:a,confirmLabel:s,cancelLabel:i,pending:c=!1,error:l,onConfirm:h,confirmVariant:p="destructive"}){const d=o.useRef(null),f=o.useRef(null);return u.jsx(Jr,{open:e,onOpenChange:y=>{c||t(y)},children:u.jsxs(en,{hideCloseButton:!0,className:"w-[calc(100%_-_2rem)] max-h-[calc(100dvh_-_2rem)] overflow-y-auto","aria-busy":c,onOpenAutoFocus:y=>{f.current=document.activeElement instanceof HTMLElement?document.activeElement:null,y.preventDefault(),d.current?.focus()},onCloseAutoFocus:y=>{f.current?.isConnected&&(y.preventDefault(),f.current.focus())},onEscapeKeyDown:y=>{c&&y.preventDefault()},onInteractOutside:y=>{c&&y.preventDefault()},children:[u.jsxs(tn,{children:[u.jsx(rn,{children:n}),u.jsx(on,{children:r})]}),a,l?u.jsx("p",{role:"alert",className:"text-sm text-destructive",children:l}):null,u.jsxs(nn,{className:"gap-2",children:[u.jsx(te,{ref:d,variant:"outline",disabled:c,onClick:()=>t(!1),children:i}),u.jsx(te,{variant:p,disabled:c,onClick:h,children:s})]})]})})}const no=`w-full rounded-md border border-input bg-background px-3 py-2 text-sm transition-[border-color] placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 ${dn}`,an=o.forwardRef(({className:e,type:t="text",...n},r)=>u.jsx("input",{ref:r,type:t,className:T(no,"flex min-h-10 file:border-0 file:bg-transparent file:text-sm file:font-medium",e),...n}));an.displayName="Input";function sn({children:e}){return u.jsx(ro,{children:u.jsx(o.Suspense,{fallback:u.jsx("div",{className:"p-6 text-sm text-muted-foreground",children:"正在打开…"}),children:e})})}class ro extends o.Component{state={};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){console.error("Route module failed to load",t,n.componentStack)}render(){if(!this.state.error)return this.props.children;const t=/Failed to fetch dynamically imported module|Importing a module script failed|Loading chunk .* failed/i.test(this.state.error.message);return u.jsxs("div",{className:"mx-auto flex min-h-64 max-w-md flex-col items-start justify-center gap-3 p-6",children:[u.jsx("div",{className:"text-base font-medium",children:t?"页面已更新":"页面暂时无法打开"}),u.jsx("div",{className:"text-sm text-muted-foreground",children:t?"当前窗口仍在使用旧版页面资源,请重新载入。":"页面加载遇到了问题,请重试。这不表示登录已失效。"}),!1,u.jsx("button",{type:"button",className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground",onClick:()=>window.location.reload(),children:"重新载入"})]})}}const vo={productName:"Xpod 账号",loginTitle:"登录",registerTitle:"创建账号",usernameLabel:"Pod 名称",usernamePlaceholder:"选择 Pod 名称",emailLabel:"邮箱",emailPlaceholder:"you@example.com",passwordLabel:"密码",passwordPlaceholder:"输入密码",confirmationLabel:"确认密码",confirmationPlaceholder:"再次输入密码",loginAction:"登录",registerAction:"创建账号",switchToRegister:"切换用户",switchToLogin:"返回登录",usernameChecking:"正在检查 Pod 名称…",usernameAvailable:"Pod 名称可用",usernameUnavailable:"Pod 名称不可用",suggestionsLabel:"可用建议",mismatchError:"两次输入的密码不一致"},ho={forgotPassword:"忘记密码?"},go={emailAlreadyRegisteredPasswordMismatch:"该邮箱已注册,但密码不正确,请登录或重置密码。"};function yo(e){return e===401||e===403?"邮箱或密码不正确。":e===429?"尝试次数过多,请稍后再试。":"登录失败,请重试。"}const oo={"zh-CN":{title:"启用 Pod 删除",lead:"允许这个账号管理下方当前的 Pod。授权成功后,请返回账号页面;删除数据仍需另行确认。",account:"授权给账号",address:"当前 Pod 地址",identities:"当前 Pod 的身份",allow:"允许这个账号删除此 Pod",cancel:"取消",loading:"正在核对设备与 Pod…",pending:"正在授权…",retry:"重新核对",back:"返回账号页面",done:"已启用删除。这个 Pod 的数据尚未删除。",operator:"请在存放这个 Pod 的设备上打开 Xpod,再完成授权。当前访问没有设备管理权限。",localAddress:"本机 Xpod 管理地址",localHint:"仅当这台电脑就是存放这个 Pod 的设备时继续。请从这台设备上的 Xpod 复制管理地址;不会自动探测本机服务。",localContinue:"在本机继续",localInvalid:"请输入本机 localhost、127.0.0.1 或 [::1] 的 HTTP(S) 地址,不得包含账号密码、查询参数或片段。",invalid:"授权请求已失效,请返回账号页面重新开始。",changed:"这个地址的 Pod 已发生变化。请返回账号页面重新发起授权。",unavailable:"暂时无法连接账号服务,请稍后重试。",failed:"未能完成授权,请重试。"},en:{title:"Enable Pod deletion",lead:"Allow this account to manage the current Pod below. Return to the account page afterwards; deleting data still requires a separate confirmation.",account:"Authorize account",address:"Current Pod address",identities:"Current Pod identities",allow:"Allow this account to delete this Pod",cancel:"Cancel",loading:"Checking the device and Pod…",pending:"Authorizing…",retry:"Check again",back:"Return to account",done:"Deletion is enabled. The Pod data has not been deleted.",operator:"Open Xpod on the device hosting this Pod to authorize it. This connection has no device management access.",localAddress:"Xpod address on this device",localHint:"Continue only if this computer hosts the Pod. Copy the management address from Xpod on this device. Local services are not probed automatically.",localContinue:"Continue on this device",localInvalid:"Enter an HTTP(S) address on localhost, 127.0.0.1, or [::1], without credentials, query parameters, or a fragment.",invalid:"This authorization request is no longer valid. Start again from your account page.",changed:"The Pod at this address has changed. Start a new authorization from your account page.",unavailable:"Cannot reach the account service. Try again later.",failed:"Could not authorize this Pod. Try again."}},ao=o.lazy(()=>rt(()=>import("./AccountAuthBoundary-Dv52SZc6.js"),__vite__mapDeps([0,1,2,3,4,5,6,7])).then(e=>({default:e.AccountAuthBoundary}))),so=o.lazy(()=>rt(()=>import("./SystemSettingsPage-HaNrP1H1.js"),__vite__mapDeps([8,1,2,6,9,3,10])));function io({to:e}){return new URLSearchParams(be().search).has("deletionAuthorization")?u.jsx(ze,{}):u.jsx(un,{to:e,replace:!0})}function co(){return new URLSearchParams(be().search).has("deletionAuthorization")?u.jsx(He,{}):u.jsx(sn,{children:u.jsx(ao,{surface:"embedded",children:u.jsx(He,{})})})}function uo(){return new URLSearchParams(be().search).has("deletionAuthorization")?u.jsx(ze,{}):u.jsx(sn,{children:u.jsx(so,{})})}function pe(e){if(typeof e!="string")return null;try{const t=new URL(e);return["http:","https:"].includes(t.protocol)&&!t.username&&!t.password&&!t.search&&!t.hash&&t.pathname.endsWith("/.account/account/")?t.href:null}catch{return null}}function ze({locale:e="zh-CN"}){const{search:t}=be(),n=oo[e],[r,a]=o.useState(null),[s,i]=o.useState(!1),[c,l]=o.useState(""),[h,p]=o.useState(!1),[d,f]=o.useState(!1),[y,g]=o.useState(null),[v,m]=o.useState(!1),[E,C]=o.useState(""),[w,P]=o.useState(""),x=o.useRef(!1),D=o.useRef(0),N=o.useCallback(b=>{switch(b){case"POD_DELETE_OPERATOR_REQUIRED":case"POD_DELETE_ORIGIN_REQUIRED":return n.operator;case"POD_DELETE_AUTHORIZATION_INVALID":return n.invalid;case"POD_DELETE_GENERATION_CHANGED":case"POD_DELETE_AUTHORIZATION_CONFLICT":case"POD_DELETE_NOT_FOUND":return n.changed;case"POD_DELETE_NODE_UNAVAILABLE":return n.unavailable;default:return n.failed}},[n]),H=o.useCallback(async()=>{if(x.current)return;const b=++D.current,S=new URLSearchParams(t),O=S.get("deletionAuthorization"),j=S.get("podName");if(a(null),g(null),l(""),f(!1),p(!1),m(!1),P(""),!O||O.length>2048||!j||!/^[a-zA-Z0-9_-]{1,64}$/.test(j)){l(n.invalid);return}x.current=!0,i(!0);try{const $=await fetch("/provision/pods",{method:"POST",credentials:"same-origin",redirect:"error",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"inspectDeletionAuthorization",challenge:O,podName:j})}),X=await $.json().catch(()=>({}));if(b!==D.current)return;if(!$.ok){const L=X.code??X.error??X.message,ce=$.status===401||L==="POD_DELETE_OPERATOR_REQUIRED"||L==="POD_DELETE_ORIGIN_REQUIRED";m(ce),l(ce?n.operator:N(L));return}const _=X.deletionAuthorization;if(!_||_.challenge!==O||_.podName!==j||!(_.expiresAt>Date.now())||!pe(_.returnUrl)||!["cloudAccountId","cloudPodId","nodeId","storageUrl","currentLocalPodId"].every(L=>typeof _[L]=="string"&&_[L])||!Array.isArray(_.ownerWebIds)||_.ownerWebIds.some(L=>typeof L!="string")){l(n.invalid);return}a(_),g(pe(_.returnUrl))}catch{b===D.current&&l(n.unavailable)}finally{b===D.current&&(x.current=!1,i(!1))}},[t,n,N]);o.useEffect(()=>{let b=!0;queueMicrotask(()=>{b&&H()});const S=()=>{D.current++,x.current=!1};return()=>{b=!1,S()}},[H]);const V=async()=>{if(!r||x.current)return;if(r.expiresAt<=Date.now()){a(null),p(!1),l(n.invalid);return}const b=D.current;x.current=!0,i(!0),l("");try{const S=await fetch("/provision/pods",{method:"POST",credentials:"same-origin",redirect:"error",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"authorizeDeletion",challenge:r.challenge,podName:r.podName,expectedLocalPodId:r.currentLocalPodId})}),O=await S.json().catch(()=>({}));if(b!==D.current)return;if(!S.ok){const j=O.code??O.error??O.message,$=S.status===401||j==="POD_DELETE_OPERATOR_REQUIRED"||j==="POD_DELETE_ORIGIN_REQUIRED";m($),l($?n.operator:N(j)),(S.status===401||S.status===403||S.status===404||S.status===409)&&(a(null),p(!1));return}if(O.success!==!0||pe(O.returnUrl)!==pe(r.returnUrl)){l(n.invalid);return}f(!0),p(!1)}catch{b===D.current&&l(n.unavailable)}finally{b===D.current&&(x.current=!1,i(!1))}},q=b=>{b.preventDefault(),P("");try{const S=new URL(E.trim()),O=S.hostname.toLowerCase(),j=/^127(?:\.\d{1,3}){3}$/.test(O)&&O.split(".").every(ce=>Number(ce)<=255);if(!["http:","https:"].includes(S.protocol)||!(["localhost","[::1]"].includes(O)||j)||S.username||S.password||S.search||S.hash||E.includes("?")||E.includes("#")||/^https?:\/\/[^/]*@/i.test(E.trim()))throw new Error("invalid-local-address");const $=new URLSearchParams(t),X=$.get("deletionAuthorization"),_=$.get("podName");if(!X||X.length>2048||!_||!/^[a-zA-Z0-9_-]{1,64}$/.test(_))throw new Error("invalid-request");const L=S.pathname.replace(/\/+$/,"");S.pathname=L.endsWith("/settings/pod")?L:`${L}/settings/pod`,S.searchParams.set("deletionAuthorization",X),S.searchParams.set("podName",_),window.location.assign(S.href)}catch{P(n.localInvalid)}},M=r?u.jsxs("dl",{className:"space-y-3 text-sm",children:[u.jsxs("div",{children:[u.jsx("dt",{className:"text-muted-foreground",children:n.account}),u.jsx("dd",{className:"break-all",children:r.cloudAccountId})]}),u.jsxs("div",{children:[u.jsx("dt",{className:"text-muted-foreground",children:n.address}),u.jsx("dd",{className:"break-all font-mono",children:r.storageUrl})]}),r.ownerWebIds.length?u.jsxs("div",{children:[u.jsx("dt",{className:"text-muted-foreground",children:n.identities}),u.jsx("dd",{className:"space-y-1 break-all",children:r.ownerWebIds.map(b=>u.jsx("p",{children:b},b))})]}):null]}):null;return u.jsxs("section",{className:"mx-auto w-full max-w-2xl p-4 sm:p-6","aria-label":n.title,children:[u.jsxs(ut,{children:[u.jsxs(lt,{children:[u.jsx(dt,{children:n.title}),u.jsx(ft,{children:n.lead})]}),u.jsxs(mt,{className:"space-y-4",children:[s&&!r?u.jsx("p",{role:"status",children:n.loading}):null,c&&!h?u.jsx("p",{role:"alert",className:"text-sm text-destructive",children:c}):null,M,v?u.jsxs("form",{onSubmit:q,className:"space-y-3",children:[u.jsx("p",{className:"text-sm text-muted-foreground",id:"local-xpod-hint",children:n.localHint}),u.jsx("label",{htmlFor:"local-xpod-address",className:"block text-sm font-medium",children:n.localAddress}),u.jsx(an,{id:"local-xpod-address",value:E,onChange:b=>C(b.target.value),"aria-describedby":"local-xpod-hint",autoComplete:"off",spellCheck:!1,required:!0}),w?u.jsx("p",{role:"alert",className:"text-sm text-destructive",children:w}):null,u.jsx(te,{type:"submit",children:n.localContinue})]}):null,d?u.jsx("p",{role:"status",children:n.done}):null,u.jsxs("div",{className:"flex flex-wrap gap-2",children:[r&&!d?u.jsx(te,{disabled:s,onClick:()=>p(!0),children:n.allow}):null,y&&!s?u.jsx(te,{asChild:!0,variant:"outline",children:u.jsx("a",{href:y,children:d||!r?n.back:n.cancel})}):null,!r&&!s?u.jsx(te,{variant:"outline",onClick:()=>{H()},children:n.retry}):null]})]})]}),u.jsx(to,{open:h,onOpenChange:p,title:n.title,description:n.lead,confirmVariant:"default",confirmLabel:s?n.pending:n.allow,cancelLabel:n.cancel,pending:s,error:c,onConfirm:()=>{V()},children:M})]})}const bo=Object.freeze(Object.defineProperty({__proto__:null,PodDeletionAuthorizationPanel:ze,PodManagementBoundary:co,PodManagementFrame:uo,PodManagementTaskRoute:io},Symbol.toStringTag,{value:"Module"}));export{Wn as A,bo as B,lt as C,Jr as D,an as I,K as P,sn as R,Rn as X,B as a,dt as b,st as c,ft as d,mt as e,ut as f,vo as g,ho as h,no as i,po as j,en as k,tn as l,rn as m,on as n,nn as o,Dn as p,io as q,at as r,yo as s,re as t,Rt as u,G as v,Fe as w,go as x,In as y,ve as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as c,j as t}from"./dashboard-Or0gnkou.js";import{a6 as q,a7 as ee,a8 as H,a4 as le,a9 as de,aa as Q,ab as ue,ac as ce}from"./xpod-remembered-login-BUF9fin1.js";import{f as ge,A as fe,g as me,m as be}from"./XpodAiConnectionsPodStore-B7gmXBmC.js";import{g as T,u as z,l as he}from"./XpodShellApp-D_KY4nCW.js";import{D as pe,j as xe,k as ve,l as we,m as ye,n as Ce,o as Ee}from"./PodDeletionAuthorizationPanel-BJk_8rJq.js";import{S as X,B as je}from"./section-header-CEIEcco-.js";import{B as M}from"./button-wslF55uZ.js";import{S as Fe}from"./setting-row-CaYv3dfF.js";import"./createLucideIcon-BJQl82Qk.js";import"./account-session-DlcKNG7k.js";import"@comunica/query-sparql-solid";import"./safe-continuation-ClWAhcma.js";import"./nav-item-style-CW1Nnorq.js";function $(e){return e.map(a=>{const i=q(a)??q(a.toLowerCase().replaceAll("-","_"));return i?ee(i)??a:a})}function ae(e,a){const i={chatModel:"chat",ocrModel:"vision",readerModel:"document_understanding",embeddingModel:"embedding",indexerModel:"indexing",rerankerModel:"reranking"}[a];return e.filter(n=>$(n.capabilities).includes(i))}function Ae(e,a){const i=ae(e,"embeddingModel");return a?.restricted?i.filter(n=>a.allowed.some(l=>l.provider===n.owner&&l.model===n.id)):i}const R="flex min-h-14 flex-wrap items-center justify-between gap-3 border-b border-border py-3",ke={queued:"排队中",running:"进行中",succeeded:"已完成",failed:"失败"},De={loading:"正在读取模型…",available:"Xpod 管理",empty:"已连接 Xpod,暂无模型",unauthorized:"请登录并允许 Xpod 访问",error:"模型读取失败,请重试",unavailable:"当前模型暂不可用"};function Be(e){const[a,i]=c.useState(!1),[n,l]=c.useState("platform"),[d,f]=c.useState(""),[y,g]=c.useState(),[F,p]=c.useState(!1),[b,A]=c.useState("all"),v=async(r,s="已保存")=>{p(!0),g(void 0);try{await r(),g(s)}catch{g("操作未完成,请重试。")}finally{p(!1)}},m=e.busy||F,E=r=>r.map(s=>t.jsx(Fe,{label:s.label,description:s.description,control:({id:u,"aria-describedby":C})=>t.jsx(le,{id:u,"aria-describedby":C,checked:s.checked,disabled:m,onChange:N=>{v(()=>e.onToggle(s.id,N.target.checked))}})},s.id));return t.jsx(pe,{open:a,onOpenChange:r=>{m||i(r)},children:t.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 p-6",children:[(y||e.error)&&t.jsx("p",{role:"status",className:"text-sm leading-normal",children:e.error?"Pod 设置暂时无法保存,请重试。":y}),e.section==="models"&&t.jsxs("section",{"aria-label":"默认模型",children:[t.jsx("p",{className:"text-sm leading-normal text-muted-foreground",children:"应用没有指定模型时用这里的默认值,随时可以改。"}),Array.from(new Set(e.models.map(r=>r.group))).map(r=>t.jsxs("section",{className:"mt-5",children:[t.jsx(X,{level:2,title:r,titleClassName:"text-xs leading-normal text-muted-foreground"}),e.models.filter(s=>s.group===r).map(s=>t.jsxs("div",{className:R,children:[t.jsx("label",{htmlFor:`pod-model-${s.id}`,className:"min-w-28 text-sm leading-normal",children:s.label}),s.id==="embeddingModel"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex-1 text-sm leading-normal",children:e.embeddingLabel}),t.jsx(M,{variant:"outline",size:"sm",onClick:()=>e.onSection("search"),children:"去更换 ›"})]}):s.models?t.jsxs(t.Fragment,{children:[t.jsxs(T,{id:`pod-model-${s.id}`,className:"min-w-[10ch] flex-1",value:s.value??"",disabled:m,onChange:u=>{v(()=>e.onModel(s.id,u.target.value))},children:[t.jsx("option",{value:"",children:s.defaultLabel}),s.value&&!s.models.some(u=>u.ref===s.value)&&t.jsx("option",{value:s.value,children:"当前模型(暂不可用)"}),s.models.map(u=>t.jsx("option",{value:u.ref,children:u.label},u.ref))]}),s.models.length===0&&e.freeQuotaUrl&&t.jsx("a",{href:e.freeQuotaUrl,className:"text-sm leading-normal text-primary",children:"领免费额度 ›"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex-1 text-sm leading-normal text-muted-foreground",children:s.defaultLabel}),!s.supported&&t.jsx(W,{})]}),s.status&&(s.models||s.supported)&&t.jsx("span",{className:"text-xs leading-normal text-muted-foreground",children:De[s.status]}),s.id!=="embeddingModel"&&s.testable&&t.jsx(M,{variant:"outline",size:"sm",disabled:m||!(s.testValue??s.value),onClick:()=>{v(()=>e.onTest(s.id,s.testValue??s.value),"测试通过")},children:"测试"})]},s.id))]},r))]}),e.section==="search"&&t.jsxs(t.Fragment,{children:[t.jsxs("section",{"aria-label":"检索",children:[E(e.search),t.jsxs("div",{className:R,children:[t.jsxs("span",{className:"text-sm leading-normal",children:["语义检索用的 Embedding",t.jsx("br",{}),t.jsx("span",{className:"text-xs leading-normal text-muted-foreground",children:e.embeddingLabel})]}),t.jsx(xe,{asChild:!0,children:t.jsx(M,{variant:"outline",size:"sm",disabled:m||!e.canChangeEmbedding,onClick:()=>{f(""),l("platform")},children:"更换"})})]})]}),t.jsxs("section",{"aria-label":"索引",children:[t.jsx(X,{level:2,title:"索引",titleClassName:"font-semibold",description:t.jsxs(t.Fragment,{children:["待处理 ",e.pending??0," · 配置版本 ",e.version??"默认"]}),actions:t.jsxs(t.Fragment,{children:[t.jsxs(T,{"aria-label":"重建哪部分",className:"min-w-[10ch] w-auto",value:b,onChange:r=>A(r.target.value),children:[t.jsx("option",{value:"all",children:"重建全部"}),t.jsx("option",{value:"fts",children:"只重建全文"}),t.jsx("option",{value:"vector",children:"只重建向量"})]}),t.jsx(M,{variant:"outline",size:"sm",disabled:m||!e.rebuildTargets.includes(b),onClick:()=>{v(()=>e.onRebuild(b),"重建已排队")},children:"重建"})]})}),e.jobs.length?e.jobs.map(r=>t.jsxs("div",{className:R,children:[t.jsx("span",{className:"text-sm leading-normal",children:r.label}),t.jsxs("span",{className:"text-sm leading-normal",children:[ke[r.status],r.progress===void 0?"":` · ${r.progress}%`]})]},r.id)):t.jsx("p",{className:"py-4 text-sm leading-normal text-muted-foreground",children:"还没有重建记录"}),E(e.maintenance),t.jsx("p",{className:"mt-3 text-xs leading-normal text-muted-foreground",children:"重建只重算索引,不改动 Pod 里的原始资料。"})]}),e.error?.includes("service_access_missing")&&t.jsx(M,{variant:"outline",size:"sm",disabled:m||e.backgroundAccess.busy,onClick:()=>{v(e.onGrant,"已允许 Xpod 访问")},children:"允许 Xpod 访问"})]}),e.section==="apps"&&t.jsxs("section",{"aria-label":"授权应用",children:[t.jsx("p",{className:"text-sm leading-normal text-muted-foreground",children:"哪些应用和服务能读写这个 Pod。"}),t.jsxs("div",{className:R,children:[t.jsxs("details",{className:"flex-1",children:[t.jsxs("summary",{className:"cursor-pointer text-sm leading-normal font-medium",children:["Xpod 后台访问 · ",e.backgroundAccess.loading?"读取中":e.backgroundAccess.granted?"已授权":"未授权"]}),t.jsx("p",{className:"py-3 text-xs leading-normal text-muted-foreground",children:"用于索引维护和后台任务。流量与访问记录:待接入。"})]}),e.backgroundAccess.granted?t.jsxs("details",{children:[t.jsx("summary",{"aria-label":"Xpod 后台访问的更多操作",className:"cursor-pointer p-2",children:"⋯"}),t.jsx("span",{className:"block py-2 text-xs leading-normal text-muted-foreground",children:"修改权限 · 待接入"}),t.jsx(M,{variant:"outline",size:"sm",disabled:m||e.backgroundAccess.busy,onClick:()=>{v(e.onRevoke,"已撤销授权")},children:"撤销"})]}):t.jsx(M,{variant:"outline",size:"sm",disabled:m||e.backgroundAccess.busy||e.backgroundAccess.loading,onClick:()=>{v(e.onGrant,"已允许 Xpod 访问")},children:"允许"})]}),e.backgroundAccess.error&&t.jsx("p",{role:"alert",className:"text-sm leading-normal",children:"授权操作暂时不可用,请重试。"}),t.jsx("p",{className:"mt-4 text-xs leading-normal text-muted-foreground",children:"其他授权应用 · 待接入"})]}),e.section==="data"&&t.jsxs(t.Fragment,{children:[t.jsxs("section",{"aria-label":"用量",children:[t.jsx(X,{level:2,title:"用量",titleClassName:"font-semibold"}),t.jsx("div",{className:"mt-3 grid grid-cols-2 gap-3",children:e.usage.map(r=>t.jsxs("div",{className:"rounded-xl border border-border p-4",children:[t.jsx("span",{className:"block text-xs leading-normal text-muted-foreground",children:r.label}),t.jsx("span",{className:"mt-2 block text-sm leading-normal",children:r.value})]},r.label))})]}),t.jsx("section",{"aria-label":"数据管理",children:["导入","导出","迁移"].map(r=>t.jsxs("div",{className:R,children:[t.jsx("span",{className:"text-sm leading-normal",children:r}),t.jsx(W,{}),r==="迁移"&&e.accountUrl&&t.jsx("a",{className:"text-sm leading-normal text-primary",href:e.accountUrl,children:"管理账号 ↗"})]},r))})]}),t.jsxs(ve,{closeLabel:"关闭",closeDisabled:m,className:"max-h-[90dvh] w-[calc(100%-2rem)] overflow-y-auto",onEscapeKeyDown:r=>{m&&r.preventDefault()},onInteractOutside:r=>{m&&r.preventDefault()},children:[t.jsx(we,{children:t.jsx(ye,{children:"更换语义检索模型"})}),t.jsx(H,{label:"来源",children:r=>t.jsxs(T,{...r,value:n,disabled:m,onChange:s=>{l(s.target.value),f("")},children:[t.jsx("option",{value:"platform",children:"Xpod 提供"}),t.jsx("option",{value:"own",children:"用我自己的 Key"})]})}),t.jsx(H,{label:"模型",children:r=>t.jsxs(T,{...r,value:d,disabled:m,onChange:s=>f(s.target.value),children:[t.jsx("option",{value:"",children:"请选择"}),e.embeddingModels.filter(s=>s.source===n).map(s=>t.jsx("option",{value:s.ref,children:s.label},s.ref))]})}),!e.embeddingModels.some(r=>r.source===n)&&t.jsx("p",{className:"text-xs leading-normal text-muted-foreground",children:n==="platform"?"Xpod 提供的模型目录 · 待接入":"暂无可用向量模型,请先在 AI 连接中添加。"}),t.jsx(Ce,{children:"更换后会重建全部语义索引,重建期间只能全文检索。"}),t.jsxs(Ee,{className:"gap-2",children:[t.jsx(M,{variant:"outline",disabled:m,onClick:()=>i(!1),children:"取消"}),t.jsx(M,{disabled:m||!e.canChangeEmbedding||!e.embeddingModels.some(r=>r.ref===d&&r.source===n),onClick:()=>{v(async()=>{await e.onEmbedding(d),i(!1)},"更换已保存,重建已排队")},children:"更换并重建索引"})]})]})]})})}function W(){return t.jsx(je,{variant:"pending",className:"font-normal",children:"待接入"})}async function Y(e){return te(e(L("/api/ai/config"),{method:"GET",credentials:"include",headers:{accept:"application/json"}}))}async function Se(e,a){return te(e(L("/api/ai/config"),{method:"PATCH",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(a)}))}async function Ie(e,a){const i=await e(L("/api/ai/config/rebuild"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({target:a})}),n=await i.json().catch(()=>{});if(!i.ok||!n?.job)throw new Error(n?.error??"Index rebuild request failed");return n.job}async function Me(e,a){const i=a.capabilities.some(l=>l.toLowerCase()==="embedding"),n=await e(L(i?"/v1/embeddings":"/v1/chat/completions"),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify(i?{model:a.id,input:"xpod readiness probe"}:{model:a.id,messages:[{role:"user",content:"Reply OK."}],max_tokens:1,stream:!1})});if(!n.ok){const l=await n.json().catch(()=>{}),d=typeof l?.error=="string"?l.error:l?.error?.message;throw new Error(d??"Model readiness probe failed")}await n.arrayBuffer()}function L(e){if(typeof window>"u")throw new Error("AI Config API requires the current browser origin");return new URL(e,window.location.origin).toString()}async function te(e){const a=await e,i=await a.json().catch(()=>{});if(!a.ok||!i?.config||!i.capabilities)throw new Error(i?.error??"AI Config request failed");return i}const ne=c.createContext(void 0),Ne=2e3;function Pe({children:e}){const a=z(),[i,n]=c.useState(),[l,d]=c.useState(),[f,y]=c.useState([]),[g,F]=c.useState(),[p,b]=c.useState(),[A,v]=c.useState(!0),[m,E]=c.useState(!1),[r,s]=c.useState(!1),[u,C]=c.useState(),[N,k]=c.useState(0),o=!!(a.webId&&a.currentPod);c.useEffect(()=>{if(!a.webId||!a.currentPod)return;let x=!1;return queueMicrotask(()=>{if(x||!a.webId||!a.currentPod)return;v(!0),C(void 0),F({webId:a.webId,podUrl:a.currentPod.podUrl,status:"loading",models:[]});const h=ge({webId:a.webId,podUrl:a.currentPod.podUrl,authenticatedFetch:a.fetch}),B={webId:a.webId,podUrl:a.currentPod.podUrl};h.listGatewayCatalogModels?h.listGatewayCatalogModels().then(j=>{x||F({...B,status:"available",models:j})}).catch(j=>{x||F({...B,models:[],status:j instanceof fe&&(j.status===401||j.status===403)?"unauthorized":"error"})}):F({...B,status:"error",models:[]});const se=me({database:a.currentPod.database,authenticatedFetch:a.fetch,podUrl:a.currentPod.podUrl,webId:a.currentPod.webId}).listModels?.()?.catch(()=>[])??Promise.resolve([]);Promise.all([Y(a.fetch),h.listModels().catch(()=>[]),se]).then(([j,re,oe])=>{x||(n(j.config),d(j.capabilities),b(j.lifecycle),y(Re(Ue(oe,re),B.podUrl)))}).catch(j=>{x||C(j instanceof Error?j.message:String(j))}).finally(()=>{x||v(!1)})}),()=>{x=!0}},[N,a.currentPod,a.fetch,a.webId]);const w=c.useCallback(()=>{k(x=>x+1)},[]),S=p?.pending??0;c.useEffect(()=>{if(S<=0||!a.webId||!a.currentPod)return;let x=!1;const h=setInterval(()=>{Y(a.fetch).then(B=>{x||b(B.lifecycle)}).catch(()=>{})},Ne);return()=>{x=!0,clearInterval(h)}},[S,a.currentPod,a.fetch,a.webId]);const I=c.useCallback(async x=>{E(!0),C(void 0);try{const h=await Se(a.fetch,x);n(h.config),d(h.capabilities),b(h.lifecycle)}catch(h){throw C(h instanceof Error?h.message:String(h)),h}finally{E(!1)}},[a.fetch]),D=c.useCallback(async x=>{s(!0),C(void 0);try{const h=await Ie(a.fetch,x);b(B=>({configurationVersion:B?.configurationVersion,pending:(B?.pending??0)+1,recent:[h,...B?.recent??[]].slice(0,20)}))}catch(h){throw C(h instanceof Error?h.message:String(h)),h}finally{s(!1)}},[a.fetch]),P=c.useCallback(async(x,h)=>{await I(x),await D(h)},[D,I]),U=o?A:!1,J=c.useMemo(()=>o?g&&g.webId===a.webId&&g.podUrl===a.currentPod?.podUrl?g:{status:"loading",models:[]}:{status:"unauthorized",models:[]},[o,g,a.webId,a.currentPod?.podUrl]),ie=c.useMemo(()=>({config:i,capabilities:l,lifecycle:p,models:f,gatewayCatalog:J,loading:U,saving:m,rebuilding:r,error:u,reload:w,save:I,rebuild:D,saveAndRebuild:P}),[l,i,U,u,p,f,J,D,r,w,I,P,m]);return t.jsx(ne.Provider,{value:ie,children:e})}function Ue(e,a){const i=new Map,n=l=>`${l.provider}\0${O(l.id)}`;for(const l of[...e,...a]){const d=n(l),f=i.get(d);if(!f){i.set(d,{...l,id:O(l.id)});continue}const y=[...new Set([...f.capabilities??[],...l.capabilities??[]])];i.set(d,{...f,...l,id:O(l.id),resourceId:f.resourceId??l.resourceId,displayName:f.displayName??l.displayName,availability:f.availability==="available"?f.availability:l.availability,modelType:f.modelType??l.modelType,...y.length>0?{capabilities:y}:{},...f.inputModalities??l.inputModalities?{inputModalities:f.inputModalities??l.inputModalities}:{}})}return[...i.values()]}function O(e){const a=e.lastIndexOf("#");return a>=0?e.slice(a+1):e}function Re(e,a){return e.map(i=>{const n=[...i.capabilities??[]],l=i.modelType?de(i.modelType):void 0,d=l?ce[l]:void 0;d&&!n.some(y=>q(y)===d)&&n.push(ee(d));const f=Q.parseRef(ue(i.provider,i.id));if(!f)throw new Error("Invalid AI model resource reference");return{id:i.id,displayName:i.displayName,owner:i.provider,ref:Q.buildIri(a,{id:f.resourceId}),capabilities:n}})}function Te(){const e=c.useContext(ne);if(!e)throw new Error("useAiConfig must be used within AiConfigProvider");return e}function Z(e,a=!1){if(a)return!0;const i=Xe(e)?.phase;return i==="queued"||i==="running"}function Le(e){const a=e?.rebuildTargets??[];if(a.includes("vector"))return"vector";if(a.includes("all"))return"all"}function Xe(e){if(!e)return;const a=e.recent[0];if(!a)return e.pending>0?{phase:"queued",pending:e.pending}:void 0;if(!(a.status==="queued"&&e.pending<=0))return{phase:a.status,pending:e.pending,target:a.target,...a.progress!==void 0?{progress:a.progress}:{},...a.error?{error:a.error}:{}}}function G(e,a){const i=a??(typeof window>"u"?void 0:window.location.origin);if(!i)throw new Error("task credential request needs a current browser origin");return new URL(e,i).toString()}async function V(e){const a=await e.text().catch(()=>"");if(a)try{const i=JSON.parse(a);return i&&typeof i=="object"&&!Array.isArray(i)?i:void 0}catch{return}}function K(e,a){const i=e?.error;return typeof i=="string"&&i?i:a}async function Oe(e){const a=await e.fetch(G("/api/ai/task-credentials",e.origin),{method:"GET",credentials:"include",headers:{accept:"application/json"}}),i=await V(a);if(!a.ok)throw new Error(K(i,"Task credential request failed"));const n=i?.data;return Array.isArray(n)?n:[]}async function _e(e){const a=await e.fetch(G("/api/ai/task-credentials",e.origin),{method:"POST",credentials:"include",headers:{accept:"application/json","content-type":"application/json"},body:JSON.stringify({apiKey:e.apiKey,...e.name?{name:e.name}:{}})}),i=await V(a);if(!a.ok)throw new Error(K(i,"Task credential grant failed"));const n=i?.credential;if(!n||typeof n!="object")throw new Error("Task credential grant returned no grant");return n}async function qe(e){const a=await e.fetch(G(`/api/ai/task-credentials/${encodeURIComponent(e.credentialRef)}`,e.origin),{method:"DELETE",credentials:"include",headers:{accept:"application/json"}});if(!a.ok)throw new Error(K(await V(a),"Task credential revocation failed"))}function $e(e,a){return e.filter(i=>i.status==="active"&&(!a||i.issuer===a)).sort((i,n)=>n.version-i.version)[0]}function ze(e,a){return e?`${e}\0${a??""}`:void 0}function _(e){return e instanceof Error?e.message:String(e)}const Ge=()=>({loaded:!1,working:!1});function Ve(){const e=z(),{fetch:a,issuer:i,requestPodApiKey:n,webId:l}=e,d=ze(l,i),[f,y]=c.useState(()=>({scope:d,generation:0}));f.scope!==d&&y({scope:d,generation:f.generation+1});const{generation:g}=f,F=c.useRef(g);c.useLayoutEffect(()=>{F.current=g},[g]);const p=f.scope===d?f.entry:void 0,b=c.useCallback((r,s)=>{y(u=>u.generation===r?{...u,entry:s(u.entry??Ge())}:u)},[]),A=c.useCallback(r=>Oe({fetch:a}).then(s=>{b(r,u=>({...u,credential:$e(s,i),loaded:!0,error:void 0}))}).catch(s=>{b(r,u=>({...u,loaded:!0,error:_(s)}))}),[i,a,b]);c.useEffect(()=>{d!==void 0&&A(g)},[g,A,d]);const v=c.useCallback(async()=>{d!==void 0&&await A(g)},[g,A,d]),m=c.useCallback(async()=>{if(d===void 0)return;const r=g;b(r,s=>({...s,working:!0,error:void 0}));try{const s=await n?.();if(!s)throw new Error("当前会话无法准备凭据");if(F.current!==r)throw new Error("会话已改变,本次授权已取消");const u=await _e({fetch:a,apiKey:s,name:"Xpod 后台任务"});b(r,C=>({...C,credential:u,loaded:!0,working:!1,error:void 0}))}catch(s){throw b(r,u=>({...u,loaded:!0,working:!1,error:_(s)})),s}},[g,n,a,d,b]),E=c.useCallback(async()=>{if(d===void 0||!p?.credential)return;const r=g,s=p.credential.credentialRef;b(r,u=>({...u,working:!0,error:void 0}));try{await qe({fetch:a,credentialRef:s}),b(r,u=>({...u,credential:void 0,loaded:!0,working:!1,error:void 0}))}catch(u){throw b(r,C=>({...C,loaded:!0,working:!1,error:_(u)})),u}},[p,g,a,d,b]);return{...p?.credential?{credential:p.credential}:{},loading:d!==void 0&&p?.loaded!==!0,working:p?.working===!0,...p?.error?{error:p.error}:{},grant:m,revoke:E,reload:v}}function la(e){return t.jsx(Pe,{children:t.jsx(Ke,{...e})})}function Ke({section:e,onSection:a,accountUrl:i}){const n=Te(),l=z(),d=Ve(),[f,y]=c.useState();if(c.useEffect(()=>{let o=!1;if(!(e!=="data"||!l.webId||!l.currentPod))return he({webId:l.webId,podUrl:l.currentPod.podUrl,authenticatedFetch:l.fetch}).then(w=>{o||y({webId:l.webId,podUrl:l.currentPod.podUrl,value:w.storage})}).catch(()=>{o||y({webId:l.webId,podUrl:l.currentPod.podUrl,value:{status:"error"}})}),()=>{o=!0}},[e,l.webId,l.currentPod,l.fetch]),(e==="models"||e==="search")&&!n.config)return t.jsxs("div",{className:"p-6 text-sm",children:[n.loading?"正在读取 Pod 设置…":"暂时无法读取 Pod 设置。",!n.loading&&(n.error?.includes("service_access_missing")?t.jsx("button",{className:"ml-3 text-primary",disabled:d.working||d.loading,onClick:()=>{d.grant().then(n.reload).catch(()=>{})},children:"允许 Xpod 访问"}):t.jsx("button",{className:"ml-3 text-primary",onClick:n.reload,children:"重试"}))]});const g=n.config,F=n.gatewayCatalog.status==="available"&&n.gatewayCatalog.models.length===0?"empty":n.gatewayCatalog.status,p=o=>n.gatewayCatalog.models.find(w=>be(w.id,o)),b=o=>({ref:o.ref,label:`${o.displayName??o.id} · ${o.owner}`,capabilities:o.capabilities,source:"own"}),A=(o,w,S,I)=>{const D=ae(n.models,o),P=D.find(U=>U.ref===g?.models[o]);return{id:o,label:w,group:S,defaultLabel:I,value:g?.models[o],models:D.map(b),supported:!0,status:g?.models[o]&&!P?"unavailable":void 0,testable:!!(P&&$(P.capabilities).some(U=>["chat","embedding"].includes(U)))}},v=p("smart"),m=p("fast"),E=A("chatModel","智能","对话",v?.displayName??"Xpod 提供");E.value||(E.status=F,E.testable=n.gatewayCatalog.status==="available"&&!!v,E.testValue=v?.id);const r=[E,{id:"fast",label:"快速",group:"对话",defaultLabel:m?.displayName??"Xpod 提供",supported:!0,status:F,testable:n.gatewayCatalog.status==="available"&&!!m,testValue:m?.id},A("ocrModel","视觉辅助","对话","不使用"),A("readerModel","文档理解","文档理解","PaddleOCR · 百度(Xpod 提供)"),{id:"embeddingModel",label:"语义检索",group:"向量",defaultLabel:""},...["语音合成","语音识别"].map(o=>({id:o,label:o,group:"语音",defaultLabel:"不使用"})),...["图像生成","视频生成"].map(o=>({id:o,label:o,group:"图像与视频",defaultLabel:"不使用"})),{id:"decision",label:"决策",group:"决策",defaultLabel:"不使用"}],s=n.models.find(o=>o.ref===g?.models.embeddingModel),u=Le(n.capabilities),C=async(o,w)=>{o==="ftsEnabled"||o==="vectorEnabled"||o==="progressiveIndexingEnabled"?await n.save({searchIndexing:{[o]:w}}):(o==="automaticIndexing"||o==="refreshAfterSourceUpdate"||o==="removeAfterSourceDeletion")&&await n.save({lifecycle:{[o]:w}})},N=f?.webId===l.webId&&f?.podUrl===l.currentPod?.podUrl?f?.value:void 0,k=N?.status==="available"?N.usage:void 0;return t.jsx(Be,{section:e,onSection:a,accountUrl:i,busy:n.saving||n.rebuilding,error:n.error,models:r,embeddingLabel:s?b(s).label:g?.models.embeddingModel?"当前模型暂不可用":"Xpod 提供",embeddingValue:g?.models.embeddingModel,embeddingModels:Ae(n.models,n.capabilities?.embeddingModels).map(b),canChangeEmbedding:!!u&&!Z(n.lifecycle,n.rebuilding),search:[{id:"ftsEnabled",label:"全文检索",checked:g?.searchIndexing.ftsEnabled??!1},{id:"vectorEnabled",label:"语义检索",checked:g?.searchIndexing.vectorEnabled??!1,description:"资料片段会发给向量模型的服务商。"},{id:"progressiveIndexingEnabled",label:"渐进式索引",checked:g?.searchIndexing.progressiveIndexingEnabled??!1}],maintenance:[{id:"automaticIndexing",label:"自动索引新资料",checked:g?.lifecycle.automaticIndexing??!1},{id:"refreshAfterSourceUpdate",label:"资料更新后刷新索引",checked:g?.lifecycle.refreshAfterSourceUpdate??!1},{id:"removeAfterSourceDeletion",label:"资料删除后清理索引",checked:g?.lifecycle.removeAfterSourceDeletion??!1}],pending:n.lifecycle?.pending,version:n.lifecycle?.configurationVersion,jobs:(n.lifecycle?.recent??[]).map(o=>({id:o.id,label:{all:"全部索引",fts:"全文索引",vector:"语义索引"}[o.target],status:o.status,progress:o.progress})),rebuildTargets:n.capabilities?.rebuildTargets??[],onRebuild:n.rebuild,backgroundAccess:{granted:!!d.credential,loading:d.loading,busy:d.working,error:d.error},onGrant:d.grant,onRevoke:d.revoke,usage:[{label:"存储",value:k?`${(k.storageBytes/1024/1024).toFixed(1)} MiB`:"—"},{label:"流量",value:k?`${((k.ingressBytes+k.egressBytes)/1024/1024).toFixed(1)} MiB`:"—"},{label:"AI 用量",value:k?`${k.tokensUsed.toLocaleString()} tokens`:"—"},{label:"计算时长",value:k?`${k.computeSeconds.toLocaleString()} 秒`:"—"}],onModel:async(o,w)=>{(o==="chatModel"||o==="ocrModel"||o==="readerModel")&&await n.save({models:{[o]:w||null}})},onTest:async(o,w)=>{const S=n.models.find(D=>D.ref===w),I=n.gatewayCatalog.models.find(D=>D.id===w);if(!S&&!I)throw new Error("Model unavailable");await Me(l.fetch,S?{...S,capabilities:$(S.capabilities)}:{id:I.id,capabilities:["chat"]})},onToggle:C,onEmbedding:async o=>{if(!u||Z(n.lifecycle,n.rebuilding))throw new Error("Rebuild unavailable");o===g?.models.embeddingModel?await n.rebuild(u):await n.saveAndRebuild({models:{embeddingModel:o}},u)}})}export{la as default};
|
package/static/dashboard/assets/{SystemSettingsPage-BNQP_Yuc.js → SystemSettingsPage-HaNrP1H1.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as m,r,j as e,O as u,N as x}from"./dashboard-
|
|
1
|
+
import{b as m,r,j as e,O as u,N as x}from"./dashboard-Or0gnkou.js";import{c as o}from"./createLucideIcon-BJQl82Qk.js";import{D as y,g,a as b,T as f,u as k,h as v,b as j}from"./nav-item-style-CW1Nnorq.js";import{P as N}from"./PaneListHeader-DtvnRmFq.js";import"./button-wslF55uZ.js";const S=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],w=o("box",S);const M=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],P=o("cloud",M);const A=[["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"}]],C=o("key-round",A);const L=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],_=o("server-cog",L);const D=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],H=o("wrench",D),z=[{scope:"account",label:"Account",description:"Your Pod and its session.",items:[{id:"pod",label:"Pod",path:"pod",description:"Current Pod identity and data boundary.",icon:w},{id:"identity-access",label:"Identity & Access",path:"identity-access",description:"Session, WebID, and account access.",icon:C}]},{scope:"node",label:"This node",description:"Shared by every Pod on this machine.",items:[{id:"storage",label:"Storage",path:"storage",description:"Authority storage backend and limits.",icon:y},{id:"runtime",label:"Runtime",path:"runtime",description:"Low-frequency runtime configuration.",icon:_},{id:"cloud",label:"Cloud",path:"cloud",description:"Cloud coordination settings when supported.",icon:P},{id:"advanced",label:"Advanced",path:"advanced",description:"Expert and compatibility controls.",icon:H}]}];function I(s){return{cloud:s.registered||s.managed||s.domainAllocated}}function V(){const s=m(),[d,n]=r.useState(!1);r.useEffect(()=>{let t=!1;return Promise.all([g(),b()]).then(([l,h])=>{t||n(I({registered:l?.registered===!0,managed:l?.managed===!0,domainAllocated:h?.allocated===!0}).cloud)}),()=>{t=!0}},[]);const a=r.useMemo(()=>z.map(t=>({...t,items:t.items.filter(l=>l.id!=="cloud"||d)})).filter(t=>t.items.length>0),[d]),c=r.useMemo(()=>a.flatMap(t=>t.items),[a]),i=c.find(t=>s.pathname.endsWith(`/${t.path}`))??c[0],p=a.find(t=>t.items.includes(i))?.scope;return e.jsx(f,{mode:"auto",listHeader:e.jsx(N,{title:"Settings"}),list:e.jsx($,{groups:a}),mainHeader:e.jsx("div",{className:"flex h-full items-center px-4",children:e.jsxs("div",{children:[e.jsxs("h1",{className:"text-sm font-semibold",children:["Settings · ",i.label]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:i.description}),p==="node"?e.jsx("div",{className:"text-xs text-warning dark:text-warning",children:"Applies to every Pod on this machine."}):null]})}),main:e.jsx("section",{className:"min-h-full bg-background",children:e.jsx(u,{})}),className:"min-h-full"})}function $({groups:s}){const d=k();return e.jsx("aside",{className:"h-full border-r border-border bg-muted/20 py-2",children:e.jsx("nav",{"aria-label":"Settings sections","data-list-navigation":!0,children:s.map(n=>e.jsxs("div",{children:[e.jsxs("div",{className:"px-4 pb-1 pt-3",children:[e.jsx("div",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:n.label}),e.jsx("div",{className:"text-xs leading-4 text-muted-foreground",children:n.description})]}),n.items.map(a=>{const c=a.icon;return e.jsxs(x,{to:a.path,"aria-label":a.label,onKeyDown:v,onClick:()=>d.openMain(),className:({isActive:i})=>j(i,{compact:!1}),children:[e.jsx(c,{className:"mt-0.5 h-4 w-4 shrink-0","aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-medium",children:a.label}),e.jsx("span",{className:"block text-xs leading-4 text-muted-foreground",children:a.description})]})]},a.id)})]},n.scope))})})}export{V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,j as e,u as ve,a as Ee}from"./dashboard-Or0gnkou.js";import{a4 as Fe,a5 as be}from"./xpod-remembered-login-BUF9fin1.js";import{I as Z,S as ke,g as Ce,u as Ae,h as Be,i as we,A as De,j as ye,k as Ne}from"./XpodShellApp-D_KY4nCW.js";import{i as Se,I as P}from"./PodDeletionAuthorizationPanel-BJk_8rJq.js";import{T as Te,u as te,W as ze}from"./nav-item-style-CW1Nnorq.js";import{c as ee,B as F,i as I}from"./button-wslF55uZ.js";import"./createLucideIcon-BJQl82Qk.js";import"./account-session-DlcKNG7k.js";import"@comunica/query-sparql-solid";import"./safe-continuation-ClWAhcma.js";const ae=i.forwardRef(({className:s,...u},c)=>e.jsx("textarea",{ref:c,className:ee(Se,"min-h-20 resize-y",s),...u}));ae.displayName="Textarea";const Ie={sm:"min-h-9 px-2.5 text-xs [@media(pointer:coarse)]:min-h-11",md:"min-h-9 px-3 text-sm [@media(pointer:coarse)]:min-h-11"},Le="bg-card font-semibold text-primary shadow-sm",Re="text-foreground hover:text-primary";function se({value:s,onValueChange:u,options:c,ariaLabel:d,name:o,size:x="md",className:n,onKeyDown:p,...h}){const m=i.useId(),g=o??m,A=i.useRef([]),k=c.findIndex(r=>r.value===s),b=c.map((r,j)=>r.disabled?-1:j).filter(r=>r>=0),f=k>=0&&!c[k]?.disabled?k:b[0],_=r=>{const j=c[r];!j||j.disabled||(A.current[r]?.focus(),j.value!==s&&u(j.value))},N=(r,j)=>{if(b.length===0)return;const C=b.indexOf(r),y=C<0?j>0?0:b.length-1:(C+j+b.length)%b.length;_(b[y])},W=r=>{if(p?.(r),r.defaultPrevented)return;const j=A.current.findIndex(y=>y===document.activeElement),C=j>=0?j:f;switch(r.key){case"ArrowRight":case"ArrowDown":r.preventDefault(),N(C,1);break;case"ArrowLeft":case"ArrowUp":r.preventDefault(),N(C,-1);break;case"Home":r.preventDefault(),N(-1,1);break;case"End":r.preventDefault(),N(-1,-1);break}};return e.jsx("div",{role:"radiogroup","aria-label":d,className:ee("inline-flex items-center gap-0.5 rounded-lg bg-muted p-0.5",n),onKeyDown:W,...h,children:c.map((r,j)=>{const C=r.value===s,y=r["aria-label"];return e.jsxs("label",{className:ee("relative inline-flex min-w-0 grow cursor-pointer select-none items-center justify-center gap-1.5 rounded-md transition-colors",Ie[x],C?Le:Re,r.disabled&&"cursor-not-allowed opacity-50"),children:[e.jsx("input",{ref:R=>{A.current[j]=R},type:"radio",className:"absolute inset-0 m-0 h-full w-full cursor-pointer appearance-none opacity-0 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:cursor-not-allowed",name:g,value:r.value,checked:C,disabled:r.disabled,tabIndex:j===f?0:-1,"aria-label":y,onChange:()=>_(j)}),r.icon?e.jsx("span",{"aria-hidden":"true",className:"inline-flex shrink-0 items-center",children:r.icon}):null,r.label?e.jsx("span",{className:"min-w-0 break-words text-center",children:r.label}):null]},r.value)})})}const q=s=>["completed","failed","cancelled"].includes(s.status),B=(s,u)=>s.assignedTo===u;function $e(s,u,c,d){const o=s.filter(n=>c==="all"||(c==="mine"?B(n,u):!!n.assignedTo&&!B(n,u))),x=o.filter(n=>!q(n));return{waiting:x.filter(n=>n.waiting),mine:x.filter(n=>!n.waiting&&B(n,u)).sort((n,p)=>(n.dueAt??1/0)-(p.dueAt??1/0)||n.createdAt-p.createdAt),ai:x.filter(n=>!n.waiting&&!!n.assignedTo&&!B(n,u)),unassigned:x.filter(n=>!n.waiting&&!n.assignedTo),recent:o.filter(n=>q(n)&&n.completedAt!==void 0&&n.completedAt>=d-7*86400),ended:o.filter(q)}}function Me(s,u,c){const d=new Date(c.getFullYear(),c.getMonth(),c.getDate()),o=new Date(d);o.setDate(o.getDate()+1);const x=new Date(d);x.setDate(x.getDate()+2);const n=new Date(d);n.setDate(n.getDate()+(7-(d.getDay()+6)%7));const p={overdue:[],today:[],tomorrow:[],week:[],later:[]};for(const h of s.filter(m=>!q(m))){const m=B(h,u)?h.dueAt:h.schedule?.kind==="cron"||h.schedule?.kind==="once"?h.schedule.nextRunAt:void 0;if(m===void 0)continue;const g=m*1e3,A=g<+d?"overdue":g<+o?"today":g<+x?"tomorrow":g<+n?"week":"later";p[A].push(h)}for(const h of Object.values(p))h.sort((m,g)=>(m.dueAt??m.schedule?.nextRunAt??0)-(g.dueAt??g.schedule?.nextRunAt??0));return p}const ce={createAi:!1,resumeStep:!1,handoff:!1,approve:!1},U={open:"待办",active:"按计划运行",blocked:"已暂停",completed:"已完成",failed:"失败",cancelled:"已取消",running:"进行中",queued:"等待执行",waiting_input:"在等你",waiting_runner:"等待执行环境"},L={cron:"定时",interval:"周期",event:"事件",once:"定时"},V=s=>s===void 0?"未设置":new Date(s*1e3).toLocaleString("zh-CN",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}),Pe=s=>{const u=/^(\d+) (\d+) \* \* \*$/.exec(s??"");return u?`每天 ${u[2].padStart(2,"0")}:${u[1].padStart(2,"0")}`:"自定义计划"},oe=s=>s&&/^https?:\/\//.test(s)?s:void 0;function qe({client:s,webId:u,workspace:c,onOpenConnections:d,selectedTaskId:o,selectedRunId:x,renderApproval:n,headerActions:p}){const[h,m]=i.useState([]),[g,A]=i.useState(ce),[k,b]=i.useState(),[f,_]=i.useState("all"),[N,W]=i.useState("list"),[r,j]=i.useState(""),[C,y]=i.useState(""),[R,he]=i.useState(!1),[$,me]=i.useState(!1),[ne,M]=i.useState(!1),[ue,H]=i.useState([]),[E,T]=i.useState(),[O,K]=i.useState(),[pe,X]=i.useState([]),[Y,S]=i.useState(""),[w,ie]=i.useState(!1),[xe,le]=i.useState(!0),G=async()=>{const t=await s.list();m(t.tasks),A(t.capabilities)};i.useEffect(()=>{let t=!0;return le(!0),m([]),A(ce),b(void 0),K(void 0),S(""),s.list().then(a=>{t&&(m(a.tasks),A(a.capabilities))}).catch(a=>{t&&S(String(a.message??a))}).finally(()=>{t&&le(!1)}),()=>{t=!1}},[s,u]),i.useEffect(()=>{let t=!0;return H([]),T(void 0),X([]),k&&s.runs(k).then(a=>{t&&(H(a.runs),O&&T(a.runs.find(Q=>Q.id===O.id)??O))}).catch(a=>{t&&S(String(a.message??a))}),()=>{t=!1}},[s,k,O]),i.useEffect(()=>{let t=!0;return X([]),E&&s.steps(E.id).then(a=>{t&&X(a.steps)}).catch(a=>{t&&S(String(a.message??a))}),()=>{t=!1}},[s,E?.id]),i.useEffect(()=>{if(!o)return;const t=h.find(a=>a.id===o||a.iri===o);t&&(b(t.id),M(!1))},[o,h]),i.useEffect(()=>{let t=!0;return x&&s.selection(x).then(a=>{t&&(b(a.taskId),K(a.run),M(!1))}).catch(a=>{t&&S(String(a.message??a))}),()=>{t=!1}},[s,x]);const D=async t=>{if(!w){ie(!0),S("");try{await t(),await G()}catch(a){S(a instanceof Error?a.message:String(a))}finally{ie(!1)}}},l=h.find(t=>t.id===k),re=h.filter(t=>`${t.title??""} ${t.instruction}`.toLowerCase().includes(r.toLowerCase())),v=$e(re,u,f,Date.now()/1e3),fe=Me(re.filter(t=>f==="all"||(f==="mine"?B(t,u):!!t.assignedTo&&!B(t,u))),u,new Date),J=t=>{b(t.id),K(void 0),M(!1)},z=t=>t.map(a=>e.jsxs("div",{className:`task-row ${k===a.id?"selected":""}`,children:[B(a,u)?e.jsx(Fe,{"aria-label":`完成 ${a.title??a.instruction}`,checked:a.status==="completed",disabled:w,onChange:Q=>{D(()=>s.update(a.id,{completed:Q.target.checked}))}}):e.jsx("span",{"aria-label":L[a.schedule?.kind??""]??"任务",children:a.schedule?.kind==="event"?"ϟ":a.schedule?.kind==="interval"?"↻":"▦"}),e.jsxs(_e,{onClick:()=>J(a),"aria-current":k===a.id?"true":void 0,children:[e.jsx("strong",{children:a.title??a.instruction}),e.jsx("small",{children:a.waiting?"在等你":a.dueAt?V(a.dueAt):U[a.status]??a.status})]})]},a.id)),je=t=>{t.preventDefault(),C.trim()&&D(async()=>{const a=await s.create({prompt:C.trim(),kind:"todo",workspace:c});y(""),J(a.task)})},ge=e.jsxs("form",{onSubmit:je,className:"task-quick-add",children:[e.jsx("span",{"aria-hidden":!0,children:"+"}),e.jsx(P,{"aria-label":"添加待办",placeholder:"添加待办,回车",value:C,onChange:t=>y(t.target.value),disabled:w})]});return e.jsx(Te,{className:"tasks-panel",pageType:"collection",hasObjectCollection:!0,listHeader:e.jsxs("div",{className:"tasks-list-header",children:[e.jsx(ke,{"aria-label":"搜索任务",value:r,onChange:t=>j(t.target.value)}),e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button","aria-label":"新建任务",onClick:()=>{M(!0),b(void 0)},children:"+"})]}),list:e.jsxs("div",{className:"tasks-list",children:[e.jsx(He,{selection:k??(ne?"create":void 0)}),e.jsxs("div",{className:"tasks-toolbar",children:[e.jsx(se,{className:"flex-1",size:"sm",ariaLabel:"交给谁",value:f,onValueChange:_,options:[{value:"all",label:"全部"},{value:"mine",label:"我的"},{value:"ai",label:"AI 的"}]}),e.jsx(se,{size:"sm",ariaLabel:"视图",value:N,onValueChange:W,options:[{value:"list",icon:e.jsx(We,{}),"aria-label":"清单"},{value:"agenda",icon:e.jsx(Ke,{}),"aria-label":"日程"}]})]}),e.jsx("div",{className:"tasks-scroll",children:xe?e.jsx("p",{role:"status",children:"正在读取任务…"}):e.jsxs(e.Fragment,{children:[v.waiting.length>0&&e.jsxs("section",{children:[e.jsxs("h3",{children:["在等你 ",e.jsx("small",{children:v.waiting.length})]}),z(v.waiting)]}),N==="list"?e.jsxs(e.Fragment,{children:[f!=="ai"&&e.jsxs("section",{children:[e.jsxs("h3",{children:["我的待办 ",e.jsx("small",{children:v.mine.length})]}),ge,z(R?v.mine:v.mine.slice(0,5)),v.mine.length>5&&e.jsx(F,{size:"sm",variant:"ghost",className:"task-more h-auto min-h-9 whitespace-normal py-1",type:"button",onClick:()=>he(!R),children:R?"收起":`还有 ${v.mine.length-5} 条`})]}),f!=="mine"&&e.jsxs("details",{children:[e.jsxs("summary",{className:I,children:["AI 按计划在做 ",e.jsx("small",{children:v.ai.length})]}),z(v.ai)]}),v.unassigned.length>0&&e.jsxs("details",{children:[e.jsxs("summary",{className:I,children:["未分配 ",e.jsx("small",{children:v.unassigned.length})]}),z(v.unassigned)]}),e.jsxs("details",{children:[e.jsxs("summary",{className:I,children:["已结束 · ",$?"全部":"最近 7 天"," ",e.jsx("small",{children:($?v.ended:v.recent).length})]}),z($?v.ended:v.recent),e.jsx(F,{size:"sm",variant:"ghost",className:"task-more h-auto min-h-9 whitespace-normal py-1",type:"button",onClick:()=>me(!$),children:$?"只看最近 7 天":"查看全部已完成"})]})]}):Object.entries(fe).map(([t,a])=>e.jsxs("section",{children:[e.jsx("h3",{children:{overdue:"已逾期",today:"今天",tomorrow:"明天",week:"本周",later:"以后"}[t]}),a.length?z(a):e.jsx("p",{className:"task-muted",children:"没有安排"})]},t))]})}),e.jsx("footer",{children:e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",disabled:w,onClick:()=>{D(G)},children:"刷新"})})]}),mainHeader:e.jsxs("div",{className:"tasks-main-header",children:[e.jsx(Oe,{}),e.jsx("span",{children:"任务与待办"}),p]}),main:e.jsxs("div",{className:"tasks-detail",children:[Y&&e.jsx(Z,{className:"task-notice",tone:"destructive",role:"alert",action:e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",onClick:()=>{D(G)},children:"重试"}),d&&e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",onClick:d,children:"检查连接与授权"})]}),children:e.jsx("p",{children:/[\u4e00-\u9fff]/.test(Y)?Y:"暂时无法加载任务,请检查连接后重试"})}),ne?e.jsx(Ve,{supported:g.createAi,busy:w,onCancel:()=>M(!1),onSubmit:t=>{D(async()=>{const a=await s.create({...t,workspace:c});J(a.task)})}},"create"):l?e.jsxs(e.Fragment,{children:[e.jsxs("header",{children:[e.jsxs("div",{children:[e.jsx("span",{className:"task-eyebrow",children:B(l,u)?"我的待办":L[l.schedule?.kind??""]??"任务"}),e.jsx("h2",{children:l.title??l.instruction})]}),e.jsx("span",{className:"task-badge",children:U[l.status]??l.status})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"要做什么"}),e.jsx("p",{className:"task-instruction",children:l.instruction})]}),B(l,u)?e.jsx(Ue,{task:l,busy:w,onSave:t=>{D(()=>s.update(l.id,t))}},`${l.id}:${l.updatedAt}`):e.jsxs(e.Fragment,{children:[e.jsxs("section",{children:[e.jsx("h3",{children:"什么时候"}),e.jsxs("p",{children:[L[l.schedule?.kind??""]??"未设置"," · ",(l.schedule?.cron?Pe(l.schedule.cron):void 0)??(l.schedule?.intervalSeconds?`每 ${l.schedule.intervalSeconds} 秒`:l.schedule?.eventName??"待接入")]}),e.jsxs("p",{children:["下次运行:",V(l.schedule?.nextRunAt)]})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"能动哪些资料"}),e.jsx("p",{className:"task-muted",children:"资料授权明细待接入"})]}),e.jsxs("div",{className:"task-actions",children:[e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",disabled:w||!["active","blocked"].includes(l.status)||!l.schedule,onClick:()=>{D(async()=>{const t=await s.run(l.id);T(t.run),H((await s.runs(l.id)).runs)})},children:"立即运行一次"}),e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",disabled:w||q(l)||!l.schedule||l.schedule.kind==="once",onClick:()=>{D(()=>s.pause(l.id,!l.schedule?.paused))},children:l.schedule?.paused?"恢复后续运行":"暂停后续运行"})]})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"怎么来的"}),oe(l.source)?e.jsx("a",{className:I,href:oe(l.source),target:"_blank",rel:"noreferrer",children:"查看来源对话"}):e.jsx("p",{className:"task-muted",children:"未记录来源"})]}),e.jsxs("section",{children:[e.jsx("h3",{children:"最近运行"}),ue.length?ue.map(t=>e.jsxs("button",{type:"button",className:`task-run-row ${I}`,onClick:()=>T(t),children:[e.jsx("span",{children:V(t.createdAt)}),e.jsx("span",{children:U[t.status]??t.status})]},t.id)):e.jsx("p",{className:"task-muted",children:"暂无运行记录"})]}),E&&e.jsxs("section",{className:"task-run-detail","aria-label":"运行详情",children:[e.jsxs("header",{children:[e.jsxs("h3",{children:["这次运行 · ",U[E.status]??E.status]}),e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",onClick:()=>T(void 0),children:"关闭"})]}),E.status==="waiting_input"&&(n?n(E):e.jsx("p",{children:"这次运行在等你确认。继续同一次运行的确认入口待接入。"})),E.error&&e.jsx(Z,{className:"task-notice",tone:"destructive",role:"alert",children:/[\u4e00-\u9fff]/.test(E.error)?E.error:"本次执行未完成,请检查连接与授权后重试"}),e.jsx("ol",{children:pe.map(t=>e.jsxs("li",{children:[e.jsx("span",{children:V(t.createdAt)})," ",t.message??t.type]},t.id))}),E.status==="failed"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"task-muted",children:"以上是已记录的执行步骤;未记录的副作用无法确认。"}),d&&e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",onClick:d,children:"检查并修复连接"}),e.jsx("p",{className:"task-muted",children:"从失败这一步继续 · 待接入"})]}),["queued","running","waiting_input","waiting_runner"].includes(E.status)&&e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",disabled:w||!!E.cancelRequestedAt,onClick:()=>{D(async()=>{const t=await s.stop(E.id);T(t.run),H((await s.runs(l.id)).runs)})},children:E.cancelRequestedAt?"已请求停止":"停止这次运行"})]})]}):e.jsxs("div",{className:"tasks-empty",children:[e.jsx("span",{className:"task-eyebrow",children:"任务与待办"}),e.jsx("h2",{children:"把想做的事,安排好"}),e.jsx("p",{children:"记下自己的待办,或让 AI 按计划完成任务。"}),e.jsx("p",{className:"task-muted",children:"从左边选择一项,查看详情和运行记录。"})]})]})})}function _e({onClick:s,children:u,...c}){const{openMain:d}=te();return e.jsx("button",{className:I,type:"button",...c,onClick:()=>{s(),d()},children:u})}function He({selection:s}){const{openMain:u}=te();return i.useEffect(()=>{s&&u()},[s,u]),null}function Oe(){const{mode:s,openList:u}=te();return!i.useContext(ze)&&s==="stack"?e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",onClick:u,"aria-label":"返回任务清单",children:"‹"}):null}function Ue({task:s,busy:u,onSave:c}){const[d,o]=i.useState(s.notes??""),[x,n]=i.useState(s.priority??"normal"),[p,h]=i.useState(s.dueAt?new Date(s.dueAt*1e3-new Date(s.dueAt*1e3).getTimezoneOffset()*6e4).toISOString().slice(0,16):"");return e.jsxs("form",{className:"task-form",onSubmit:m=>{m.preventDefault(),c({notes:d,priority:x,dueAt:p?new Date(p).getTime()/1e3:null})},children:[e.jsxs("label",{children:["截止日期",e.jsx(P,{type:"datetime-local",value:p,onChange:m=>h(m.target.value)})]}),e.jsxs("label",{children:["重要程度",e.jsxs(Ce,{value:x,onChange:m=>n(m.target.value),children:[e.jsx("option",{value:"normal",children:"普通"}),e.jsx("option",{value:"high",children:"重要"}),e.jsx("option",{value:"urgent",children:"紧急"})]})]}),e.jsxs("label",{children:["备注",e.jsx(ae,{value:d,onChange:m=>o(m.target.value)})]}),e.jsxs("div",{className:"task-actions",children:[e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"submit",disabled:u,children:"保存待办"}),e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",disabled:u,onClick:()=>c({completed:s.status!=="completed"}),children:s.status==="completed"?"重新打开":"标记完成"})]}),e.jsx("p",{className:"task-muted",children:"交给 AI 去做 · 待接入"})]})}function Ve({supported:s,busy:u,onSubmit:c,onCancel:d}){const[o,x]=i.useState(""),[n,p]=i.useState("cron"),[h,m]=i.useState("09:00"),[g,A]=i.useState(60),[k,b]=i.useState("");return e.jsxs("form",{className:"task-form",onSubmit:f=>{f.preventDefault(),c({prompt:o,kind:n,...n==="cron"?{cron:`${Number(h.split(":")[1])} ${Number(h.split(":")[0])} * * *`}:n==="interval"?{intervalSeconds:g*60}:{eventName:k}})},children:[e.jsxs("header",{children:[e.jsx("h2",{children:"新建任务"}),e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"button",onClick:d,children:"取消"})]}),e.jsxs("label",{children:["要做什么",e.jsx(ae,{required:!0,value:o,placeholder:"例如,每天整理我关注的信息",onChange:f=>x(f.target.value)})]}),e.jsxs("fieldset",{children:[e.jsx("legend",{children:"什么时候"}),e.jsx(se,{className:"grow",size:"sm",ariaLabel:"什么时候",value:n,onValueChange:p,options:[{value:"cron",label:L.cron},{value:"interval",label:L.interval},{value:"event",label:L.event}]})]}),n==="cron"?e.jsxs("label",{children:["每天几点",e.jsx(P,{type:"time",required:!0,value:h,onChange:f=>m(f.target.value)}),e.jsx("small",{children:"按执行环境的时区安排。"})]}):n==="interval"?e.jsxs("label",{children:["每隔多少分钟",e.jsx(P,{type:"number",min:"1",required:!0,value:g,onChange:f=>A(Number(f.target.value))})]}):e.jsxs("label",{children:["事件名称",e.jsx(P,{required:!0,value:k,onChange:f=>b(f.target.value)})]}),!s&&e.jsx(Z,{tone:"info",role:"status",children:"代理执行身份待接入。你可以先在清单中添加自己的待办。"}),e.jsx(F,{size:"sm",variant:"outline",className:"h-auto min-h-9 whitespace-normal py-1",type:"submit",disabled:u||!s||!o.trim(),children:"创建任务"})]})}const de={width:15,height:15,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function We(){return e.jsx("svg",{...de,children:e.jsx("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})})}function Ke(){return e.jsx("svg",{...de,children:e.jsx("path",{d:"M4 5h16v15H4zM4 10h16M8 3v4M16 3v4"})})}function Xe(s,u,c){if(!u.thread)return;const d=s.filter(o=>o.approvalId&&o.run===u.id&&o.thread===u.thread);return d.find(o=>o.approvalId===c)??d[0]}function us(){const s=Ae(),u=ve(),[c]=Ee(),d=Be(),o=i.useMemo(()=>{const n=we({fetch:s.fetch,baseUrl:window.location.origin});return{...n,stop:async p=>{const h=await n.stop(p);return window.dispatchEvent(new Event("xpod:pod-changed")),h}}},[s.fetch]),x=c.get("approval");return e.jsx(qe,{client:o,webId:s.webId,workspace:s.currentPod.podUrl,selectedTaskId:c.get("task")??void 0,selectedRunId:c.get("run")??void 0,onOpenConnections:()=>u("/ai-connections"),headerActions:e.jsx(Ne,{}),renderApproval:n=>{const p=s.currentPod.database.resolveRowIri(be,{id:n.id}),h=Xe(d.snapshot.attention,{...n,id:p},x),m=d.snapshot.attention.some(g=>g.id===p&&g.resumeApproval);return e.jsxs(e.Fragment,{children:[h?e.jsx(De,{item:h}):!m&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"这次运行在等你确认,暂未收到对应的申请。"}),e.jsx(ye,{run:p})]})}},`${s.webId}:${s.currentPod?.podUrl}`)}export{us as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,r as c}from"./dashboard-
|
|
1
|
+
import{j as e,r as c}from"./dashboard-Or0gnkou.js";import{A as C,r as w,a as A,b as v,c as g,d as y,e as I}from"./safe-continuation-ClWAhcma.js";import{u as E,a as N,s as b,X as T}from"./account-session-DlcKNG7k.js";import{B as i}from"./button-wslF55uZ.js";function X(){const a=E(),s=w(a.controls,a.identity),x=N(a.idpIndex),[p,d]=c.useState(null),[f,m]=c.useState(""),[l,h]=c.useState(!1),u=a.bindAccountCapability,o=p?.record.accountId===s?p:null;c.useEffect(()=>{if(document.title="Xpod · 桌面管理",!s||!u)return;let t=!0;const n=u();return(async()=>{const r=await A({accountId:s},{assertCurrent:n,headers:b({Accept:"application/json"})});if(t)try{n();const j=r??v({accountId:s});d(j?{record:j,assertCurrent:n}:null)}catch{d(null)}})(),()=>{t=!1}},[s,u]);const k=async()=>{if(!o||l)return;h(!0),m("");const{record:t,assertCurrent:n}=o;try{if(n(),t.kind==="consent"){if(!await g(t,{assertCurrent:n,headers:b({Accept:"application/json"})})||!y(t,{accountId:t.accountId},{assertCurrent:n}))throw new Error("expired-task")}else{const r=v({accountId:t.accountId});if(!r||r.createdAt!==t.createdAt||r.returnTo!==t.returnTo)throw new Error("expired-task");if(!I({accountId:t.accountId}))throw new Error("expired-task")}n(),window.location.assign(t.returnTo)}catch{d(null),h(!1),m("原任务已失效,请回到账号或应用重新发起。")}};return e.jsxs("main",{className:"mx-auto flex min-h-screen w-full max-w-2xl flex-col justify-center gap-6 px-6 py-12",children:[e.jsx(T,{size:56}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"在桌面 Xpod 中管理"}),e.jsx("p",{className:"text-muted-foreground",children:"Web 提供登录、应用授权、账号管理和快速创建 Pod。管理自己的部署、AI 连接和系统设置,请使用桌面 Xpod。"})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsx(i,{asChild:!0,children:e.jsx("a",{href:"https://github.com/undefinedsco/xpod/releases/latest",target:"_blank",rel:"noopener noreferrer",children:"下载桌面 Xpod"})}),x?e.jsx(i,{asChild:!0,variant:"outline",children:e.jsx("a",{href:x,children:"账号页面"})}):e.jsx(i,{variant:"outline",disabled:!0,children:"账号页面"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"已安装?打开桌面 Xpod,在其中管理本机部署。"}),o?e.jsxs("section",{"aria-label":"原任务",className:"space-y-3 rounded-xl border border-border bg-card p-4",children:[e.jsx("p",{children:"当前任务保留在这个浏览器标签页中。完成桌面操作后,回到这里继续。"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:o.record.kind==="consent"?"返回授权后重新选择 Pod,再确认授权;也可以在那里取消本次请求。":"返回原来的账号页面查看 Pod。"}),e.jsx(i,{variant:"outline",disabled:l,onClick:()=>{k()},children:l?"正在确认…":o.record.kind==="consent"?"回到授权":"返回账号"})]}):null,f?e.jsx("p",{role:"alert",className:"text-sm text-destructive",children:f}):null]})}function B(){return e.jsx(C,{children:e.jsx(X,{})})}export{X as DesktopEntryContent,B as default};
|