@undefineds.co/xpod 0.3.71-rc.8 → 0.3.71
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/ai-gateway/connect/index.d.ts +2 -0
- package/dist/api/ai-gateway/connect/index.js +87 -24
- package/dist/api/ai-gateway/connect/index.js.map +1 -1
- package/dist/api/ai-gateway/pod/HostedPodDataAccess.js +2 -2
- package/dist/api/ai-gateway/pod/HostedPodDataAccess.js.map +1 -1
- package/dist/api/container/common.js +1 -1
- package/dist/api/container/common.js.map +1 -1
- package/dist/api/container/routes.js +1 -1
- package/dist/api/container/routes.js.map +1 -1
- package/dist/api/handlers/AiGatewayManagementHandler.js +28 -12
- package/dist/api/handlers/AiGatewayManagementHandler.js.map +1 -1
- package/dist/api/handlers/PodSettingsHandler.d.ts +12 -19
- package/dist/api/handlers/PodSettingsHandler.js +12 -51
- package/dist/api/handlers/PodSettingsHandler.js.map +1 -1
- package/dist/http/InternalPodDataHttpHandler.d.ts +3 -1
- package/dist/http/InternalPodDataHttpHandler.js +48 -7
- package/dist/http/InternalPodDataHttpHandler.js.map +1 -1
- package/dist/http/InternalPodDataHttpHandler.jsonld +10 -2
- package/dist/runtime/GatewayAdminProxyAuth.d.ts +1 -1
- package/dist/runtime/GatewayAdminProxyAuth.js +1 -1
- package/dist/runtime/GatewayAdminProxyAuth.js.map +1 -1
- package/dist/runtime/Proxy.d.ts +1 -0
- package/dist/runtime/Proxy.js +22 -0
- package/dist/runtime/Proxy.js.map +1 -1
- package/package.json +1 -1
- package/static/dashboard/assets/{NetworkPage-CXjiUMR1.js → NetworkPage-CsERgA2D.js} +1 -1
- package/static/dashboard/assets/{PaneListHeader-BSipfl0W.js → PaneListHeader-WJWFvTKY.js} +1 -1
- package/static/dashboard/assets/{PodPage-Bd3Xhmp-.js → PodPage-Bo_NbnK1.js} +1 -1
- package/static/dashboard/assets/{ServicesPage-CI3jWZGe.js → ServicesPage-CrNDXQlg.js} +1 -1
- package/static/dashboard/assets/{card-z5BV5hTo.js → card-Cjax171A.js} +1 -1
- package/static/dashboard/assets/{dashboard-CSrqAv2L.js → dashboard-CaE1mRUL.js} +4 -4
- package/static/dashboard/assets/{database-Ct5ZPe6L.js → database-B0sGiSz2.js} +1 -1
- package/static/dashboard/assets/{external-link-B7wD1hkm.js → external-link-C_ANDdCY.js} +1 -1
- package/static/dashboard/assets/{index-tOBaUnM1.js → index-CDoxbvUP.js} +1 -1
- package/static/dashboard/assets/{refresh-cw-CFDZPaE8.js → refresh-cw-DHzHxCme.js} +1 -1
- package/static/dashboard/assets/{services-status-context-DN1Icg4A.js → services-status-context-ukghtkFD.js} +1 -1
- package/static/dashboard/dashboard.html +1 -1
- package/static/settings/assets/ModelsPage-ClTKzRGm.js +1 -0
- package/static/settings/assets/{PaneListHeader-BtON8Z5Q.js → PaneListHeader-DTVY4Ig2.js} +1 -1
- package/static/settings/assets/{PodPage-9LGuOloQ.js → PodPage-L_JAOD-r.js} +1 -1
- package/static/settings/assets/{ServicesPage-ZoT9-B_0.js → ServicesPage-BwLxrSWw.js} +1 -1
- package/static/settings/assets/{SettingsPage-Bj4lB3mq.js → SettingsPage-DUGHDPQx.js} +1 -1
- package/static/settings/assets/{card-CCGngjas.js → card-BZF0jSa_.js} +1 -1
- package/static/settings/assets/{services-status-context-CBfImxL_.js → services-status-context-BnbZHZnu.js} +1 -1
- package/static/settings/assets/{settings-yUyFIJxi.js → settings-BN7FyntE.js} +4 -4
- package/static/settings/assets/{workspace-layout-B0wJpPze.js → workspace-layout-jzYHoh3_.js} +1 -1
- package/static/settings/settings.html +1 -1
- package/static/settings/assets/ModelsPage-D87RrLB0.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./dashboard-
|
|
1
|
+
import{c as e}from"./dashboard-CaE1mRUL.js";const a=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],s=e("database",a);export{s as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as a}from"./dashboard-
|
|
1
|
+
import{c as a}from"./dashboard-CaE1mRUL.js";const e=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],n=a("external-link",e);export{n as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var Jn=e=>{throw TypeError(e)};var es=(e,t,n)=>t.has(e)||Jn("Cannot "+n);var be=(e,t,n)=>(es(e,t,"read from private field"),n?n.call(e):t.get(e)),ts=(e,t,n)=>t.has(e)?Jn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),on=(e,t,n,o)=>(es(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);import{g as cr,c as Ee,j as s,e as ie,r as l,A as ar,G as ir,O as lr,L as ur,h as xe,i as pt,R as Kt,k as dr}from"./dashboard-CSrqAv2L.js";import{g as fr,u as zs,f as ns,r as pr,s as mr,b as hr,a as gr,c as xr,d as vr,e as br,h as yr,i as wr,t as Sr}from"./services-status-context-DN1Icg4A.js";import{R as Dn}from"./refresh-cw-CFDZPaE8.js";import{D as Nr}from"./database-Ct5ZPe6L.js";import{E as jr}from"./external-link-B7wD1hkm.js";var jt=cr();const Cr=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Er=Ee("chart-column",Cr);const Rr=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pr=Ee("check",Rr);const Tr=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_r=Ee("chevron-down",Tr);const Or=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Lr=Ee("copy",Or);const Ar=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Dr=Ee("download",Ar);const kr=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],Ir=Ee("file-down",kr);const Mr=[["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"}]],$r=Ee("key-round",Mr);const Fr=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],qr=Ee("pause",Fr);const Ur=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Hr=Ee("play",Ur);const Br=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ss=Ee("search",Br);const Vr=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],zr=Ee("trash-2",Vr);const Kr=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],kn=Ee("triangle-alert",Kr);const Wr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xr=Ee("x",Wr);function pe(e){const{className:t,variant:n="default",size:o="default",children:r,...c}=e,a="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary active:translate-y-px disabled:opacity-50 disabled:pointer-events-none",i={default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-muted text-foreground hover:bg-muted/80",ghost:"bg-transparent hover:bg-muted text-foreground"},u={default:"h-10 px-4 py-2",sm:"h-8 px-3"};return s.jsx("button",{className:ie(a,i[n],u[o],t),...c,children:r})}function Z(e){const{className:t,variant:n,children:o}=e;return s.jsx("div",{className:ie("rounded-xl bg-background",n==="bordered"&&"border border-border",t),children:o})}function ce(e){const{className:t,children:n}=e;return s.jsx("div",{className:ie("px-5 pt-5",t),children:n})}function ae(e){const{className:t,children:n}=e;return s.jsx("div",{className:ie("text-base font-semibold",t),children:n})}function J(e){const{className:t,children:n}=e;return s.jsx("div",{className:ie("px-5 pb-5 pt-4",t),children:n})}function Wt(e){const{className:t,...n}=e;return s.jsx("input",{className:ie("w-full h-10 rounded-md border border-input bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",t),...n})}function Ye(e){const{className:t,...n}=e;return s.jsx("label",{className:ie("text-sm font-medium text-foreground",t),...n})}const Gr={"not-cloud":"非 Cloud 模式","missing-sparql-endpoint":"缺少 PostgreSQL 端点","unsupported-sparql-endpoint":"非 PostgreSQL 端点"};function Yr(e){const t=e.trim();return t?{cacheScopeQuery:t,cacheScopeLimit:50}:{}}function Dz(){const[e,t]=l.useState(null),[n,o]=l.useState(!0),[r,c]=l.useState(!1),[a,i]=l.useState(""),[u,d]=l.useState(""),[h,f]=l.useState(""),g=l.useRef(!1),v=l.useCallback(async(w=!1,j=h)=>{w?o(!0):c(!0),i("");try{const N=await fr(Yr(j));N?t(N):i("RDF 统计不可用")}finally{o(!1),c(!1)}},[h]);l.useEffect(()=>{g.current||(g.current=!0,v(!0))},[v]),l.useEffect(()=>{const w=setInterval(()=>{v(!1)},1e4);return()=>clearInterval(w)},[v]);const y=w=>{w.preventDefault();const j=u.trim();f(j),v(!1,j)},b=()=>{d(""),f(""),v(!1,"")},m=e?Xt(e.generatedAt):"-";return n?s.jsx("div",{className:"p-8 text-foreground",children:"加载中..."}):s.jsxs("div",{className:"p-8",children:[s.jsxs("div",{className:"mb-6 flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"type-h1",children:"RDF 索引"}),s.jsxs("div",{className:"mt-1 text-sm text-muted-foreground",children:["更新时间 ",m]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("form",{className:"flex min-w-0 items-center gap-2",onSubmit:y,children:[s.jsxs("div",{className:"relative w-72 max-w-[70vw]",children:[s.jsx(ss,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(Wt,{value:u,onChange:w=>d(w.target.value),className:"pl-9",placeholder:"principal / base / version"})]}),s.jsxs(pe,{type:"submit",variant:"secondary",size:"sm",className:"gap-2",children:[s.jsx(ss,{className:"h-4 w-4"}),"搜索"]}),h&&s.jsx(pe,{type:"button",variant:"ghost",size:"sm",onClick:b,"aria-label":"清除 scope 搜索",children:s.jsx(Xr,{className:"h-4 w-4"})})]}),s.jsxs(pe,{type:"button",variant:"secondary",size:"sm",onClick:()=>{v(!1)},disabled:r,className:"gap-2",children:[s.jsx(Dn,{className:ie("h-4 w-4",r&&"animate-spin")}),"刷新"]})]})]}),a&&s.jsx("div",{className:"mb-5 rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:a}),e?.available?s.jsx(Qr,{snapshot:e,scopeQuery:h}):s.jsxs(s.Fragment,{children:[s.jsx(Zr,{snapshot:e}),s.jsx("div",{className:"mt-8",children:s.jsx(Ks,{snapshot:e?.benchmarkReports})})]})]})}function Qr(e){const{snapshot:t,scopeQuery:n}=e,o=t.stats,r=o.rdf3x,c=o.slowQueries?.entries??[],a=o.derivedCache,i=a?.scopeEntries??[],u=o.pgAcceleration,d=o.lifecycle,h=d?.coldStart,f=h?.phases.reduce((g,v)=>v.durationMs>g.durationMs?v:g,{name:"-",durationMs:0});return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-5",children:[s.jsx(vt,{icon:Nr,label:"引擎",value:t.engine,detail:u?.profile??"baseline",tone:u?.enabled?"good":"neutral"}),s.jsx(vt,{icon:ar,label:"RDF-3X",value:r?.syncedWithFacts?"已同步":`${r?.refreshLag??0} 版本延迟`,detail:`facts ${r?.factsDataVersion??0} / rdf3x ${r?.rdf3xFactsDataVersion??0} / pending ${r?.pendingSources??0}`,tone:r?.syncedWithFacts?"good":"warn"}),s.jsx(vt,{icon:ir,label:"存储",value:fe(o.totalBytes),detail:`facts ${fe(o.factsBytes)} / derived ${fe(o.derivedBytes)}`,tone:"neutral"}),s.jsx(vt,{icon:Dn,label:"冷启动",value:Oe(h?.durationMs??d?.lastOpenDurationMs??0),detail:`${d?.status??"unknown"} / open ${d?.openCount??0}`,tone:d?.status==="failed"?"warn":"neutral"}),s.jsx(vt,{icon:kn,label:"慢查询",value:`${o.slowQueries?.entryCount??0}`,detail:`保留 ${o.slowQueries?.maxEntries??0} 条`,tone:(o.slowQueries?.entryCount??0)>0?"warn":"good"})]}),s.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 xl:grid-cols-5",children:[s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"空间占用"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"derived/facts",value:vn(o.derivedToFactsRatio)}),s.jsx(B,{label:"total/facts",value:vn(o.totalToFactsRatio)}),s.jsx(B,{label:"result cache",value:fe(o.queryResultCache?.totalBytes??0)}),s.jsx(B,{label:"materialized",value:fe(o.materializedResultCache?.totalBytes??0)}),s.jsx(B,{label:"template",value:fe(o.queryTemplateCache?.totalBytes??0)})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"Cache"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"result entries",value:`${o.queryResultCache?.entryCount??0}`}),s.jsx(B,{label:"result scopes",value:`${o.queryResultCache?.scopeCount??0}`}),s.jsx(B,{label:"materialized entries",value:`${o.materializedResultCache?.entryCount??0}`}),s.jsx(B,{label:"materialized scopes",value:`${o.materializedResultCache?.scopeCount??0}`}),s.jsx(B,{label:"result hit rate",value:rs(o.queryResultCache)}),s.jsx(B,{label:"materialized hit rate",value:rs(o.materializedResultCache)}),s.jsx(B,{label:"template entries",value:`${o.queryTemplateCache?.entryCount??0}`}),s.jsx(B,{label:"cache pressure",value:bt(a?.cachePressure??0)})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"生命周期"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"driver",value:d?.driver??"-"}),s.jsx(B,{label:"ready at",value:d?.lastReadyAt?Xt(d.lastReadyAt):"-"}),s.jsx(B,{label:"slowest phase",value:`${f?.name??"-"} ${Oe(f?.durationMs??0)}`}),s.jsx(B,{label:"dirty sources",value:`${r?.pendingSources??0}`}),s.jsx(B,{label:"custom index",value:h?h.customIndexDeferred?"deferred":"startup":"-"}),s.jsx(B,{label:"maintenance",value:h?h.maintenanceEnabled?"enabled":"disabled":"-"})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"权限 Scope"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"scope versions",value:`${a?.scopeVersionCount??0}`}),s.jsx(B,{label:"max scope",value:fe(a?.maxScopeBytes??0)}),s.jsx(B,{label:"largest scope",value:fe(a?.largestScopeBytes??0)}),s.jsx(B,{label:"scope pressure",value:bt(a?.largestScopePressure??0)}),s.jsx(B,{label:"scope hash",value:yt(a?.largestScopeHash??"-")}),s.jsx(B,{label:"facts version",value:`${a?.largestScopeFactsDataVersion??"-"}`})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"PG 加速"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"profile",value:u?.profile??"baseline"}),s.jsx(B,{label:"provider",value:u?.provider??"-"}),s.jsx(B,{label:"enabled",value:u?.enabled?"true":"false"}),s.jsx(B,{label:"capabilities",value:`${u?.capabilities?.length??0}`}),s.jsx(B,{label:"active operators",value:wt(u?.activeOperators)}),s.jsx(B,{label:"missing caps",value:wt(u?.missingCapabilities)}),s.jsx(B,{label:"fallback",value:u?.fallbackReason??"-"})]})]})]}),s.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 xl:grid-cols-2",children:[s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"Cache 淘汰"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"total",value:`${a?.evictionCount??0}`}),s.jsx(nc,{evictions:a?.evictions})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"Cache 载荷"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"result payload",value:fe(a?.queryResultPayloadBytes??0)}),s.jsx(B,{label:"materialized payload",value:fe(a?.materializedResultPayloadBytes??0)}),s.jsx(B,{label:"template bytes",value:fe(a?.queryTemplateBytes??0)}),s.jsx(B,{label:"result table/index",value:`${fe(o.queryResultCache?.tableBytes??0)} / ${fe(o.queryResultCache?.indexBytes??0)}`}),s.jsx(B,{label:"materialized table/index",value:`${fe(o.materializedResultCache?.tableBytes??0)} / ${fe(o.materializedResultCache?.indexBytes??0)}`})]})]})]}),s.jsx("div",{className:"mb-8",children:s.jsx(tc,{entries:i,totalCount:a?.scopeVersionCount??0,query:n})}),s.jsx("div",{className:"mb-8",children:s.jsx(Ks,{snapshot:t.benchmarkReports})}),s.jsx(Jr,{entries:c})]})}function Zr(e){const{snapshot:t}=e,n=t?.available===!1?Gr[t.reason]:"无数据";return s.jsx(Z,{variant:"bordered",children:s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[s.jsx(kn,{className:"h-5 w-5 text-yellow-600"}),s.jsx("span",{children:n})]})})})}function vt(e){const t=e.icon;return s.jsx(Z,{variant:"bordered",children:s.jsxs(J,{children:[s.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:e.label}),s.jsx(t,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx("div",{className:ie("text-xl font-semibold",e.tone==="good"&&"text-green-600",e.tone==="warn"&&"text-yellow-700"),children:e.value}),s.jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:e.detail})]})})}function B(e){return s.jsxs("div",{className:"flex items-center justify-between gap-4 text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:e.label}),s.jsx("span",{className:"min-w-0 truncate font-mono",children:e.value})]})}function Jr(e){return s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"最近慢查询"})}),s.jsx(J,{className:"p-0",children:e.entries.length===0?s.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:"暂无慢查询"}):s.jsx("div",{className:"overflow-auto",children:s.jsxs("table",{className:"w-full min-w-[920px] border-collapse text-left text-sm",children:[s.jsx("thead",{className:"border-b border-border text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-5 py-3 font-medium",children:"时间"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"路径"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"耗时"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"扫描"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Cache"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"原因"})]})}),s.jsx("tbody",{children:e.entries.map(t=>s.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[s.jsx("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:Xt(t.generatedAt)}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsx("div",{className:"font-medium",children:t.selectedPath}),s.jsx("div",{className:"mt-1 max-w-[240px] truncate font-mono text-xs text-muted-foreground",children:yt(t.queryKey)})]}),s.jsx("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:Oe(t.runtime.durationMs)}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[le(t.runtime.scannedRows)," / ",le(t.runtime.returnedRows)]}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsxs("div",{className:"font-mono text-xs",children:["tpl ",t.cache.templateStatus??"-"," / res ",t.cache.resultStatus??"-"," / mat ",t.cache.materializedStatus??"-"]}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate font-mono text-xs text-muted-foreground",children:rc(t)}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:cc(t)}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:t.cache.scopeBasePath??t.cache.scopeHash}),t.cache.scopePrincipal&&s.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:t.cache.scopePrincipal})]}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsx(oc,{reasons:t.slowQuery.reasons}),s.jsx(ec,{entry:t})]})]},`${t.generatedAt}-${t.queryKey}`))})]})})})]})}function ec(e){const t=ac(e.entry),n=ic(e.entry);return!t&&!n?null:s.jsxs("div",{className:"mt-2 max-w-[320px] space-y-1 text-xs text-muted-foreground",children:[t&&s.jsx("div",{className:"truncate",children:t}),n&&s.jsx("div",{className:"truncate",children:n})]})}function tc(e){return s.jsxs(Z,{variant:"bordered",children:[s.jsxs(ce,{className:"flex flex-row items-start justify-between gap-3",children:[s.jsx(ae,{children:"权限 Scope 明细"}),s.jsxs("div",{className:"text-sm text-muted-foreground",children:[le(e.entries.length)," / ",le(e.totalCount)]})]}),s.jsx(J,{className:"p-0",children:e.entries.length===0?s.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:e.query?"没有匹配的缓存 scope":"暂无缓存 scope"}):s.jsx("div",{className:"overflow-auto",children:s.jsxs("table",{className:"w-full min-w-[1020px] border-collapse text-left text-sm",children:[s.jsx("thead",{className:"border-b border-border text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-5 py-3 font-medium",children:"Scope"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Principal"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Base"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"权限"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"版本"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Payload"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Entries"})]})}),s.jsx("tbody",{children:e.entries.map(t=>s.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:[s.jsx("div",{children:yt(t.scopeHash)}),s.jsxs("div",{className:"mt-1 text-muted-foreground",children:["facts ",t.factsDataVersion]})]}),s.jsx("td",{className:"px-5 py-3",children:s.jsx("div",{className:"max-w-[220px] truncate",children:t.principal??"-"})}),s.jsx("td",{className:"px-5 py-3",children:s.jsx("div",{className:"max-w-[260px] truncate",children:t.basePath??"-"})}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:[t.authorizationModel??"-","/",t.mode??"-"]}),s.jsx("td",{className:"px-5 py-3",children:s.jsx("div",{className:"max-w-[180px] truncate font-mono text-xs",children:t.permissionVersion??"-"})}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsx("div",{children:fe(t.payloadBytes)}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["r ",fe(t.queryResultPayloadBytes)," / m ",fe(t.materializedResultPayloadBytes)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[le(t.queryResultEntries)," / ",le(t.materializedResultEntries)]})]},`${t.scopeHash}-${t.factsDataVersion}`))})]})})})]})}function nc(e){const t=Object.entries(e.evictions??{}).filter(([,n])=>n>0);return t.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"暂无淘汰"}):s.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:t.map(([n,o])=>s.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md bg-muted px-3 py-2 text-sm",children:[s.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:n}),s.jsx("span",{className:"font-mono",children:le(o)})]},n))})}function Ks(e){const t=e.snapshot?.reports??[],n=e.snapshot?.errors??[];return s.jsxs(Z,{variant:"bordered",children:[s.jsxs(ce,{className:"flex flex-row items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx(ae,{children:"Benchmark 报告"}),s.jsx("div",{className:"mt-1 max-w-[720px] truncate text-sm text-muted-foreground",children:(e.snapshot?.roots??[]).join(", ")||"未配置目录"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Er,{className:"h-4 w-4"}),le(e.snapshot?.reportCount??t.length)]})]}),s.jsxs(J,{className:"p-0",children:[n.length>0&&s.jsxs("div",{className:"border-b border-border px-5 py-3 text-sm text-yellow-700",children:[le(n.length)," 个报告读取失败,最近一个:",n[0].path," - ",n[0].message]}),t.length===0?s.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:"暂无 benchmark report"}):s.jsx("div",{className:"overflow-auto",children:s.jsxs("table",{className:"w-full min-w-[1180px] border-collapse text-left text-sm",children:[s.jsx("thead",{className:"border-b border-border text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-5 py-3 font-medium",children:"时间"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Profile"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"规模"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Gate"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Ingest"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Refresh"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Cold / Warm"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Storage"})]})}),s.jsx("tbody",{children:t.map(o=>s.jsx(sc,{report:o},`${o.path}-${o.generatedAt}`))})]})})]})]})}function sc(e){const t=e.report,n=t.failedPlanCases.length,o=t.failedConcurrencyCases.length;return s.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[s.jsxs("td",{className:"whitespace-nowrap px-5 py-3",children:[s.jsx("div",{className:"font-mono text-xs",children:Xt(t.generatedAt)}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate font-mono text-xs text-muted-foreground",children:t.path})]}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsx("div",{className:"font-medium",children:t.rdfAccelerationProfile??t.engine}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[t.driver??t.engine," / ",t.caseProfile??"-"]}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:t.pgAccelerationFallbackReason??wt(t.pgActiveOperators)})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsxs("div",{children:[le(t.seedQuadCount??0)," / ",le(t.targetQuadCount??0)]}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[t.scale??"-"," / ",t.fullScale===!1?"partial":"full"]})]}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsx(os,{ok:t.planMatched!==!1&&n===0,label:`plan ${t.planMatched===!1?"fail":"ok"}`}),s.jsx("div",{className:"mt-1",children:s.jsx(os,{ok:t.concurrencyMatched!==!1&&o===0,label:`conc ${t.concurrency??1}`})}),(n>0||o>0)&&s.jsxs("div",{className:"mt-1 text-xs text-yellow-700",children:["fail ",le(n+o)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsx("div",{children:Oe(t.ingestDurationMs??0)}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["COPY ",le(t.copyRows??0)," / fb ",le(t.copyFallbacks??0)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsx("div",{children:Oe(t.refreshDurationMs??0)}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["planner ",Oe(t.plannerStatsDurationMs??0)," / ",le(t.plannerStatsAnalyzedTables?.length??0)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsxs("div",{children:[Oe(t.coldStartDurationMs??0)," / ",Oe(t.firstQueryDurationMs??0)]}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["p50/p95 ",Oe(t.warmP50DurationMs??0)," / ",Oe(t.warmP95DurationMs??0)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsx("div",{children:vn(t.storageTotalToFactsRatio??0)}),s.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:fe(t.storageTotalBytes??0)})]})]})}function os(e){return s.jsx("span",{className:ie("inline-flex rounded-md px-2 py-0.5 text-xs",e.ok?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-800"),children:e.label})}function oc(e){return s.jsx("div",{className:"flex max-w-[320px] flex-wrap gap-1.5",children:e.reasons.map(t=>s.jsx("span",{className:"rounded-md bg-yellow-100 px-2 py-0.5 text-xs text-yellow-800",children:t},t))})}function fe(e){if(!Number.isFinite(e)||e<=0)return"0 B";const t=["B","KiB","MiB","GiB","TiB"];let n=e,o=0;for(;n>=1024&&o<t.length-1;)n/=1024,o+=1;return`${n>=10||o===0?n.toFixed(0):n.toFixed(1)} ${t[o]}`}function vn(e){return Number.isFinite(e)?`${e.toFixed(2)}x`:"0.00x"}function bt(e){return Number.isFinite(e)?`${Math.round(e*100)}%`:"0%"}function rs(e){const t=e?.hitCount??0,n=e?.missCount??0,o=t+n;return o<=0?"-":`${bt(t/o)} (${le(t)}/${le(o)})`}function rc(e){const t=e.cache.materialized?.key;if(t)return`mat ${yt(t)}`;const n=e.cache.result?.key??e.queryKey;return`res ${yt(n)}`}function cc(e){const t=e.derivedCache,n=bt(t.cachePressure),o=bt(t.largestScopePressure),r=t.evictionCount;return`pressure ${n} / scope ${o} / evict ${le(r)}`}function ac(e){const t=e.histogramHints??[];if(t.length===0)return"";const n=t.map(o=>`${o.kind}:${le(o.quadCount)}`);return`hist ${le(t.length)} ${wt(n)}`}function ic(e){const t=e.rejectedNativeOperators??[];if(t.length===0)return"";const n=t.map(o=>`${o.capability}:${o.reason}`);return`native rejected ${le(t.length)} ${wt(n)}`}function Oe(e){return Number.isFinite(e)?`${Math.round(e)} ms`:"0 ms"}function le(e){return Number.isFinite(e)?new Intl.NumberFormat().format(e):"0"}function Xt(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function yt(e){return e.length<=16?e:`${e.slice(0,12)}...${e.slice(-4)}`}function wt(e){return e?.length?e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`:"-"}function kz(){return s.jsx(lr,{})}const lc={healthy:"border-green-200 bg-green-50 text-green-700 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",degraded:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300",failed:"border-destructive/30 bg-destructive/10 text-destructive",unknown:"border-border bg-muted text-muted-foreground"};function qt(e){const{state:t,children:n,className:o}=e;return s.jsx("span",{className:ie("inline-flex items-center rounded-md border px-2 py-1 text-xs font-medium",lc[t],o),children:n})}function uc(e,t,n){const o=dc(e.XPOD_TUNNEL_PROFILES,n);if(o)return o;switch(t){case"ngrok":return e.NGROK_URL||"未配置";case"cloudflare":return e.CLOUDFLARE_TUNNEL_URL||e.XPOD_TUNNEL_PUBLIC_URL||"未配置";case"sakura_frp":return e.SAKURA_TUNNEL_URL||e.XPOD_TUNNEL_PUBLIC_URL||"未配置";case"frp":return e.FRP_TUNNEL_URL||"未配置";default:return"未配置"}}function dc(e,t){if(!e||!t||t==="none")return"";try{const n=JSON.parse(e);if(!Array.isArray(n))return"";const o=n.find(c=>c&&typeof c=="object"&&!Array.isArray(c)&&c.id===t);return(typeof o?.publicUrl=="string"?o.publicUrl.trim():"")||""}catch{return""}}function Ut(e){switch(e){case"healthy":return"可用";case"degraded":return"降级";case"failed":return"失败";default:return"未知"}}function cs(e){return e?e.status==="running"?"healthy":e.status==="starting"?"degraded":"failed":"unknown"}function fc(e,t){return e?t?"healthy":"failed":"unknown"}function pc(e,t){return e?t?"本机访问应可用。":"CSS 或 API 未运行。":"等待服务状态上报。"}function as(e){if(!e)return"未知";const t=Math.floor(e/1e3),n=Math.floor(t/60),o=Math.floor(n/60);return o>0?`${o}h ${n%60}m`:n>0?`${n}m ${t%60}s`:`${t}s`}function mc(e){return["Public","User tunnel","LAN","Loopback"].map(n=>e.find(o=>o.name===n&&o.state==="healthy")).find(n=>!!n)??e.find(n=>n.state==="degraded")??e.find(n=>n.state==="unknown")??null}function hc(e){return s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"访问路径"})}),s.jsx(J,{children:s.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-5",children:e.routes.map(t=>s.jsxs("div",{className:"min-w-0 rounded-xl border border-border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:t.name}),s.jsx(qt,{state:t.state,children:Ut(t.state)})]}),s.jsx("div",{className:"mt-2 min-w-0 break-all font-mono text-xs text-muted-foreground",title:t.target,children:t.target}),s.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:t.detail})]},t.name))})})]})}function gc(e){return s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"完整路径详情"})}),s.jsx(J,{children:s.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:s.jsxs("table",{className:"w-full min-w-[720px] text-sm",children:[s.jsx("thead",{className:"bg-muted/60 text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"路径"}),s.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"目标"}),s.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"状态"}),s.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"证据"})]})}),s.jsx("tbody",{className:"divide-y divide-border",children:e.routes.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-3 py-2 font-medium",children:t.name}),s.jsx("td",{className:"px-3 py-2 font-mono text-xs break-all",children:t.target}),s.jsx("td",{className:"px-3 py-2",children:s.jsx(qt,{state:t.state,children:Ut(t.state)})}),s.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:t.detail})]},t.name))})]})})})]})}function xc(e){if(e.state==="healthy"||e.state==="unknown")return null;const t=e.routes.find(o=>o.state==="failed"||o.state==="degraded"),n=t?`${t.name} 当前不可用。${t.detail}`:"运行时状态还没有完整上报,请刷新或查看日志。";return s.jsxs(Z,{variant:"bordered",className:"border-amber-200 bg-amber-50/60 dark:border-amber-900 dark:bg-amber-950/20",children:[s.jsx(ce,{children:s.jsx(ae,{children:"需要处理"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:n}),s.jsx(pe,{variant:"secondary",onClick:()=>window.location.assign("/dashboard/logs"),children:"打开日志"})]})]})}function Iz(){const e=zs(),[t,n]=l.useState(null),[o,r]=l.useState(null),[c,a]=l.useState(null),[i,u]=l.useState(null),[d,h]=l.useState(null),[f,g]=l.useState(!0),[v,y]=l.useState(""),[b,m]=l.useState(""),[w,j]=l.useState(null),N=l.useCallback(M=>{n(M.servicesData),r(M.adminData),a(M.configData),u(M.ddnsData),h(M.publicCheck),j(M.checkedAt),m(""),g(!1)},[]),S=l.useCallback(async()=>{try{N(await ns())}catch{m("状态加载失败,请查看日志或稍后刷新。"),g(!1)}},[N]),R=l.useCallback(async()=>{g(!0),await S()},[S]);l.useEffect(()=>{if(e)return;let M=!1;return ns().then(X=>{M||N(X)}).catch(()=>{M||(m("状态加载失败,请查看日志或稍后刷新。"),g(!1))}),()=>{M=!0}},[N,e]);const E=e?.snapshot,T=E?.servicesData??t,D=E?.adminData??o,k=E?.configData??c,I=E?.ddnsData??i,U=E?.publicCheck??d,p=E?.checkedAt??w,x=e?e.loading&&!E:f,C=e?.error??b,_=T?.find(M=>M.name==="css"),O=T?.find(M=>M.name==="api"),L=T?"healthy":"unknown",A=cs(_),q=cs(O),$=A==="healthy"&&q==="healthy",V=k?.env??{},z=V.XPOD_TUNNEL_PROVIDER||I?.tunnelProvider||"none",te=V.XPOD_TUNNEL_ACTIVE_PROFILE_ID||z,G=pr(V,I,window.location.origin),re=uc(V,z,te),Y=l.useMemo(()=>{const M=U?.status==="pass"?"healthy":U?.status==="fail"?"failed":"unknown",X=z==="none"?"unknown":I?.mode==="tunnel"||re!=="未配置"?"healthy":"degraded";return[{name:"Loopback",target:`http://127.0.0.1:${V.CSS_PORT||"3000"}`,state:fc(T,$),detail:pc(T,$)},{name:"LAN",target:I?.ipv4?`http://${I.ipv4}:${V.CSS_PORT||"3000"}`:"等待本机地址上报",state:I?.ipv4&&$?"healthy":"unknown",detail:I?.ipv4?"局域网设备可尝试该地址。":"运行时还没有上报局域网地址。"},{name:"Public",target:G,state:M,detail:U?.detail||"公网可达性尚未检测。"},{name:"User tunnel",target:re,state:X,detail:z==="none"?"未启用用户隧道。":`当前供应商: ${z}`},{name:"P2P backup",target:"信令协调的原生客户端",state:"unknown",detail:"P2P 只作为免配置备选路径,不作为浏览器默认入口。"}]},[$,G,I,V.CSS_PORT,U,T,z,re]),ve=T?$?Y.some(M=>M.state==="failed")?"degraded":"healthy":"failed":"unknown",F=mc(Y),K=async()=>{const M={lastCheckedAt:p?.toISOString()??null,services:T,adminStatus:D,ddnsStatus:I,publicIpCheck:U,routes:Y,stableDataUrl:G,recommendedRoute:F,sanitizedConfig:k?{env:k.env,secrets:k.secrets??{}}:null};await navigator.clipboard.writeText(JSON.stringify(M,null,2)),y("状态 JSON 已复制")},ne=async()=>{await navigator.clipboard.writeText(G),y("稳定资料入口已复制")};return s.jsxs("div",{className:"p-4 sm:p-8 max-w-6xl space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"type-h1",children:"状态"}),s.jsx("p",{className:"mt-2 max-w-[65ch] text-sm text-muted-foreground",children:"查看服务是否运行、资料路径是否稳定,以及外部访问失败时需要处理什么。"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(pe,{variant:"ghost",onClick:()=>e?e.refresh():void R(),disabled:x||e?.refreshing,className:"gap-2",children:[s.jsx(Dn,{className:`h-4 w-4 ${x?"animate-spin":""}`}),"刷新"]}),s.jsxs(pe,{variant:"secondary",onClick:()=>{K()},className:"gap-2",children:[s.jsx(Lr,{className:"h-4 w-4"}),"复制状态 JSON"]}),s.jsxs(pe,{onClick:()=>window.open(G,"_blank"),className:"gap-2",children:[s.jsx(jr,{className:"h-4 w-4"}),"打开入口"]})]})]}),v?s.jsx("p",{className:"text-sm text-green-700 dark:text-green-300",children:v}):null,C?s.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}):null,s.jsx(Z,{variant:"bordered",children:s.jsx(J,{className:"pt-5",children:s.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1fr_1.5fr]",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{state:ve,children:Ut(ve)}),s.jsx("div",{className:"text-2xl font-semibold",children:"Xpod runtime"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:p?`最后检查: ${p.toLocaleString()}`:"等待第一次检查。"}),s.jsxs("div",{className:"pt-3",children:[s.jsx("div",{className:"text-sm font-medium",children:"稳定资料入口"}),s.jsx("div",{className:"mt-1 break-all rounded-md border border-border bg-muted/30 px-3 py-2 font-mono text-sm",children:G||"等待稳定入口"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium",children:"当前建议路径"}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:F?`${F.name}: ${F.detail}`:"等待访问路径检测。"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[s.jsx(pe,{variant:"secondary",size:"sm",onClick:()=>{ne()},disabled:!G,children:"复制 URL"}),s.jsx(pe,{size:"sm",onClick:()=>window.open(G,"_blank"),disabled:!G,children:"打开入口"})]})]}),s.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[["Gateway",L,"当前控制台可访问"],["CSS",A,as(_?.uptime)],["API",q,as(O?.uptime)],["Tunnel",z==="none"?"unknown":"healthy",z]].map(([M,X,W])=>s.jsxs("div",{className:"rounded-xl border border-border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:M}),s.jsx(qt,{state:X,children:Ut(X)})]}),s.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:W})]},M))})]})})}),s.jsx(xc,{state:ve,routes:Y}),s.jsx(hc,{routes:Y}),s.jsx(gc,{routes:Y}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"Cloud 协调"})}),s.jsxs(J,{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"nodeId"}),s.jsx("span",{className:"font-mono break-all",children:V.XPOD_NODE_ID||"未上报"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"spDomain"}),s.jsx("span",{className:"font-mono break-all",children:V.XPOD_SP_DOMAIN||I?.fqdn||"未分配"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"DDNS"}),s.jsx("span",{children:I?.detail||"未上报"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"heartbeat"}),s.jsx("span",{children:I?.enabled?"已启用":"未启用或未上报"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"模式"}),s.jsx("span",{children:I?.mode||"unknown"})]}),s.jsx("p",{className:"pt-2 text-muted-foreground",children:"Cloud 负责稳定域名和 IDP,本地 SP 负责数据存储与实际接入。"})]})]}),s.jsxs(Z,{variant:"bordered",className:"bg-muted/30",children:[s.jsx(ce,{children:s.jsx(ae,{children:"配置摘要"})}),s.jsxs(J,{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"edition"}),s.jsx("span",{children:D?.env.XPOD_EDITION||"local"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"baseUrl"}),s.jsx("span",{className:"font-mono break-all",children:G})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"storage"}),s.jsx("span",{className:"font-mono break-all",children:V.CSS_ROOT_FILE_PATH||"./data"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"provider"}),s.jsx("span",{children:z})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"tunnelProfile"}),s.jsx("span",{children:te})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"secrets"}),s.jsxs("span",{children:[Object.entries(k?.secrets??{}).filter(([,M])=>M.configured).length," 个已配置"]})]})]})]}),s.jsxs("div",{className:"text-sm text-muted-foreground",children:["需要修改运行时配置时进入 ",s.jsx(ur,{className:"text-primary underline-offset-4 hover:underline",to:"/services/configuration",children:"配置"}),"。"]})]})}var vc=Object.defineProperty,bc=(e,t)=>vc(e,"name",{value:t,configurable:!0});function bn(e,[t,n]){return Math.min(n,Math.max(t,e))}bc(bn,"clamp");var yc=Object.defineProperty,ht=(e,t)=>yc(e,"name",{value:t,configurable:!0}),Ws=!!(typeof window<"u"&&window.document&&window.document.createElement);function me(e,t,{checkForDefaultPrevented:n=!0}={}){return ht(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}ht(me,"composeEventHandlers");function wc(e){if(!Ws)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}ht(wc,"getOwnerWindow");function yn(e){if(!Ws)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}ht(yn,"getOwnerDocument");function Xs(e,t=!1){const{activeElement:n}=yn(e);if(!n?.nodeName)return null;if(Gs(n)&&n.contentDocument)return Xs(n.contentDocument.body,t);if(t){const o=n.getAttribute("aria-activedescendant");if(o){const r=yn(n).getElementById(o);if(r)return r}}return n}ht(Xs,"getActiveElement");function Gs(e){return e.tagName==="IFRAME"}ht(Gs,"isFrame");var Sc=Object.defineProperty,Re=(e,t)=>Sc(e,"name",{value:t,configurable:!0});function Nc(e,t){const n=l.createContext(t);n.displayName=e+"Context";const o=Re(c=>{const{children:a,...i}=c,u=l.useMemo(()=>i,Object.values(i));return s.jsx(n.Provider,{value:u,children:a})},"Provider");o.displayName=e+"Provider";function r(c,a={}){const{optional:i=!1}=a,u=l.useContext(n);if(u)return u;if(t!==void 0)return t;if(!i)throw new Error(`\`${c}\` must be used within \`${e}\``)}return Re(r,"useContext"),[o,r]}Re(Nc,"createContext");function Ct(e,t=[]){let n=[];function o(c,a){const i=l.createContext(a);i.displayName=c+"Context";const u=n.length;n=[...n,a];const d=Re(f=>{const{scope:g,children:v,...y}=f,b=g?.[e]?.[u]||i,m=l.useMemo(()=>y,Object.values(y));return s.jsx(b.Provider,{value:m,children:v})},"Provider");d.displayName=c+"Provider";function h(f,g,v={}){const{optional:y=!1}=v,b=g?.[e]?.[u]||i,m=l.useContext(b);if(m)return m;if(a!==void 0)return a;if(!y)throw new Error(`\`${f}\` must be used within \`${c}\``)}return Re(h,"useContext"),[d,h]}Re(o,"createContext");const r=Re(()=>{const c=n.map(a=>l.createContext(a));return Re(function(i){const u=i?.[e]||c;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])},"useScope")},"createScope");return r.scopeName=e,[o,Ys(r,...t)]}Re(Ct,"createContextScope");function Ys(...e){const t=e[0];if(e.length===1)return t;const n=Re(()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Re(function(c){const a=o.reduce((i,{useScope:u,scopeName:d})=>{const f=u(c)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Re(Ys,"composeContextScopes");var jc=Object.defineProperty,ge=(e,t)=>jc(e,"name",{value:t,configurable:!0});function Qs(e){const t=e+"CollectionProvider",[n,o]=Ct(t),[r,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=ge(b=>{const{scope:m,children:w}=b,j=l.useRef(null),N=l.useRef(new Map).current;return s.jsx(r,{scope:m,itemMap:N,collectionRef:j,children:w})},"CollectionProvider");a.displayName=t;const i=e+"CollectionSlot",u=pt(i),d=l.forwardRef((b,m)=>{const{scope:w,children:j}=b,N=c(i,w),S=xe(m,N.collectionRef);return s.jsx(u,{ref:S,children:j})});d.displayName=i;const h=e+"CollectionItemSlot",f="data-radix-collection-item",g=pt(h),v=l.forwardRef((b,m)=>{const{scope:w,children:j,...N}=b,S=l.useRef(null),R=xe(m,S),E=c(h,w);return l.useEffect(()=>(E.itemMap.set(S,{ref:S,...N}),()=>{E.itemMap.delete(S)})),s.jsx(g,{[f]:"",ref:R,children:j})});v.displayName=h;function y(b){const m=c(e+"CollectionConsumer",b);return l.useCallback(()=>{const j=m.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${f}]`));return Array.from(m.itemMap.values()).sort((E,T)=>N.indexOf(E.ref.current)-N.indexOf(T.ref.current))},[m.collectionRef,m.itemMap])}return ge(y,"useCollection"),[{Provider:a,Slot:d,ItemSlot:v},y,o]}ge(Qs,"createCollection");var is=new WeakMap,ue,Ce,rn=(Ce=class extends Map{constructor(n){super(n);ts(this,ue);on(this,ue,[...super.keys()]),is.set(this,!0)}set(n,o){return is.get(this)&&(this.has(n)?be(this,ue)[be(this,ue).indexOf(n)]=n:be(this,ue).push(n)),super.set(n,o),this}insert(n,o,r){const c=this.has(o),a=be(this,ue).length,i=In(n);let u=i>=0?i:a+i;const d=u<0||u>=a?-1:u;if(d===this.size||c&&d===this.size-1||d===-1)return this.set(o,r),this;const h=this.size+(c?0:1);i<0&&u++;const f=[...be(this,ue)];let g,v=!1;for(let y=u;y<h;y++)if(u===y){let b=f[y];f[y]===o&&(b=f[y+1]),c&&this.delete(o),g=this.get(b),this.set(o,r)}else{!v&&f[y-1]===o&&(v=!0);const b=f[v?y:y-1],m=g;g=this.get(b),this.delete(b),this.set(b,m)}return this}with(n,o,r){const c=new Ce(this);return c.insert(n,o,r),c}before(n){const o=be(this,ue).indexOf(n)-1;if(!(o<0))return this.entryAt(o)}setBefore(n,o,r){const c=be(this,ue).indexOf(n);return c===-1?this:this.insert(c,o,r)}after(n){let o=be(this,ue).indexOf(n);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(n,o,r){const c=be(this,ue).indexOf(n);return c===-1?this:this.insert(c+1,o,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return on(this,ue,[]),super.clear()}delete(n){const o=super.delete(n);return o&&be(this,ue).splice(be(this,ue).indexOf(n),1),o}deleteAt(n){const o=this.keyAt(n);return o!==void 0?this.delete(o):!1}at(n){const o=It(be(this,ue),n);if(o!==void 0)return this.get(o)}entryAt(n){const o=It(be(this,ue),n);if(o!==void 0)return[o,this.get(o)]}indexOf(n){return be(this,ue).indexOf(n)}keyAt(n){return It(be(this,ue),n)}from(n,o){const r=this.indexOf(n);if(r===-1)return;let c=r+o;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.at(c)}keyFrom(n,o){const r=this.indexOf(n);if(r===-1)return;let c=r+o;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.keyAt(c)}find(n,o){let r=0;for(const c of this){if(Reflect.apply(n,o,[c,r,this]))return c;r++}}findIndex(n,o){let r=0;for(const c of this){if(Reflect.apply(n,o,[c,r,this]))return r;r++}return-1}filter(n,o){const r=[];let c=0;for(const a of this)Reflect.apply(n,o,[a,c,this])&&r.push(a),c++;return new Ce(r)}map(n,o){const r=[];let c=0;for(const a of this)r.push([a[0],Reflect.apply(n,o,[a,c,this])]),c++;return new Ce(r)}reduce(...n){const[o,r]=n;let c=0,a=r??this.at(0);for(const i of this)c===0&&n.length===1?a=i:a=Reflect.apply(o,this,[a,i,c,this]),c++;return a}reduceRight(...n){const[o,r]=n;let c=r??this.at(-1);for(let a=this.size-1;a>=0;a--){const i=this.at(a);a===this.size-1&&n.length===1?c=i:c=Reflect.apply(o,this,[c,i,a,this])}return c}toSorted(n){const o=[...this.entries()].sort(n);return new Ce(o)}toReversed(){const n=new Ce;for(let o=this.size-1;o>=0;o--){const r=this.keyAt(o),c=this.get(r);n.set(r,c)}return n}toSpliced(...n){const o=[...this.entries()];return o.splice(...n),new Ce(o)}slice(n,o){const r=new Ce;let c=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),o!==void 0&&o>0&&(c=o-1);for(let a=n;a<=c;a++){const i=this.keyAt(a),u=this.get(i);r.set(i,u)}return r}every(n,o){let r=0;for(const c of this){if(!Reflect.apply(n,o,[c,r,this]))return!1;r++}return!0}some(n,o){let r=0;for(const c of this){if(Reflect.apply(n,o,[c,r,this]))return!0;r++}return!1}},ue=new WeakMap,ge(Ce,"OrderedDict"),Ce);function It(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Zs(e,t);return n===-1?void 0:e[n]}ge(It,"at");function Zs(e,t){const n=e.length,o=In(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}ge(Zs,"toSafeIndex");function In(e){return e!==e||e===0?0:Math.trunc(e)}ge(In,"toSafeInteger");function Cc(e){const t=e+"CollectionProvider",[n,o]=Ct(t),[r,c]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new rn,setItemMap:ge(()=>{},"setItemMap")}),a=ge(({state:N,...S})=>N?s.jsx(u,{...S,state:N}):s.jsx(i,{...S}),"CollectionProvider");a.displayName=t;const i=ge(N=>{const S=m();return s.jsx(u,{...N,state:S})},"CollectionInit");i.displayName=t+"Init";const u=ge(N=>{const{scope:S,children:R,state:E}=N,T=l.useRef(null),[D,k]=l.useState(null),I=xe(T,k),[U,p]=E;return l.useEffect(()=>{if(!D)return;const x=to(()=>{});return x.observe(D,{childList:!0,subtree:!0}),()=>{x.disconnect()}},[D]),s.jsx(r,{scope:S,itemMap:U,setItemMap:p,collectionRef:I,collectionRefObject:T,collectionElement:D,children:R})},"CollectionProviderImpl");u.displayName=t+"Impl";const d=e+"CollectionSlot",h=pt(d),f=l.forwardRef((N,S)=>{const{scope:R,children:E}=N,T=c(d,R),D=xe(S,T.collectionRef);return s.jsx(h,{ref:D,children:E})});f.displayName=d;const g=e+"CollectionItemSlot",v="data-radix-collection-item",y=pt(g),b=l.forwardRef((N,S)=>{const{scope:R,children:E,...T}=N,D=l.useRef(null),[k,I]=l.useState(null),U=xe(S,D,I),p=c(g,R),{setItemMap:x}=p,C=l.useRef(T);Js(C.current,T)||(C.current=T);const _=C.current;return l.useEffect(()=>{const O=_;return x(L=>k?L.has(k)?L.set(k,{...O,element:k}).toSorted(wn):(L.set(k,{...O,element:k}),L.toSorted(wn)):L),()=>{x(L=>!k||!L.has(k)?L:(L.delete(k),new rn(L)))}},[k,_,x]),s.jsx(y,{[v]:"",ref:U,children:E})});b.displayName=g;function m(){return l.useState(new rn)}ge(m,"useInitCollection");function w(N){const{itemMap:S}=c(e+"CollectionConsumer",N);return S}return ge(w,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:o,useCollection:w,useInitCollection:m}]}ge(Cc,"createCollection");function Js(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ge(Js,"shallowEqual");function eo(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ge(eo,"isElementPreceding");function wn(e,t){return!e[1].element||!t[1].element?0:eo(e[1].element,t[1].element)?-1:1}ge(wn,"sortByDocumentPosition");function to(e){return new MutationObserver(n=>{for(const o of n)if(o.type==="childList"){e();return}})}ge(to,"getChildListObserver");var Ec=Object.defineProperty,Rc=(e,t)=>Ec(e,"name",{value:t,configurable:!0}),Pc=l.createContext(void 0);function no(e){const t=l.useContext(Pc);return e||t||"ltr"}Rc(no,"useDirection");var Tc=Object.defineProperty,_c=(e,t)=>Tc(e,"name",{value:t,configurable:!0}),Oc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=Oc.reduce((e,t)=>{const n=pt(`Primitive.${t}`),o=l.forwardRef((r,c)=>{const{asChild:a,...i}=r,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(u,{...i,ref:c})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function so(e,t){e&&jt.flushSync(()=>e.dispatchEvent(t))}_c(so,"dispatchDiscreteCustomEvent");var Lc=Object.defineProperty,Ac=(e,t)=>Lc(e,"name",{value:t,configurable:!0});function De(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>((...n)=>t.current?.(...n)),[])}Ac(De,"useCallbackRef");var Dc=Object.defineProperty,he=(e,t)=>Dc(e,"name",{value:t,configurable:!0}),Sn="dismissableLayer.update",kc="dismissableLayer.pointerDownOutside",Ic="dismissableLayer.focusOutside",ls,oo=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Mc=l.forwardRef(he(function(t,n){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:c,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:u,onDismiss:d,...h}=t,f=l.useContext(oo),[g,v]=l.useState(null),y=g?.ownerDocument??globalThis?.document,[,b]=l.useState({}),m=xe(n,v),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=j?w.indexOf(j):-1,S=g?w.indexOf(g):-1,R=f.layersWithOutsidePointerEventsDisabled.size>0,E=S>=N,T=l.useRef(!1),D=ro(p=>{a?.(p),u?.(p),p.defaultPrevented||d?.()},{ownerDocument:y,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:l.useCallback(p=>{if(!(p instanceof Node))return!1;const x=[...f.branches].some(C=>C.contains(p));return E&&!x},[f.branches,E])}),k=co(p=>{if(r&&T.current)return;const x=p.target;[...f.branches].some(_=>_.contains(x))||(i?.(p),u?.(p),p.defaultPrevented||d?.())},y),I=g?S===w.length-1:!1,U=De(p=>{p.key==="Escape"&&(c?.(p),!p.defaultPrevented&&d&&(p.preventDefault(),d()))});return l.useEffect(()=>{if(I)return y.addEventListener("keydown",U,{capture:!0}),()=>y.removeEventListener("keydown",U,{capture:!0})},[y,I,U]),l.useEffect(()=>{if(g)return o&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ls=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(g)),f.layers.add(g),Nn(),()=>{o&&(f.layersWithOutsidePointerEventsDisabled.delete(g),f.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=ls))}},[g,y,o,f]),l.useEffect(()=>()=>{g&&(f.layers.delete(g),f.layersWithOutsidePointerEventsDisabled.delete(g),Nn())},[g,f]),l.useEffect(()=>{const p=he(()=>b({}),"handleUpdate");return document.addEventListener(Sn,p),()=>document.removeEventListener(Sn,p)},[]),s.jsx(Ne.div,{...h,ref:m,style:{pointerEvents:R?E?"auto":"none":void 0,...t.style},onFocusCapture:me(t.onFocusCapture,k.onFocusCapture),onBlurCapture:me(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:me(t.onPointerDownCapture,D.onPointerDownCapture)})},"DismissableLayer"));function $c(){const e=l.useContext(oo),[t,n]=l.useState(null);return l.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}he($c,"useDismissableLayerSurface");var Fc=he(()=>!0,"IS_TRUE");function ro(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:c,shouldHandlePointerDownOutside:a=Fc}=t,i=De(e),u=l.useRef(!1),d=l.useRef(!1),h=l.useRef(new Map),f=l.useRef(()=>{});return l.useEffect(()=>{function g(){d.current=!1,r.current=!1,h.current.clear()}he(g,"resetOutsideInteraction");function v(){return Array.from(h.current.values()).some(Boolean)}he(v,"isOutsideInteractionIntercepted");function y(N){if(!d.current)return;const S=N.target;S instanceof Node&&[...c].some(E=>E.contains(S))||h.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{d.current&&f.current()},0)}he(y,"handleInteractionCapture");function b(N){d.current&&h.current.set(N.type,!1)}he(b,"handleInteractionBubble");const m=he(N=>{if(N.target&&!u.current){let S=function(){n.removeEventListener("click",f.current);const E=v();g(),E||Mn(kc,i,R,{discrete:!0})};if(he(S,"handleAndDispatchPointerDownOutsideEvent"),!a(N.target)){n.removeEventListener("click",f.current),g(),u.current=!1;return}const R={originalEvent:N};d.current=!0,r.current=o&&N.button===0,h.current.clear(),!o||N.button!==0?S():(n.removeEventListener("click",f.current),f.current=S,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),g();u.current=!1},"handlePointerDown"),w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const N of w)n.addEventListener(N,y,!0),n.addEventListener(N,b);const j=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(j),n.removeEventListener("pointerdown",m),n.removeEventListener("click",f.current);for(const N of w)n.removeEventListener(N,y,!0),n.removeEventListener(N,b)}},[n,i,o,r,c,a]),{onPointerDownCapture:he(()=>u.current=!0,"onPointerDownCapture")}}he(ro,"usePointerDownOutside");function co(e,t=globalThis?.document){const n=De(e),o=l.useRef(!1);return l.useEffect(()=>{const r=he(c=>{c.target&&!o.current&&Mn(Ic,n,{originalEvent:c},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:he(()=>o.current=!0,"onFocusCapture"),onBlurCapture:he(()=>o.current=!1,"onBlurCapture")}}he(co,"useFocusOutside");function Nn(){const e=new CustomEvent(Sn);document.dispatchEvent(e)}he(Nn,"dispatchUpdate");function Mn(e,t,n,{discrete:o}){const r=n.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?so(r,c):r.dispatchEvent(c)}he(Mn,"handleAndDispatchCustomEvent");var qc=Object.defineProperty,$n=(e,t)=>qc(e,"name",{value:t,configurable:!0}),Pt=0,st=null;function Uc(e){return Fn(),e.children}$n(Uc,"FocusGuards");function Fn(){l.useEffect(()=>{st||(st={start:jn(),end:jn()});const{start:e,end:t}=st;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Pt++,()=>{Pt===1&&(st?.start.remove(),st?.end.remove(),st=null),Pt=Math.max(0,Pt-1)}},[])}$n(Fn,"useFocusGuards");function jn(){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}$n(jn,"createFocusGuard");var Hc=Object.defineProperty,we=(e,t)=>Hc(e,"name",{value:t,configurable:!0}),cn="focusScope.autoFocusOnMount",an="focusScope.autoFocusOnUnmount",us={bubbles:!1,cancelable:!0},Bc=l.forwardRef(we(function(t,n){const{loop:o=!1,trapped:r=!1,onMountAutoFocus:c,onUnmountAutoFocus:a,...i}=t,[u,d]=l.useState(null),h=De(c),f=De(a),g=l.useRef(null),v=xe(n,d),y=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let m=function(S){if(y.paused||!u)return;const R=S.target;u.contains(R)?g.current=R:Me(g.current,{select:!0})},w=function(S){if(y.paused||!u)return;const R=S.relatedTarget;R!==null&&(u.contains(R)||Me(g.current,{select:!0}))},j=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Me(u)};we(m,"handleFocusIn"),we(w,"handleFocusOut"),we(j,"handleMutations"),document.addEventListener("focusin",m),document.addEventListener("focusout",w);const N=new MutationObserver(j);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),N.disconnect()}}},[r,u,y.paused]),l.useEffect(()=>{if(u){ds.add(y);const m=document.activeElement;if(!u.contains(m)){const j=new CustomEvent(cn,us);u.addEventListener(cn,h),u.dispatchEvent(j),j.defaultPrevented||(ao(po(qn(u)),{select:!0}),document.activeElement===m&&Me(u))}return()=>{u.removeEventListener(cn,h),setTimeout(()=>{const j=new CustomEvent(an,us);u.addEventListener(an,f),u.dispatchEvent(j),j.defaultPrevented||Me(m??document.body,{select:!0}),u.removeEventListener(an,f),ds.remove(y)},0)}}},[u,h,f,y]);const b=l.useCallback(m=>{if(!o&&!r||y.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,j=document.activeElement;if(w&&j){const N=m.currentTarget,[S,R]=io(N);S&&R?!m.shiftKey&&j===R?(m.preventDefault(),o&&Me(S,{select:!0})):m.shiftKey&&j===S&&(m.preventDefault(),o&&Me(R,{select:!0})):j===N&&m.preventDefault()}},[o,r,y.paused]);return s.jsx(Ne.div,{tabIndex:-1,...i,ref:v,onKeyDown:b})},"FocusScope"));function ao(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Me(o,{select:t}),document.activeElement!==n)return}we(ao,"focusFirst");function io(e){const t=qn(e),n=Cn(t,e),o=Cn(t.reverse(),e);return[n,o]}we(io,"getTabbableEdges");function qn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:we(o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}we(qn,"getTabbableCandidates");function Cn(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const o of e)if(!(n?!o.checkVisibility({checkVisibilityCSS:!0}):lo(o,{upTo:t})))return o}we(Cn,"findVisible");function lo(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}we(lo,"isHidden");function uo(e){return e instanceof HTMLInputElement&&"select"in e}we(uo,"isSelectableInput");function Me(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uo(e)&&t&&e.select()}}we(Me,"focus");var ds=fo();function fo(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=En(e,t),e.unshift(t)},remove(t){e=En(e,t),e[0]?.resume()}}}we(fo,"createFocusScopesStack");function En(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}we(En,"arrayRemove");function po(e){return e.filter(t=>t.tagName!=="A")}we(po,"removeLinks");var Se=globalThis?.document?l.useLayoutEffect:()=>{},Vc=Object.defineProperty,zc=(e,t)=>Vc(e,"name",{value:t,configurable:!0}),Kc=Kt[" useId ".trim().toString()]||(()=>{}),Wc=0;function Un(e){const[t,n]=l.useState(Kc());return Se(()=>{e||n(o=>o??String(Wc++))},[e]),e||(t?`radix-${t}`:"")}zc(Un,"useId");const Xc=["top","right","bottom","left"],ze=Math.min,$e=Math.max,Ht=Math.round,Tt=Math.floor,Fe=e=>({x:e,y:e}),Gc={left:"right",right:"left",bottom:"top",top:"bottom"};function mo(e,t,n){return $e(e,ze(t,n))}function qe(e,t){return typeof e=="function"?e(t):e}function Ke(e){return e.split("-")[0]}function gt(e){return e.split("-")[1]}function Hn(e){return e==="x"?"y":"x"}function Bn(e){return e==="y"?"height":"width"}function Ae(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Vn(e){return Hn(Ae(e))}function Yc(e,t,n){n===void 0&&(n=!1);const o=gt(e),r=Vn(e),c=Bn(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(a=Bt(a)),[a,Bt(a)]}function Qc(e){const t=Bt(e);return[Rn(e),t,Rn(t)]}function Rn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const fs=["left","right"],ps=["right","left"],Zc=["top","bottom"],Jc=["bottom","top"];function ea(e,t,n){switch(e){case"top":case"bottom":return n?t?ps:fs:t?fs:ps;case"left":case"right":return t?Zc:Jc;default:return[]}}function ta(e,t,n,o){const r=gt(e);let c=ea(Ke(e),n==="start",o);return r&&(c=c.map(a=>a+"-"+r),t&&(c=c.concat(c.map(Rn)))),c}function Bt(e){const t=Ke(e);return Gc[t]+e.slice(t.length)}function na(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function ho(e){return typeof e!="number"?na(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function ms(e,t,n){let{reference:o,floating:r}=e;const c=Ae(t),a=Vn(t),i=Bn(a),u=Ke(t),d=c==="y",h=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,g=o[i]/2-r[i]/2;let v;switch(u){case"top":v={x:h,y:o.y-r.height};break;case"bottom":v={x:h,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:f};break;case"left":v={x:o.x-r.width,y:f};break;default:v={x:o.x,y:o.y}}const y=gt(t);return y&&(v[a]+=g*(y==="end"?1:-1)*(n&&d?-1:1)),v}async function sa(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:c,rects:a,elements:i,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:v=0}=qe(t,e),y=ho(v),m=i[g?f==="floating"?"reference":"floating":f],w=Vt(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(m)))==null||n?m:m.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(i.floating)),boundary:d,rootBoundary:h,strategy:u})),j=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(i.floating)),S=await(c.isElement==null?void 0:c.isElement(N))&&await(c.getScale==null?void 0:c.getScale(N))||{x:1,y:1},R=Vt(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:j,offsetParent:N,strategy:u}):j);return{top:(w.top-R.top+y.top)/S.y,bottom:(R.bottom-w.bottom+y.bottom)/S.y,left:(w.left-R.left+y.left)/S.x,right:(R.right-w.right+y.right)/S.x}}const oa=50,ra=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:c=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:sa},u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:f}=ms(d,o,u),g=o,v=0;const y={};for(let b=0;b<c.length;b++){const m=c[b];if(!m)continue;const{name:w,fn:j}=m,{x:N,y:S,data:R,reset:E}=await j({x:h,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:y,rects:d,platform:i,elements:{reference:e,floating:t}});h=N??h,f=S??f,y[w]={...y[w],...R},E&&v<oa&&(v++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(d=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):E.rects),{x:h,y:f}=ms(d,g,u)),b=-1)}return{x:h,y:f,placement:g,strategy:r,middlewareData:y}},ca=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:c,platform:a,elements:i,middlewareData:u}=t,{element:d,padding:h=0}=qe(e,t)||{};if(d==null)return{};const f=ho(h),g={x:n,y:o},v=Vn(r),y=Bn(v),b=await a.getDimensions(d),m=v==="y",w=m?"top":"left",j=m?"bottom":"right",N=m?"clientHeight":"clientWidth",S=c.reference[y]+c.reference[v]-g[v]-c.floating[y],R=g[v]-c.reference[v],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let T=E?E[N]:0;(!T||!await(a.isElement==null?void 0:a.isElement(E)))&&(T=i.floating[N]||c.floating[y]);const D=S/2-R/2,k=T/2-b[y]/2-1,I=ze(f[w],k),U=ze(f[j],k),p=T-b[y]-U,x=T/2-b[y]/2+D,C=mo(I,x,p),_=!u.arrow&>(r)!=null&&x!==C&&c.reference[y]/2-(x<I?I:U)-b[y]/2<0,O=_?x<I?x-I:x-p:0;return{[v]:g[v]+O,data:{[v]:C,centerOffset:x-C-O,..._&&{alignmentOffset:O}},reset:_}}}),aa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:c,rects:a,initialPlacement:i,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...m}=qe(e,t);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const w=Ke(r),j=Ae(i),N=Ke(i)===i,S=await(u.isRTL==null?void 0:u.isRTL(d.floating)),R=g||(N||!b?[Bt(i)]:Qc(i)),E=y!=="none";!g&&E&&R.push(...ta(i,b,y,S));const T=[i,...R],D=await u.detectOverflow(t,m),k=[];let I=((o=c.flip)==null?void 0:o.overflows)||[];if(h&&k.push(D[w]),f){const C=Yc(r,a,S);k.push(D[C[0]],D[C[1]])}if(I=[...I,{placement:r,overflows:k}],!k.every(C=>C<=0)){var U,p;const C=(((U=c.flip)==null?void 0:U.index)||0)+1,_=T[C];if(_&&(!(f==="alignment"?j!==Ae(_):!1)||I.every(A=>Ae(A.placement)===j?A.overflows[0]>0:!0)))return{data:{index:C,overflows:I},reset:{placement:_}};let O=(p=I.filter(L=>L.overflows[0]<=0).sort((L,A)=>L.overflows[1]-A.overflows[1])[0])==null?void 0:p.placement;if(!O)switch(v){case"bestFit":{var x;const L=(x=I.filter(A=>{if(E){const q=Ae(A.placement);return q===j||q==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(q=>q>0).reduce((q,$)=>q+$,0)]).sort((A,q)=>A[1]-q[1])[0])==null?void 0:x[0];L&&(O=L);break}case"initialPlacement":O=i;break}if(r!==O)return{reset:{placement:O}}}return{}}}};function hs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gs(e){return Xc.some(t=>e[t]>=0)}const ia=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...c}=qe(e,t);switch(r){case"referenceHidden":{const a=await o.detectOverflow(t,{...c,elementContext:"reference"}),i=hs(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:gs(i)}}}case"escaped":{const a=await o.detectOverflow(t,{...c,altBoundary:!0}),i=hs(a,n.floating);return{data:{escapedOffsets:i,escaped:gs(i)}}}default:return{}}}}},go=new Set(["left","top"]);async function la(e,t){const{placement:n,platform:o,elements:r}=e,c=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=Ke(n),i=gt(n),u=Ae(n)==="y",d=go.has(a)?-1:1,h=c&&u?-1:1,f=qe(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof y=="number"&&(v=i==="end"?y*-1:y),u?{x:v*h,y:g*d}:{x:g*d,y:v*h}}const ua=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:c,placement:a,middlewareData:i}=t,u=await la(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(o=i.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:c+u.y,data:{...u,placement:a}}}}},da=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:c}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:u={fn:j=>{let{x:N,y:S}=j;return{x:N,y:S}}},...d}=qe(e,t),h={x:n,y:o},f=await c.detectOverflow(t,d),g=Ae(r),v=Hn(g);let y=h[v],b=h[g];const m=(j,N)=>mo(N+f[j==="y"?"top":"left"],N,N-f[j==="y"?"bottom":"right"]);a&&(y=m(v,y)),i&&(b=m(g,b));const w=u.fn({...t,[v]:y,[g]:b});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[v]:a,[g]:i}}}}}},fa=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:c,placement:a,rects:i,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:f=!0}=qe(e,t),g={x:r,y:c},v=Ae(a),y=Hn(v);let b=g[y],m=g[v];const w=qe(d,t),j=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(n=w.mainAxis)!=null?n:0,crossAxis:(o=w.crossAxis)!=null?o:0};if(h){const R=y==="y"?"height":"width",E=i.reference[y]-i.floating[R]+j.mainAxis,T=i.reference[y]+i.reference[R]-j.mainAxis;b<E?b=E:b>T&&(b=T)}if(f){var N,S;const R=y==="y"?"width":"height",E=go.has(Ke(a)),T=i.reference[v]-i.floating[R]+(E&&((N=u.offset)==null?void 0:N[v])||0)+(E?0:j.crossAxis),D=i.reference[v]+i.reference[R]+(E?0:((S=u.offset)==null?void 0:S[v])||0)-(E?j.crossAxis:0);m<T?m=T:m>D&&(m=D)}return{[y]:b,[v]:m}}}},pa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:c}=t,{apply:a=()=>{},...i}=qe(e,t),u=await r.detectOverflow(t,i),d=Ke(n),h=gt(n),f=Ae(n)==="y",{width:g,height:v}=o.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=h===(await(r.isRTL==null?void 0:r.isRTL(c.floating))?"start":"end")?"left":"right"):(b=d,y=h==="end"?"top":"bottom");const m=v-u.top-u.bottom,w=g-u.left-u.right,j=ze(v-u[y],m),N=ze(g-u[b],w),S=t.middlewareData.shift,R=!S;let E=j,T=N;S!=null&&S.enabled.x&&(T=w),S!=null&&S.enabled.y&&(E=m),R&&!h&&(f?T=g-2*$e(u.left,u.right):E=v-2*$e(u.top,u.bottom)),await a({...t,availableWidth:T,availableHeight:E});const D=await r.getDimensions(c.floating);return g!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function Gt(){return typeof window<"u"}function xt(e){return xo(e)?(e.nodeName||"").toLowerCase():"#document"}function je(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function He(e){var t;return(t=(xo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xo(e){return Gt()?e instanceof Node||e instanceof je(e).Node:!1}function ke(e){return Gt()?e instanceof Element||e instanceof je(e).Element:!1}function We(e){return Gt()?e instanceof HTMLElement||e instanceof je(e).HTMLElement:!1}function xs(e){return!Gt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof je(e).ShadowRoot}function Yt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ie(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function ma(e){return/^(table|td|th)$/.test(xt(e))}function Qt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ha=/transform|translate|scale|rotate|perspective|filter/,ga=/paint|layout|strict|content/,Ge=e=>!!e&&e!=="none";let ln;function zn(e){const t=ke(e)?Ie(e):e;return Ge(t.transform)||Ge(t.translate)||Ge(t.scale)||Ge(t.rotate)||Ge(t.perspective)||!Kn()&&(Ge(t.backdropFilter)||Ge(t.filter))||ha.test(t.willChange||"")||ga.test(t.contain||"")}function xa(e){let t=Je(e);for(;We(t)&&!St(t);){if(zn(t))return t;if(Qt(t))return null;t=Je(t)}return null}function Kn(){return ln==null&&(ln=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ln}function St(e){return/^(html|body|#document)$/.test(xt(e))}function Ie(e){return je(e).getComputedStyle(e)}function Zt(e){return ke(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xs(e)&&e.host||He(e);return xs(t)?t.host:t}function vo(e){const t=Je(e);return St(t)?(e.ownerDocument||e).body:We(t)&&Yt(t)?t:vo(t)}function Nt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=vo(e),c=r===((o=e.ownerDocument)==null?void 0:o.body),a=je(r);if(c){const i=Pn(a);return t.concat(a,a.visualViewport||[],Yt(r)?r:[],i&&n?Nt(i):[])}else return t.concat(r,Nt(r,[],n))}function Pn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bo(e){const t=Ie(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=We(e),c=r?e.offsetWidth:n,a=r?e.offsetHeight:o,i=Ht(n)!==c||Ht(o)!==a;return i&&(n=c,o=a),{width:n,height:o,$:i}}function Wn(e){return ke(e)?e:e.contextElement}function dt(e){const t=Wn(e);if(!We(t))return Fe(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:c}=bo(t);let a=(c?Ht(n.width):n.width)/o,i=(c?Ht(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const va=Fe(0);function yo(e){const t=je(e);return!Kn()||!t.visualViewport?va:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ba(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===je(e)}function et(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),c=Wn(e);let a=Fe(1);t&&(o?ke(o)&&(a=dt(o)):a=dt(e));const i=ba(c,n,o)?yo(c):Fe(0);let u=(r.left+i.x)/a.x,d=(r.top+i.y)/a.y,h=r.width/a.x,f=r.height/a.y;if(c&&o){const g=je(c),v=ke(o)?je(o):o;let y=g,b=Pn(y);for(;b&&v!==y;){const m=dt(b),w=b.getBoundingClientRect(),j=Ie(b),N=w.left+(b.clientLeft+parseFloat(j.paddingLeft))*m.x,S=w.top+(b.clientTop+parseFloat(j.paddingTop))*m.y;u*=m.x,d*=m.y,h*=m.x,f*=m.y,u+=N,d+=S,y=je(b),b=Pn(y)}}return Vt({width:h,height:f,x:u,y:d})}function Jt(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:et(He(e)).left+n}function wo(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Jt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ya(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const c=r==="fixed",a=He(o),i=t?Qt(t.floating):!1;if(o===a||i&&c)return n;let u={scrollLeft:0,scrollTop:0},d=Fe(1);const h=Fe(0),f=We(o);if((f||!c)&&((xt(o)!=="body"||Yt(a))&&(u=Zt(o)),f)){const v=et(o);d=dt(o),h.x=v.x+o.clientLeft,h.y=v.y+o.clientTop}const g=a&&!f&&!c?wo(a,u):Fe(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function wa(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Sa(e){const t=Zt(e),n=e.ownerDocument.body,o=$e(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=$e(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let c=-t.scrollLeft+Jt(e);const a=-t.scrollTop;return Ie(n).direction==="rtl"&&(c+=$e(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:c,y:a}}const Na=25;function ja(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=je(e),c=He(e),a=r.visualViewport;let i=c.clientWidth,u=c.clientHeight,d=0,h=0;if(a){const g=!Kn()||t==="fixed";o?g||(d=-a.offsetLeft,h=-a.offsetTop):(i=a.width,u=a.height,g&&(d=a.offsetLeft,h=a.offsetTop))}if(Jt(c)<=0){const g=c.ownerDocument,v=g.body,y=getComputedStyle(v),b=g.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,m=Math.abs(c.clientWidth-v.clientWidth-b),w=getComputedStyle(c).scrollbarGutter==="stable both-edges"?m/2:m;w<=Na&&(i-=w)}return{width:i,height:u,x:d,y:h}}function Ca(e,t){const n=et(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,c=dt(e),a=e.clientWidth*c.x,i=e.clientHeight*c.y,u=r*c.x,d=o*c.y;return{width:a,height:i,x:u,y:d}}function vs(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=ja(e,n,t);else if(t==="document")o=Sa(He(e));else if(ke(t))o=Ca(t,n);else{const r=yo(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Vt(o)}function Ea(e,t){const n=t.get(e);if(n)return n;let o=Nt(e,[],!1).filter(i=>ke(i)&&xt(i)!=="body"),r=null;const c=Ie(e).position==="fixed";let a=c?Je(e):e;for(;ke(a)&&!St(a);){const i=Ie(a),u=zn(a),d=r?r.position:c?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&i.position==="static")?o=o.filter(f=>f!==a):r=i,a=Je(a)}return t.set(e,o),o}function Ra(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Qt(t)?[]:Ea(t,this._c):[].concat(n),o],i=vs(t,a[0],r);let u=i.top,d=i.right,h=i.bottom,f=i.left;for(let g=1;g<a.length;g++){const v=vs(t,a[g],r);u=$e(v.top,u),d=ze(v.right,d),h=ze(v.bottom,h),f=$e(v.left,f)}return{width:d-f,height:h-u,x:f,y:u}}function Pa(e){const{width:t,height:n}=bo(e);return{width:t,height:n}}function Ta(e,t,n){const o=We(t),r=He(t),c=n==="fixed",a=et(e,!0,c,t);let i={scrollLeft:0,scrollTop:0};const u=Fe(0);if((o||!c)&&((xt(t)!=="body"||Yt(r))&&(i=Zt(t)),o)){const g=et(t,!0,c,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}!o&&r&&(u.x=Jt(r));const d=r&&!o&&!c?wo(r,i):Fe(0),h=a.left+i.scrollLeft-u.x-d.x,f=a.top+i.scrollTop-u.y-d.y;return{x:h,y:f,width:a.width,height:a.height}}function un(e){return Ie(e).position==="static"}function bs(e,t){if(!We(e)||Ie(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return He(e)===n&&(n=n.ownerDocument.body),n}function So(e,t){const n=je(e);if(Qt(e))return n;if(!We(e)){let r=Je(e);for(;r&&!St(r);){if(ke(r)&&!un(r))return r;r=Je(r)}return n}let o=bs(e,t);for(;o&&ma(o)&&un(o);)o=bs(o,t);return o&&St(o)&&un(o)&&!zn(o)?n:o||xa(e)||n}const _a=async function(e){const t=this.getOffsetParent||So,n=this.getDimensions,o=await n(e.floating);return{reference:Ta(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Oa(e){return Ie(e).direction==="rtl"}const La={convertOffsetParentRelativeRectToViewportRelativeRect:ya,getDocumentElement:He,getClippingRect:Ra,getOffsetParent:So,getElementRects:_a,getClientRects:wa,getDimensions:Pa,getScale:dt,isElement:ke,isRTL:Oa};function No(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Aa(e,t,n){let o=null,r;const c=He(e);function a(){var h;clearTimeout(r),(h=o)==null||h.disconnect(),o=null}function i(h,f){h===void 0&&(h=!1),f===void 0&&(f=1),a();const g=e.getBoundingClientRect(),{left:v,top:y,width:b,height:m}=g;if(h||t(),!b||!m)return;const w=Tt(y),j=Tt(c.clientWidth-(v+b)),N=Tt(c.clientHeight-(y+m)),S=Tt(v),E={rootMargin:-w+"px "+-j+"px "+-N+"px "+-S+"px",threshold:$e(0,ze(1,f))||1};let T=!0;function D(k){const I=k[0].intersectionRatio;if(!No(g,e.getBoundingClientRect()))return i();if(I!==f){if(!T)return i();I?i(!1,I):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T=!1}try{o=new IntersectionObserver(D,{...E,root:c.ownerDocument})}catch{o=new IntersectionObserver(D,E)}o.observe(e)}const u=je(e),d=()=>i(n);return u.addEventListener("resize",d),i(!0),()=>{u.removeEventListener("resize",d),a()}}function Da(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:c=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=Wn(e),h=r||c?[...d?Nt(d):[],...t?Nt(t):[]]:[];h.forEach(w=>{r&&w.addEventListener("scroll",n),c&&w.addEventListener("resize",n)});const f=d&&i?Aa(d,n,c):null;let g=-1,v=null;a&&(v=new ResizeObserver(w=>{let[j]=w;j&&j.target===d&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=v)==null||N.observe(t)})),n()}),d&&!u&&v.observe(d),t&&v.observe(t));let y,b=u?et(e):null;u&&m();function m(){const w=et(e);b&&!No(b,w)&&n(),b=w,y=requestAnimationFrame(m)}return n(),()=>{var w;h.forEach(j=>{r&&j.removeEventListener("scroll",n),c&&j.removeEventListener("resize",n)}),f?.(),(w=v)==null||w.disconnect(),v=null,u&&cancelAnimationFrame(y)}}const ka=ua,Ia=da,Ma=aa,$a=pa,Fa=ia,ys=ca,qa=fa,Ua=(e,t,n)=>{const o=new Map,r=n??{},c={...La,...r.platform,_c:o};return ra(e,t,{...r,platform:c})};var Ha=typeof document<"u",Ba=function(){},Mt=Ha?l.useLayoutEffect:Ba;function zt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!zt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const c=r[o];if(!(c==="_owner"&&e.$$typeof)&&!zt(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function jo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ws(e,t){const n=jo(e);return Math.round(t*n)/n}function dn(e){const t=l.useRef(e);return Mt(()=>{t.current=e}),t}function Va(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:c,floating:a}={},transform:i=!0,whileElementsMounted:u,open:d}=e,[h,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=l.useState(o);zt(g,o)||v(o);const[y,b]=l.useState(null),[m,w]=l.useState(null),j=l.useCallback(A=>{A!==E.current&&(E.current=A,b(A))},[]),N=l.useCallback(A=>{A!==T.current&&(T.current=A,w(A))},[]),S=c||y,R=a||m,E=l.useRef(null),T=l.useRef(null),D=l.useRef(h),k=u!=null,I=dn(u),U=dn(r),p=dn(d),x=l.useCallback(()=>{if(!E.current||!T.current)return;const A={placement:t,strategy:n,middleware:g};U.current&&(A.platform=U.current),Ua(E.current,T.current,A).then(q=>{const $={...q,isPositioned:p.current!==!1};C.current&&!zt(D.current,$)&&(D.current=$,jt.flushSync(()=>{f($)}))})},[g,t,n,U,p]);Mt(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[d]);const C=l.useRef(!1);Mt(()=>(C.current=!0,()=>{C.current=!1}),[]),Mt(()=>{if(S&&(E.current=S),R&&(T.current=R),S&&R){if(I.current)return I.current(S,R,x);x()}},[S,R,x,I,k]);const _=l.useMemo(()=>({reference:E,floating:T,setReference:j,setFloating:N}),[j,N]),O=l.useMemo(()=>({reference:S,floating:R}),[S,R]),L=l.useMemo(()=>{const A={position:n,left:0,top:0};if(!O.floating)return A;const q=ws(O.floating,h.x),$=ws(O.floating,h.y);return i?{...A,transform:"translate("+q+"px, "+$+"px)",...jo(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:$}},[n,i,O.floating,h.x,h.y]);return l.useMemo(()=>({...h,update:x,refs:_,elements:O,floatingStyles:L}),[h,x,_,O,L])}const za=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?ys({element:o.current,padding:r}).fn(n):{}:o?ys({element:o,padding:r}).fn(n):{}}}},Ka=(e,t)=>{const n=ka(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wa=(e,t)=>{const n=Ia(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xa=(e,t)=>({fn:qa(e).fn,options:[e,t]}),Ga=(e,t)=>{const n=Ma(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ya=(e,t)=>{const n=$a(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qa=(e,t)=>{const n=Fa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Za=(e,t)=>{const n=za(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ja=Object.defineProperty,ei=(e,t)=>Ja(e,"name",{value:t,configurable:!0});function Co(e){const[t,n]=l.useState(void 0);return Se(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const c=r[0];let a,i;if("borderBoxSize"in c){const u=c.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}ei(Co,"useSize");var ti=Object.defineProperty,Ve=(e,t)=>ti(e,"name",{value:t,configurable:!0}),Eo="Popper",[Ro,Po]=Ct(Eo),[ni,To]=Ro(Eo),si=Ve(e=>{const{__scopePopper:t,children:n}=e,[o,r]=l.useState(null),[c,a]=l.useState(void 0);return s.jsx(ni,{scope:t,anchor:o,onAnchorChange:r,placementState:c,setPlacementState:a,children:n})},"Popper"),oi="PopperAnchor",ri=l.forwardRef(Ve(function(t,n){const{__scopePopper:o,virtualRef:r,...c}=t,a=To(oi,o),i=l.useRef(null),u=a.onAnchorChange,d=l.useCallback(b=>{i.current=b,b&&u(b)},[u]),h=xe(n,d),f=l.useRef(null);l.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&u(f.current)});const g=a.placementState&&en(a.placementState),v=g?.[0],y=g?.[1];return r?null:s.jsx(Ne.div,{"data-radix-popper-side":v,"data-radix-popper-align":y,...c,ref:h})},"PopperAnchor")),_o="PopperContent",[ci,Mz]=Ro(_o),ai=l.forwardRef(Ve(function(t,n){const{__scopePopper:o,side:r="bottom",sideOffset:c=0,align:a="center",alignOffset:i=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...m}=t,w=To(_o,o),[j,N]=l.useState(null),S=xe(n,N),[R,E]=l.useState(null),T=Co(R),D=T?.width??0,k=T?.height??0,I=r+(a!=="center"?"-"+a:""),U=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},p=Array.isArray(h)?h:[h],x=p.length>0,C={padding:U,boundary:p.filter(Oo),altBoundary:x},{refs:_,floatingStyles:O,placement:L,isPositioned:A,middlewareData:q}=Va({strategy:"fixed",placement:I,whileElementsMounted:Ve((...K)=>Da(...K,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:w.anchor},middleware:[Ka({mainAxis:c+k,alignmentAxis:i}),d&&Wa({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Xa():void 0,...C}),d&&Ga({...C}),Ya({...C,apply:Ve(({elements:K,rects:ne,availableWidth:M,availableHeight:X})=>{const{width:W,height:se}=ne.reference,de=K.floating.style;de.setProperty("--radix-popper-available-width",`${M}px`),de.setProperty("--radix-popper-available-height",`${X}px`),de.setProperty("--radix-popper-anchor-width",`${W}px`),de.setProperty("--radix-popper-anchor-height",`${se}px`)},"apply")}),R&&Za({element:R,padding:u}),ii({arrowWidth:D,arrowHeight:k}),v&&Qa({strategy:"referenceHidden",...C,boundary:x?C.boundary:void 0})]}),$=w.setPlacementState;Se(()=>($(L),()=>{$(void 0)}),[L,$]);const[V,z]=en(L),te=De(b);Se(()=>{A&&te?.()},[A,te]);const G=q.arrow?.x,re=q.arrow?.y,Y=q.arrow?.centerOffset!==0,[ve,F]=l.useState();return Se(()=>{j&&F(window.getComputedStyle(j).zIndex)},[j]),s.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:A?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:s.jsx(ci,{scope:o,placedSide:V,placedAlign:z,onArrowChange:E,arrowX:G,arrowY:re,shouldHideArrow:Y,children:s.jsx(Ne.div,{"data-side":V,"data-align":z,...m,ref:S,style:{...m.style,animation:A?m.style?.animation:"none"}})})})},"PopperContent"));function Oo(e){return e!==null}Ve(Oo,"isNotNull");var ii=Ve(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[d,h]=en(n),f={start:"0%",center:"50%",end:"100%"}[h],g=(r.arrow?.x??0)+i/2,v=(r.arrow?.y??0)+u/2;let y="",b="";return d==="bottom"?(y=a?f:`${g}px`,b=`${-u}px`):d==="top"?(y=a?f:`${g}px`,b=`${o.floating.height+u}px`):d==="right"?(y=`${-u}px`,b=a?f:`${v}px`):d==="left"&&(y=`${o.floating.width+u}px`,b=a?f:`${v}px`),{data:{x:y,y:b}}}}),"transformOrigin");function en(e){const[t,n="center"]=e.split("-");return[t,n]}Ve(en,"getSideAndAlignFromPlacement");var li=si,ui=ri,di=ai,fi=Object.defineProperty,pi=(e,t)=>fi(e,"name",{value:t,configurable:!0}),mi=l.forwardRef(pi(function(t,n){const{container:o,...r}=t,[c,a]=l.useState(!1);Se(()=>a(!0),[]);const i=o||c&&globalThis?.document?.body;return i?jt.createPortal(s.jsx(Ne.div,{...r,ref:n}),i):null},"Portal")),hi=Object.defineProperty,Ue=(e,t)=>hi(e,"name",{value:t,configurable:!0});function Lo(e,t){return l.useReducer((n,o)=>t[n][o]??n,e)}Ue(Lo,"useStateMachine");var gi=Ue(e=>{const{present:t,children:n}=e,o=Ao(t),r=typeof n=="function"?n({present:o.isPresent}):l.Children.only(n),c=Do(o.ref,ko(r));return typeof n=="function"||o.isPresent?l.cloneElement(r,{ref:c}):null},"Presence");function Ao(e){const[t,n]=l.useState(),o=l.useRef(null),r=l.useRef(e),c=l.useRef("none"),a=l.useRef(void 0),i=e?"mounted":"unmounted",[u,d]=Lo(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{u==="mounted"?(c.current=a.current??it(o.current),a.current=void 0):c.current="none"},[u]),Se(()=>{const h=o.current,f=r.current;if(f!==e){const v=c.current,y=it(h);e?(a.current=y,d("MOUNT")):y==="none"||h?.display==="none"?d("UNMOUNT"):d(f&&v!==y?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,d]),Se(()=>{if(t){let h;const f=t.ownerDocument.defaultView??window,g=Ue(y=>{const m=it(o.current).includes(CSS.escape(y.animationName));if(y.target===t&&m&&(d("ANIMATION_END"),!r.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",h=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},"handleAnimationEnd"),v=Ue(y=>{y.target===t&&(c.current=it(o.current))},"handleAnimationStart");return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:l.useCallback(h=>{if(h){const f=getComputedStyle(h);o.current=f,a.current=it(f)}else o.current=null;n(h)},[])}}Ue(Ao,"usePresence");function Tn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Ue(Tn,"setRef");function Do(...e){const t=l.useRef(e);return t.current=e,l.useCallback(n=>{const o=t.current;let r=!1;const c=o.map(a=>{const i=Tn(a,n);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<c.length;a++){const i=c[a];typeof i=="function"?i():Tn(o[a],null)}}},[])}Ue(Do,"useStableComposedRefs");function it(e){return e?.animationName||"none"}Ue(it,"getAnimationName");function ko(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)}Ue(ko,"getElementRef");var xi=Object.defineProperty,vi=(e,t)=>xi(e,"name",{value:t,configurable:!0}),Ss=Kt[" useEffectEvent ".trim().toString()],Ns=Kt[" useInsertionEffect ".trim().toString()];function Io(e){if(typeof Ss=="function")return Ss(e);const t=l.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ns=="function"?Ns(()=>{t.current=e}):Se(()=>{t.current=e}),l.useMemo(()=>((...n)=>t.current?.(...n)),[])}vi(Io,"useEffectEvent");var bi=Object.defineProperty,Et=(e,t)=>bi(e,"name",{value:t,configurable:!0}),yi=Kt[" useInsertionEffect ".trim().toString()]||Se;function _n({prop:e,defaultProp:t,onChange:n=Et(()=>{},"onChange"),caller:o}){const[r,c,a]=Mo({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:r,d=l.useCallback(h=>{if(i){const f=$o(h)?h(e):h;f!==e&&a.current?.(f)}else c(h)},[i,e,c,a]);return[u,d]}Et(_n,"useControllableState");function Mo({defaultProp:e,onChange:t}){const[n,o]=l.useState(e),r=l.useRef(n),c=l.useRef(t);return yi(()=>{c.current=t},[t]),l.useEffect(()=>{r.current!==n&&(c.current?.(n),r.current=n)},[n,r]),[n,o,c]}Et(Mo,"useUncontrolledState");function $o(e){return typeof e=="function"}Et($o,"isFunction");var js=Symbol("RADIX:SYNC_STATE");function wi(e,t,n,o){const{prop:r,defaultProp:c,onChange:a,caller:i}=t,u=r!==void 0,d=Io(a),h=[{...n,state:c}];o&&h.push(o);const[f,g]=l.useReducer((m,w)=>{if(w.type===js)return{...m,state:w.state};const j=e(m,w);return u&&!Object.is(j.state,m.state)&&d(j.state),j},...h),v=f.state,y=l.useRef(v);l.useEffect(()=>{y.current!==v&&(y.current=v,u||d(v))},[v,y,u]);const b=l.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return l.useEffect(()=>{u&&!Object.is(r,f.state)&&g({type:js,state:r})},[r,f.state,u]),[b,g]}Et(wi,"useControllableStateReducer");var Si=Object.defineProperty,Ni=(e,t)=>Si(e,"name",{value:t,configurable:!0});function Fo(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Ni(Fo,"usePrevious");var ji=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Ci=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ot=new WeakMap,_t=new WeakMap,Ot={},fn=0,qo=function(e){return e&&(e.host||qo(e.parentNode))},Ei=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=qo(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ri=function(e,t,n,o){var r=Ei(t,Array.isArray(e)?e:[e]);Ot[n]||(Ot[n]=new WeakMap);var c=Ot[n],a=[],i=new Set,u=new Set(r),d=function(f){!f||i.has(f)||(i.add(f),d(f.parentNode))};r.forEach(d);var h=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(g){if(i.has(g))h(g);else try{var v=g.getAttribute(o),y=v!==null&&v!=="false",b=(ot.get(g)||0)+1,m=(c.get(g)||0)+1;ot.set(g,b),c.set(g,m),a.push(g),b===1&&y&&_t.set(g,!0),m===1&&g.setAttribute(n,"true"),y||g.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",g,w)}})};return h(t),i.clear(),fn++,function(){a.forEach(function(f){var g=ot.get(f)-1,v=c.get(f)-1;ot.set(f,g),c.set(f,v),g||(_t.has(f)||f.removeAttribute(o),_t.delete(f)),v||f.removeAttribute(n)}),fn--,fn||(ot=new WeakMap,ot=new WeakMap,_t=new WeakMap,Ot={})}},Pi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Ci(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Ri(o,r,n,"aria-hidden")):function(){return null}},Le=function(){return Le=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(t[c]=n[c])}return t},Le.apply(this,arguments)};function Uo(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Ti(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,c;o<r;o++)(c||!(o in t))&&(c||(c=Array.prototype.slice.call(t,0,o)),c[o]=t[o]);return e.concat(c||Array.prototype.slice.call(t))}var $t="right-scroll-bar-position",Ft="width-before-scroll-bar",_i="with-scroll-bars-hidden",Oi="--removed-body-scroll-bar-size";function pn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Li(e,t){var n=l.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Ai=typeof window<"u"?l.useLayoutEffect:l.useEffect,Cs=new WeakMap;function Di(e,t){var n=Li(null,function(o){return e.forEach(function(r){return pn(r,o)})});return Ai(function(){var o=Cs.get(n);if(o){var r=new Set(o),c=new Set(e),a=n.current;r.forEach(function(i){c.has(i)||pn(i,null)}),c.forEach(function(i){r.has(i)||pn(i,a)})}Cs.set(n,e)},[e]),n}function ki(e){return e}function Ii(e,t){t===void 0&&(t=ki);var n=[],o=!1,r={read:function(){if(o)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(c){var a=t(c,o);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(c){for(o=!0;n.length;){var a=n;n=[],a.forEach(c)}n={push:function(i){return c(i)},filter:function(){return n}}},assignMedium:function(c){o=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(c),a=n}var u=function(){var h=a;a=[],h.forEach(c)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return r}function Mi(e){e===void 0&&(e={});var t=Ii(null);return t.options=Le({async:!0,ssr:!1},e),t}var Ho=function(e){var t=e.sideCar,n=Uo(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return l.createElement(o,Le({},n))};Ho.isSideCarExport=!0;function $i(e,t){return e.useMedium(t),Ho}var Bo=Mi(),mn=function(){},tn=l.forwardRef(function(e,t){var n=l.useRef(null),o=l.useState({onScrollCapture:mn,onWheelCapture:mn,onTouchMoveCapture:mn}),r=o[0],c=o[1],a=e.forwardProps,i=e.children,u=e.className,d=e.removeScrollBar,h=e.enabled,f=e.shards,g=e.sideCar,v=e.noRelative,y=e.noIsolation,b=e.inert,m=e.allowPinchZoom,w=e.as,j=w===void 0?"div":w,N=e.gapMode,S=Uo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=g,E=Di([n,t]),T=Le(Le({},S),r);return l.createElement(l.Fragment,null,h&&l.createElement(R,{sideCar:Bo,removeScrollBar:d,shards:f,noRelative:v,noIsolation:y,inert:b,setCallbacks:c,allowPinchZoom:!!m,lockRef:n,gapMode:N}),a?l.cloneElement(l.Children.only(i),Le(Le({},T),{ref:E})):l.createElement(j,Le({},T,{className:u,ref:E}),i))});tn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tn.classNames={fullWidth:Ft,zeroRight:$t};var Fi=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Fi();return t&&e.setAttribute("nonce",t),e}function Ui(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Bi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qi())&&(Ui(t,n),Hi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Vi=function(){var e=Bi();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Vo=function(){var e=Vi(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},zi={left:0,top:0,right:0,gap:0},hn=function(e){return parseInt(e||"",10)||0},Ki=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[hn(n),hn(o),hn(r)]},Wi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zi;var t=Ki(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Xi=Vo(),ft="data-scroll-locked",Gi=function(e,t,n,o){var r=e.left,c=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
var Jn=e=>{throw TypeError(e)};var es=(e,t,n)=>t.has(e)||Jn("Cannot "+n);var be=(e,t,n)=>(es(e,t,"read from private field"),n?n.call(e):t.get(e)),ts=(e,t,n)=>t.has(e)?Jn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),on=(e,t,n,o)=>(es(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);import{g as cr,c as Ee,j as s,e as ie,r as l,A as ar,G as ir,O as lr,L as ur,h as xe,i as pt,R as Kt,k as dr}from"./dashboard-CaE1mRUL.js";import{g as fr,u as zs,f as ns,r as pr,s as mr,b as hr,a as gr,c as xr,d as vr,e as br,h as yr,i as wr,t as Sr}from"./services-status-context-ukghtkFD.js";import{R as Dn}from"./refresh-cw-DHzHxCme.js";import{D as Nr}from"./database-B0sGiSz2.js";import{E as jr}from"./external-link-C_ANDdCY.js";var jt=cr();const Cr=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Er=Ee("chart-column",Cr);const Rr=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pr=Ee("check",Rr);const Tr=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_r=Ee("chevron-down",Tr);const Or=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Lr=Ee("copy",Or);const Ar=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Dr=Ee("download",Ar);const kr=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]],Ir=Ee("file-down",kr);const Mr=[["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"}]],$r=Ee("key-round",Mr);const Fr=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],qr=Ee("pause",Fr);const Ur=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Hr=Ee("play",Ur);const Br=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ss=Ee("search",Br);const Vr=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],zr=Ee("trash-2",Vr);const Kr=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],kn=Ee("triangle-alert",Kr);const Wr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Xr=Ee("x",Wr);function pe(e){const{className:t,variant:n="default",size:o="default",children:r,...c}=e,a="inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-primary active:translate-y-px disabled:opacity-50 disabled:pointer-events-none",i={default:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-muted text-foreground hover:bg-muted/80",ghost:"bg-transparent hover:bg-muted text-foreground"},u={default:"h-10 px-4 py-2",sm:"h-8 px-3"};return s.jsx("button",{className:ie(a,i[n],u[o],t),...c,children:r})}function Z(e){const{className:t,variant:n,children:o}=e;return s.jsx("div",{className:ie("rounded-xl bg-background",n==="bordered"&&"border border-border",t),children:o})}function ce(e){const{className:t,children:n}=e;return s.jsx("div",{className:ie("px-5 pt-5",t),children:n})}function ae(e){const{className:t,children:n}=e;return s.jsx("div",{className:ie("text-base font-semibold",t),children:n})}function J(e){const{className:t,children:n}=e;return s.jsx("div",{className:ie("px-5 pb-5 pt-4",t),children:n})}function Wt(e){const{className:t,...n}=e;return s.jsx("input",{className:ie("w-full h-10 rounded-md border border-input bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary",t),...n})}function Ye(e){const{className:t,...n}=e;return s.jsx("label",{className:ie("text-sm font-medium text-foreground",t),...n})}const Gr={"not-cloud":"非 Cloud 模式","missing-sparql-endpoint":"缺少 PostgreSQL 端点","unsupported-sparql-endpoint":"非 PostgreSQL 端点"};function Yr(e){const t=e.trim();return t?{cacheScopeQuery:t,cacheScopeLimit:50}:{}}function Dz(){const[e,t]=l.useState(null),[n,o]=l.useState(!0),[r,c]=l.useState(!1),[a,i]=l.useState(""),[u,d]=l.useState(""),[h,f]=l.useState(""),g=l.useRef(!1),v=l.useCallback(async(w=!1,j=h)=>{w?o(!0):c(!0),i("");try{const N=await fr(Yr(j));N?t(N):i("RDF 统计不可用")}finally{o(!1),c(!1)}},[h]);l.useEffect(()=>{g.current||(g.current=!0,v(!0))},[v]),l.useEffect(()=>{const w=setInterval(()=>{v(!1)},1e4);return()=>clearInterval(w)},[v]);const y=w=>{w.preventDefault();const j=u.trim();f(j),v(!1,j)},b=()=>{d(""),f(""),v(!1,"")},m=e?Xt(e.generatedAt):"-";return n?s.jsx("div",{className:"p-8 text-foreground",children:"加载中..."}):s.jsxs("div",{className:"p-8",children:[s.jsxs("div",{className:"mb-6 flex flex-wrap items-center justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"type-h1",children:"RDF 索引"}),s.jsxs("div",{className:"mt-1 text-sm text-muted-foreground",children:["更新时间 ",m]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("form",{className:"flex min-w-0 items-center gap-2",onSubmit:y,children:[s.jsxs("div",{className:"relative w-72 max-w-[70vw]",children:[s.jsx(ss,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(Wt,{value:u,onChange:w=>d(w.target.value),className:"pl-9",placeholder:"principal / base / version"})]}),s.jsxs(pe,{type:"submit",variant:"secondary",size:"sm",className:"gap-2",children:[s.jsx(ss,{className:"h-4 w-4"}),"搜索"]}),h&&s.jsx(pe,{type:"button",variant:"ghost",size:"sm",onClick:b,"aria-label":"清除 scope 搜索",children:s.jsx(Xr,{className:"h-4 w-4"})})]}),s.jsxs(pe,{type:"button",variant:"secondary",size:"sm",onClick:()=>{v(!1)},disabled:r,className:"gap-2",children:[s.jsx(Dn,{className:ie("h-4 w-4",r&&"animate-spin")}),"刷新"]})]})]}),a&&s.jsx("div",{className:"mb-5 rounded-md border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive",children:a}),e?.available?s.jsx(Qr,{snapshot:e,scopeQuery:h}):s.jsxs(s.Fragment,{children:[s.jsx(Zr,{snapshot:e}),s.jsx("div",{className:"mt-8",children:s.jsx(Ks,{snapshot:e?.benchmarkReports})})]})]})}function Qr(e){const{snapshot:t,scopeQuery:n}=e,o=t.stats,r=o.rdf3x,c=o.slowQueries?.entries??[],a=o.derivedCache,i=a?.scopeEntries??[],u=o.pgAcceleration,d=o.lifecycle,h=d?.coldStart,f=h?.phases.reduce((g,v)=>v.durationMs>g.durationMs?v:g,{name:"-",durationMs:0});return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 md:grid-cols-2 xl:grid-cols-5",children:[s.jsx(vt,{icon:Nr,label:"引擎",value:t.engine,detail:u?.profile??"baseline",tone:u?.enabled?"good":"neutral"}),s.jsx(vt,{icon:ar,label:"RDF-3X",value:r?.syncedWithFacts?"已同步":`${r?.refreshLag??0} 版本延迟`,detail:`facts ${r?.factsDataVersion??0} / rdf3x ${r?.rdf3xFactsDataVersion??0} / pending ${r?.pendingSources??0}`,tone:r?.syncedWithFacts?"good":"warn"}),s.jsx(vt,{icon:ir,label:"存储",value:fe(o.totalBytes),detail:`facts ${fe(o.factsBytes)} / derived ${fe(o.derivedBytes)}`,tone:"neutral"}),s.jsx(vt,{icon:Dn,label:"冷启动",value:Oe(h?.durationMs??d?.lastOpenDurationMs??0),detail:`${d?.status??"unknown"} / open ${d?.openCount??0}`,tone:d?.status==="failed"?"warn":"neutral"}),s.jsx(vt,{icon:kn,label:"慢查询",value:`${o.slowQueries?.entryCount??0}`,detail:`保留 ${o.slowQueries?.maxEntries??0} 条`,tone:(o.slowQueries?.entryCount??0)>0?"warn":"good"})]}),s.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 xl:grid-cols-5",children:[s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"空间占用"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"derived/facts",value:vn(o.derivedToFactsRatio)}),s.jsx(B,{label:"total/facts",value:vn(o.totalToFactsRatio)}),s.jsx(B,{label:"result cache",value:fe(o.queryResultCache?.totalBytes??0)}),s.jsx(B,{label:"materialized",value:fe(o.materializedResultCache?.totalBytes??0)}),s.jsx(B,{label:"template",value:fe(o.queryTemplateCache?.totalBytes??0)})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"Cache"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"result entries",value:`${o.queryResultCache?.entryCount??0}`}),s.jsx(B,{label:"result scopes",value:`${o.queryResultCache?.scopeCount??0}`}),s.jsx(B,{label:"materialized entries",value:`${o.materializedResultCache?.entryCount??0}`}),s.jsx(B,{label:"materialized scopes",value:`${o.materializedResultCache?.scopeCount??0}`}),s.jsx(B,{label:"result hit rate",value:rs(o.queryResultCache)}),s.jsx(B,{label:"materialized hit rate",value:rs(o.materializedResultCache)}),s.jsx(B,{label:"template entries",value:`${o.queryTemplateCache?.entryCount??0}`}),s.jsx(B,{label:"cache pressure",value:bt(a?.cachePressure??0)})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"生命周期"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"driver",value:d?.driver??"-"}),s.jsx(B,{label:"ready at",value:d?.lastReadyAt?Xt(d.lastReadyAt):"-"}),s.jsx(B,{label:"slowest phase",value:`${f?.name??"-"} ${Oe(f?.durationMs??0)}`}),s.jsx(B,{label:"dirty sources",value:`${r?.pendingSources??0}`}),s.jsx(B,{label:"custom index",value:h?h.customIndexDeferred?"deferred":"startup":"-"}),s.jsx(B,{label:"maintenance",value:h?h.maintenanceEnabled?"enabled":"disabled":"-"})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"权限 Scope"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"scope versions",value:`${a?.scopeVersionCount??0}`}),s.jsx(B,{label:"max scope",value:fe(a?.maxScopeBytes??0)}),s.jsx(B,{label:"largest scope",value:fe(a?.largestScopeBytes??0)}),s.jsx(B,{label:"scope pressure",value:bt(a?.largestScopePressure??0)}),s.jsx(B,{label:"scope hash",value:yt(a?.largestScopeHash??"-")}),s.jsx(B,{label:"facts version",value:`${a?.largestScopeFactsDataVersion??"-"}`})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"PG 加速"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"profile",value:u?.profile??"baseline"}),s.jsx(B,{label:"provider",value:u?.provider??"-"}),s.jsx(B,{label:"enabled",value:u?.enabled?"true":"false"}),s.jsx(B,{label:"capabilities",value:`${u?.capabilities?.length??0}`}),s.jsx(B,{label:"active operators",value:wt(u?.activeOperators)}),s.jsx(B,{label:"missing caps",value:wt(u?.missingCapabilities)}),s.jsx(B,{label:"fallback",value:u?.fallbackReason??"-"})]})]})]}),s.jsxs("div",{className:"mb-8 grid grid-cols-1 gap-5 xl:grid-cols-2",children:[s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"Cache 淘汰"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"total",value:`${a?.evictionCount??0}`}),s.jsx(nc,{evictions:a?.evictions})]})]}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"Cache 载荷"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx(B,{label:"result payload",value:fe(a?.queryResultPayloadBytes??0)}),s.jsx(B,{label:"materialized payload",value:fe(a?.materializedResultPayloadBytes??0)}),s.jsx(B,{label:"template bytes",value:fe(a?.queryTemplateBytes??0)}),s.jsx(B,{label:"result table/index",value:`${fe(o.queryResultCache?.tableBytes??0)} / ${fe(o.queryResultCache?.indexBytes??0)}`}),s.jsx(B,{label:"materialized table/index",value:`${fe(o.materializedResultCache?.tableBytes??0)} / ${fe(o.materializedResultCache?.indexBytes??0)}`})]})]})]}),s.jsx("div",{className:"mb-8",children:s.jsx(tc,{entries:i,totalCount:a?.scopeVersionCount??0,query:n})}),s.jsx("div",{className:"mb-8",children:s.jsx(Ks,{snapshot:t.benchmarkReports})}),s.jsx(Jr,{entries:c})]})}function Zr(e){const{snapshot:t}=e,n=t?.available===!1?Gr[t.reason]:"无数据";return s.jsx(Z,{variant:"bordered",children:s.jsx(J,{children:s.jsxs("div",{className:"flex items-center gap-3 text-muted-foreground",children:[s.jsx(kn,{className:"h-5 w-5 text-yellow-600"}),s.jsx("span",{children:n})]})})})}function vt(e){const t=e.icon;return s.jsx(Z,{variant:"bordered",children:s.jsxs(J,{children:[s.jsxs("div",{className:"mb-3 flex items-center justify-between gap-3",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:e.label}),s.jsx(t,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx("div",{className:ie("text-xl font-semibold",e.tone==="good"&&"text-green-600",e.tone==="warn"&&"text-yellow-700"),children:e.value}),s.jsx("div",{className:"mt-1 truncate text-sm text-muted-foreground",children:e.detail})]})})}function B(e){return s.jsxs("div",{className:"flex items-center justify-between gap-4 text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:e.label}),s.jsx("span",{className:"min-w-0 truncate font-mono",children:e.value})]})}function Jr(e){return s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"最近慢查询"})}),s.jsx(J,{className:"p-0",children:e.entries.length===0?s.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:"暂无慢查询"}):s.jsx("div",{className:"overflow-auto",children:s.jsxs("table",{className:"w-full min-w-[920px] border-collapse text-left text-sm",children:[s.jsx("thead",{className:"border-b border-border text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-5 py-3 font-medium",children:"时间"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"路径"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"耗时"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"扫描"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Cache"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"原因"})]})}),s.jsx("tbody",{children:e.entries.map(t=>s.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[s.jsx("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:Xt(t.generatedAt)}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsx("div",{className:"font-medium",children:t.selectedPath}),s.jsx("div",{className:"mt-1 max-w-[240px] truncate font-mono text-xs text-muted-foreground",children:yt(t.queryKey)})]}),s.jsx("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:Oe(t.runtime.durationMs)}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[le(t.runtime.scannedRows)," / ",le(t.runtime.returnedRows)]}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsxs("div",{className:"font-mono text-xs",children:["tpl ",t.cache.templateStatus??"-"," / res ",t.cache.resultStatus??"-"," / mat ",t.cache.materializedStatus??"-"]}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate font-mono text-xs text-muted-foreground",children:rc(t)}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:cc(t)}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:t.cache.scopeBasePath??t.cache.scopeHash}),t.cache.scopePrincipal&&s.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:t.cache.scopePrincipal})]}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsx(oc,{reasons:t.slowQuery.reasons}),s.jsx(ec,{entry:t})]})]},`${t.generatedAt}-${t.queryKey}`))})]})})})]})}function ec(e){const t=ac(e.entry),n=ic(e.entry);return!t&&!n?null:s.jsxs("div",{className:"mt-2 max-w-[320px] space-y-1 text-xs text-muted-foreground",children:[t&&s.jsx("div",{className:"truncate",children:t}),n&&s.jsx("div",{className:"truncate",children:n})]})}function tc(e){return s.jsxs(Z,{variant:"bordered",children:[s.jsxs(ce,{className:"flex flex-row items-start justify-between gap-3",children:[s.jsx(ae,{children:"权限 Scope 明细"}),s.jsxs("div",{className:"text-sm text-muted-foreground",children:[le(e.entries.length)," / ",le(e.totalCount)]})]}),s.jsx(J,{className:"p-0",children:e.entries.length===0?s.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:e.query?"没有匹配的缓存 scope":"暂无缓存 scope"}):s.jsx("div",{className:"overflow-auto",children:s.jsxs("table",{className:"w-full min-w-[1020px] border-collapse text-left text-sm",children:[s.jsx("thead",{className:"border-b border-border text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-5 py-3 font-medium",children:"Scope"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Principal"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Base"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"权限"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"版本"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Payload"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Entries"})]})}),s.jsx("tbody",{children:e.entries.map(t=>s.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:[s.jsx("div",{children:yt(t.scopeHash)}),s.jsxs("div",{className:"mt-1 text-muted-foreground",children:["facts ",t.factsDataVersion]})]}),s.jsx("td",{className:"px-5 py-3",children:s.jsx("div",{className:"max-w-[220px] truncate",children:t.principal??"-"})}),s.jsx("td",{className:"px-5 py-3",children:s.jsx("div",{className:"max-w-[260px] truncate",children:t.basePath??"-"})}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono text-xs",children:[t.authorizationModel??"-","/",t.mode??"-"]}),s.jsx("td",{className:"px-5 py-3",children:s.jsx("div",{className:"max-w-[180px] truncate font-mono text-xs",children:t.permissionVersion??"-"})}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsx("div",{children:fe(t.payloadBytes)}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["r ",fe(t.queryResultPayloadBytes)," / m ",fe(t.materializedResultPayloadBytes)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[le(t.queryResultEntries)," / ",le(t.materializedResultEntries)]})]},`${t.scopeHash}-${t.factsDataVersion}`))})]})})})]})}function nc(e){const t=Object.entries(e.evictions??{}).filter(([,n])=>n>0);return t.length===0?s.jsx("div",{className:"text-sm text-muted-foreground",children:"暂无淘汰"}):s.jsx("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:t.map(([n,o])=>s.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md bg-muted px-3 py-2 text-sm",children:[s.jsx("span",{className:"min-w-0 truncate text-muted-foreground",children:n}),s.jsx("span",{className:"font-mono",children:le(o)})]},n))})}function Ks(e){const t=e.snapshot?.reports??[],n=e.snapshot?.errors??[];return s.jsxs(Z,{variant:"bordered",children:[s.jsxs(ce,{className:"flex flex-row items-start justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx(ae,{children:"Benchmark 报告"}),s.jsx("div",{className:"mt-1 max-w-[720px] truncate text-sm text-muted-foreground",children:(e.snapshot?.roots??[]).join(", ")||"未配置目录"})]}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Er,{className:"h-4 w-4"}),le(e.snapshot?.reportCount??t.length)]})]}),s.jsxs(J,{className:"p-0",children:[n.length>0&&s.jsxs("div",{className:"border-b border-border px-5 py-3 text-sm text-yellow-700",children:[le(n.length)," 个报告读取失败,最近一个:",n[0].path," - ",n[0].message]}),t.length===0?s.jsx("div",{className:"px-5 pb-5 pt-4 text-sm text-muted-foreground",children:"暂无 benchmark report"}):s.jsx("div",{className:"overflow-auto",children:s.jsxs("table",{className:"w-full min-w-[1180px] border-collapse text-left text-sm",children:[s.jsx("thead",{className:"border-b border-border text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-5 py-3 font-medium",children:"时间"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Profile"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"规模"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Gate"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Ingest"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Refresh"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Cold / Warm"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Storage"})]})}),s.jsx("tbody",{children:t.map(o=>s.jsx(sc,{report:o},`${o.path}-${o.generatedAt}`))})]})})]})]})}function sc(e){const t=e.report,n=t.failedPlanCases.length,o=t.failedConcurrencyCases.length;return s.jsxs("tr",{className:"border-b border-border/60 last:border-0",children:[s.jsxs("td",{className:"whitespace-nowrap px-5 py-3",children:[s.jsx("div",{className:"font-mono text-xs",children:Xt(t.generatedAt)}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate font-mono text-xs text-muted-foreground",children:t.path})]}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsx("div",{className:"font-medium",children:t.rdfAccelerationProfile??t.engine}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[t.driver??t.engine," / ",t.caseProfile??"-"]}),s.jsx("div",{className:"mt-1 max-w-[220px] truncate text-xs text-muted-foreground",children:t.pgAccelerationFallbackReason??wt(t.pgActiveOperators)})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsxs("div",{children:[le(t.seedQuadCount??0)," / ",le(t.targetQuadCount??0)]}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:[t.scale??"-"," / ",t.fullScale===!1?"partial":"full"]})]}),s.jsxs("td",{className:"px-5 py-3",children:[s.jsx(os,{ok:t.planMatched!==!1&&n===0,label:`plan ${t.planMatched===!1?"fail":"ok"}`}),s.jsx("div",{className:"mt-1",children:s.jsx(os,{ok:t.concurrencyMatched!==!1&&o===0,label:`conc ${t.concurrency??1}`})}),(n>0||o>0)&&s.jsxs("div",{className:"mt-1 text-xs text-yellow-700",children:["fail ",le(n+o)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsx("div",{children:Oe(t.ingestDurationMs??0)}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["COPY ",le(t.copyRows??0)," / fb ",le(t.copyFallbacks??0)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsx("div",{children:Oe(t.refreshDurationMs??0)}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["planner ",Oe(t.plannerStatsDurationMs??0)," / ",le(t.plannerStatsAnalyzedTables?.length??0)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsxs("div",{children:[Oe(t.coldStartDurationMs??0)," / ",Oe(t.firstQueryDurationMs??0)]}),s.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["p50/p95 ",Oe(t.warmP50DurationMs??0)," / ",Oe(t.warmP95DurationMs??0)]})]}),s.jsxs("td",{className:"whitespace-nowrap px-5 py-3 font-mono",children:[s.jsx("div",{children:vn(t.storageTotalToFactsRatio??0)}),s.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:fe(t.storageTotalBytes??0)})]})]})}function os(e){return s.jsx("span",{className:ie("inline-flex rounded-md px-2 py-0.5 text-xs",e.ok?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-800"),children:e.label})}function oc(e){return s.jsx("div",{className:"flex max-w-[320px] flex-wrap gap-1.5",children:e.reasons.map(t=>s.jsx("span",{className:"rounded-md bg-yellow-100 px-2 py-0.5 text-xs text-yellow-800",children:t},t))})}function fe(e){if(!Number.isFinite(e)||e<=0)return"0 B";const t=["B","KiB","MiB","GiB","TiB"];let n=e,o=0;for(;n>=1024&&o<t.length-1;)n/=1024,o+=1;return`${n>=10||o===0?n.toFixed(0):n.toFixed(1)} ${t[o]}`}function vn(e){return Number.isFinite(e)?`${e.toFixed(2)}x`:"0.00x"}function bt(e){return Number.isFinite(e)?`${Math.round(e*100)}%`:"0%"}function rs(e){const t=e?.hitCount??0,n=e?.missCount??0,o=t+n;return o<=0?"-":`${bt(t/o)} (${le(t)}/${le(o)})`}function rc(e){const t=e.cache.materialized?.key;if(t)return`mat ${yt(t)}`;const n=e.cache.result?.key??e.queryKey;return`res ${yt(n)}`}function cc(e){const t=e.derivedCache,n=bt(t.cachePressure),o=bt(t.largestScopePressure),r=t.evictionCount;return`pressure ${n} / scope ${o} / evict ${le(r)}`}function ac(e){const t=e.histogramHints??[];if(t.length===0)return"";const n=t.map(o=>`${o.kind}:${le(o.quadCount)}`);return`hist ${le(t.length)} ${wt(n)}`}function ic(e){const t=e.rejectedNativeOperators??[];if(t.length===0)return"";const n=t.map(o=>`${o.capability}:${o.reason}`);return`native rejected ${le(t.length)} ${wt(n)}`}function Oe(e){return Number.isFinite(e)?`${Math.round(e)} ms`:"0 ms"}function le(e){return Number.isFinite(e)?new Intl.NumberFormat().format(e):"0"}function Xt(e){const t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function yt(e){return e.length<=16?e:`${e.slice(0,12)}...${e.slice(-4)}`}function wt(e){return e?.length?e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`:"-"}function kz(){return s.jsx(lr,{})}const lc={healthy:"border-green-200 bg-green-50 text-green-700 dark:border-green-900 dark:bg-green-950/40 dark:text-green-300",degraded:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300",failed:"border-destructive/30 bg-destructive/10 text-destructive",unknown:"border-border bg-muted text-muted-foreground"};function qt(e){const{state:t,children:n,className:o}=e;return s.jsx("span",{className:ie("inline-flex items-center rounded-md border px-2 py-1 text-xs font-medium",lc[t],o),children:n})}function uc(e,t,n){const o=dc(e.XPOD_TUNNEL_PROFILES,n);if(o)return o;switch(t){case"ngrok":return e.NGROK_URL||"未配置";case"cloudflare":return e.CLOUDFLARE_TUNNEL_URL||e.XPOD_TUNNEL_PUBLIC_URL||"未配置";case"sakura_frp":return e.SAKURA_TUNNEL_URL||e.XPOD_TUNNEL_PUBLIC_URL||"未配置";case"frp":return e.FRP_TUNNEL_URL||"未配置";default:return"未配置"}}function dc(e,t){if(!e||!t||t==="none")return"";try{const n=JSON.parse(e);if(!Array.isArray(n))return"";const o=n.find(c=>c&&typeof c=="object"&&!Array.isArray(c)&&c.id===t);return(typeof o?.publicUrl=="string"?o.publicUrl.trim():"")||""}catch{return""}}function Ut(e){switch(e){case"healthy":return"可用";case"degraded":return"降级";case"failed":return"失败";default:return"未知"}}function cs(e){return e?e.status==="running"?"healthy":e.status==="starting"?"degraded":"failed":"unknown"}function fc(e,t){return e?t?"healthy":"failed":"unknown"}function pc(e,t){return e?t?"本机访问应可用。":"CSS 或 API 未运行。":"等待服务状态上报。"}function as(e){if(!e)return"未知";const t=Math.floor(e/1e3),n=Math.floor(t/60),o=Math.floor(n/60);return o>0?`${o}h ${n%60}m`:n>0?`${n}m ${t%60}s`:`${t}s`}function mc(e){return["Public","User tunnel","LAN","Loopback"].map(n=>e.find(o=>o.name===n&&o.state==="healthy")).find(n=>!!n)??e.find(n=>n.state==="degraded")??e.find(n=>n.state==="unknown")??null}function hc(e){return s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"访问路径"})}),s.jsx(J,{children:s.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-5",children:e.routes.map(t=>s.jsxs("div",{className:"min-w-0 rounded-xl border border-border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:t.name}),s.jsx(qt,{state:t.state,children:Ut(t.state)})]}),s.jsx("div",{className:"mt-2 min-w-0 break-all font-mono text-xs text-muted-foreground",title:t.target,children:t.target}),s.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:t.detail})]},t.name))})})]})}function gc(e){return s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"完整路径详情"})}),s.jsx(J,{children:s.jsx("div",{className:"overflow-x-auto rounded-md border border-border",children:s.jsxs("table",{className:"w-full min-w-[720px] text-sm",children:[s.jsx("thead",{className:"bg-muted/60 text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"路径"}),s.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"目标"}),s.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"状态"}),s.jsx("th",{className:"px-3 py-2 text-left font-medium",children:"证据"})]})}),s.jsx("tbody",{className:"divide-y divide-border",children:e.routes.map(t=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-3 py-2 font-medium",children:t.name}),s.jsx("td",{className:"px-3 py-2 font-mono text-xs break-all",children:t.target}),s.jsx("td",{className:"px-3 py-2",children:s.jsx(qt,{state:t.state,children:Ut(t.state)})}),s.jsx("td",{className:"px-3 py-2 text-muted-foreground",children:t.detail})]},t.name))})]})})})]})}function xc(e){if(e.state==="healthy"||e.state==="unknown")return null;const t=e.routes.find(o=>o.state==="failed"||o.state==="degraded"),n=t?`${t.name} 当前不可用。${t.detail}`:"运行时状态还没有完整上报,请刷新或查看日志。";return s.jsxs(Z,{variant:"bordered",className:"border-amber-200 bg-amber-50/60 dark:border-amber-900 dark:bg-amber-950/20",children:[s.jsx(ce,{children:s.jsx(ae,{children:"需要处理"})}),s.jsxs(J,{className:"space-y-3",children:[s.jsx("p",{className:"text-sm text-amber-800 dark:text-amber-200",children:n}),s.jsx(pe,{variant:"secondary",onClick:()=>window.location.assign("/dashboard/logs"),children:"打开日志"})]})]})}function Iz(){const e=zs(),[t,n]=l.useState(null),[o,r]=l.useState(null),[c,a]=l.useState(null),[i,u]=l.useState(null),[d,h]=l.useState(null),[f,g]=l.useState(!0),[v,y]=l.useState(""),[b,m]=l.useState(""),[w,j]=l.useState(null),N=l.useCallback(M=>{n(M.servicesData),r(M.adminData),a(M.configData),u(M.ddnsData),h(M.publicCheck),j(M.checkedAt),m(""),g(!1)},[]),S=l.useCallback(async()=>{try{N(await ns())}catch{m("状态加载失败,请查看日志或稍后刷新。"),g(!1)}},[N]),R=l.useCallback(async()=>{g(!0),await S()},[S]);l.useEffect(()=>{if(e)return;let M=!1;return ns().then(X=>{M||N(X)}).catch(()=>{M||(m("状态加载失败,请查看日志或稍后刷新。"),g(!1))}),()=>{M=!0}},[N,e]);const E=e?.snapshot,T=E?.servicesData??t,D=E?.adminData??o,k=E?.configData??c,I=E?.ddnsData??i,U=E?.publicCheck??d,p=E?.checkedAt??w,x=e?e.loading&&!E:f,C=e?.error??b,_=T?.find(M=>M.name==="css"),O=T?.find(M=>M.name==="api"),L=T?"healthy":"unknown",A=cs(_),q=cs(O),$=A==="healthy"&&q==="healthy",V=k?.env??{},z=V.XPOD_TUNNEL_PROVIDER||I?.tunnelProvider||"none",te=V.XPOD_TUNNEL_ACTIVE_PROFILE_ID||z,G=pr(V,I,window.location.origin),re=uc(V,z,te),Y=l.useMemo(()=>{const M=U?.status==="pass"?"healthy":U?.status==="fail"?"failed":"unknown",X=z==="none"?"unknown":I?.mode==="tunnel"||re!=="未配置"?"healthy":"degraded";return[{name:"Loopback",target:`http://127.0.0.1:${V.CSS_PORT||"3000"}`,state:fc(T,$),detail:pc(T,$)},{name:"LAN",target:I?.ipv4?`http://${I.ipv4}:${V.CSS_PORT||"3000"}`:"等待本机地址上报",state:I?.ipv4&&$?"healthy":"unknown",detail:I?.ipv4?"局域网设备可尝试该地址。":"运行时还没有上报局域网地址。"},{name:"Public",target:G,state:M,detail:U?.detail||"公网可达性尚未检测。"},{name:"User tunnel",target:re,state:X,detail:z==="none"?"未启用用户隧道。":`当前供应商: ${z}`},{name:"P2P backup",target:"信令协调的原生客户端",state:"unknown",detail:"P2P 只作为免配置备选路径,不作为浏览器默认入口。"}]},[$,G,I,V.CSS_PORT,U,T,z,re]),ve=T?$?Y.some(M=>M.state==="failed")?"degraded":"healthy":"failed":"unknown",F=mc(Y),K=async()=>{const M={lastCheckedAt:p?.toISOString()??null,services:T,adminStatus:D,ddnsStatus:I,publicIpCheck:U,routes:Y,stableDataUrl:G,recommendedRoute:F,sanitizedConfig:k?{env:k.env,secrets:k.secrets??{}}:null};await navigator.clipboard.writeText(JSON.stringify(M,null,2)),y("状态 JSON 已复制")},ne=async()=>{await navigator.clipboard.writeText(G),y("稳定资料入口已复制")};return s.jsxs("div",{className:"p-4 sm:p-8 max-w-6xl space-y-6",children:[s.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"type-h1",children:"状态"}),s.jsx("p",{className:"mt-2 max-w-[65ch] text-sm text-muted-foreground",children:"查看服务是否运行、资料路径是否稳定,以及外部访问失败时需要处理什么。"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(pe,{variant:"ghost",onClick:()=>e?e.refresh():void R(),disabled:x||e?.refreshing,className:"gap-2",children:[s.jsx(Dn,{className:`h-4 w-4 ${x?"animate-spin":""}`}),"刷新"]}),s.jsxs(pe,{variant:"secondary",onClick:()=>{K()},className:"gap-2",children:[s.jsx(Lr,{className:"h-4 w-4"}),"复制状态 JSON"]}),s.jsxs(pe,{onClick:()=>window.open(G,"_blank"),className:"gap-2",children:[s.jsx(jr,{className:"h-4 w-4"}),"打开入口"]})]})]}),v?s.jsx("p",{className:"text-sm text-green-700 dark:text-green-300",children:v}):null,C?s.jsx("div",{className:"rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:C}):null,s.jsx(Z,{variant:"bordered",children:s.jsx(J,{className:"pt-5",children:s.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1fr_1.5fr]",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(qt,{state:ve,children:Ut(ve)}),s.jsx("div",{className:"text-2xl font-semibold",children:"Xpod runtime"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:p?`最后检查: ${p.toLocaleString()}`:"等待第一次检查。"}),s.jsxs("div",{className:"pt-3",children:[s.jsx("div",{className:"text-sm font-medium",children:"稳定资料入口"}),s.jsx("div",{className:"mt-1 break-all rounded-md border border-border bg-muted/30 px-3 py-2 font-mono text-sm",children:G||"等待稳定入口"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium",children:"当前建议路径"}),s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:F?`${F.name}: ${F.detail}`:"等待访问路径检测。"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 pt-2",children:[s.jsx(pe,{variant:"secondary",size:"sm",onClick:()=>{ne()},disabled:!G,children:"复制 URL"}),s.jsx(pe,{size:"sm",onClick:()=>window.open(G,"_blank"),disabled:!G,children:"打开入口"})]})]}),s.jsx("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[["Gateway",L,"当前控制台可访问"],["CSS",A,as(_?.uptime)],["API",q,as(O?.uptime)],["Tunnel",z==="none"?"unknown":"healthy",z]].map(([M,X,W])=>s.jsxs("div",{className:"rounded-xl border border-border p-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"text-sm font-medium",children:M}),s.jsx(qt,{state:X,children:Ut(X)})]}),s.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:W})]},M))})]})})}),s.jsx(xc,{state:ve,routes:Y}),s.jsx(hc,{routes:Y}),s.jsx(gc,{routes:Y}),s.jsxs(Z,{variant:"bordered",children:[s.jsx(ce,{children:s.jsx(ae,{children:"Cloud 协调"})}),s.jsxs(J,{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"nodeId"}),s.jsx("span",{className:"font-mono break-all",children:V.XPOD_NODE_ID||"未上报"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"spDomain"}),s.jsx("span",{className:"font-mono break-all",children:V.XPOD_SP_DOMAIN||I?.fqdn||"未分配"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"DDNS"}),s.jsx("span",{children:I?.detail||"未上报"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"heartbeat"}),s.jsx("span",{children:I?.enabled?"已启用":"未启用或未上报"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"模式"}),s.jsx("span",{children:I?.mode||"unknown"})]}),s.jsx("p",{className:"pt-2 text-muted-foreground",children:"Cloud 负责稳定域名和 IDP,本地 SP 负责数据存储与实际接入。"})]})]}),s.jsxs(Z,{variant:"bordered",className:"bg-muted/30",children:[s.jsx(ce,{children:s.jsx(ae,{children:"配置摘要"})}),s.jsxs(J,{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"edition"}),s.jsx("span",{children:D?.env.XPOD_EDITION||"local"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"baseUrl"}),s.jsx("span",{className:"font-mono break-all",children:G})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"storage"}),s.jsx("span",{className:"font-mono break-all",children:V.CSS_ROOT_FILE_PATH||"./data"})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"provider"}),s.jsx("span",{children:z})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"tunnelProfile"}),s.jsx("span",{children:te})]}),s.jsxs("div",{className:"grid grid-cols-[140px_1fr] gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"secrets"}),s.jsxs("span",{children:[Object.entries(k?.secrets??{}).filter(([,M])=>M.configured).length," 个已配置"]})]})]})]}),s.jsxs("div",{className:"text-sm text-muted-foreground",children:["需要修改运行时配置时进入 ",s.jsx(ur,{className:"text-primary underline-offset-4 hover:underline",to:"/services/configuration",children:"配置"}),"。"]})]})}var vc=Object.defineProperty,bc=(e,t)=>vc(e,"name",{value:t,configurable:!0});function bn(e,[t,n]){return Math.min(n,Math.max(t,e))}bc(bn,"clamp");var yc=Object.defineProperty,ht=(e,t)=>yc(e,"name",{value:t,configurable:!0}),Ws=!!(typeof window<"u"&&window.document&&window.document.createElement);function me(e,t,{checkForDefaultPrevented:n=!0}={}){return ht(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}ht(me,"composeEventHandlers");function wc(e){if(!Ws)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}ht(wc,"getOwnerWindow");function yn(e){if(!Ws)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}ht(yn,"getOwnerDocument");function Xs(e,t=!1){const{activeElement:n}=yn(e);if(!n?.nodeName)return null;if(Gs(n)&&n.contentDocument)return Xs(n.contentDocument.body,t);if(t){const o=n.getAttribute("aria-activedescendant");if(o){const r=yn(n).getElementById(o);if(r)return r}}return n}ht(Xs,"getActiveElement");function Gs(e){return e.tagName==="IFRAME"}ht(Gs,"isFrame");var Sc=Object.defineProperty,Re=(e,t)=>Sc(e,"name",{value:t,configurable:!0});function Nc(e,t){const n=l.createContext(t);n.displayName=e+"Context";const o=Re(c=>{const{children:a,...i}=c,u=l.useMemo(()=>i,Object.values(i));return s.jsx(n.Provider,{value:u,children:a})},"Provider");o.displayName=e+"Provider";function r(c,a={}){const{optional:i=!1}=a,u=l.useContext(n);if(u)return u;if(t!==void 0)return t;if(!i)throw new Error(`\`${c}\` must be used within \`${e}\``)}return Re(r,"useContext"),[o,r]}Re(Nc,"createContext");function Ct(e,t=[]){let n=[];function o(c,a){const i=l.createContext(a);i.displayName=c+"Context";const u=n.length;n=[...n,a];const d=Re(f=>{const{scope:g,children:v,...y}=f,b=g?.[e]?.[u]||i,m=l.useMemo(()=>y,Object.values(y));return s.jsx(b.Provider,{value:m,children:v})},"Provider");d.displayName=c+"Provider";function h(f,g,v={}){const{optional:y=!1}=v,b=g?.[e]?.[u]||i,m=l.useContext(b);if(m)return m;if(a!==void 0)return a;if(!y)throw new Error(`\`${f}\` must be used within \`${c}\``)}return Re(h,"useContext"),[d,h]}Re(o,"createContext");const r=Re(()=>{const c=n.map(a=>l.createContext(a));return Re(function(i){const u=i?.[e]||c;return l.useMemo(()=>({[`__scope${e}`]:{...i,[e]:u}}),[i,u])},"useScope")},"createScope");return r.scopeName=e,[o,Ys(r,...t)]}Re(Ct,"createContextScope");function Ys(...e){const t=e[0];if(e.length===1)return t;const n=Re(()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return Re(function(c){const a=o.reduce((i,{useScope:u,scopeName:d})=>{const f=u(c)[`__scope${d}`];return{...i,...f}},{});return l.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Re(Ys,"composeContextScopes");var jc=Object.defineProperty,ge=(e,t)=>jc(e,"name",{value:t,configurable:!0});function Qs(e){const t=e+"CollectionProvider",[n,o]=Ct(t),[r,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=ge(b=>{const{scope:m,children:w}=b,j=l.useRef(null),N=l.useRef(new Map).current;return s.jsx(r,{scope:m,itemMap:N,collectionRef:j,children:w})},"CollectionProvider");a.displayName=t;const i=e+"CollectionSlot",u=pt(i),d=l.forwardRef((b,m)=>{const{scope:w,children:j}=b,N=c(i,w),S=xe(m,N.collectionRef);return s.jsx(u,{ref:S,children:j})});d.displayName=i;const h=e+"CollectionItemSlot",f="data-radix-collection-item",g=pt(h),v=l.forwardRef((b,m)=>{const{scope:w,children:j,...N}=b,S=l.useRef(null),R=xe(m,S),E=c(h,w);return l.useEffect(()=>(E.itemMap.set(S,{ref:S,...N}),()=>{E.itemMap.delete(S)})),s.jsx(g,{[f]:"",ref:R,children:j})});v.displayName=h;function y(b){const m=c(e+"CollectionConsumer",b);return l.useCallback(()=>{const j=m.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${f}]`));return Array.from(m.itemMap.values()).sort((E,T)=>N.indexOf(E.ref.current)-N.indexOf(T.ref.current))},[m.collectionRef,m.itemMap])}return ge(y,"useCollection"),[{Provider:a,Slot:d,ItemSlot:v},y,o]}ge(Qs,"createCollection");var is=new WeakMap,ue,Ce,rn=(Ce=class extends Map{constructor(n){super(n);ts(this,ue);on(this,ue,[...super.keys()]),is.set(this,!0)}set(n,o){return is.get(this)&&(this.has(n)?be(this,ue)[be(this,ue).indexOf(n)]=n:be(this,ue).push(n)),super.set(n,o),this}insert(n,o,r){const c=this.has(o),a=be(this,ue).length,i=In(n);let u=i>=0?i:a+i;const d=u<0||u>=a?-1:u;if(d===this.size||c&&d===this.size-1||d===-1)return this.set(o,r),this;const h=this.size+(c?0:1);i<0&&u++;const f=[...be(this,ue)];let g,v=!1;for(let y=u;y<h;y++)if(u===y){let b=f[y];f[y]===o&&(b=f[y+1]),c&&this.delete(o),g=this.get(b),this.set(o,r)}else{!v&&f[y-1]===o&&(v=!0);const b=f[v?y:y-1],m=g;g=this.get(b),this.delete(b),this.set(b,m)}return this}with(n,o,r){const c=new Ce(this);return c.insert(n,o,r),c}before(n){const o=be(this,ue).indexOf(n)-1;if(!(o<0))return this.entryAt(o)}setBefore(n,o,r){const c=be(this,ue).indexOf(n);return c===-1?this:this.insert(c,o,r)}after(n){let o=be(this,ue).indexOf(n);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(n,o,r){const c=be(this,ue).indexOf(n);return c===-1?this:this.insert(c+1,o,r)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return on(this,ue,[]),super.clear()}delete(n){const o=super.delete(n);return o&&be(this,ue).splice(be(this,ue).indexOf(n),1),o}deleteAt(n){const o=this.keyAt(n);return o!==void 0?this.delete(o):!1}at(n){const o=It(be(this,ue),n);if(o!==void 0)return this.get(o)}entryAt(n){const o=It(be(this,ue),n);if(o!==void 0)return[o,this.get(o)]}indexOf(n){return be(this,ue).indexOf(n)}keyAt(n){return It(be(this,ue),n)}from(n,o){const r=this.indexOf(n);if(r===-1)return;let c=r+o;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.at(c)}keyFrom(n,o){const r=this.indexOf(n);if(r===-1)return;let c=r+o;return c<0&&(c=0),c>=this.size&&(c=this.size-1),this.keyAt(c)}find(n,o){let r=0;for(const c of this){if(Reflect.apply(n,o,[c,r,this]))return c;r++}}findIndex(n,o){let r=0;for(const c of this){if(Reflect.apply(n,o,[c,r,this]))return r;r++}return-1}filter(n,o){const r=[];let c=0;for(const a of this)Reflect.apply(n,o,[a,c,this])&&r.push(a),c++;return new Ce(r)}map(n,o){const r=[];let c=0;for(const a of this)r.push([a[0],Reflect.apply(n,o,[a,c,this])]),c++;return new Ce(r)}reduce(...n){const[o,r]=n;let c=0,a=r??this.at(0);for(const i of this)c===0&&n.length===1?a=i:a=Reflect.apply(o,this,[a,i,c,this]),c++;return a}reduceRight(...n){const[o,r]=n;let c=r??this.at(-1);for(let a=this.size-1;a>=0;a--){const i=this.at(a);a===this.size-1&&n.length===1?c=i:c=Reflect.apply(o,this,[c,i,a,this])}return c}toSorted(n){const o=[...this.entries()].sort(n);return new Ce(o)}toReversed(){const n=new Ce;for(let o=this.size-1;o>=0;o--){const r=this.keyAt(o),c=this.get(r);n.set(r,c)}return n}toSpliced(...n){const o=[...this.entries()];return o.splice(...n),new Ce(o)}slice(n,o){const r=new Ce;let c=this.size-1;if(n===void 0)return r;n<0&&(n=n+this.size),o!==void 0&&o>0&&(c=o-1);for(let a=n;a<=c;a++){const i=this.keyAt(a),u=this.get(i);r.set(i,u)}return r}every(n,o){let r=0;for(const c of this){if(!Reflect.apply(n,o,[c,r,this]))return!1;r++}return!0}some(n,o){let r=0;for(const c of this){if(Reflect.apply(n,o,[c,r,this]))return!0;r++}return!1}},ue=new WeakMap,ge(Ce,"OrderedDict"),Ce);function It(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=Zs(e,t);return n===-1?void 0:e[n]}ge(It,"at");function Zs(e,t){const n=e.length,o=In(t),r=o>=0?o:n+o;return r<0||r>=n?-1:r}ge(Zs,"toSafeIndex");function In(e){return e!==e||e===0?0:Math.trunc(e)}ge(In,"toSafeInteger");function Cc(e){const t=e+"CollectionProvider",[n,o]=Ct(t),[r,c]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new rn,setItemMap:ge(()=>{},"setItemMap")}),a=ge(({state:N,...S})=>N?s.jsx(u,{...S,state:N}):s.jsx(i,{...S}),"CollectionProvider");a.displayName=t;const i=ge(N=>{const S=m();return s.jsx(u,{...N,state:S})},"CollectionInit");i.displayName=t+"Init";const u=ge(N=>{const{scope:S,children:R,state:E}=N,T=l.useRef(null),[D,k]=l.useState(null),I=xe(T,k),[U,p]=E;return l.useEffect(()=>{if(!D)return;const x=to(()=>{});return x.observe(D,{childList:!0,subtree:!0}),()=>{x.disconnect()}},[D]),s.jsx(r,{scope:S,itemMap:U,setItemMap:p,collectionRef:I,collectionRefObject:T,collectionElement:D,children:R})},"CollectionProviderImpl");u.displayName=t+"Impl";const d=e+"CollectionSlot",h=pt(d),f=l.forwardRef((N,S)=>{const{scope:R,children:E}=N,T=c(d,R),D=xe(S,T.collectionRef);return s.jsx(h,{ref:D,children:E})});f.displayName=d;const g=e+"CollectionItemSlot",v="data-radix-collection-item",y=pt(g),b=l.forwardRef((N,S)=>{const{scope:R,children:E,...T}=N,D=l.useRef(null),[k,I]=l.useState(null),U=xe(S,D,I),p=c(g,R),{setItemMap:x}=p,C=l.useRef(T);Js(C.current,T)||(C.current=T);const _=C.current;return l.useEffect(()=>{const O=_;return x(L=>k?L.has(k)?L.set(k,{...O,element:k}).toSorted(wn):(L.set(k,{...O,element:k}),L.toSorted(wn)):L),()=>{x(L=>!k||!L.has(k)?L:(L.delete(k),new rn(L)))}},[k,_,x]),s.jsx(y,{[v]:"",ref:U,children:E})});b.displayName=g;function m(){return l.useState(new rn)}ge(m,"useInitCollection");function w(N){const{itemMap:S}=c(e+"CollectionConsumer",N);return S}return ge(w,"useCollection"),[{Provider:a,Slot:f,ItemSlot:b},{createCollectionScope:o,useCollection:w,useInitCollection:m}]}ge(Cc,"createCollection");function Js(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ge(Js,"shallowEqual");function eo(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ge(eo,"isElementPreceding");function wn(e,t){return!e[1].element||!t[1].element?0:eo(e[1].element,t[1].element)?-1:1}ge(wn,"sortByDocumentPosition");function to(e){return new MutationObserver(n=>{for(const o of n)if(o.type==="childList"){e();return}})}ge(to,"getChildListObserver");var Ec=Object.defineProperty,Rc=(e,t)=>Ec(e,"name",{value:t,configurable:!0}),Pc=l.createContext(void 0);function no(e){const t=l.useContext(Pc);return e||t||"ltr"}Rc(no,"useDirection");var Tc=Object.defineProperty,_c=(e,t)=>Tc(e,"name",{value:t,configurable:!0}),Oc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ne=Oc.reduce((e,t)=>{const n=pt(`Primitive.${t}`),o=l.forwardRef((r,c)=>{const{asChild:a,...i}=r,u=a?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(u,{...i,ref:c})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function so(e,t){e&&jt.flushSync(()=>e.dispatchEvent(t))}_c(so,"dispatchDiscreteCustomEvent");var Lc=Object.defineProperty,Ac=(e,t)=>Lc(e,"name",{value:t,configurable:!0});function De(e){const t=l.useRef(e);return l.useEffect(()=>{t.current=e}),l.useMemo(()=>((...n)=>t.current?.(...n)),[])}Ac(De,"useCallbackRef");var Dc=Object.defineProperty,he=(e,t)=>Dc(e,"name",{value:t,configurable:!0}),Sn="dismissableLayer.update",kc="dismissableLayer.pointerDownOutside",Ic="dismissableLayer.focusOutside",ls,oo=l.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Mc=l.forwardRef(he(function(t,n){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:c,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:u,onDismiss:d,...h}=t,f=l.useContext(oo),[g,v]=l.useState(null),y=g?.ownerDocument??globalThis?.document,[,b]=l.useState({}),m=xe(n,v),w=Array.from(f.layers),[j]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),N=j?w.indexOf(j):-1,S=g?w.indexOf(g):-1,R=f.layersWithOutsidePointerEventsDisabled.size>0,E=S>=N,T=l.useRef(!1),D=ro(p=>{a?.(p),u?.(p),p.defaultPrevented||d?.()},{ownerDocument:y,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:T,dismissableSurfaces:f.dismissableSurfaces,shouldHandlePointerDownOutside:l.useCallback(p=>{if(!(p instanceof Node))return!1;const x=[...f.branches].some(C=>C.contains(p));return E&&!x},[f.branches,E])}),k=co(p=>{if(r&&T.current)return;const x=p.target;[...f.branches].some(_=>_.contains(x))||(i?.(p),u?.(p),p.defaultPrevented||d?.())},y),I=g?S===w.length-1:!1,U=De(p=>{p.key==="Escape"&&(c?.(p),!p.defaultPrevented&&d&&(p.preventDefault(),d()))});return l.useEffect(()=>{if(I)return y.addEventListener("keydown",U,{capture:!0}),()=>y.removeEventListener("keydown",U,{capture:!0})},[y,I,U]),l.useEffect(()=>{if(g)return o&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(ls=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(g)),f.layers.add(g),Nn(),()=>{o&&(f.layersWithOutsidePointerEventsDisabled.delete(g),f.layersWithOutsidePointerEventsDisabled.size===0&&(y.body.style.pointerEvents=ls))}},[g,y,o,f]),l.useEffect(()=>()=>{g&&(f.layers.delete(g),f.layersWithOutsidePointerEventsDisabled.delete(g),Nn())},[g,f]),l.useEffect(()=>{const p=he(()=>b({}),"handleUpdate");return document.addEventListener(Sn,p),()=>document.removeEventListener(Sn,p)},[]),s.jsx(Ne.div,{...h,ref:m,style:{pointerEvents:R?E?"auto":"none":void 0,...t.style},onFocusCapture:me(t.onFocusCapture,k.onFocusCapture),onBlurCapture:me(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:me(t.onPointerDownCapture,D.onPointerDownCapture)})},"DismissableLayer"));function $c(){const e=l.useContext(oo),[t,n]=l.useState(null);return l.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}he($c,"useDismissableLayerSurface");var Fc=he(()=>!0,"IS_TRUE");function ro(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:r,dismissableSurfaces:c,shouldHandlePointerDownOutside:a=Fc}=t,i=De(e),u=l.useRef(!1),d=l.useRef(!1),h=l.useRef(new Map),f=l.useRef(()=>{});return l.useEffect(()=>{function g(){d.current=!1,r.current=!1,h.current.clear()}he(g,"resetOutsideInteraction");function v(){return Array.from(h.current.values()).some(Boolean)}he(v,"isOutsideInteractionIntercepted");function y(N){if(!d.current)return;const S=N.target;S instanceof Node&&[...c].some(E=>E.contains(S))||h.current.set(N.type,!0),N.type==="click"&&window.setTimeout(()=>{d.current&&f.current()},0)}he(y,"handleInteractionCapture");function b(N){d.current&&h.current.set(N.type,!1)}he(b,"handleInteractionBubble");const m=he(N=>{if(N.target&&!u.current){let S=function(){n.removeEventListener("click",f.current);const E=v();g(),E||Mn(kc,i,R,{discrete:!0})};if(he(S,"handleAndDispatchPointerDownOutsideEvent"),!a(N.target)){n.removeEventListener("click",f.current),g(),u.current=!1;return}const R={originalEvent:N};d.current=!0,r.current=o&&N.button===0,h.current.clear(),!o||N.button!==0?S():(n.removeEventListener("click",f.current),f.current=S,n.addEventListener("click",f.current,{once:!0}))}else n.removeEventListener("click",f.current),g();u.current=!1},"handlePointerDown"),w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const N of w)n.addEventListener(N,y,!0),n.addEventListener(N,b);const j=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{window.clearTimeout(j),n.removeEventListener("pointerdown",m),n.removeEventListener("click",f.current);for(const N of w)n.removeEventListener(N,y,!0),n.removeEventListener(N,b)}},[n,i,o,r,c,a]),{onPointerDownCapture:he(()=>u.current=!0,"onPointerDownCapture")}}he(ro,"usePointerDownOutside");function co(e,t=globalThis?.document){const n=De(e),o=l.useRef(!1);return l.useEffect(()=>{const r=he(c=>{c.target&&!o.current&&Mn(Ic,n,{originalEvent:c},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:he(()=>o.current=!0,"onFocusCapture"),onBlurCapture:he(()=>o.current=!1,"onBlurCapture")}}he(co,"useFocusOutside");function Nn(){const e=new CustomEvent(Sn);document.dispatchEvent(e)}he(Nn,"dispatchUpdate");function Mn(e,t,n,{discrete:o}){const r=n.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?so(r,c):r.dispatchEvent(c)}he(Mn,"handleAndDispatchCustomEvent");var qc=Object.defineProperty,$n=(e,t)=>qc(e,"name",{value:t,configurable:!0}),Pt=0,st=null;function Uc(e){return Fn(),e.children}$n(Uc,"FocusGuards");function Fn(){l.useEffect(()=>{st||(st={start:jn(),end:jn()});const{start:e,end:t}=st;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Pt++,()=>{Pt===1&&(st?.start.remove(),st?.end.remove(),st=null),Pt=Math.max(0,Pt-1)}},[])}$n(Fn,"useFocusGuards");function jn(){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}$n(jn,"createFocusGuard");var Hc=Object.defineProperty,we=(e,t)=>Hc(e,"name",{value:t,configurable:!0}),cn="focusScope.autoFocusOnMount",an="focusScope.autoFocusOnUnmount",us={bubbles:!1,cancelable:!0},Bc=l.forwardRef(we(function(t,n){const{loop:o=!1,trapped:r=!1,onMountAutoFocus:c,onUnmountAutoFocus:a,...i}=t,[u,d]=l.useState(null),h=De(c),f=De(a),g=l.useRef(null),v=xe(n,d),y=l.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;l.useEffect(()=>{if(r){let m=function(S){if(y.paused||!u)return;const R=S.target;u.contains(R)?g.current=R:Me(g.current,{select:!0})},w=function(S){if(y.paused||!u)return;const R=S.relatedTarget;R!==null&&(u.contains(R)||Me(g.current,{select:!0}))},j=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&Me(u)};we(m,"handleFocusIn"),we(w,"handleFocusOut"),we(j,"handleMutations"),document.addEventListener("focusin",m),document.addEventListener("focusout",w);const N=new MutationObserver(j);return u&&N.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",w),N.disconnect()}}},[r,u,y.paused]),l.useEffect(()=>{if(u){ds.add(y);const m=document.activeElement;if(!u.contains(m)){const j=new CustomEvent(cn,us);u.addEventListener(cn,h),u.dispatchEvent(j),j.defaultPrevented||(ao(po(qn(u)),{select:!0}),document.activeElement===m&&Me(u))}return()=>{u.removeEventListener(cn,h),setTimeout(()=>{const j=new CustomEvent(an,us);u.addEventListener(an,f),u.dispatchEvent(j),j.defaultPrevented||Me(m??document.body,{select:!0}),u.removeEventListener(an,f),ds.remove(y)},0)}}},[u,h,f,y]);const b=l.useCallback(m=>{if(!o&&!r||y.paused)return;const w=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,j=document.activeElement;if(w&&j){const N=m.currentTarget,[S,R]=io(N);S&&R?!m.shiftKey&&j===R?(m.preventDefault(),o&&Me(S,{select:!0})):m.shiftKey&&j===S&&(m.preventDefault(),o&&Me(R,{select:!0})):j===N&&m.preventDefault()}},[o,r,y.paused]);return s.jsx(Ne.div,{tabIndex:-1,...i,ref:v,onKeyDown:b})},"FocusScope"));function ao(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(Me(o,{select:t}),document.activeElement!==n)return}we(ao,"focusFirst");function io(e){const t=qn(e),n=Cn(t,e),o=Cn(t.reverse(),e);return[n,o]}we(io,"getTabbableEdges");function qn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:we(o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}we(qn,"getTabbableCandidates");function Cn(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const o of e)if(!(n?!o.checkVisibility({checkVisibilityCSS:!0}):lo(o,{upTo:t})))return o}we(Cn,"findVisible");function lo(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}we(lo,"isHidden");function uo(e){return e instanceof HTMLInputElement&&"select"in e}we(uo,"isSelectableInput");function Me(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uo(e)&&t&&e.select()}}we(Me,"focus");var ds=fo();function fo(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=En(e,t),e.unshift(t)},remove(t){e=En(e,t),e[0]?.resume()}}}we(fo,"createFocusScopesStack");function En(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}we(En,"arrayRemove");function po(e){return e.filter(t=>t.tagName!=="A")}we(po,"removeLinks");var Se=globalThis?.document?l.useLayoutEffect:()=>{},Vc=Object.defineProperty,zc=(e,t)=>Vc(e,"name",{value:t,configurable:!0}),Kc=Kt[" useId ".trim().toString()]||(()=>{}),Wc=0;function Un(e){const[t,n]=l.useState(Kc());return Se(()=>{e||n(o=>o??String(Wc++))},[e]),e||(t?`radix-${t}`:"")}zc(Un,"useId");const Xc=["top","right","bottom","left"],ze=Math.min,$e=Math.max,Ht=Math.round,Tt=Math.floor,Fe=e=>({x:e,y:e}),Gc={left:"right",right:"left",bottom:"top",top:"bottom"};function mo(e,t,n){return $e(e,ze(t,n))}function qe(e,t){return typeof e=="function"?e(t):e}function Ke(e){return e.split("-")[0]}function gt(e){return e.split("-")[1]}function Hn(e){return e==="x"?"y":"x"}function Bn(e){return e==="y"?"height":"width"}function Ae(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Vn(e){return Hn(Ae(e))}function Yc(e,t,n){n===void 0&&(n=!1);const o=gt(e),r=Vn(e),c=Bn(r);let a=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(a=Bt(a)),[a,Bt(a)]}function Qc(e){const t=Bt(e);return[Rn(e),t,Rn(t)]}function Rn(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const fs=["left","right"],ps=["right","left"],Zc=["top","bottom"],Jc=["bottom","top"];function ea(e,t,n){switch(e){case"top":case"bottom":return n?t?ps:fs:t?fs:ps;case"left":case"right":return t?Zc:Jc;default:return[]}}function ta(e,t,n,o){const r=gt(e);let c=ea(Ke(e),n==="start",o);return r&&(c=c.map(a=>a+"-"+r),t&&(c=c.concat(c.map(Rn)))),c}function Bt(e){const t=Ke(e);return Gc[t]+e.slice(t.length)}function na(e){var t,n,o,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(r=e.left)!=null?r:0}}function ho(e){return typeof e!="number"?na(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function ms(e,t,n){let{reference:o,floating:r}=e;const c=Ae(t),a=Vn(t),i=Bn(a),u=Ke(t),d=c==="y",h=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,g=o[i]/2-r[i]/2;let v;switch(u){case"top":v={x:h,y:o.y-r.height};break;case"bottom":v={x:h,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:f};break;case"left":v={x:o.x-r.width,y:f};break;default:v={x:o.x,y:o.y}}const y=gt(t);return y&&(v[a]+=g*(y==="end"?1:-1)*(n&&d?-1:1)),v}async function sa(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:c,rects:a,elements:i,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:g=!1,padding:v=0}=qe(t,e),y=ho(v),m=i[g?f==="floating"?"reference":"floating":f],w=Vt(await c.getClippingRect({element:(n=await(c.isElement==null?void 0:c.isElement(m)))==null||n?m:m.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(i.floating)),boundary:d,rootBoundary:h,strategy:u})),j=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(i.floating)),S=await(c.isElement==null?void 0:c.isElement(N))&&await(c.getScale==null?void 0:c.getScale(N))||{x:1,y:1},R=Vt(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:j,offsetParent:N,strategy:u}):j);return{top:(w.top-R.top+y.top)/S.y,bottom:(R.bottom-w.bottom+y.bottom)/S.y,left:(w.left-R.left+y.left)/S.x,right:(R.right-w.right+y.right)/S.x}}const oa=50,ra=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:c=[],platform:a}=n,i=a.detectOverflow?a:{...a,detectOverflow:sa},u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:f}=ms(d,o,u),g=o,v=0;const y={};for(let b=0;b<c.length;b++){const m=c[b];if(!m)continue;const{name:w,fn:j}=m,{x:N,y:S,data:R,reset:E}=await j({x:h,y:f,initialPlacement:o,placement:g,strategy:r,middlewareData:y,rects:d,platform:i,elements:{reference:e,floating:t}});h=N??h,f=S??f,y[w]={...y[w],...R},E&&v<oa&&(v++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(d=E.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:r}):E.rects),{x:h,y:f}=ms(d,g,u)),b=-1)}return{x:h,y:f,placement:g,strategy:r,middlewareData:y}},ca=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:c,platform:a,elements:i,middlewareData:u}=t,{element:d,padding:h=0}=qe(e,t)||{};if(d==null)return{};const f=ho(h),g={x:n,y:o},v=Vn(r),y=Bn(v),b=await a.getDimensions(d),m=v==="y",w=m?"top":"left",j=m?"bottom":"right",N=m?"clientHeight":"clientWidth",S=c.reference[y]+c.reference[v]-g[v]-c.floating[y],R=g[v]-c.reference[v],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let T=E?E[N]:0;(!T||!await(a.isElement==null?void 0:a.isElement(E)))&&(T=i.floating[N]||c.floating[y]);const D=S/2-R/2,k=T/2-b[y]/2-1,I=ze(f[w],k),U=ze(f[j],k),p=T-b[y]-U,x=T/2-b[y]/2+D,C=mo(I,x,p),_=!u.arrow&>(r)!=null&&x!==C&&c.reference[y]/2-(x<I?I:U)-b[y]/2<0,O=_?x<I?x-I:x-p:0;return{[v]:g[v]+O,data:{[v]:C,centerOffset:x-C-O,..._&&{alignmentOffset:O}},reset:_}}}),aa=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:c,rects:a,initialPlacement:i,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:b=!0,...m}=qe(e,t);if((n=c.arrow)!=null&&n.alignmentOffset)return{};const w=Ke(r),j=Ae(i),N=Ke(i)===i,S=await(u.isRTL==null?void 0:u.isRTL(d.floating)),R=g||(N||!b?[Bt(i)]:Qc(i)),E=y!=="none";!g&&E&&R.push(...ta(i,b,y,S));const T=[i,...R],D=await u.detectOverflow(t,m),k=[];let I=((o=c.flip)==null?void 0:o.overflows)||[];if(h&&k.push(D[w]),f){const C=Yc(r,a,S);k.push(D[C[0]],D[C[1]])}if(I=[...I,{placement:r,overflows:k}],!k.every(C=>C<=0)){var U,p;const C=(((U=c.flip)==null?void 0:U.index)||0)+1,_=T[C];if(_&&(!(f==="alignment"?j!==Ae(_):!1)||I.every(A=>Ae(A.placement)===j?A.overflows[0]>0:!0)))return{data:{index:C,overflows:I},reset:{placement:_}};let O=(p=I.filter(L=>L.overflows[0]<=0).sort((L,A)=>L.overflows[1]-A.overflows[1])[0])==null?void 0:p.placement;if(!O)switch(v){case"bestFit":{var x;const L=(x=I.filter(A=>{if(E){const q=Ae(A.placement);return q===j||q==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(q=>q>0).reduce((q,$)=>q+$,0)]).sort((A,q)=>A[1]-q[1])[0])==null?void 0:x[0];L&&(O=L);break}case"initialPlacement":O=i;break}if(r!==O)return{reset:{placement:O}}}return{}}}};function hs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gs(e){return Xc.some(t=>e[t]>=0)}const ia=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:o}=t,{strategy:r="referenceHidden",...c}=qe(e,t);switch(r){case"referenceHidden":{const a=await o.detectOverflow(t,{...c,elementContext:"reference"}),i=hs(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:gs(i)}}}case"escaped":{const a=await o.detectOverflow(t,{...c,altBoundary:!0}),i=hs(a,n.floating);return{data:{escapedOffsets:i,escaped:gs(i)}}}default:return{}}}}},go=new Set(["left","top"]);async function la(e,t){const{placement:n,platform:o,elements:r}=e,c=await(o.isRTL==null?void 0:o.isRTL(r.floating)),a=Ke(n),i=gt(n),u=Ae(n)==="y",d=go.has(a)?-1:1,h=c&&u?-1:1,f=qe(t,e);let{mainAxis:g,crossAxis:v,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof y=="number"&&(v=i==="end"?y*-1:y),u?{x:v*h,y:g*d}:{x:g*d,y:v*h}}const ua=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:c,placement:a,middlewareData:i}=t,u=await la(t,e);return a===((n=i.offset)==null?void 0:n.placement)&&(o=i.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:c+u.y,data:{...u,placement:a}}}}},da=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:c}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:u={fn:j=>{let{x:N,y:S}=j;return{x:N,y:S}}},...d}=qe(e,t),h={x:n,y:o},f=await c.detectOverflow(t,d),g=Ae(r),v=Hn(g);let y=h[v],b=h[g];const m=(j,N)=>mo(N+f[j==="y"?"top":"left"],N,N-f[j==="y"?"bottom":"right"]);a&&(y=m(v,y)),i&&(b=m(g,b));const w=u.fn({...t,[v]:y,[g]:b});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[v]:a,[g]:i}}}}}},fa=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:c,placement:a,rects:i,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:f=!0}=qe(e,t),g={x:r,y:c},v=Ae(a),y=Hn(v);let b=g[y],m=g[v];const w=qe(d,t),j=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:(n=w.mainAxis)!=null?n:0,crossAxis:(o=w.crossAxis)!=null?o:0};if(h){const R=y==="y"?"height":"width",E=i.reference[y]-i.floating[R]+j.mainAxis,T=i.reference[y]+i.reference[R]-j.mainAxis;b<E?b=E:b>T&&(b=T)}if(f){var N,S;const R=y==="y"?"width":"height",E=go.has(Ke(a)),T=i.reference[v]-i.floating[R]+(E&&((N=u.offset)==null?void 0:N[v])||0)+(E?0:j.crossAxis),D=i.reference[v]+i.reference[R]+(E?0:((S=u.offset)==null?void 0:S[v])||0)-(E?j.crossAxis:0);m<T?m=T:m>D&&(m=D)}return{[y]:b,[v]:m}}}},pa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:c}=t,{apply:a=()=>{},...i}=qe(e,t),u=await r.detectOverflow(t,i),d=Ke(n),h=gt(n),f=Ae(n)==="y",{width:g,height:v}=o.floating;let y,b;d==="top"||d==="bottom"?(y=d,b=h===(await(r.isRTL==null?void 0:r.isRTL(c.floating))?"start":"end")?"left":"right"):(b=d,y=h==="end"?"top":"bottom");const m=v-u.top-u.bottom,w=g-u.left-u.right,j=ze(v-u[y],m),N=ze(g-u[b],w),S=t.middlewareData.shift,R=!S;let E=j,T=N;S!=null&&S.enabled.x&&(T=w),S!=null&&S.enabled.y&&(E=m),R&&!h&&(f?T=g-2*$e(u.left,u.right):E=v-2*$e(u.top,u.bottom)),await a({...t,availableWidth:T,availableHeight:E});const D=await r.getDimensions(c.floating);return g!==D.width||v!==D.height?{reset:{rects:!0}}:{}}}};function Gt(){return typeof window<"u"}function xt(e){return xo(e)?(e.nodeName||"").toLowerCase():"#document"}function je(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function He(e){var t;return(t=(xo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xo(e){return Gt()?e instanceof Node||e instanceof je(e).Node:!1}function ke(e){return Gt()?e instanceof Element||e instanceof je(e).Element:!1}function We(e){return Gt()?e instanceof HTMLElement||e instanceof je(e).HTMLElement:!1}function xs(e){return!Gt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof je(e).ShadowRoot}function Yt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ie(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function ma(e){return/^(table|td|th)$/.test(xt(e))}function Qt(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ha=/transform|translate|scale|rotate|perspective|filter/,ga=/paint|layout|strict|content/,Ge=e=>!!e&&e!=="none";let ln;function zn(e){const t=ke(e)?Ie(e):e;return Ge(t.transform)||Ge(t.translate)||Ge(t.scale)||Ge(t.rotate)||Ge(t.perspective)||!Kn()&&(Ge(t.backdropFilter)||Ge(t.filter))||ha.test(t.willChange||"")||ga.test(t.contain||"")}function xa(e){let t=Je(e);for(;We(t)&&!St(t);){if(zn(t))return t;if(Qt(t))return null;t=Je(t)}return null}function Kn(){return ln==null&&(ln=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ln}function St(e){return/^(html|body|#document)$/.test(xt(e))}function Ie(e){return je(e).getComputedStyle(e)}function Zt(e){return ke(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Je(e){if(xt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||xs(e)&&e.host||He(e);return xs(t)?t.host:t}function vo(e){const t=Je(e);return St(t)?(e.ownerDocument||e).body:We(t)&&Yt(t)?t:vo(t)}function Nt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=vo(e),c=r===((o=e.ownerDocument)==null?void 0:o.body),a=je(r);if(c){const i=Pn(a);return t.concat(a,a.visualViewport||[],Yt(r)?r:[],i&&n?Nt(i):[])}else return t.concat(r,Nt(r,[],n))}function Pn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function bo(e){const t=Ie(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=We(e),c=r?e.offsetWidth:n,a=r?e.offsetHeight:o,i=Ht(n)!==c||Ht(o)!==a;return i&&(n=c,o=a),{width:n,height:o,$:i}}function Wn(e){return ke(e)?e:e.contextElement}function dt(e){const t=Wn(e);if(!We(t))return Fe(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:c}=bo(t);let a=(c?Ht(n.width):n.width)/o,i=(c?Ht(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!i||!Number.isFinite(i))&&(i=1),{x:a,y:i}}const va=Fe(0);function yo(e){const t=je(e);return!Kn()||!t.visualViewport?va:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ba(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===je(e)}function et(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),c=Wn(e);let a=Fe(1);t&&(o?ke(o)&&(a=dt(o)):a=dt(e));const i=ba(c,n,o)?yo(c):Fe(0);let u=(r.left+i.x)/a.x,d=(r.top+i.y)/a.y,h=r.width/a.x,f=r.height/a.y;if(c&&o){const g=je(c),v=ke(o)?je(o):o;let y=g,b=Pn(y);for(;b&&v!==y;){const m=dt(b),w=b.getBoundingClientRect(),j=Ie(b),N=w.left+(b.clientLeft+parseFloat(j.paddingLeft))*m.x,S=w.top+(b.clientTop+parseFloat(j.paddingTop))*m.y;u*=m.x,d*=m.y,h*=m.x,f*=m.y,u+=N,d+=S,y=je(b),b=Pn(y)}}return Vt({width:h,height:f,x:u,y:d})}function Jt(e,t){const n=Zt(e).scrollLeft;return t?t.left+n:et(He(e)).left+n}function wo(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Jt(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function ya(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const c=r==="fixed",a=He(o),i=t?Qt(t.floating):!1;if(o===a||i&&c)return n;let u={scrollLeft:0,scrollTop:0},d=Fe(1);const h=Fe(0),f=We(o);if((f||!c)&&((xt(o)!=="body"||Yt(a))&&(u=Zt(o)),f)){const v=et(o);d=dt(o),h.x=v.x+o.clientLeft,h.y=v.y+o.clientTop}const g=a&&!f&&!c?wo(a,u):Fe(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function wa(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Sa(e){const t=Zt(e),n=e.ownerDocument.body,o=$e(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=$e(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let c=-t.scrollLeft+Jt(e);const a=-t.scrollTop;return Ie(n).direction==="rtl"&&(c+=$e(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:c,y:a}}const Na=25;function ja(e,t,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",r=je(e),c=He(e),a=r.visualViewport;let i=c.clientWidth,u=c.clientHeight,d=0,h=0;if(a){const g=!Kn()||t==="fixed";o?g||(d=-a.offsetLeft,h=-a.offsetTop):(i=a.width,u=a.height,g&&(d=a.offsetLeft,h=a.offsetTop))}if(Jt(c)<=0){const g=c.ownerDocument,v=g.body,y=getComputedStyle(v),b=g.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,m=Math.abs(c.clientWidth-v.clientWidth-b),w=getComputedStyle(c).scrollbarGutter==="stable both-edges"?m/2:m;w<=Na&&(i-=w)}return{width:i,height:u,x:d,y:h}}function Ca(e,t){const n=et(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,c=dt(e),a=e.clientWidth*c.x,i=e.clientHeight*c.y,u=r*c.x,d=o*c.y;return{width:a,height:i,x:u,y:d}}function vs(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=ja(e,n,t);else if(t==="document")o=Sa(He(e));else if(ke(t))o=Ca(t,n);else{const r=yo(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Vt(o)}function Ea(e,t){const n=t.get(e);if(n)return n;let o=Nt(e,[],!1).filter(i=>ke(i)&&xt(i)!=="body"),r=null;const c=Ie(e).position==="fixed";let a=c?Je(e):e;for(;ke(a)&&!St(a);){const i=Ie(a),u=zn(a),d=r?r.position:c?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&i.position==="static")?o=o.filter(f=>f!==a):r=i,a=Je(a)}return t.set(e,o),o}function Ra(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const a=[...n==="clippingAncestors"?Qt(t)?[]:Ea(t,this._c):[].concat(n),o],i=vs(t,a[0],r);let u=i.top,d=i.right,h=i.bottom,f=i.left;for(let g=1;g<a.length;g++){const v=vs(t,a[g],r);u=$e(v.top,u),d=ze(v.right,d),h=ze(v.bottom,h),f=$e(v.left,f)}return{width:d-f,height:h-u,x:f,y:u}}function Pa(e){const{width:t,height:n}=bo(e);return{width:t,height:n}}function Ta(e,t,n){const o=We(t),r=He(t),c=n==="fixed",a=et(e,!0,c,t);let i={scrollLeft:0,scrollTop:0};const u=Fe(0);if((o||!c)&&((xt(t)!=="body"||Yt(r))&&(i=Zt(t)),o)){const g=et(t,!0,c,t);u.x=g.x+t.clientLeft,u.y=g.y+t.clientTop}!o&&r&&(u.x=Jt(r));const d=r&&!o&&!c?wo(r,i):Fe(0),h=a.left+i.scrollLeft-u.x-d.x,f=a.top+i.scrollTop-u.y-d.y;return{x:h,y:f,width:a.width,height:a.height}}function un(e){return Ie(e).position==="static"}function bs(e,t){if(!We(e)||Ie(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return He(e)===n&&(n=n.ownerDocument.body),n}function So(e,t){const n=je(e);if(Qt(e))return n;if(!We(e)){let r=Je(e);for(;r&&!St(r);){if(ke(r)&&!un(r))return r;r=Je(r)}return n}let o=bs(e,t);for(;o&&ma(o)&&un(o);)o=bs(o,t);return o&&St(o)&&un(o)&&!zn(o)?n:o||xa(e)||n}const _a=async function(e){const t=this.getOffsetParent||So,n=this.getDimensions,o=await n(e.floating);return{reference:Ta(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Oa(e){return Ie(e).direction==="rtl"}const La={convertOffsetParentRelativeRectToViewportRelativeRect:ya,getDocumentElement:He,getClippingRect:Ra,getOffsetParent:So,getElementRects:_a,getClientRects:wa,getDimensions:Pa,getScale:dt,isElement:ke,isRTL:Oa};function No(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Aa(e,t,n){let o=null,r;const c=He(e);function a(){var h;clearTimeout(r),(h=o)==null||h.disconnect(),o=null}function i(h,f){h===void 0&&(h=!1),f===void 0&&(f=1),a();const g=e.getBoundingClientRect(),{left:v,top:y,width:b,height:m}=g;if(h||t(),!b||!m)return;const w=Tt(y),j=Tt(c.clientWidth-(v+b)),N=Tt(c.clientHeight-(y+m)),S=Tt(v),E={rootMargin:-w+"px "+-j+"px "+-N+"px "+-S+"px",threshold:$e(0,ze(1,f))||1};let T=!0;function D(k){const I=k[0].intersectionRatio;if(!No(g,e.getBoundingClientRect()))return i();if(I!==f){if(!T)return i();I?i(!1,I):r=setTimeout(()=>{i(!1,1e-7)},1e3)}T=!1}try{o=new IntersectionObserver(D,{...E,root:c.ownerDocument})}catch{o=new IntersectionObserver(D,E)}o.observe(e)}const u=je(e),d=()=>i(n);return u.addEventListener("resize",d),i(!0),()=>{u.removeEventListener("resize",d),a()}}function Da(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:c=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=Wn(e),h=r||c?[...d?Nt(d):[],...t?Nt(t):[]]:[];h.forEach(w=>{r&&w.addEventListener("scroll",n),c&&w.addEventListener("resize",n)});const f=d&&i?Aa(d,n,c):null;let g=-1,v=null;a&&(v=new ResizeObserver(w=>{let[j]=w;j&&j.target===d&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=v)==null||N.observe(t)})),n()}),d&&!u&&v.observe(d),t&&v.observe(t));let y,b=u?et(e):null;u&&m();function m(){const w=et(e);b&&!No(b,w)&&n(),b=w,y=requestAnimationFrame(m)}return n(),()=>{var w;h.forEach(j=>{r&&j.removeEventListener("scroll",n),c&&j.removeEventListener("resize",n)}),f?.(),(w=v)==null||w.disconnect(),v=null,u&&cancelAnimationFrame(y)}}const ka=ua,Ia=da,Ma=aa,$a=pa,Fa=ia,ys=ca,qa=fa,Ua=(e,t,n)=>{const o=new Map,r=n??{},c={...La,...r.platform,_c:o};return ra(e,t,{...r,platform:c})};var Ha=typeof document<"u",Ba=function(){},Mt=Ha?l.useLayoutEffect:Ba;function zt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!zt(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const c=r[o];if(!(c==="_owner"&&e.$$typeof)&&!zt(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function jo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ws(e,t){const n=jo(e);return Math.round(t*n)/n}function dn(e){const t=l.useRef(e);return Mt(()=>{t.current=e}),t}function Va(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:c,floating:a}={},transform:i=!0,whileElementsMounted:u,open:d}=e,[h,f]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,v]=l.useState(o);zt(g,o)||v(o);const[y,b]=l.useState(null),[m,w]=l.useState(null),j=l.useCallback(A=>{A!==E.current&&(E.current=A,b(A))},[]),N=l.useCallback(A=>{A!==T.current&&(T.current=A,w(A))},[]),S=c||y,R=a||m,E=l.useRef(null),T=l.useRef(null),D=l.useRef(h),k=u!=null,I=dn(u),U=dn(r),p=dn(d),x=l.useCallback(()=>{if(!E.current||!T.current)return;const A={placement:t,strategy:n,middleware:g};U.current&&(A.platform=U.current),Ua(E.current,T.current,A).then(q=>{const $={...q,isPositioned:p.current!==!1};C.current&&!zt(D.current,$)&&(D.current=$,jt.flushSync(()=>{f($)}))})},[g,t,n,U,p]);Mt(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[d]);const C=l.useRef(!1);Mt(()=>(C.current=!0,()=>{C.current=!1}),[]),Mt(()=>{if(S&&(E.current=S),R&&(T.current=R),S&&R){if(I.current)return I.current(S,R,x);x()}},[S,R,x,I,k]);const _=l.useMemo(()=>({reference:E,floating:T,setReference:j,setFloating:N}),[j,N]),O=l.useMemo(()=>({reference:S,floating:R}),[S,R]),L=l.useMemo(()=>{const A={position:n,left:0,top:0};if(!O.floating)return A;const q=ws(O.floating,h.x),$=ws(O.floating,h.y);return i?{...A,transform:"translate("+q+"px, "+$+"px)",...jo(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:$}},[n,i,O.floating,h.x,h.y]);return l.useMemo(()=>({...h,update:x,refs:_,elements:O,floatingStyles:L}),[h,x,_,O,L])}const za=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:r}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?ys({element:o.current,padding:r}).fn(n):{}:o?ys({element:o,padding:r}).fn(n):{}}}},Ka=(e,t)=>{const n=ka(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wa=(e,t)=>{const n=Ia(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xa=(e,t)=>({fn:qa(e).fn,options:[e,t]}),Ga=(e,t)=>{const n=Ma(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ya=(e,t)=>{const n=$a(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qa=(e,t)=>{const n=Fa(e);return{name:n.name,fn:n.fn,options:[e,t]}},Za=(e,t)=>{const n=za(e);return{name:n.name,fn:n.fn,options:[e,t]}};var Ja=Object.defineProperty,ei=(e,t)=>Ja(e,"name",{value:t,configurable:!0});function Co(e){const[t,n]=l.useState(void 0);return Se(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const c=r[0];let a,i;if("borderBoxSize"in c){const u=c.borderBoxSize,d=Array.isArray(u)?u[0]:u;a=d.inlineSize,i=d.blockSize}else a=e.offsetWidth,i=e.offsetHeight;n({width:a,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}ei(Co,"useSize");var ti=Object.defineProperty,Ve=(e,t)=>ti(e,"name",{value:t,configurable:!0}),Eo="Popper",[Ro,Po]=Ct(Eo),[ni,To]=Ro(Eo),si=Ve(e=>{const{__scopePopper:t,children:n}=e,[o,r]=l.useState(null),[c,a]=l.useState(void 0);return s.jsx(ni,{scope:t,anchor:o,onAnchorChange:r,placementState:c,setPlacementState:a,children:n})},"Popper"),oi="PopperAnchor",ri=l.forwardRef(Ve(function(t,n){const{__scopePopper:o,virtualRef:r,...c}=t,a=To(oi,o),i=l.useRef(null),u=a.onAnchorChange,d=l.useCallback(b=>{i.current=b,b&&u(b)},[u]),h=xe(n,d),f=l.useRef(null);l.useEffect(()=>{if(!r)return;const b=f.current;f.current=r.current,b!==f.current&&u(f.current)});const g=a.placementState&&en(a.placementState),v=g?.[0],y=g?.[1];return r?null:s.jsx(Ne.div,{"data-radix-popper-side":v,"data-radix-popper-align":y,...c,ref:h})},"PopperAnchor")),_o="PopperContent",[ci,Mz]=Ro(_o),ai=l.forwardRef(Ve(function(t,n){const{__scopePopper:o,side:r="bottom",sideOffset:c=0,align:a="center",alignOffset:i=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:f=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:b,...m}=t,w=To(_o,o),[j,N]=l.useState(null),S=xe(n,N),[R,E]=l.useState(null),T=Co(R),D=T?.width??0,k=T?.height??0,I=r+(a!=="center"?"-"+a:""),U=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},p=Array.isArray(h)?h:[h],x=p.length>0,C={padding:U,boundary:p.filter(Oo),altBoundary:x},{refs:_,floatingStyles:O,placement:L,isPositioned:A,middlewareData:q}=Va({strategy:"fixed",placement:I,whileElementsMounted:Ve((...K)=>Da(...K,{animationFrame:y==="always"}),"whileElementsMounted"),elements:{reference:w.anchor},middleware:[Ka({mainAxis:c+k,alignmentAxis:i}),d&&Wa({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Xa():void 0,...C}),d&&Ga({...C}),Ya({...C,apply:Ve(({elements:K,rects:ne,availableWidth:M,availableHeight:X})=>{const{width:W,height:se}=ne.reference,de=K.floating.style;de.setProperty("--radix-popper-available-width",`${M}px`),de.setProperty("--radix-popper-available-height",`${X}px`),de.setProperty("--radix-popper-anchor-width",`${W}px`),de.setProperty("--radix-popper-anchor-height",`${se}px`)},"apply")}),R&&Za({element:R,padding:u}),ii({arrowWidth:D,arrowHeight:k}),v&&Qa({strategy:"referenceHidden",...C,boundary:x?C.boundary:void 0})]}),$=w.setPlacementState;Se(()=>($(L),()=>{$(void 0)}),[L,$]);const[V,z]=en(L),te=De(b);Se(()=>{A&&te?.()},[A,te]);const G=q.arrow?.x,re=q.arrow?.y,Y=q.arrow?.centerOffset!==0,[ve,F]=l.useState();return Se(()=>{j&&F(window.getComputedStyle(j).zIndex)},[j]),s.jsx("div",{ref:_.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:A?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[q.transformOrigin?.x,q.transformOrigin?.y].join(" "),...q.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:s.jsx(ci,{scope:o,placedSide:V,placedAlign:z,onArrowChange:E,arrowX:G,arrowY:re,shouldHideArrow:Y,children:s.jsx(Ne.div,{"data-side":V,"data-align":z,...m,ref:S,style:{...m.style,animation:A?m.style?.animation:"none"}})})})},"PopperContent"));function Oo(e){return e!==null}Ve(Oo,"isNotNull");var ii=Ve(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:r}=t,a=r.arrow?.centerOffset!==0,i=a?0:e.arrowWidth,u=a?0:e.arrowHeight,[d,h]=en(n),f={start:"0%",center:"50%",end:"100%"}[h],g=(r.arrow?.x??0)+i/2,v=(r.arrow?.y??0)+u/2;let y="",b="";return d==="bottom"?(y=a?f:`${g}px`,b=`${-u}px`):d==="top"?(y=a?f:`${g}px`,b=`${o.floating.height+u}px`):d==="right"?(y=`${-u}px`,b=a?f:`${v}px`):d==="left"&&(y=`${o.floating.width+u}px`,b=a?f:`${v}px`),{data:{x:y,y:b}}}}),"transformOrigin");function en(e){const[t,n="center"]=e.split("-");return[t,n]}Ve(en,"getSideAndAlignFromPlacement");var li=si,ui=ri,di=ai,fi=Object.defineProperty,pi=(e,t)=>fi(e,"name",{value:t,configurable:!0}),mi=l.forwardRef(pi(function(t,n){const{container:o,...r}=t,[c,a]=l.useState(!1);Se(()=>a(!0),[]);const i=o||c&&globalThis?.document?.body;return i?jt.createPortal(s.jsx(Ne.div,{...r,ref:n}),i):null},"Portal")),hi=Object.defineProperty,Ue=(e,t)=>hi(e,"name",{value:t,configurable:!0});function Lo(e,t){return l.useReducer((n,o)=>t[n][o]??n,e)}Ue(Lo,"useStateMachine");var gi=Ue(e=>{const{present:t,children:n}=e,o=Ao(t),r=typeof n=="function"?n({present:o.isPresent}):l.Children.only(n),c=Do(o.ref,ko(r));return typeof n=="function"||o.isPresent?l.cloneElement(r,{ref:c}):null},"Presence");function Ao(e){const[t,n]=l.useState(),o=l.useRef(null),r=l.useRef(e),c=l.useRef("none"),a=l.useRef(void 0),i=e?"mounted":"unmounted",[u,d]=Lo(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return l.useEffect(()=>{u==="mounted"?(c.current=a.current??it(o.current),a.current=void 0):c.current="none"},[u]),Se(()=>{const h=o.current,f=r.current;if(f!==e){const v=c.current,y=it(h);e?(a.current=y,d("MOUNT")):y==="none"||h?.display==="none"?d("UNMOUNT"):d(f&&v!==y?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,d]),Se(()=>{if(t){let h;const f=t.ownerDocument.defaultView??window,g=Ue(y=>{const m=it(o.current).includes(CSS.escape(y.animationName));if(y.target===t&&m&&(d("ANIMATION_END"),!r.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",h=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},"handleAnimationEnd"),v=Ue(y=>{y.target===t&&(c.current=it(o.current))},"handleAnimationStart");return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{f.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:l.useCallback(h=>{if(h){const f=getComputedStyle(h);o.current=f,a.current=it(f)}else o.current=null;n(h)},[])}}Ue(Ao,"usePresence");function Tn(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Ue(Tn,"setRef");function Do(...e){const t=l.useRef(e);return t.current=e,l.useCallback(n=>{const o=t.current;let r=!1;const c=o.map(a=>{const i=Tn(a,n);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<c.length;a++){const i=c[a];typeof i=="function"?i():Tn(o[a],null)}}},[])}Ue(Do,"useStableComposedRefs");function it(e){return e?.animationName||"none"}Ue(it,"getAnimationName");function ko(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)}Ue(ko,"getElementRef");var xi=Object.defineProperty,vi=(e,t)=>xi(e,"name",{value:t,configurable:!0}),Ss=Kt[" useEffectEvent ".trim().toString()],Ns=Kt[" useInsertionEffect ".trim().toString()];function Io(e){if(typeof Ss=="function")return Ss(e);const t=l.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Ns=="function"?Ns(()=>{t.current=e}):Se(()=>{t.current=e}),l.useMemo(()=>((...n)=>t.current?.(...n)),[])}vi(Io,"useEffectEvent");var bi=Object.defineProperty,Et=(e,t)=>bi(e,"name",{value:t,configurable:!0}),yi=Kt[" useInsertionEffect ".trim().toString()]||Se;function _n({prop:e,defaultProp:t,onChange:n=Et(()=>{},"onChange"),caller:o}){const[r,c,a]=Mo({defaultProp:t,onChange:n}),i=e!==void 0,u=i?e:r,d=l.useCallback(h=>{if(i){const f=$o(h)?h(e):h;f!==e&&a.current?.(f)}else c(h)},[i,e,c,a]);return[u,d]}Et(_n,"useControllableState");function Mo({defaultProp:e,onChange:t}){const[n,o]=l.useState(e),r=l.useRef(n),c=l.useRef(t);return yi(()=>{c.current=t},[t]),l.useEffect(()=>{r.current!==n&&(c.current?.(n),r.current=n)},[n,r]),[n,o,c]}Et(Mo,"useUncontrolledState");function $o(e){return typeof e=="function"}Et($o,"isFunction");var js=Symbol("RADIX:SYNC_STATE");function wi(e,t,n,o){const{prop:r,defaultProp:c,onChange:a,caller:i}=t,u=r!==void 0,d=Io(a),h=[{...n,state:c}];o&&h.push(o);const[f,g]=l.useReducer((m,w)=>{if(w.type===js)return{...m,state:w.state};const j=e(m,w);return u&&!Object.is(j.state,m.state)&&d(j.state),j},...h),v=f.state,y=l.useRef(v);l.useEffect(()=>{y.current!==v&&(y.current=v,u||d(v))},[v,y,u]);const b=l.useMemo(()=>r!==void 0?{...f,state:r}:f,[f,r]);return l.useEffect(()=>{u&&!Object.is(r,f.state)&&g({type:js,state:r})},[r,f.state,u]),[b,g]}Et(wi,"useControllableStateReducer");var Si=Object.defineProperty,Ni=(e,t)=>Si(e,"name",{value:t,configurable:!0});function Fo(e){const t=l.useRef({value:e,previous:e});return l.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Ni(Fo,"usePrevious");var ji=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Ci=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ot=new WeakMap,_t=new WeakMap,Ot={},fn=0,qo=function(e){return e&&(e.host||qo(e.parentNode))},Ei=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=qo(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ri=function(e,t,n,o){var r=Ei(t,Array.isArray(e)?e:[e]);Ot[n]||(Ot[n]=new WeakMap);var c=Ot[n],a=[],i=new Set,u=new Set(r),d=function(f){!f||i.has(f)||(i.add(f),d(f.parentNode))};r.forEach(d);var h=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(g){if(i.has(g))h(g);else try{var v=g.getAttribute(o),y=v!==null&&v!=="false",b=(ot.get(g)||0)+1,m=(c.get(g)||0)+1;ot.set(g,b),c.set(g,m),a.push(g),b===1&&y&&_t.set(g,!0),m===1&&g.setAttribute(n,"true"),y||g.setAttribute(o,"true")}catch(w){console.error("aria-hidden: cannot operate on ",g,w)}})};return h(t),i.clear(),fn++,function(){a.forEach(function(f){var g=ot.get(f)-1,v=c.get(f)-1;ot.set(f,g),c.set(f,v),g||(_t.has(f)||f.removeAttribute(o),_t.delete(f)),v||f.removeAttribute(n)}),fn--,fn||(ot=new WeakMap,ot=new WeakMap,_t=new WeakMap,Ot={})}},Pi=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=Ci(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),Ri(o,r,n,"aria-hidden")):function(){return null}},Le=function(){return Le=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&(t[c]=n[c])}return t},Le.apply(this,arguments)};function Uo(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Ti(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,c;o<r;o++)(c||!(o in t))&&(c||(c=Array.prototype.slice.call(t,0,o)),c[o]=t[o]);return e.concat(c||Array.prototype.slice.call(t))}var $t="right-scroll-bar-position",Ft="width-before-scroll-bar",_i="with-scroll-bars-hidden",Oi="--removed-body-scroll-bar-size";function pn(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Li(e,t){var n=l.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var r=n.value;r!==o&&(n.value=o,n.callback(o,r))}}}})[0];return n.callback=t,n.facade}var Ai=typeof window<"u"?l.useLayoutEffect:l.useEffect,Cs=new WeakMap;function Di(e,t){var n=Li(null,function(o){return e.forEach(function(r){return pn(r,o)})});return Ai(function(){var o=Cs.get(n);if(o){var r=new Set(o),c=new Set(e),a=n.current;r.forEach(function(i){c.has(i)||pn(i,null)}),c.forEach(function(i){r.has(i)||pn(i,a)})}Cs.set(n,e)},[e]),n}function ki(e){return e}function Ii(e,t){t===void 0&&(t=ki);var n=[],o=!1,r={read:function(){if(o)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(c){var a=t(c,o);return n.push(a),function(){n=n.filter(function(i){return i!==a})}},assignSyncMedium:function(c){for(o=!0;n.length;){var a=n;n=[],a.forEach(c)}n={push:function(i){return c(i)},filter:function(){return n}}},assignMedium:function(c){o=!0;var a=[];if(n.length){var i=n;n=[],i.forEach(c),a=n}var u=function(){var h=a;a=[],h.forEach(c)},d=function(){return Promise.resolve().then(u)};d(),n={push:function(h){a.push(h),d()},filter:function(h){return a=a.filter(h),n}}}};return r}function Mi(e){e===void 0&&(e={});var t=Ii(null);return t.options=Le({async:!0,ssr:!1},e),t}var Ho=function(e){var t=e.sideCar,n=Uo(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return l.createElement(o,Le({},n))};Ho.isSideCarExport=!0;function $i(e,t){return e.useMedium(t),Ho}var Bo=Mi(),mn=function(){},tn=l.forwardRef(function(e,t){var n=l.useRef(null),o=l.useState({onScrollCapture:mn,onWheelCapture:mn,onTouchMoveCapture:mn}),r=o[0],c=o[1],a=e.forwardProps,i=e.children,u=e.className,d=e.removeScrollBar,h=e.enabled,f=e.shards,g=e.sideCar,v=e.noRelative,y=e.noIsolation,b=e.inert,m=e.allowPinchZoom,w=e.as,j=w===void 0?"div":w,N=e.gapMode,S=Uo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=g,E=Di([n,t]),T=Le(Le({},S),r);return l.createElement(l.Fragment,null,h&&l.createElement(R,{sideCar:Bo,removeScrollBar:d,shards:f,noRelative:v,noIsolation:y,inert:b,setCallbacks:c,allowPinchZoom:!!m,lockRef:n,gapMode:N}),a?l.cloneElement(l.Children.only(i),Le(Le({},T),{ref:E})):l.createElement(j,Le({},T,{className:u,ref:E}),i))});tn.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tn.classNames={fullWidth:Ft,zeroRight:$t};var Fi=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Fi();return t&&e.setAttribute("nonce",t),e}function Ui(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Hi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Bi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=qi())&&(Ui(t,n),Hi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Vi=function(){var e=Bi();return function(t,n){l.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Vo=function(){var e=Vi(),t=function(n){var o=n.styles,r=n.dynamic;return e(o,r),null};return t},zi={left:0,top:0,right:0,gap:0},hn=function(e){return parseInt(e||"",10)||0},Ki=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],r=t[e==="padding"?"paddingRight":"marginRight"];return[hn(n),hn(o),hn(r)]},Wi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zi;var t=Ki(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},Xi=Vo(),ft="data-scroll-locked",Gi=function(e,t,n,o){var r=e.left,c=e.top,a=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(_i,` {
|
|
3
3
|
overflow: hidden `).concat(o,`;
|
|
4
4
|
padding-right: `).concat(i,"px ").concat(o,`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./dashboard-
|
|
1
|
+
import{c as e}from"./dashboard-CaE1mRUL.js";const c=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],a=e("refresh-cw",c);export{a as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i}from"./dashboard-
|
|
1
|
+
import{r as i}from"./dashboard-CaE1mRUL.js";const n="/api/admin";async function l(t={}){try{const e=await fetch(`${n}/status`,{signal:t.signal});if(e.ok)return await e.json()}catch(e){console.error("Failed to get admin status:",e)}return null}async function u(t={}){try{const e=await fetch(`${n}/config`,{signal:t.signal});if(e.ok)return await e.json()}catch(e){console.error("Failed to get admin config:",e)}return null}async function h(t,e={}){try{const a=t?"?baseUrl="+encodeURIComponent(t):"",r=await fetch(n+"/public-ip"+a,{signal:e.signal});if(r.ok)return await r.json()}catch(a){console.error("Failed to get public ip check:",a)}return null}async function $(t){try{return(await fetch(`${n}/config`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t})})).ok}catch(e){return console.error("Failed to update admin config:",e),!1}}async function k(){try{return(await fetch(`${n}/restart`,{method:"POST"})).ok}catch(t){return console.error("Failed to trigger restart:",t),!1}}async function g(t={}){try{const e=await fetch("/service/status",{signal:t.signal});if(e.ok)return await e.json()}catch(e){console.error("Failed to get gateway status:",e)}return null}async function v(t={}){try{const a=S(t).toString(),r=await fetch(`${n}/rdf/stats${a?`?${a}`:""}`);if(r.ok)return await r.json()}catch(e){console.error("Failed to get RDF stats:",e)}return null}function S(t){const e=new URLSearchParams;return c(e,"cacheScopeQuery",t.cacheScopeQuery),c(e,"cacheScopePrincipal",t.cacheScopePrincipal),c(e,"cacheScopeBasePath",t.cacheScopeBasePath),c(e,"cacheScopeMode",t.cacheScopeMode),c(e,"cacheScopeAuthorizationModel",t.cacheScopeAuthorizationModel),c(e,"cacheScopePermissionVersion",t.cacheScopePermissionVersion),c(e,"cacheScopeLimit",t.cacheScopeLimit),e}function c(t,e,a){a!==void 0&&a!==""&&t.set(e,String(a))}async function d(t){try{const e=new URLSearchParams;t?.limit&&e.set("limit",t.limit.toString()),t?.level&&t.level!=="all"&&e.set("level",t.level),t?.source&&t.source!=="all"&&e.set("source",t.source);const a=e.toString(),r=await fetch(`${n}/logs${a?`?${a}`:""}`);if(r.ok){const s=await r.json();return Array.isArray(s)?s:s.logs??[]}}catch(e){console.error("Failed to get logs:",e)}return[]}async function m(t){try{const e=new URLSearchParams;t?.lines&&e.set("lines",t.lines.toString());const a=e.toString(),r=await fetch(`${n}/logs/file${a?`?${a}`:""}`);if(r.ok)return await r.json()}catch(e){console.error("Failed to get log file tail:",e)}return null}async function A(){const[t,e,a,r,s,o]=await Promise.all([g(),l(),u(),f(),d({limit:200}),m({lines:120})]);return{generatedAt:new Date().toISOString(),gatewayStatus:t,adminStatus:e,sanitizedConfig:{env:a?.env??{},secrets:a?.secrets??{}},ddnsStatus:r,recentLogs:s,logFile:o}}function F(t,e){const a=new EventSource(`${n}/logs/stream`);return a.onmessage=r=>{try{const s=JSON.parse(r.data);s.logs&&t(s.logs)}catch(s){console.error("Failed to parse log data:",s)}},a.onerror=r=>{console.error("Log stream error:",r),e?.(r)},()=>{a.close()}}function y(t){return t?t.startsWith("http://")||t.startsWith("https://")?t:`https://${t}/`:""}function w(t,e,a=""){return e?.baseUrl||y(e?.fqdn)||t.CSS_BASE_URL||a}async function f(t={}){try{const e=await fetch(`${n}/ddns`,{signal:t.signal});if(e.ok)return await e.json()}catch(e){console.error("Failed to get ddns status:",e)}return null}async function b(t={}){const[e,a,r,s]=await Promise.all([g(t),l(t),u(t),f(t)]),o=await h(w(r?.env??{},s),t);return{servicesData:e,adminData:a,configData:r,ddnsData:s,publicCheck:o,checkedAt:new Date}}const p=i.createContext(null);function C(){return i.useContext(p)}export{p as S,d as a,A as b,m as c,f as d,u as e,b as f,v as g,h,$ as i,w as r,F as s,k as t,C as u};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Xpod Dashboard</title>
|
|
7
|
-
<script type="module" crossorigin src="/dashboard/assets/dashboard-
|
|
7
|
+
<script type="module" crossorigin src="/dashboard/assets/dashboard-CaE1mRUL.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/dashboard/assets/dashboard-CSdewNeA.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|