@usine/server 0.3.0 → 0.4.0
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/LICENSE +661 -21
- package/README.md +22 -4
- package/dist/backend.d.ts +3 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +5 -1
- package/dist/backend.js.map +1 -1
- package/dist/backup.d.ts +3 -3
- package/dist/backup.d.ts.map +1 -1
- package/dist/backup.js +3 -5
- package/dist/backup.js.map +1 -1
- package/dist/cli.d.ts +58 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +216 -17
- package/dist/cli.js.map +1 -1
- package/dist/command.d.ts +22 -0
- package/dist/command.d.ts.map +1 -0
- package/dist/command.js +51 -0
- package/dist/command.js.map +1 -0
- package/dist/detach.d.ts +83 -0
- package/dist/detach.d.ts.map +1 -0
- package/dist/detach.js +320 -0
- package/dist/detach.js.map +1 -0
- package/dist/failure-message.d.ts +7 -1
- package/dist/failure-message.d.ts.map +1 -1
- package/dist/failure-message.js +71 -2
- package/dist/failure-message.js.map +1 -1
- package/dist/http.d.ts +14 -5
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +25 -13
- package/dist/http.js.map +1 -1
- package/dist/instance/environment.d.ts +17 -0
- package/dist/instance/environment.d.ts.map +1 -0
- package/dist/instance/environment.js +51 -0
- package/dist/instance/environment.js.map +1 -0
- package/dist/instance/id.d.ts +17 -0
- package/dist/instance/id.d.ts.map +1 -0
- package/dist/instance/id.js +35 -0
- package/dist/instance/id.js.map +1 -0
- package/dist/{instance-lock.d.ts → instance/lock.d.ts} +9 -5
- package/dist/instance/lock.d.ts.map +1 -0
- package/dist/instance/lock.js +127 -0
- package/dist/instance/lock.js.map +1 -0
- package/dist/instance/manifest.d.ts +52 -0
- package/dist/instance/manifest.d.ts.map +1 -0
- package/dist/instance/manifest.js +131 -0
- package/dist/instance/manifest.js.map +1 -0
- package/dist/instance/operator-api.d.ts +30 -0
- package/dist/instance/operator-api.d.ts.map +1 -0
- package/dist/instance/operator-api.js +47 -0
- package/dist/instance/operator-api.js.map +1 -0
- package/dist/instance/ports.d.ts +23 -0
- package/dist/instance/ports.d.ts.map +1 -0
- package/dist/instance/ports.js +81 -0
- package/dist/instance/ports.js.map +1 -0
- package/dist/instance/record.d.ts +82 -0
- package/dist/instance/record.d.ts.map +1 -0
- package/dist/instance/record.js +116 -0
- package/dist/instance/record.js.map +1 -0
- package/dist/instance/state.d.ts +45 -0
- package/dist/instance/state.d.ts.map +1 -0
- package/dist/instance/state.js +79 -0
- package/dist/instance/state.js.map +1 -0
- package/dist/instance/systemd.d.ts +36 -0
- package/dist/instance/systemd.d.ts.map +1 -0
- package/dist/instance/systemd.js +61 -0
- package/dist/instance/systemd.js.map +1 -0
- package/dist/logger.d.ts +3 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +27 -0
- package/dist/logger.js.map +1 -0
- package/dist/main.js +35 -9
- package/dist/main.js.map +1 -1
- package/dist/registry.d.ts +20 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +37 -0
- package/dist/registry.js.map +1 -0
- package/dist/restart.d.ts +19 -0
- package/dist/restart.d.ts.map +1 -0
- package/dist/restart.js +105 -0
- package/dist/restart.js.map +1 -0
- package/dist/status.d.ts +12 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/status.js +99 -0
- package/dist/status.js.map +1 -0
- package/dist/stop.d.ts +81 -0
- package/dist/stop.d.ts.map +1 -0
- package/dist/stop.js +195 -0
- package/dist/stop.js.map +1 -0
- package/dist/system-sleep.d.ts +9 -0
- package/dist/system-sleep.d.ts.map +1 -0
- package/dist/system-sleep.js +42 -0
- package/dist/system-sleep.js.map +1 -0
- package/dist/tracing.d.ts +22 -0
- package/dist/tracing.d.ts.map +1 -0
- package/dist/tracing.js +61 -0
- package/dist/tracing.js.map +1 -0
- package/dist/up.d.ts +2 -2
- package/dist/up.d.ts.map +1 -1
- package/dist/up.js +41 -16
- package/dist/up.js.map +1 -1
- package/dist/upgrade.d.ts +58 -0
- package/dist/upgrade.d.ts.map +1 -0
- package/dist/upgrade.js +237 -0
- package/dist/upgrade.js.map +1 -0
- package/dist/web/assets/CompositeItem-DU6IyNMY.js +1 -0
- package/dist/web/assets/ToolbarRootContext-Cytu6o2e.js +1 -0
- package/dist/web/assets/X.es-B7iqdxa_.js +1 -0
- package/dist/web/assets/_agent-BVKD5odk.js +1 -0
- package/dist/web/assets/_loop-BFLzamuo.js +1 -0
- package/dist/web/assets/_name-Bh4AQ9sR.js +6 -0
- package/dist/web/assets/_name-CMVsmWzq.js +1 -0
- package/dist/web/assets/_name-DCkgEma_.js +1 -0
- package/dist/web/assets/_name-Ds_pWi15.js +1 -0
- package/dist/web/assets/_number-B9aYwvcQ.js +1 -0
- package/dist/web/assets/_run-BZWt47QS.js +8 -0
- package/dist/web/assets/_worker-Dgfufm5p.js +1 -0
- package/dist/web/assets/action-rCd1FeAz.js +1 -0
- package/dist/web/assets/agents-Drbg6qpH.js +1 -0
- package/dist/web/assets/agents-_6-dEjrY.js +1 -0
- package/dist/web/assets/button-DVWXde__.js +1 -0
- package/dist/web/assets/collapsible-IOhZV1qg.js +1 -0
- package/dist/web/assets/{core-BUmsKffF.js → core-wi-Hu_JV.js} +1 -1
- package/dist/web/assets/drawer-BiqnR_8i.js +1 -0
- package/dist/web/assets/dropdown-menu-C9D1kRkO.js +1 -0
- package/dist/web/assets/edit-and-retry-BgOR6mvP.js +1 -0
- package/dist/web/assets/error-alert-9tKpTE3v.js +1 -0
- package/dist/web/assets/file-error-SjG2jLJ9.js +1 -0
- package/dist/web/assets/fill-cell-ClM88KFD.js +1 -0
- package/dist/web/assets/heading-lX1a1LNN.js +1 -0
- package/dist/web/assets/index-BymNZU1Q.js +10 -0
- package/dist/web/assets/index-Dyjfp3ET.css +2 -0
- package/dist/web/assets/label-badge-aIGT1Bry.js +1 -0
- package/dist/web/assets/list-v8WJp2Eq.js +1 -0
- package/dist/web/assets/loops-BFoFf_og.js +1 -0
- package/dist/web/assets/mark-CC3RwMy_.js +1 -0
- package/dist/web/assets/{markdown-D07-JkYB.js → markdown-BnyfnuCL.js} +4 -4
- package/dist/web/assets/matchContext-BquevSJS.js +2 -0
- package/dist/web/assets/model-BerBT6R0.js +1 -0
- package/dist/web/assets/moves-Dg9sshX5.js +1 -0
- package/dist/web/assets/overview-C_tFKGZ8.js +1 -0
- package/dist/web/assets/page-DWnGi6wA.js +301 -0
- package/dist/web/assets/project-not-found-CodaBVdu.js +1 -0
- package/dist/web/assets/pull-request-marks-DE00nqGW.js +1 -0
- package/dist/web/assets/queries-B1SHA_r4.js +1 -0
- package/dist/web/assets/reload-Dsl0zjJ7.js +1 -0
- package/dist/web/assets/repositories-BdxmD192.js +1 -0
- package/dist/web/assets/repositories-D4wYJfa_.js +1 -0
- package/dist/web/assets/route-B_gphTYG.js +1 -0
- package/dist/web/assets/route-Cc7dKnn5.js +1 -0
- package/dist/web/assets/routes-BLy5TGH_.js +65 -0
- package/dist/web/assets/run-again-BTKagSXR.js +1 -0
- package/dist/web/assets/section-B3pWIIBa.js +1 -0
- package/dist/web/assets/section-CD-MB5r3.js +1 -0
- package/dist/web/assets/section-Id99HktI.js +1 -0
- package/dist/web/assets/settings-YrDysQXW.js +1 -0
- package/dist/web/assets/slots-BraHmbNr.js +1 -0
- package/dist/web/assets/status-badge-DnvNo1tG.js +1 -0
- package/dist/web/assets/strings-CW2XaR5f.js +1 -0
- package/dist/web/assets/table-BjyI4fVI.js +1 -0
- package/dist/web/assets/tasks-DCL8kLmD.js +1 -0
- package/dist/web/assets/transcript-sxRJzx6t.js +5 -0
- package/dist/web/assets/usage-CLQJdX9-.js +1 -0
- package/dist/web/assets/use-now-0P8TUXeg.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-CQ83Wy-r.js +1 -0
- package/dist/web/assets/useNavigate-BW1WdocJ.js +1 -0
- package/dist/web/assets/usePositioner-rNCxnHO-.js +1 -0
- package/dist/web/assets/useTimeout-_TcdZXP6.js +1 -0
- package/dist/web/assets/with-selector-DoElmmtd.js +1 -0
- package/dist/web/assets/workers-BH5CBOR3.js +1 -0
- package/dist/web/index.html +15 -12
- package/package.json +16 -15
- package/dist/instance-lock.d.ts.map +0 -1
- package/dist/instance-lock.js +0 -58
- package/dist/instance-lock.js.map +0 -1
- package/dist/web/assets/DialogTitle-DrHlwOSg.js +0 -1
- package/dist/web/assets/_agent-cBqm12lE.js +0 -1
- package/dist/web/assets/_loop-kf1h3qkS.js +0 -1
- package/dist/web/assets/_name-CKWcxUh0.js +0 -2
- package/dist/web/assets/_name-DCEDRHnF.js +0 -1
- package/dist/web/assets/_name-sJkGyn7O.js +0 -1
- package/dist/web/assets/_number-DbgcVg1N.js +0 -1
- package/dist/web/assets/_run-DqslP0y6.js +0 -8
- package/dist/web/assets/_worker-CH4UoJT_.js +0 -1
- package/dist/web/assets/action-DYT048Jm.js +0 -1
- package/dist/web/assets/agents-DIZolb0U.js +0 -1
- package/dist/web/assets/agents-DMhSMb9O.js +0 -1
- package/dist/web/assets/button-C4yvcSko.js +0 -2
- package/dist/web/assets/copy-BM1l6IGB.js +0 -1
- package/dist/web/assets/error-alert-BrI00JbQ.js +0 -1
- package/dist/web/assets/file-error-C--_cWuj.js +0 -1
- package/dist/web/assets/index-BljdfRBm.js +0 -10
- package/dist/web/assets/index-YKcAk3No.css +0 -2
- package/dist/web/assets/item-rBBCTV8x.js +0 -1
- package/dist/web/assets/label-badge-ohqvZnY7.js +0 -1
- package/dist/web/assets/loops-CXM3f90o.js +0 -1
- package/dist/web/assets/loops-DWLXyUPN.js +0 -1
- package/dist/web/assets/moves-RiWgdCxQ.js +0 -5
- package/dist/web/assets/operator-copy-DsM7LJx6.js +0 -301
- package/dist/web/assets/outcome-YiIf6xbJ.js +0 -5
- package/dist/web/assets/project-not-found-CQVclgb0.js +0 -1
- package/dist/web/assets/query-DWN8IHdt.js +0 -1
- package/dist/web/assets/repositories-CoTEmYmS.js +0 -1
- package/dist/web/assets/repositories-Cq7zGzNb.js +0 -1
- package/dist/web/assets/rolldown-runtime-XKyaHtl9.js +0 -1
- package/dist/web/assets/route-CE9U74a9.js +0 -1
- package/dist/web/assets/route-DNH2EwHP.js +0 -1
- package/dist/web/assets/routes-XAUJJqfj.js +0 -1
- package/dist/web/assets/run-again-DxjFCuNu.js +0 -1
- package/dist/web/assets/run-drawer-CyjxH5mf.js +0 -1
- package/dist/web/assets/section-BBnBOk-U.js +0 -1
- package/dist/web/assets/section-Cm-j3zHs.js +0 -1
- package/dist/web/assets/section-DkBCDv4D.js +0 -1
- package/dist/web/assets/settings-iZf872O5.js +0 -1
- package/dist/web/assets/status-badge-CNlyvwWL.js +0 -1
- package/dist/web/assets/table-B6NH8hTW.js +0 -1
- package/dist/web/assets/tasks-DhLW-1gg.js +0 -1
- package/dist/web/assets/usage-DPUTTLGs.js +0 -1
- package/dist/web/assets/use-now-CcFZyFvf.js +0 -1
- package/dist/web/assets/useNavigate-lXd3v3E0.js +0 -1
- package/dist/web/assets/usePositioner-WErrA3Ah.js +0 -1
- package/dist/web/assets/useScrollLock-BOb01sL8.js +0 -1
- package/dist/web/assets/useTriggerFocusGuards-B0FItfLc.js +0 -1
- package/dist/web/assets/utils-BEQKLGgi.js +0 -1
- package/dist/web/assets/with-selector-NsM_5qXG.js +0 -1
- package/dist/web/assets/workers-BgocBXT9.js +0 -1
- package/dist/web/assets/workers-Dw2uHY0Y.js +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{k as t,lt as n,t as r,ut as i}from"./button-C4yvcSko.js";import{An as a,At as o,D as s,Dt as c,G as l,Gt as u,It as d,Jt as f,K as p,N as m,O as h,Rt as ee,S as g,U as _,Xt as te,Yt as v,Zt as ne,a as y,an as b,bt as x,ct as S,d as C,en as re,f as ie,ft as ae,ht as oe,i as se,in as w,l as T,lt as E,nn as D,o as ce,pt as le,q as ue,qt as de,rn as O,tn as k,vt as fe,wt as pe,yt as A}from"./operator-copy-DsM7LJx6.js";import{o as me,t as he}from"./error-alert-BrI00JbQ.js";import{n as ge,t as j}from"./use-now-CcFZyFvf.js";import{r as _e}from"./item-rBBCTV8x.js";import{d as ve,f as ye,p as be}from"./index-BljdfRBm.js";import{t as xe}from"./markdown-D07-JkYB.js";import{n as M}from"./status-badge-CNlyvwWL.js";import{n as Se}from"./usage-DPUTTLGs.js";var Ce=e(i(),1),N=n(),we=({run:e,onEdit:n,openRun:i,className:a})=>{let o=ye(),s=be(),[c,l]=(0,Ce.useState)(!1),u=o.isPending||s.isPending,d=t=>o.mutate({runId:e.id,request:t},{onSuccess:()=>l(!1)}),f=()=>s.mutate(ve(e),{onSuccess:e=>{e._tag===`Claimed`&&i(e.runId)}}),p=e.attempts.at(-1),m=p?.outcome?._tag===`Failed`&&p.outcome.failure._tag===`QuestionFailure`;return!e.canApprove&&!e.canRetry&&!e.canRunAgain&&!e.canCancel&&!e.canResolveFailure?null:(0,N.jsxs)(`div`,{className:t(`space-y-2`,a),children:[(0,N.jsxs)(`div`,{role:`group`,"aria-label":`Run actions`,className:`flex flex-wrap items-center gap-2`,children:[e.canApprove&&(0,N.jsx)(r,{disabled:u,onClick:()=>d({action:`approve`}),children:g.approve}),e.canRetry&&(0,N.jsx)(r,{disabled:u,onClick:()=>d({action:`retry`}),children:g.retry}),e.canRetry&&(0,N.jsx)(r,{variant:`outline`,disabled:u,onClick:()=>n(`retry`),children:`Edit and retry`}),e.canRunAgain&&(0,N.jsx)(r,{disabled:u,onClick:f,children:g.runAgain}),e.canRunAgain&&(0,N.jsx)(r,{variant:`outline`,disabled:u,onClick:()=>n(`runAgain`),children:`Edit and run again`}),e.canResolveFailure&&p!==void 0&&(0,N.jsx)(r,{variant:`ghost`,disabled:u,onClick:()=>d({action:`resolveFailure`,attemptId:p.id}),children:m?`Mark answered`:`Mark resolved`}),e.canCancel&&(c?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(r,{variant:`destructive`,disabled:u,onClick:()=>d({action:`cancel`}),children:g.confirmCancel}),(0,N.jsx)(r,{variant:`ghost`,disabled:u,onClick:()=>l(!1),children:g.keepRunning})]}):(0,N.jsx)(r,{variant:`ghost`,disabled:u,onClick:()=>l(!0),children:g.cancel}))]}),s.data?._tag===`CycleBlocked`&&(0,N.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),o.isError&&(0,N.jsx)(he,{message:o.error.message}),s.isError&&(0,N.jsx)(he,{message:s.error.message})]})},P=(e,t)=>{let n=new Map(e.map(e=>[e.sequence,e]));for(let e of t)n.has(e.sequence)||n.set(e.sequence,e);return[...n.values()].sort((e,t)=>e.sequence-t.sequence)},Te=(e,t,n)=>[...e.filter(({attemptId:e})=>e!==t),...n].sort((e,t)=>e.before-t.before),Ee=(e,t,n)=>new _({...e,transcript:P(e.transcript,t.transcript),earlierTranscript:Te(e.earlierTranscript,n.attemptId,t.earlierTranscript)}),De=e=>{let t=new Map;for(let n of e){if(n.payload._tag!==`SessionEvent`)continue;let e=n.payload.event;e._tag===`PoolRateLimitsUpdated`&&t.set(e.pool,{pool:e.pool,windows:u([e.rateLimits.primary,e.rateLimits.secondary])})}return[...t.values()]},Oe=async(e,t)=>{let n=await t(e);if(e._tag===`ColdTranscriptRequest`)return n;let r=n.transcript;for(;!n.run.canCancel;){let e=n.transcript.at(-1);if(e===void 0)break;n=await t(new ue({after:e.sequence})),r=P(r,n.transcript)}return new _({...n,transcript:r})},ke=(e,t)=>{let n=a();return ge({queryKey:[`run`,e],queryFn:async()=>{let t=[`run`,e],r=n.getQueryData(t)?.transcript.at(-1)?.sequence,i=await Oe(r===void 0?new l:new ue({after:r}),t=>m(n=>n.detail({params:{runId:e},query:t}))),a=n.getQueryData(t);return r===void 0||a===void 0?i:new _({...i,transcript:P(a.transcript,i.transcript),earlierTranscript:a.earlierTranscript})},structuralSharing:!1,enabled:t,refetchInterval:e=>e.state.data?.run.canCancel===!0&&1e3})},Ae=e=>{let t=a();return me({mutationFn:t=>m(n=>n.detail({params:{runId:e},query:new p(t)})),onSuccess:(n,r)=>{t.setQueryData([`run`,e],e=>e===void 0?e:Ee(e,n,r))}})},F={target:`_blank`,rel:`noreferrer`},je=({run:e,item:t,heading:n,shared:r})=>(0,N.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-2.5`,style:r?{viewTransitionName:`run-title`}:void 0,children:[D(t,{onNone:()=>null,onSome:({number:e,url:t})=>(0,N.jsxs)(`a`,{href:t,...F,className:`shrink-0 font-mono text-xs text-primary underline-offset-4 hover:underline`,children:[`#`,e]})}),n(te(f(t,({title:e})=>e),()=>`${e.loop} on ${e.repository}`))]}),Me=({run:e,item:n,shared:r,className:i})=>{let a=e.pullRequestUrl??ne(k(de(n,({pullRequest:e})=>e),({url:e})=>e));return(0,N.jsxs)(`p`,{className:t(`flex flex-wrap items-center gap-x-5 gap-y-1 text-sm text-muted-foreground`,i),children:[(0,N.jsxs)(`span`,{className:`inline-flex items-center gap-2 font-medium text-foreground`,style:r?{viewTransitionName:`run-state`}:void 0,children:[(0,N.jsx)(M,{state:e.state}),s(e)]}),a===null?(0,N.jsx)(`span`,{children:`No pull request`}):(0,N.jsxs)(`a`,{href:a,...F,className:`text-primary underline-offset-4 hover:underline`,children:[`Pull request`,D(_e(a),{onNone:()=>null,onSome:e=>(0,N.jsxs)(`span`,{className:`font-mono text-xs`,children:[` #`,e]})})]}),(0,N.jsxs)(`span`,{children:[`Loop `,(0,N.jsx)(`span`,{className:`text-foreground`,children:e.loop})]}),(0,N.jsxs)(`span`,{children:[`Agent `,(0,N.jsx)(`span`,{className:`text-foreground`,children:e.agent})]}),e.loopPaused&&(0,N.jsx)(`span`,{children:`Loop paused`})]})},Ne=({endedMillis:e,since:t})=>{let n=j(1e3);return(0,N.jsx)(N.Fragment,{children:T(e+Math.max(0,n-Date.parse(t)))})},Pe=({duration:e})=>(0,N.jsxs)(`span`,{title:e.unmeasured===0?`Total attempt time`:`${e.unmeasured} ${e.unmeasured===1?`attempt`:`attempts`} not counted: no recorded end time`,children:[`Duration`,` `,(0,N.jsxs)(`span`,{className:`font-mono text-xs text-foreground tabular-nums`,children:[e.unmeasured>0&&`at least `,e.runningSince===null?T(e.endedMillis):(0,N.jsx)(Ne,{endedMillis:e.endedMillis,since:e.runningSince})]})]}),Fe=({detail:e,showUsage:n,className:r})=>e.worker===null?null:(0,N.jsxs)(`p`,{className:t(`flex flex-wrap items-baseline gap-x-5 gap-y-1 text-sm text-muted-foreground`,r),children:[(0,N.jsxs)(`span`,{children:[`Worker `,(0,N.jsx)(`span`,{className:`text-foreground`,children:e.worker})]}),(0,N.jsx)(Pe,{duration:e.duration}),n&&e.usage.sessions.length>0&&(0,N.jsx)(Se,{usage:e.usage,attempts:e.run.attempts})]}),Ie=(e,t,n)=>{let r=new Set(e.map(({sequence:e})=>e)),i=[...new Map([...t,...e].map(e=>[e.sequence,e])).values()].sort((e,t)=>e.sequence-t.sequence),a=new Map,o=new Map,s=(e,t)=>JSON.stringify([e,t]);for(let e of i){let t=e.payload;if(t._tag!==`SessionEvent`)continue;let i=t.event;if(i._tag===`PoolRateLimitsUpdated`||i._tag===`SessionTokensUpdated`)continue;let c=s(e.attemptId,i.session.id),l=a.get(c);l===void 0&&(l={attemptId:e.attemptId,session:i.session,first:e,harnessSession:O(),latestSequence:e.sequence,status:n.has(e.attemptId)?`Stopped`:`Live`,held:!1,paused:!1,idle:!1,events:[],interventions:[]},a.set(c,l),i.session._tag===`ParentSession`&&o.set(e.attemptId,l)),l.latestSequence=e.sequence,i._tag===`SessionStarted`&&(l.harnessSession=i.harnessSession),i._tag===`SessionFinished`&&(l.status=`Finished`),i._tag===`SessionIdle`&&(l.idle=!0),i._tag===`SessionResumed`&&(l.idle=!1),r.has(e.sequence)&&l.events.push({sequence:e.sequence,receivedAt:e.receivedAt,event:i})}let c=[],l=(e,t)=>JSON.stringify([e,t.inputSequence]),u=new Map;for(let{attemptId:e,payload:t}of i)(t._tag===`InterventionApplied`||t._tag===`InterventionRejected`)&&u.set(l(e,t),t);let d=new Set;for(let e of i){let t=e.payload;if(t._tag!==`InterventionApplied`&&t._tag!==`InterventionRejected`)continue;let n=l(e.attemptId,t),i={...e,payload:u.get(n)??t},f=t.intervention.target,p=f._tag===`Parent`?o.get(e.attemptId):a.get(s(e.attemptId,f.sessionId)),m=r.has(e.sequence)&&!d.has(n);m&&d.add(n),p===void 0?m&&c.push(i):(e.sequence>p.latestSequence&&(p.latestSequence=e.sequence),t._tag===`InterventionApplied`&&(p.held=t.state.held,p.paused=t.state.paused),m&&p.interventions.push(i))}return{groups:a,unmatched:c}},I=e=>({key:`event:${e.sequence}`,attemptId:e.attemptId,sequence:e.sequence,latestSequence:e.sequence,receivedAt:e.receivedAt}),L=(e,t,n)=>({_tag:`Notice`,...I(e),...t,origin:n,queued:null}),R=e=>`${e} ${e===1?`retry`:`retries`}`,Le=(e,t)=>{let n=[],r=new Map;for(let i of e.events){let a=i.event,o={...i,attemptId:e.attemptId};if(a._tag===`ToolStarted`||a._tag===`ToolFinished`){let n=JSON.stringify([e.attemptId,e.session.id,a.callId]),s=r.get(n),c=s?.start??O();r.set(n,{_tag:`Tool`,...I(o),key:n,sequence:s?.sequence??i.sequence,receivedAt:s?.receivedAt??i.receivedAt,name:a.tool,start:a._tag===`ToolStarted`?b({receivedAt:i.receivedAt,input:a.input}):c,state:a._tag===`ToolFinished`?{_tag:a.isError?`Error`:`Finished`,receivedAt:i.receivedAt,output:a.output}:s?.state??{_tag:t===`Live`?`Running`:`Stopped`}});continue}if(a._tag===`ProviderRetrying`||a._tag===`ProviderRecovered`){n.push(L(o,a._tag===`ProviderRetrying`?{kind:`status`,label:`${e.session.agent}: provider unreachable`,detail:a.message,format:`plain`,tone:`warning`}:{kind:`status`,label:`${e.session.agent}: provider reachable again`,detail:`After ${R(a.retries)}`,format:`plain`,tone:`plain`},{_tag:`Provider`,session:e.session,event:a}));continue}let s=S(a,{TextOutput:({text:t})=>({kind:`message`,label:e.session.agent,detail:t,format:`markdown`,tone:`plain`}),SessionStarted:()=>({kind:`status`,label:`${e.session.agent} started`,detail:se(e.session.brain),format:`plain`,tone:`plain`}),SessionIdle:()=>({kind:`status`,label:`${e.session.agent} idle`,detail:`Session open for operator input`,format:`plain`,tone:`plain`}),SessionResumed:()=>({kind:`status`,label:`${e.session.agent} resumed`,detail:``,format:`plain`,tone:`plain`}),SessionFinished:()=>({kind:`status`,label:`${e.session.agent} finished`,detail:``,format:`plain`,tone:`plain`})});n.push(L(o,s,{_tag:`Session`,session:e.session,event:a._tag}))}return[...n,...r.values()].sort((e,t)=>e.sequence-t.sequence)},z=e=>{let{action:t,operator:n,target:r}=e.payload.intervention,i=e.payload._tag===`InterventionRejected`,a=t._tag===`OperatorMessage`||t._tag===`Steer`,o=e.payload._tag===`InterventionApplied`&&e.payload.state.queued?r._tag===`Parent`?`parent`:`child`:null,s=`${n} released the ${r._tag===`Parent`?`parent`:`child`}`;return{...L(e,{kind:a?`message`:`status`,label:i?`${n} · not delivered`:a?n:t._tag===`Release`?s:`${n} paused the session`,detail:i?`${a?`${t.message}\n\n`:``}${e.payload.message}`:a?t.message:``,format:a?`markdown`:`plain`,tone:i?`failed`:`plain`},{_tag:`Operator`,operator:n}),queued:o}},Re=(e,t,n=[])=>{let r=new Set(t.filter(({outcome:e})=>e!==null).map(({id:e})=>e));for(let{attemptId:t,payload:n}of e)(n._tag===`Final`||n._tag===`Failed`||n._tag===`Interrupted`)&&r.add(t);let{groups:i,unmatched:a}=Ie(e,n,r),o=[];for(let t of[...e].sort((e,t)=>e.sequence-t.sequence)){let e=t.payload;e._tag!==`InterventionApplied`&&e._tag!==`InterventionRejected`&&(t.direction!==`inbound`||t.operator===void 0||e._tag===`Cancel`)&&e._tag!==`SessionEvent`&&o.push(L(t,S(e,{Started:({parentModel:e,conflictingSalvage:t})=>({kind:`status`,label:`Attempt started`,detail:D(t,{onNone:()=>e,onSome:t=>`${e}. ${ce(t)}`}),format:`plain`,tone:`plain`}),Final:({result:e})=>({kind:`status`,label:`Attempt finished`,detail:e.message,format:`markdown`,tone:`plain`}),Failed:({failure:e})=>({kind:`status`,label:`Attempt failed`,detail:C(e),format:`plain`,tone:`failed`}),Cancel:()=>({kind:`status`,label:`Cancel requested`,detail:`Attempt stopping`,format:`plain`,tone:`plain`}),Interrupted:()=>({kind:`status`,label:`Interrupted`,detail:`Acknowledged by the parent session`,format:`plain`,tone:`plain`}),Steer:({message:e})=>({kind:`message`,label:`Operator`,detail:e,format:`markdown`,tone:`plain`}),Interrupt:()=>({kind:`status`,label:`Interrupt requested`,detail:`Sent by the operator`,format:`plain`,tone:`plain`}),OperatorMessage:({message:e})=>({kind:`message`,label:`Operator`,detail:e,format:`markdown`,tone:`plain`}),Release:()=>({kind:`status`,label:`Released`,detail:`Held child released by the operator`,format:`plain`,tone:`plain`}),WorkerUnresponsive:({worker:e,lastAnsweredAt:t,reason:n})=>({kind:`status`,label:`${e} silent since ${y(d(t))}`,detail:n,format:`plain`,tone:`warning`}),WorkerResponsive:({worker:e,lastAnsweredAt:n})=>({kind:`status`,label:`${e} answering again`,detail:`Silent for ${T(Date.parse(t.receivedAt)-ee(n))}`,format:`plain`,tone:`plain`})}),{_tag:`Envelope`,payload:e}))}let s=[];for(let[e,t]of i)s.push({_tag:`Session`,...I(t.first),key:e,latestSequence:t.latestSequence,session:t.session,harnessSession:t.harnessSession,status:t.status,held:t.status===`Live`&&t.held,paused:t.status===`Live`&&t.paused,idle:t.status===`Live`&&t.idle,entries:[...Le(t,t.status),...t.interventions.map(e=>z(e))].sort((e,t)=>e.sequence-t.sequence)});return o.push(...a.map(e=>{let t=z(e),n=e.payload.intervention.target;return{...t,label:`${t.label} · ${n._tag===`Parent`?`parent`:n.sessionId}`}})),{sessions:s,terminalAttempts:r,items:[...o,...s.flatMap(e=>e.session._tag===`ChildSession`?[e]:e.entries)].sort((e,t)=>e.sequence-t.sequence)}},ze=e=>{if(e.status!==`Live`)return e.status;if(e.paused)return`Paused`;if(e.held)return e.idle?`Held, waiting for input`:`Held, working`;if(e.idle)return`Waiting for input`;let t=[...e.entries].reverse().find(e=>e._tag===`Tool`&&e.state._tag===`Running`);return t?._tag===`Tool`?`Running ${t.name}`:`Working`},Be=e=>{let t=null,n=new Map;for(let{payload:r,receivedAt:i}of e)if(r._tag===`WorkerUnresponsive`)t={_tag:`WorkerSilent`,worker:r.worker,lastAnsweredAt:d(r.lastAnsweredAt)};else if(r._tag===`WorkerResponsive`)t=null;else if(r._tag===`SessionEvent`){let e=r.event;e._tag===`ProviderRetrying`?n.set(e.session.id,{_tag:`ProviderRetrying`,sessionId:e.session.id,agent:e.session.agent,message:e.message,retries:e.retries,since:n.get(e.session.id)?.since??i}):(e._tag===`ProviderRecovered`||e._tag===`SessionIdle`||e._tag===`SessionFinished`)&&n.delete(e.session.id)}return[...t===null?[]:[t],...n.values()]},B=fe(A,le),Ve=x({type:oe([`text`,`inputText`]),text:A}),V=e=>c(B)(e)?e:{},H=e=>c(A)(e)?e:void 0,He=e=>{if(e===`cwd`)return`Working directory`;if(e===`durationMs`)return`Duration (ms)`;let t=e.replace(/([a-z])([A-Z])/gu,`$1 $2`).replaceAll(`_`,` `).toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)},U=(e,t,n=`text`)=>({_tag:`Code`,label:e,text:t,language:n}),W=(e,t,n=[])=>{let r=Object.entries(t).filter(([e])=>!n.includes(e)).map(([e,t])=>({label:He(e),value:t}));return r.length===0?[]:[{_tag:`Fields`,label:e,fields:r}]},G=(e,t,n=`text`)=>{if(e==null)return[];if(c(A)(e))return[U(t,e,n)];if(Array.isArray(e))return e.flatMap(e=>c(Ve)(e)?[U(t,e.text,n)]:G(e,t,n));if(!c(B)(e))return[{_tag:`Fields`,label:t,fields:[{label:`Value`,value:e}]}];let r=[],i={};for(let[a,o]of Object.entries(e))a===`content`&&Array.isArray(o)?r.push(...G(o,t,n)):[`text`,`stdout`,`stderr`,`aggregatedOutput`,`message`].includes(a)?r.push(...G(o,a===`text`?t:He(a),n)):a===`error`?r.push(...G(o,`Error`)):i[a]=o;return[...r,...W(t,i)]},Ue=x({oldText:A,newText:A}),We=x({path:A,diff:A,kind:x({type:A})}),K=pe(E(We)),Ge=ae.check(o(1)),q=e=>/\.[cm]?tsx?$/iu.test(e)?`typescript`:/\.json$/iu.test(e)?`json`:`text`,Ke=e=>G(e,`Confirmation`).map(e=>e._tag===`Code`?{_tag:`Text`,label:e.label,text:e.text}:e),J=(e,t,n)=>{let r=V(e),i=V(t),a=K(i.changes??r.changes),o=H(r.path)??H(r.file_path),s=c(Ge)(r.offset)?r.offset:void 0,l=c(Ge)(r.limit)?r.limit:void 0,u=s??(r.offset===void 0?1:void 0),d=n===`read`&&(s!==void 0||l!==void 0)?[u===void 0?``:`From line ${u}`,l===void 0?``:`up to ${l} ${l===1?`line`:`lines`}`].filter(e=>e!==``).join(` · `):``,f=[o??`File details unavailable`,d].filter(e=>e!==``).join(` · `),p=H(V(i.details).patch)??H(V(i.details).diff),m=pe(E(Ue))(r.edits),h=te(m,()=>c(A)(r.old_string)&&c(A)(r.new_string)?[{oldText:r.old_string,newText:r.new_string}]:[]);return{activity:{_tag:`Files`,operation:i.type===`fileChange`||r.type===`fileChange`?`change`:n,paths:D(a,{onNone:()=>o===void 0?[]:[o],onSome:e=>e.map(({path:e})=>e)})},title:{read:`Read file`,edit:`Edit file`,write:`Write file`}[n],subject:n===`read`?f:o??D(a,{onNone:()=>`File details unavailable`,onSome:e=>e.length===1?e[0]?.path??`File details unavailable`:`${e.length} files`}),input:[...W(`Options`,r,[`path`,`file_path`,`edits`,`old_string`,`new_string`,`content`,`changes`,`type`,`id`,`status`,...n===`read`&&s!==void 0?[`offset`]:[],...n===`read`&&l!==void 0?[`limit`]:[]]),...(p===void 0?h:[]).flatMap(({oldText:e,newText:t},n)=>[U(h.length===1?`Before`:`Before ${n+1}`,e,q(o??``)),U(h.length===1?`After`:`After ${n+1}`,t,q(o??``))]),...c(A)(r.content)?[U(`Content`,r.content,q(o??``))]:[],...t===void 0?D(K(r.changes),{onNone:()=>[],onSome:e=>e.map(({path:e,diff:t})=>U(e,t,`diff`))}):[]],output:D(K(i.changes),{onNone:()=>p===void 0?n===`read`?G(t,o??`Output`,q(o??``)):Ke(t):[U(o??`Changes`,p,`diff`),...Ke(Object.fromEntries(Object.entries(i).filter(([e])=>e!==`details`))),...W(`Metadata`,V(i.details),[`patch`,`diff`])],onSome:e=>e.map(({path:e,diff:t,kind:n})=>U(`${e} · ${n.type}`,t,`diff`))})}},qe=e=>{switch(e.toLowerCase()){case`bash`:case`powershell`:case`shell`:case`command`:return`command`;case`read`:return`read`;case`edit`:case`file_change`:return`edit`;case`write`:return`write`;case`grep`:case`glob`:case`find`:case`ls`:case`web_search`:return`search`;case`subagent`:case`agent`:case`task`:return`agent`;default:return`tool`}},Je=({input:e,output:t})=>{let n=V(e??t),r=V(t),i=H(n.command)??H(r.command);return{activity:{_tag:`Command`,command:i},title:`Command`,subject:i??`Command details unavailable`,input:[...i===void 0?[]:[U(`Command`,i,`bash`)],...W(`Options`,n,[`command`,`type`,`id`,`status`,`aggregatedOutput`,`exitCode`,`durationMs`,`processId`,`source`,`commandActions`])],output:r.type===`commandExecution`?[...G(r.aggregatedOutput,`Output`),...W(`Execution`,r,[`type`,`id`,`status`,`command`,`cwd`,`aggregatedOutput`,`processId`,`source`,`commandActions`])]:G(t,`Output`)}},Ye=({input:e,output:t,name:n})=>{let r=V(e??t),i=V(t),a=V(r.action);return{activity:{_tag:`Search`},title:n.toLowerCase()===`ls`?`List files`:`Search`,subject:H(r.pattern)??H(r.query)??H(a.query)??H(a.url)??H(r.path)??`Search details unavailable`,input:W(`Search`,r,[`type`,`id`]),output:i.type===`webSearch`?W(`Search`,i,[`type`,`id`]):G(t,`Results`)}},Xe=({input:e,output:t})=>{let n=V(e),r=H(n.task)??H(n.prompt);return{activity:{_tag:`Delegation`},title:`Delegate`,subject:H(n.description)??r??`Delegated task`,input:[...r===void 0?[]:[{_tag:`Text`,label:`Task`,text:r}],...W(`Agent`,n,[`task`,`prompt`])],output:G(t,`Report`).map(e=>e._tag===`Code`?{_tag:`Text`,label:e.label,text:e.text}:e)}},Ze=({input:e,output:t,name:n})=>{let r=V(e),i=V(t),a=r.type===`mcpToolCall`||r.type===`dynamicToolCall`||i.type===`mcpToolCall`||i.type===`dynamicToolCall`,o=a?r.arguments??i.arguments:e;return{activity:{_tag:`Tool`},title:(a?[H(r.server)??H(i.server)??H(r.namespace)??H(i.namespace),H(r.tool)??H(i.tool)].filter(e=>e!==void 0).join(` · `):n)||n,subject:c(B)(o)?`${Object.keys(o).length} parameters`:c(A)(o)?o:`Tool details`,input:G(o,`Parameters`),output:a?[...G(i.result??i.contentItems,`Output`),...G(i.error,`Error`)]:G(t,`Output`)}},Y=e=>{let t={name:e.name,input:D(e.start,{onNone:()=>void 0,onSome:({input:e})=>e}),output:S(e.state,{Running:()=>void 0,Stopped:()=>void 0,Finished:({output:e})=>e,Error:({output:e})=>e})},n=qe(e.name);return{category:n,...{command:Je,read:({input:e,output:t})=>J(e,t,`read`),edit:({input:e,output:t})=>J(e,t,`edit`),write:({input:e,output:t})=>J(e,t,`write`),search:Ye,agent:Xe,tool:Ze}[n](t)}},Qe=/^\s*\[usine:(blocked|question|failed)\]/u,$e=e=>{let t=Qe.exec(e)?.[1];return t===`blocked`||t===`question`?t:null},X=e=>e.replace(Qe,``).trimStart(),et=e=>X(e).replace(/\s+/gu,` `).trim(),tt=e=>e.replace(/^\s{0,3}(?:#{1,6}\s+|[-*+]\s+|\d+[.)]\s+|>\s?)/u,``).replace(/!?\[([^\]]*)\]\([^)]*\)/gu,`$1`).replace(/`([^`]*)`/gu,`$1`).replace(/(\*\*|__)(.+?)\1/gu,`$2`).replace(/(^|[\s(])\*(\S(?:.*?\S)?)\*(?=[\s).,;:!?]|$)/gu,`$1$2`).trim(),nt=e=>e.replace(/```[\s\S]*?(?:```|$)/gu,`
|
|
2
|
-
`).split(`
|
|
3
|
-
`).map(tt).filter(e=>e!==``).join(` `),Z=e=>{let t=X(e).replace(/```[\s\S]*?(?:```|$)/gu,`
|
|
4
|
-
`).split(`
|
|
5
|
-
`).map(tt).filter(e=>e!==``)[0]??``;return/^(.*?[.!?…])(?=\s|$)/u.exec(t)?.[1]??t},rt=32,it=12,at=e=>{if(e.length<=rt)return e;let t=/^(.+?)(?:[,;:]\s|\s[—–-]\s)/u.exec(e)?.[1];if(t!==void 0&&t.length>=it&&t.length<=rt)return t;let n=e.slice(0,33).lastIndexOf(` `);return`${(n>0?e.slice(0,n):e.split(` `)[0]??e).replace(/[\s,;:.—–-]+$/u,``)}…`},ot=e=>({name:e.session._tag===`ParentSession`?`Parent`:e.session.agent,sessionKey:e.key}),st=e=>e.origin._tag===`Envelope`&&(e.origin.payload._tag===`Final`||e.origin.payload._tag===`Failed`||e.origin.payload._tag===`Interrupted`),Q=e=>S(e,{Succeeded:({message:e})=>ne(e),Failed:({failure:e})=>e._tag===`AgentFailure`||e._tag===`BlockedFailure`||e._tag===`QuestionFailure`?C(e):null,Canceled:()=>null}),ct=(e,t)=>{let n=t?.salvage??null,r=e?.origin._tag===`Envelope`&&e.origin.payload._tag===`Final`?b(e.origin.payload.result.message):O(),i=t?.outcome;if(i!=null)return S(i,{Succeeded:()=>({_tag:`Succeeded`,message:r}),Failed:({failure:e})=>({_tag:`Failed`,failure:e,salvage:n}),Canceled:()=>({_tag:`Canceled`,salvage:n})});if(e?.origin._tag!==`Envelope`)return null;let a=e.origin.payload;return a._tag===`Final`?{_tag:`Succeeded`,message:r}:a._tag===`Failed`?{_tag:`Failed`,failure:a.failure,salvage:n}:a._tag===`Interrupted`?{_tag:`Canceled`,salvage:n}:null},lt=({direction:e,payload:t})=>e===`outbound`&&t._tag!==`WorkerUnresponsive`&&t._tag!==`WorkerResponsive`&&(t._tag!==`SessionEvent`||t.event._tag!==`PoolRateLimitsUpdated`&&t.event._tag!==`ProviderRetrying`),ut=e=>e.detail===``?e.label:`${e.label}. ${e.detail}`,dt=e=>e._tag===`Envelope`?e.payload._tag===`WorkerUnresponsive`?{_tag:`WorkerSilent`}:e.payload._tag===`WorkerResponsive`?{_tag:`WorkerAnswers`}:null:null,ft=(e,t,n,r,i)=>{let a=[],o=t===null?null:Q(t),s=o===null?null:et(o),c=new Set,l=null,u=[],d=null,f=new Map,p=()=>{let[e,...t]=u;e!==void 0&&d!==null&&a.push({_tag:`Burst`,key:`burst:${e.key}`,speaker:d,tools:[e,...t]}),u=[],d=null};for(let{entry:t,session:n}of e){if(t._tag===`Tool`){let e=n??{name:`Parent`,sessionKey:null};if(Y(t).category===`agent`){p(),a.push({_tag:`Delegation`,key:t.key,speaker:e,tool:t});continue}d!==null&&d.sessionKey!==e.sessionKey&&p(),d=e,u.push(t);continue}if(st(t))continue;let e=t.origin,r={key:t.key,sequence:t.sequence,latestSequence:t.latestSequence,receivedAt:t.receivedAt};if(e._tag===`Session`){let i=n??{name:e.session.agent,sessionKey:null};if(e.event===`TextOutput`){let n=et(t.detail);if(s!==null&&n===s){l??={receivedAt:t.receivedAt,speaker:i};continue}let o=e.session._tag===`ChildSession`;if(!o&&c.has(n))continue;o&&c.add(n),p();let u=$e(t.detail);a.push({_tag:`Message`,...r,speaker:i,from:`agent`,text:X(t.detail),format:t.format,undelivered:!1,queued:null,blocked:u===`blocked`,question:u===`question`});continue}(e.event===`SessionIdle`||e.event===`SessionResumed`)&&(p(),a.push({_tag:`Note`,...r,speaker:i,text:e.event===`SessionIdle`?`Waiting for operator input`:`Resumed`,tone:`plain`,connectivity:null}))}else if(e._tag===`Provider`){let i=n??{name:e.session.agent,sessionKey:null},o=e.event;if(p(),o._tag===`ProviderRecovered`){f.delete(e.session.id),a.push({_tag:`Note`,...r,speaker:i,text:`Provider reachable again after ${R(o.retries)}`,tone:`plain`,connectivity:null});continue}let s=`Provider unreachable, ${R(o.retries)} so far. ${o.message}`,c=f.get(e.session.id),l=c===void 0?void 0:a[c];if(c===a.length-1&&l?._tag===`Note`){a[c]={...l,latestSequence:t.latestSequence,text:s};continue}f.set(e.session.id,a.length),a.push({_tag:`Note`,...r,speaker:i,text:s,tone:`warning`,connectivity:{_tag:`ProviderRetrying`,sessionId:e.session.id}})}else if(e._tag===`Envelope`&&e.payload._tag===`Started`){let t=e.payload.conflictingSalvage;re(t)&&(p(),a.push({_tag:`Note`,...r,speaker:null,text:ce(t.value),tone:`plain`,connectivity:null}))}else p(),a.push(t.kind===`message`?{_tag:`Message`,...r,speaker:{name:e._tag===`Operator`?e.operator:t.label,sessionKey:n?.sessionKey??null},from:`operator`,text:t.detail,format:t.format,undelivered:t.tone===`failed`,queued:t.queued,blocked:!1,question:!1}:{_tag:`Note`,...r,speaker:null,text:ut(t),tone:t.tone,connectivity:dt(e)})}if(p(),t!==null){let e=n===void 0?O():b({key:n.key,sequence:n.sequence,latestSequence:n.latestSequence,receivedAt:n.receivedAt});a.push({_tag:`Ending`,key:n?.key??`ending:${i}`,position:e,receivedAt:w(v(l?.receivedAt),()=>w(k(e,({receivedAt:e})=>e),()=>v(r?.endedAt))),speaker:l?.speaker??null,end:t})}return a},pt=(e,t,n)=>{let r=new Map;for(let t of e.sessions)for(let e of t.entries)r.set(e.key,t);let i=e.items.flatMap(e=>e._tag===`Session`?e.entries:[e]).sort((e,t)=>e.sequence-t.sequence),a=[...[...t].sort((e,t)=>e.number-t.number).map(({id:e})=>e),...i.map(({attemptId:e})=>e)];return{chapters:[...new Set(a)].map(a=>{let o=t.find(({id:e})=>e===a),s=i.filter(e=>e.attemptId===a),c=[...s].reverse().find(e=>e._tag===`Notice`&&st(e)),l=s.find(e=>e._tag===`Notice`&&e.origin._tag===`Envelope`&&e.origin.payload._tag===`Started`),u=ct(c,o),d=n.filter(e=>e.attemptId===a),f=[...d].reverse().find(lt),p=u===null&&!e.terminalAttempts.has(a);return{key:`attempt:${a}`,attemptId:a,attempt:v(o),live:p,parentModel:l?._tag===`Notice`&&l.origin._tag===`Envelope`&&l.origin.payload._tag===`Started`?b(l.origin.payload.parentModel):O(),sessions:e.sessions.filter(e=>e.attemptId===a).sort((e,t)=>Number(e.session._tag===`ChildSession`)-Number(t.session._tag===`ChildSession`)||e.sequence-t.sequence),rows:ft(s.map(e=>{let t=r.get(e.key);return{entry:e,session:t===void 0?null:ot(t)}}),u,c,o,a),meters:De(d),endedAt:w(v(o?.endedAt),()=>v(c?.receivedAt)),lastActivityAt:v(f?.receivedAt),connectivity:p?Be(d):[]}})}},mt=e=>e.rows.flatMap(e=>{let t=(t,n)=>[{key:e.key,...t,text:n,label:at(n)}];if(e._tag===`Message`){let{sessionKey:n,name:r}=e.speaker;return e.from===`operator`?t({sessionKey:n,kind:`operator`,speaker:r,tone:e.undelivered?`failed`:`plain`},Z(e.text)):t({sessionKey:n,kind:e.blocked?`blocker`:e.question?`question`:`turn`,speaker:r,tone:e.blocked?`failed`:`plain`},Z(e.text))}if(e._tag===`Note`)return e.connectivity===null&&e.tone!==`failed`?[]:t({sessionKey:e.speaker?.sessionKey??null,kind:e.connectivity===null?`operator`:`notice`,speaker:e.speaker?.name??null,tone:e.tone},Z(e.text));if(e._tag!==`Ending`)return[];let n=(n,r)=>t({sessionKey:e.speaker?.sessionKey??null,kind:`ending`,speaker:null,tone:r},n);return S(e.end,{Succeeded:({message:e})=>n(D(e,{onNone:()=>`Succeeded`,onSome:Z}),`plain`),Failed:({failure:e})=>n(Z(C(e)),`failed`),Canceled:()=>n(`Canceled`,`plain`)})}),ht=e=>{let t=[];for(let n of mt(e)){let e=t.at(-1);n.kind===`turn`?e?._tag===`Turns`&&e.sessionKey===n.sessionKey?t[t.length-1]={...e,turns:[...e.turns,n]}:t.push({_tag:`Turns`,key:`turns:${n.key}`,speaker:n.speaker??`Parent`,sessionKey:n.sessionKey,turns:[n]}):t.push({_tag:`Mark`,checkpoint:n})}return t},gt=e=>e.chapters.flatMap(e=>{let t=new Set(mt(e).map(({key:e})=>e)),n=(t,n=!1)=>({id:t,attemptId:e.attemptId,checkpoint:n});return[n(e.key),n(`history:${e.attemptId}`),n(`empty:${e.attemptId}`),...e.rows.map(e=>n(e.key,t.has(e.key))),n(`activity:${e.attemptId}`)]}),_t=(e,t)=>{let n=new Set(t),r=e.findIndex(({id:e})=>n.has(e)),i=e[r];if(i===void 0)return null;let a=e.slice(0,r+1).reverse().find(e=>e.attemptId===i.attemptId&&e.checkpoint);return{attemptId:i.attemptId,checkpointKey:a?.id??null}},$=(e,t)=>{let n=Math.max(0,Math.floor((t-Date.parse(e))/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m ${n%60}s`:`${Math.floor(r/60)}h ${r%60}m`},vt=({since:e,className:n})=>{let r=j(1e3);return(0,N.jsx)(`time`,{dateTime:e,"aria-live":`off`,className:t(`font-mono tabular-nums`,n),title:`Since ${h(e)}`,children:$(e,r)})},yt=e=>{if(e.status!==`Live`)return{label:e.status,detail:``,since:O()};if(e.paused||e.held||e.idle)return{label:ze(e),detail:``,since:O()};let t=[...e.entries].reverse().find(e=>e._tag===`Tool`&&e.state._tag===`Running`);if(t?._tag!==`Tool`)return{label:`Working`,detail:``,since:O()};let n=Y(t);return{label:{command:`Running command`,read:`Reading file`,edit:`Editing file`,write:`Writing file`,search:`Searching`,agent:`Delegating`,tool:`Running ${n.title}`}[n.category],detail:n.subject,since:k(t.start,({receivedAt:e})=>e)}},bt=e=>{let t=e.filter(({status:e})=>e===`Live`);return t.filter(({session:e})=>e._tag===`ChildSession`).sort((e,t)=>t.latestSequence-e.latestSequence)[0]??t.find(({session:e})=>e._tag===`ParentSession`)},xt=({chapter:e})=>{let t=j(1e3),n=bt(e.sessions),r=n===void 0?{label:`Parent session starting`,detail:``,since:O()}:yt(n);return(0,N.jsxs)(`div`,{role:`status`,"aria-label":`Current activity`,className:`min-w-0 space-y-0.5 text-xs`,children:[(0,N.jsxs)(`p`,{className:`flex min-w-0 items-center gap-2`,children:[(0,N.jsx)(M,{state:`Running`}),n!==void 0&&(0,N.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:n.session._tag===`ParentSession`?`Parent`:n.session.agent}),(0,N.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:r.label}),D(r.since,{onNone:()=>null,onSome:e=>(0,N.jsx)(`span`,{"aria-live":`off`,className:`ml-auto shrink-0 font-mono tabular-nums text-muted-foreground`,title:`Started ${h(e)}`,children:$(e,t)})})]}),r.detail!==``&&(0,N.jsx)(`p`,{className:`truncate pl-3.5 font-mono text-muted-foreground`,title:r.detail,children:r.detail}),D(e.lastActivityAt,{onNone:()=>null,onSome:e=>(0,N.jsxs)(`p`,{"aria-live":`off`,className:`pl-3.5 text-muted-foreground`,children:[`Last activity `,$(e,t),` ago`]})}),e.connectivity.map(e=>(0,N.jsx)(St,{warning:e,now:t},e._tag===`WorkerSilent`?e.worker:`${e.agent}:${e.since}`))]})},St=({warning:e,now:t})=>{let n=S(e,{WorkerSilent:({worker:e,lastAnsweredAt:t})=>({text:`${e} silent since ${y(t)}`,since:t,detail:null}),ProviderRetrying:({agent:e,retries:t,since:n,message:r})=>({text:`${e}: provider unreachable, ${R(t)} since ${y(n)}`,since:n,detail:r})});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2 pl-3.5`,children:[(0,N.jsxs)(`span`,{className:`min-w-0 text-warning`,children:[(0,N.jsx)(`span`,{className:`sr-only`,children:`Warning: `}),n.text]}),(0,N.jsx)(`span`,{"aria-live":`off`,className:`ml-auto shrink-0 font-mono tabular-nums text-muted-foreground`,title:`Since ${h(n.since)}`,children:$(n.since,t)})]}),n.detail!==null&&(0,N.jsx)(`p`,{className:`truncate pl-3.5 text-muted-foreground`,title:n.detail,children:n.detail})]})},Ct=({failure:e,className:n})=>(0,N.jsxs)(`div`,{className:t(`rounded-lg border border-destructive/25 bg-destructive/8 px-3 pt-2 pb-2.5 text-sm`,n),children:[(0,N.jsx)(`p`,{className:`font-medium text-destructive`,children:ie(e)}),(0,N.jsx)(xe,{className:`wrap-anywhere`,children:C(e)})]}),wt=({salvage:e})=>(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground wrap-anywhere`,children:e===null?`No salvage branch`:S(e,{Pushed:({ref:e,commit:t})=>(0,N.jsxs)(N.Fragment,{children:[`Unfinished work pushed to `,(0,N.jsx)(`span`,{className:`font-mono`,children:e}),` at`,` `,(0,N.jsx)(`span`,{className:`font-mono`,children:t.slice(0,7)})]}),Retained:({path:e,message:t})=>(0,N.jsxs)(N.Fragment,{children:[`Salvage incomplete: unfinished work at `,(0,N.jsx)(`span`,{className:`font-mono`,children:e}),`, retried at each startup while the worker is configured. Last error: `,t]})})}),Tt=({end:e})=>S(e,{Failed:({failure:e,salvage:t})=>(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(Ct,{failure:e}),(0,N.jsx)(wt,{salvage:t})]}),Succeeded:({message:e})=>(0,N.jsxs)(`div`,{className:`space-y-1`,children:[(0,N.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,N.jsx)(M,{state:`Succeeded`}),`Succeeded`]}),D(e,{onNone:()=>null,onSome:e=>(0,N.jsx)(xe,{className:`text-md wrap-anywhere`,children:e})})]}),Canceled:({salvage:e})=>(0,N.jsxs)(`div`,{className:`space-y-1`,children:[(0,N.jsxs)(`p`,{className:`flex items-center gap-2 text-sm font-medium`,children:[(0,N.jsx)(M,{state:`Canceled`}),`Canceled`]}),(0,N.jsx)(wt,{salvage:e})]})});export{we as _,pt as a,Q as c,Re as d,Me as f,ke as g,Ae as h,ht as i,nt as l,Fe as m,xt as n,gt as o,je as p,vt as r,_t as s,Tt as t,Y as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as e,lt as t,t as n}from"./button-C4yvcSko.js";import{C as r}from"./index-BljdfRBm.js";var i=t(),a=()=>(0,i.jsx)(r,{title:`Project not found`,description:`This repository is not under repos in usine.yaml.`,tone:`error`,inPanel:!0,children:(0,i.jsx)(n,{variant:`outline`,nativeButton:!1,render:(0,i.jsx)(e,{to:`/`}),children:`Back to Overview`})});export{a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{N as e}from"./operator-copy-DsM7LJx6.js";var t=3e3,n=15e3,r=()=>({queryKey:[`desk`],queryFn:()=>e(e=>e.desk()),refetchInterval:e=>{let r=e.state.data;return r!==void 0&&(r.running.length>0||r.notMoving.some(({reason:e})=>e._tag===`QueuedForWorker`))?t:n}});export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lt as e}from"./button-C4yvcSko.js";import{on as t}from"./operator-copy-DsM7LJx6.js";import{G as n}from"./index-BljdfRBm.js";import{t as r}from"./repositories-Cq7zGzNb.js";var i=e(),a=()=>{let{data:e}=t(n());return(0,i.jsx)(r,{configuration:e})};export{a as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as e,lt as t}from"./button-C4yvcSko.js";import{st as n}from"./operator-copy-DsM7LJx6.js";import{n as r}from"./useNavigate-lXd3v3E0.js";import{q as i}from"./index-BljdfRBm.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./table-B6NH8hTW.js";import{a as d,d as f,i as p,l as m,n as h,r as g,s as _,t as v,u as y}from"./section-Cm-j3zHs.js";import{n as b,t as x}from"./label-badge-ohqvZnY7.js";var S=t(),C=e=>e.lanes.flatMap(({sources:e})=>e.flatMap(e=>e._tag===`Label`?[e.label]:[])),w=e=>{let t=[...e.declaredLabels,...C(e)];if(t.length===0)return{text:`No labels`,problem:!1};if(t.some(({onGitHub:e})=>e===null))return{text:`Not polled yet`,problem:!1};let n=e=>new Set(e.map(({name:e})=>e.toLowerCase())).size,r=n(t.filter(({failure:e})=>e!==null)),i=n(t.filter(({onGitHub:e})=>e===!1)),a=[...r>0?[`${r} failed`]:[],...i>0?[`${i} missing on GitHub`]:[]];return a.length===0?{text:`All on GitHub`,problem:!1}:{text:a.join(`, `),problem:!0}},T=({repository:t})=>{let i=r(),a=n(t.name),o=w(t);return(0,S.jsxs)(m,{open:()=>void i({to:`/configuration/repositories/$owner/$name`,params:a}),children:[(0,S.jsx)(l,{className:`py-3`,children:(0,S.jsx)(e,{to:`/configuration/repositories/$owner/$name`,params:a,onClick:e=>e.stopPropagation(),className:f,children:t.name})}),(0,S.jsx)(l,{className:`hidden md:table-cell`,children:t.tags.length===0?(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:`None`}):t.tags.join(`, `)}),(0,S.jsx)(l,{className:`text-right tabular-nums`,children:t.lanes.length===0?(0,S.jsx)(`span`,{className:`text-muted-foreground`,children:`Proposed`}):t.lanes.length}),(0,S.jsx)(l,{className:o.problem?`text-destructive`:`text-muted-foreground`,children:o.text}),(0,S.jsx)(l,{className:`hidden w-full whitespace-normal text-muted-foreground sm:table-cell`,children:t.loops.length===0?`No loop`:t.loops.join(`, `)})]})},E=({configuration:e})=>(0,S.jsx)(v,{title:`Repositories`,counts:`${e.repositories.length} ${e.repositories.length===1?`repository`:`repositories`}`,children:e.repositories.length===0?(0,S.jsxs)(_,{title:`No repositories registered`,children:[`Add each repository under `,(0,S.jsx)(`code`,{children:`repos`}),` in `,(0,S.jsx)(`code`,{children:`usine.yaml`}),`, then reload the configuration.`]}):(0,S.jsx)(`div`,{className:`-mx-2`,children:(0,S.jsxs)(u,{children:[(0,S.jsx)(a,{children:(0,S.jsxs)(c,{className:`hover:bg-transparent`,children:[(0,S.jsx)(o,{children:`Repository`}),(0,S.jsx)(o,{className:`hidden md:table-cell`,children:`Tags`}),(0,S.jsx)(o,{className:`text-right`,children:`Lanes`}),(0,S.jsx)(o,{children:`Labels`}),(0,S.jsx)(o,{className:`hidden w-full sm:table-cell`,children:`Loops`})]})}),(0,S.jsx)(s,{children:e.repositories.map(e=>(0,S.jsx)(T,{repository:e},e.name))})]})})}),D=({label:e})=>e.failure===null?e.onGitHub===!1?(0,S.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,S.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),O=({source:e})=>e._tag===`Label`?(0,S.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(x,{name:e.label.name,label:e.label}),(0,S.jsx)(`span`,{className:`text-xs`,children:(0,S.jsx)(D,{label:e.label})})]}):(0,S.jsx)(b,{variant:`outline`,className:`text-muted-foreground`,children:e.state}),k=({repository:e})=>(0,S.jsx)(`div`,{className:`-mx-2`,children:(0,S.jsxs)(u,{children:[(0,S.jsx)(a,{children:(0,S.jsxs)(c,{className:`hover:bg-transparent`,children:[(0,S.jsx)(o,{className:`text-right`,children:`#`}),(0,S.jsx)(o,{children:`Lane`}),(0,S.jsx)(o,{className:`w-full`,children:`Items with`})]})}),(0,S.jsx)(s,{children:e.lanes.map((e,t)=>(0,S.jsxs)(c,{className:`hover:bg-transparent`,children:[(0,S.jsx)(l,{className:`py-3 text-right align-top font-mono text-xs text-muted-foreground tabular-nums`,children:t+1}),(0,S.jsx)(l,{className:`py-3 align-top font-medium`,children:e.name}),(0,S.jsx)(l,{className:`py-3 whitespace-normal`,children:(0,S.jsx)(`ul`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:e.sources.map(e=>(0,S.jsx)(`li`,{children:(0,S.jsx)(O,{source:e})},e._tag===`Label`?e.label.name:e.state))})})]},e.name))})]})}),A=({repository:t})=>(0,S.jsxs)(d,{children:[(0,S.jsx)(p,{label:`Board`,children:(0,S.jsx)(e,{to:`/projects/$owner/$name`,params:i(t.name),className:`text-primary hover:underline`,children:`Open the board`})}),(0,S.jsx)(p,{label:`Tags`,children:t.tags.length===0?(0,S.jsx)(y,{children:`None`}):t.tags.join(`, `)}),(0,S.jsx)(p,{label:`Loops`,children:t.loops.length===0?(0,S.jsx)(y,{children:`Not selected by any loop`}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:t.loops.map(t=>(0,S.jsx)(`li`,{children:(0,S.jsx)(e,{to:`/configuration/loops/$loop`,params:{loop:t},className:`text-primary hover:underline`,children:t})},t))})})]}),j=({owner:t,name:n,configuration:r})=>{let i=`${t}/${n}`,a=r.repositories.find(e=>e.name.toLowerCase()===i.toLowerCase());return a===void 0?(0,S.jsx)(v,{title:i,children:(0,S.jsxs)(_,{title:`Repository not registered`,children:[i,` is not under `,(0,S.jsx)(`code`,{children:`repos`}),` in `,(0,S.jsx)(`code`,{children:`usine.yaml`}),`.`,` `,(0,S.jsx)(e,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,S.jsx)(v,{title:a.name,children:(0,S.jsxs)(h,{facts:(0,S.jsx)(A,{repository:a}),children:[(0,S.jsxs)(g,{title:`Lanes`,aside:a.lanes.length===0?void 0:`In board order, as listed in repos[].lanes`,children:[[...a.declaredLabels,...C(a)].some(({onGitHub:e})=>e===null)&&(0,S.jsx)(`p`,{className:`text-muted-foreground`,children:`Labels not polled yet. Whether each label is on GitHub shows after the first poll.`}),a.lanes.length===0?(0,S.jsxs)(`p`,{className:`max-w-[72ch] text-muted-foreground`,children:[(0,S.jsx)(`code`,{children:`usine.yaml`}),` has no lanes for this repository. The board shows lanes proposed from the repository labels, and cards cannot be moved. To move cards, add lanes under `,(0,S.jsx)(`code`,{children:`repos[].lanes`}),`.`]}):(0,S.jsx)(k,{repository:a})]}),(0,S.jsx)(g,{title:`Labels usine creates`,aside:`From labels in usine.yaml`,children:a.declaredLabels.length===0?(0,S.jsxs)(`p`,{className:`text-muted-foreground`,children:[`No labels under `,(0,S.jsx)(`code`,{children:`labels`}),` in `,(0,S.jsx)(`code`,{children:`usine.yaml`}),`.`]}):(0,S.jsx)(`ul`,{className:`flex flex-col gap-2`,children:a.declaredLabels.map(e=>(0,S.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,S.jsx)(x,{name:e.name,label:e}),(0,S.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,S.jsx)(y,{children:`On GitHub`}):(0,S.jsx)(D,{label:e})})]},e.name))})})]})})};export{j as n,E as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));export{s as n,l as r,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e}from"./index-BljdfRBm.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{O as e}from"./index-BljdfRBm.js";var t=e;export{t as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lt as e}from"./button-C4yvcSko.js";import{O as t,a as n,c as r,ct as i,on as a,t as o}from"./operator-copy-DsM7LJx6.js";import{t as s}from"./error-alert-BrI00JbQ.js";import{n as c,t as ee}from"./use-now-CcFZyFvf.js";import{H as l,J as u,K as d,U as f,W as p,Y as m,et as h,lt as g,st as _,u as v}from"./index-BljdfRBm.js";import{a as y,i as b,n as x,o as S,r as C,t as w}from"./table-B6NH8hTW.js";import{n as T,r as E}from"./status-badge-CNlyvwWL.js";import{a as D,i as O,n as k,r as A,t as j}from"./section-BBnBOk-U.js";import{t as M}from"./action-DYT048Jm.js";import{d as N,n as P}from"./copy-BM1l6IGB.js";import{t as F}from"./query-DWN8IHdt.js";var I=e=>i(e,{WorkerSilent:({worker:e,lastAnsweredAt:t})=>`${e} silent since ${n(t)}`,ProviderRetrying:({agent:e,retries:t,since:r})=>`${e}: provider unreachable, ${t} ${t===1?`retry`:`retries`} since ${n(r)}`}),L=e=>e.reduce((e,{slots:{capacity:t,leased:n}})=>e+Math.max(0,t-n),0),R=e=>{let t=e.reduce((e,{slots:t})=>e+t.capacity,0),n=L(e);return t===0?`Nothing running`:`Nothing running, ${n} of ${t} worker ${t===1?`slot`:`slots`} free`},te=(e,t)=>{if(e.length===0)return null;if(e.every(({polledAt:e})=>e===null))return`Not checked yet`;let[n]=e;return e.length===1&&n!==void 0&&n.polledAt!==null?`Last checked ${o(n.polledAt,t)}`:`Last checked ${e.map(({repository:e,polledAt:n})=>`${e} ${n===null?`not yet`:o(n,t)}`).join(`, `)}`},z=e=>{let t=[e.running.length>0?`${e.running.length} running`:null,e.notMoving.length>0?`${e.notMoving.length} stalled`:null].filter(e=>e!==null);return t.length===0?void 0:t.join(`, `)},B=e=>{let t=/\/pull\/(\d+)/u.exec(e)?.[1];return t===void 0?e:`#${t}`},V=e(),H=({closed:e,now:n})=>{let{run:r,item:i,closedAt:a}=e;return(0,V.jsxs)(D,{run:r,children:[(0,V.jsxs)(C,{className:`w-full max-w-0 py-3`,children:[(0,V.jsx)(O,{run:r,children:(0,V.jsx)(A,{item:i,run:r})}),(0,V.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground md:hidden`,children:r.loop})]}),(0,V.jsx)(C,{className:`py-3 max-md:hidden`,children:r.loop}),(0,V.jsx)(C,{className:`py-3`,children:(0,V.jsx)(E,{state:r.state})}),(0,V.jsx)(C,{className:`py-3 text-right max-sm:hidden`,children:(0,V.jsx)(`time`,{dateTime:a,title:t(a),className:`text-xs text-muted-foreground tabular-nums`,children:o(a,n)})}),(0,V.jsx)(C,{className:`py-3 text-right`,children:r.pullRequestUrl===null?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`None`}):(0,V.jsx)(`a`,{href:r.pullRequestUrl,target:`_blank`,rel:`noreferrer`,onClick:e=>e.stopPropagation(),className:`rounded-sm font-mono text-xs text-primary underline-offset-4 outline-none hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:B(r.pullRequestUrl)})})]})},U=({outcomes:e,now:t})=>e.length===0?(0,V.jsx)(k,{children:`No recent runs`}):(0,V.jsx)(`div`,{className:`-mx-2`,children:(0,V.jsxs)(w,{children:[(0,V.jsx)(y,{children:(0,V.jsxs)(S,{className:`hover:bg-transparent`,children:[(0,V.jsx)(b,{children:`Item`}),(0,V.jsx)(b,{className:`max-md:hidden`,children:`Loop`}),(0,V.jsx)(b,{children:`Outcome`}),(0,V.jsx)(b,{className:`text-right max-sm:hidden`,children:`Closed`}),(0,V.jsx)(b,{className:`text-right`,children:`Pull request`})]})}),(0,V.jsx)(x,{children:e.map(e=>(0,V.jsx)(H,{closed:e,now:t},e.run.id))})]})}),W=({stalled:e,now:t,readOnly:n,narrow:r})=>{let i=N(e),a=(0,V.jsx)(A,{item:e.item}),o=i===null?a:(0,V.jsx)(O,{run:i,children:a}),s=(0,V.jsx)(M,{stalled:e,readOnly:n,appearance:`row`});return r?(0,V.jsx)(D,{run:i,children:(0,V.jsxs)(C,{className:`w-full max-w-0 py-3 align-top whitespace-normal`,children:[o,(0,V.jsx)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground`,children:e.loop}),(0,V.jsx)(`p`,{className:`mt-1 text-sm text-foreground/90`,children:P(e,t)}),(0,V.jsx)(`div`,{className:`-ml-2.5 empty:hidden [&>span]:items-start`,children:s})]})}):(0,V.jsxs)(D,{run:i,children:[(0,V.jsx)(C,{className:`w-2/5 max-w-0 py-3 align-top whitespace-normal`,children:o}),(0,V.jsx)(C,{className:`py-3 align-top`,children:e.loop}),(0,V.jsx)(C,{className:`w-3/5 py-3 align-top whitespace-normal text-foreground/90`,children:P(e,t)}),(0,V.jsx)(C,{className:`py-2 text-right align-top`,children:s})]})},G=({stalled:e,now:t,readOnly:n,polled:r})=>{let i=_();return e.length===0?(0,V.jsx)(k,{children:r?`Nothing stalled`:`Not checked yet`}):(0,V.jsx)(`div`,{className:`-mx-2`,children:(0,V.jsxs)(w,{children:[(0,V.jsx)(y,{children:(0,V.jsxs)(S,{className:`hover:bg-transparent`,children:[(0,V.jsx)(b,{children:`Item`}),!i&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b,{children:`Loop`}),(0,V.jsx)(b,{children:`Reason`}),(0,V.jsx)(b,{children:(0,V.jsx)(`span`,{className:`sr-only`,children:`Action`})})]})]})}),(0,V.jsx)(x,{children:e.map(e=>(0,V.jsx)(W,{stalled:e,now:t,readOnly:n,narrow:i},`${e.loop}:${e.item.itemKey}`))})]})})},K=(e,n)=>new Date(e).toDateString()===new Date(n).toDateString()?t(e).slice(11):r(e),q=({running:e,now:n})=>{let{run:r,attempt:i,item:a,lastActivityAt:s,warnings:c}=e;return(0,V.jsxs)(D,{run:r,children:[(0,V.jsxs)(C,{className:`w-full max-w-0 py-3 whitespace-normal align-top`,children:[(0,V.jsx)(O,{run:r,children:(0,V.jsx)(A,{item:a,run:r})}),(0,V.jsxs)(`p`,{className:`mt-0.5 truncate text-xs text-muted-foreground lg:hidden`,children:[(0,V.jsxs)(`span`,{className:`md:hidden`,children:[r.loop,`, `,r.agent,` on `,i.worker]}),(0,V.jsxs)(`span`,{className:`max-md:hidden`,children:[r.agent,` on `,i.worker]})]}),c.map(e=>(0,V.jsxs)(`p`,{className:`mt-1 flex items-start gap-1.5 text-xs text-warning`,children:[(0,V.jsx)(g,{"aria-hidden":`true`,weight:`fill`,className:`mt-0.5 size-3 shrink-0`}),(0,V.jsxs)(`span`,{children:[I(e),e._tag===`ProviderRetrying`&&(0,V.jsx)(`span`,{className:`block text-warning/80 wrap-anywhere`,children:e.message})]})]},e._tag===`WorkerSilent`?e.worker:`${e.agent}`))]}),(0,V.jsx)(C,{className:`py-3 max-md:hidden align-top`,children:r.loop}),(0,V.jsx)(C,{className:`py-3 max-lg:hidden align-top`,children:r.agent}),(0,V.jsx)(C,{className:`py-3 max-lg:hidden align-top`,children:i.worker}),(0,V.jsx)(C,{className:`py-3 max-sm:hidden align-top`,children:(0,V.jsx)(`time`,{dateTime:i.startedAt,title:t(i.startedAt),className:`font-mono text-xs tabular-nums`,children:K(i.startedAt,n)})}),(0,V.jsx)(C,{className:`py-3 text-right align-top`,children:s===null?(0,V.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`None yet`}):(0,V.jsx)(`time`,{dateTime:s,title:t(s),className:`text-xs text-muted-foreground tabular-nums`,children:o(s,n)})})]})},J=({running:e,workers:t,now:n})=>e.length===0?(0,V.jsx)(k,{children:R(t)}):(0,V.jsx)(`div`,{className:`-mx-2`,children:(0,V.jsxs)(w,{children:[(0,V.jsx)(y,{children:(0,V.jsxs)(S,{className:`hover:bg-transparent`,children:[(0,V.jsx)(b,{children:`Item`}),(0,V.jsx)(b,{className:`max-md:hidden`,children:`Loop`}),(0,V.jsx)(b,{className:`max-lg:hidden`,children:`Agent`}),(0,V.jsx)(b,{className:`max-lg:hidden`,children:`Worker`}),(0,V.jsx)(b,{className:`max-sm:hidden`,children:`Started`}),(0,V.jsx)(b,{className:`text-right`,children:`Last activity`})]})}),(0,V.jsx)(x,{children:e.map(e=>(0,V.jsx)(q,{running:e,now:n},e.attempt.id))})]})}),Y=({worker:e,now:n})=>{let r=e.preflight;if(r===null)return(0,V.jsx)(`span`,{children:`No preflight yet`});let i=r._tag===`Passed`;return(0,V.jsxs)(`span`,{className:i?void 0:`text-destructive`,title:i?t(r.checkedAt):r.message,children:[(0,V.jsx)(T,{state:i?`Succeeded`:`Failed`,className:`mr-1.5 align-middle`}),`Preflight `,i?`passed`:`failed`,` `,o(r.checkedAt,n)]})},X=({workers:e,now:t})=>(0,V.jsxs)(`footer`,{"aria-label":`Workers`,className:`flex flex-wrap items-baseline gap-x-8 gap-y-1.5 border-t pt-3 text-xs text-muted-foreground`,children:[(0,V.jsx)(`span`,{className:`font-medium text-foreground`,children:`Workers`}),e.map(e=>(0,V.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-3`,children:[(0,V.jsx)(`span`,{className:`font-mono text-foreground`,children:e.name}),(0,V.jsxs)(`span`,{className:`tabular-nums`,children:[e.slots.leased,` of `,e.slots.capacity,` `,e.slots.capacity===1?`slot`:`slots`,` in use`]}),(0,V.jsx)(Y,{worker:e,now:t})]},e.name))]}),Z=()=>{let e=p();return(0,V.jsxs)(`section`,{className:`flex flex-col items-start gap-3`,children:[(0,V.jsxs)(`div`,{className:`flex max-w-prose flex-col gap-1`,children:[(0,V.jsx)(`h2`,{className:`text-md font-medium`,children:`No projects registered`}),(0,V.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Add each repository under `,(0,V.jsx)(`code`,{children:`repos`}),` in `,(0,V.jsx)(`code`,{children:`usine.yaml`}),`, then reload the configuration.`]})]}),(0,V.jsx)(l,{reload:e}),(0,V.jsx)(f,{reload:e})]})},Q=({needs:e,polls:t,now:n})=>(0,V.jsx)(j,{id:`desk-needs-you`,title:`Needs attention`,count:e.length,countTone:`needs-you`,note:te(t,n)??void 0,children:e.length===0?(0,V.jsx)(k,{children:`Nothing needs attention`}):(0,V.jsx)(`ul`,{className:`grid grid-cols-1 items-start gap-2.5 lg:grid-cols-2`,children:e.map(e=>(0,V.jsx)(v,{need:e,compact:!1},e.id))})}),$=({id:e,title:t})=>(0,V.jsx)(j,{id:e,title:t,children:(0,V.jsx)(`div`,{"aria-hidden":`true`,className:`flex flex-col border-t`,children:[0,1,2].map(e=>(0,V.jsx)(`div`,{className:`flex h-11 items-center border-b`,children:(0,V.jsx)(h,{className:`h-3 w-2/5`})},e))})}),ne=()=>{let{data:e}=a(d()),t=c(F()),n=ee(15e3),r=e._tag===`NeedsSetup`;return(0,V.jsx)(u,{width:`full`,children:(0,V.jsxs)(`div`,{className:`flex flex-col gap-9 pb-2`,children:[(0,V.jsx)(m,{title:`Overview`,counts:t.data===void 0?void 0:z(t.data)}),e.projects.length===0&&(0,V.jsx)(Z,{}),(0,V.jsx)(Q,{needs:e.needsYou,polls:t.data?.polls??[],now:n}),t.data===void 0?t.isError?(0,V.jsx)(s,{title:`Could not load the overview`,message:t.error.message}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)($,{id:`desk-running`,title:`Running`}),(0,V.jsx)($,{id:`desk-not-moving`,title:`Stalled`}),(0,V.jsx)($,{id:`desk-outcomes`,title:`Recent runs`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(j,{id:`desk-running`,title:`Running`,count:t.data.running.length,children:(0,V.jsx)(J,{running:t.data.running,workers:t.data.workers,now:n})}),(0,V.jsx)(j,{id:`desk-not-moving`,title:`Stalled`,count:t.data.notMoving.length,children:(0,V.jsx)(G,{stalled:t.data.notMoving,now:n,readOnly:r,polled:t.data.polls.some(({polledAt:e})=>e!==null)})}),(0,V.jsx)(j,{id:`desk-outcomes`,title:`Recent runs`,children:(0,V.jsx)(U,{outcomes:t.data.lastOutcomes,now:n})}),t.data.workers.length>0&&(0,V.jsx)(X,{workers:t.data.workers,now:n})]})]})})};export{ne as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as e,k as t,lt as n}from"./button-C4yvcSko.js";import{Jt as r,O as i,Yt as a,c as o,n as s,nn as c}from"./operator-copy-DsM7LJx6.js";import{q as l}from"./index-BljdfRBm.js";var u=n(),d=({approval:e,className:n})=>{if(e===null)return null;let l=a(e.source),d=r(l,({approver:e})=>e);return(0,u.jsxs)(`span`,{className:t(`text-muted-foreground`,n),children:[(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:c(d,{onNone:()=>`Approved`,onSome:e=>`Approved by ${e}`})}),` · `,(0,u.jsx)(`time`,{dateTime:e.approvedAt,title:i(e.approvedAt),className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:o(e.approvedAt)}),c(l,{onNone:()=>null,onSome:({channel:e})=>(0,u.jsxs)(u.Fragment,{children:[` · `,(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:s[e]})]})})]})},f=({run:n,source:r,className:a})=>{if(n.runAgain===null)return null;let{from:s,requestedBy:d}=n.runAgain,f=s.slice(0,8);return(0,u.jsxs)(`span`,{className:t(`text-muted-foreground`,a),children:[(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:c(d,{onNone:()=>`Run again`,onSome:e=>`Run again by ${e}`})}),` · `,(0,u.jsx)(`time`,{dateTime:n.openedAt,title:i(n.openedAt),className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:o(n.openedAt)}),` · `,(0,u.jsxs)(`span`,{className:`whitespace-nowrap`,children:[`from run`,` `,r===`link`?(0,u.jsx)(e,{to:`/projects/$owner/$name/runs/$run`,params:{...l(n.repository),run:s},className:`relative z-10 font-mono text-xs text-primary underline-offset-4 hover:underline`,children:f}):(0,u.jsx)(`span`,{className:`font-mono text-xs`,children:f})]})]})};export{d as n,f as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{H as t,U as n,k as r,lt as i,n as a,ut as o}from"./button-C4yvcSko.js";import{O as s,Yt as c,a as l,an as u,nn as d,on as f,rn as p,y as m}from"./operator-copy-DsM7LJx6.js";import{t as h}from"./error-alert-BrI00JbQ.js";import{a as g,i as _,o as v}from"./item-rBBCTV8x.js";import{K as y,Q as b,X as x,Z as S,at as C,it as w,m as T,nt as E,q as D,rt as O,tt as k}from"./index-BljdfRBm.js";import{_ as A,a as j,d as M,f as N,g as P,l as F,m as I,n as L,p as R,t as z}from"./outcome-YiIf6xbJ.js";var B=e(o(),1),V=new Map([[`bold`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-39.51,39.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM99.51,139.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l39.52-39.51a12,12,0,0,0-17-17Z`}))],[`duotone`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M224,48V208a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32H208A16,16,0,0,1,224,48Z`,opacity:`0.2`}),B.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`fill`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M117.66,138.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l34.34-34.35A8,8,0,0,1,117.66,138.34ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72l-34.35,34.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Z`}))],[`light`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-53.76,53.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM107.76,139.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l53.76-53.76a6,6,0,0,0-8.48-8.48Z`}))],[`regular`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-50.34,50.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM106.34,138.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l50.35-50.34a8,8,0,0,0-11.32-11.32Z`}))],[`thin`,B.createElement(B.Fragment,null,B.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-57.17,57.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM109.17,141.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l57.17-57.17a4,4,0,0,0-5.66-5.66Z`}))]]),H=B.forwardRef((e,n)=>B.createElement(t,{ref:n,...e,weights:V}));H.displayName=`ArrowsOutSimpleIcon`;var U=i(),W=({detail:e})=>{let t=(0,B.useMemo)(()=>j(M(e.transcript,e.run.attempts,e.sessionState),e.run.attempts,e.transcript),[e.transcript,e.sessionState,e.run.attempts]),n=[...t.chapters].reverse().find(({live:e})=>e),r=t.chapters.flatMap(({rows:e})=>e).reverse().find(e=>e._tag===`Message`);return(0,U.jsxs)(`div`,{className:`space-y-4`,children:[n===void 0?(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`Attempt starting`}):(0,U.jsx)(L,{chapter:n}),r?._tag===`Message`&&(0,U.jsxs)(`section`,{"aria-label":`Latest message`,className:`space-y-1`,children:[(0,U.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:r.speaker.name}),(0,U.jsx)(`time`,{dateTime:r.receivedAt,title:s(r.receivedAt),className:`font-mono tabular-nums text-muted-foreground`,children:l(r.receivedAt)})]}),(0,U.jsx)(`p`,{className:`line-clamp-6 text-md wrap-anywhere`,children:F(r.text)}),r.queued!==null&&(0,U.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:m(r.queued)})]})]})},G=e=>{let t=e.attempts.at(-1),n=t?.salvage??null;return e.state===`Succeeded`?u({_tag:`Succeeded`,message:c(e.resultMessage)}):e.state===`Canceled`?u({_tag:`Canceled`,salvage:n}):e.state===`Failed`&&t?.outcome?._tag===`Failed`?u({_tag:`Failed`,failure:t.outcome.failure,salvage:n}):p()},K=({detail:e})=>{let t=e.run;switch(t.state){case`Pending`:return(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`Opened, not scheduled yet`});case`Waiting`:return(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`Waiting for approval`});case`Queued`:return(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`Approved, waiting for a free worker`});case`Running`:return(0,U.jsx)(W,{detail:e});case`Succeeded`:case`Failed`:case`Canceled`:return d(G(t),{onNone:()=>(0,U.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempt started`}),onSome:e=>(0,U.jsx)(z,{end:e})})}},q=({runId:e,open:t,close:i})=>{let{data:o}=f(y()),s=P(e,t),[c,l]=(0,B.useState)(null),u=T(),d=s.data?.run,m=s.data===void 0?p():_(s.data.run,o,s.data.eventPayload);return(0,U.jsx)(k,{open:t,onOpenChange:e=>{e||i()},children:(0,U.jsxs)(E,{side:`right`,"aria-label":`Run detail`,className:`gap-0 data-[side=right]:w-full data-[side=right]:sm:max-w-md`,children:[(0,U.jsx)(w,{className:`shrink-0 gap-3 border-b px-5 pt-5 pb-4 pr-20`,children:d===void 0||s.data===void 0?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(C,{children:`Loading…`}),(0,U.jsx)(O,{children:`Loading run…`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(R,{run:d,item:m,shared:t,heading:e=>(0,U.jsx)(C,{className:`text-lg font-semibold wrap-anywhere`,children:e})}),(0,U.jsxs)(O,{className:`sr-only`,children:[`Run `,d.id,` of `,d.loop,` on `,d.repository]}),(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsx)(N,{run:d,item:m,shared:t,className:`gap-x-4`}),(0,U.jsx)(I,{detail:s.data,showUsage:!1,className:`gap-x-4`})]}),(0,U.jsx)(A,{run:d,onEdit:l,openRun:u})]})}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-5 overflow-y-auto px-5 py-4`,children:[s.isError&&(0,U.jsx)(h,{message:s.error.message}),d!==void 0&&c!==null&&v(d,c)&&(0,U.jsx)(g,{run:d,intent:c,close:()=>l(null),openRun:u},`${d.id}:${c}`),s.data!==void 0&&(0,U.jsx)(K,{detail:s.data}),d!==void 0&&(0,U.jsx)(n,{to:`/projects/$owner/$name/runs/$run`,params:{...D(d.repository),run:d.id},search:{},viewTransition:!0,className:a({variant:`outline`}),children:`Open run page`})]}),d!==void 0&&(0,U.jsxs)(x,{children:[(0,U.jsx)(b,{render:(0,U.jsx)(n,{to:`/projects/$owner/$name/runs/$run`,params:{...D(d.repository),run:d.id},search:{},viewTransition:!0,"aria-label":`Open run page`,className:r(a({variant:`ghost`,size:`icon-sm`}),`absolute top-4 right-11`)}),children:(0,U.jsx)(H,{"aria-hidden":`true`})}),(0,U.jsx)(S,{side:`bottom`,children:`Open run page`})]})]})})};export{q as RunDrawer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as e,k as t,lt as n}from"./button-C4yvcSko.js";import{Jt as r,Qt as i,V as a,Yt as o,tn as s,wt as c}from"./operator-copy-DsM7LJx6.js";import{n as l}from"./useNavigate-lXd3v3E0.js";import{q as u}from"./index-BljdfRBm.js";import{o as d}from"./table-B6NH8hTW.js";var f=n(),p=({id:e,title:n,count:r,countTone:i=`muted`,note:a,children:o})=>(0,f.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-2`,children:[(0,f.jsxs)(`header`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,f.jsx)(`h2`,{id:e,className:`text-lg font-semibold`,children:n}),r!==void 0&&r>0&&(0,f.jsx)(`span`,{className:t(`text-sm tabular-nums`,i===`needs-you`?`text-needs-you`:`text-muted-foreground`),children:r}),a!==void 0&&(0,f.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:a})]}),o]}),m=({children:e})=>(0,f.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e}),h=c(a),g=({item:e,run:t})=>{let n=e?.number??i(s(r(o(t),({itemKey:e})=>h(e)),([,,e])=>e));return(0,f.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,f.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground tabular-nums`,children:n===void 0?`Run ${t?.id.slice(0,8)??``}`:`#${n}`}),(0,f.jsx)(`span`,{className:`truncate font-medium`,title:e?.title,children:e?.title??``})]})},_=({run:t,children:n})=>(0,f.jsx)(e,{to:`/projects/$owner/$name/runs/$run`,params:{...u(t.repository),run:t.id},onClick:e=>e.stopPropagation(),className:`block min-w-0 rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:n}),v=({run:e,className:n,children:r})=>{let i=l();return(0,f.jsx)(d,{className:t(e===null?`hover:bg-transparent`:`cursor-pointer hover:bg-muted/60 has-[a:focus-visible]:bg-muted/60`,n),onClick:e===null?void 0:()=>void i({to:`/projects/$owner/$name/runs/$run`,params:{...u(e.repository),run:e.id}}),children:r})};export{v as a,_ as i,m as n,g as r,p as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e,lt as t}from"./button-C4yvcSko.js";import{D as n,E as r,J as i,M as a,T as o,Y as s,j as c,w as l}from"./index-BljdfRBm.js";import{o as u}from"./table-B6NH8hTW.js";import{r as d}from"./status-badge-CNlyvwWL.js";var f=t(),p=({title:e,counts:t,marks:n,file:r,actions:o,children:l})=>(0,f.jsxs)(i,{width:`full`,children:[(0,f.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,f.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,f.jsx)(s,{title:e,counts:t,children:n}),r!==void 0&&(0,f.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:r})]}),(0,f.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o,(0,f.jsx)(c,{})]})]}),(0,f.jsx)(a,{}),l]}),m=({facts:e,children:t})=>(0,f.jsxs)(`div`,{className:`grid gap-x-10 gap-y-8 pt-2 lg:grid-cols-[minmax(0,1fr)_21rem]`,children:[(0,f.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8 max-lg:order-2`,children:t}),(0,f.jsx)(`aside`,{className:`min-w-0 max-lg:order-1 lg:border-l lg:pl-6`,children:e})]}),h=({title:e,aside:t,children:n})=>(0,f.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,f.jsxs)(`header`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,f.jsx)(`h2`,{className:`text-md font-semibold`,children:e}),t!==void 0&&(0,f.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),n]}),g=({children:e})=>(0,f.jsx)(`dl`,{className:`grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-3 gap-y-3 text-sm`,children:e}),_=({label:e,children:t})=>(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,f.jsx)(`dd`,{className:`min-w-0 wrap-anywhere`,children:t})]}),v=({children:e})=>(0,f.jsx)(`span`,{className:`text-muted-foreground`,children:e}),y=({entries:t,className:n})=>(0,f.jsx)(`dl`,{className:e(`grid grid-cols-[max-content_minmax(0,1fr)] gap-x-4 gap-y-1.5 rounded-lg bg-card px-3 py-2.5 font-mono text-xs [font-variant-ligatures:none] ring-1 ring-border`,n),children:t.map(([e,t])=>(0,f.jsxs)(`div`,{className:`contents`,children:[(0,f.jsxs)(`dt`,{className:`text-muted-foreground`,children:[e,`:`]}),(0,f.jsx)(`dd`,{className:`whitespace-pre-wrap text-foreground wrap-anywhere`,children:t})]},e))}),b=({open:e,children:t})=>(0,f.jsx)(u,{className:`cursor-pointer hover:bg-muted/60 has-[a:focus-visible]:bg-muted/60`,onClick:e,children:t}),x=`rounded-sm font-medium whitespace-nowrap outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,S=()=>(0,f.jsx)(d,{state:`Failed`,label:`Not loaded`}),C=({title:e,children:t})=>(0,f.jsx)(l,{className:`items-start p-0 py-6 text-left`,children:(0,f.jsxs)(r,{className:`items-start`,children:[(0,f.jsx)(n,{className:`text-md font-semibold tracking-normal`,children:e}),(0,f.jsx)(o,{className:`text-sm text-muted-foreground`,children:t})]})});export{g as a,S as c,x as d,_ as i,b as l,m as n,y as o,h as r,C as s,p as t,v as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lt as e}from"./button-C4yvcSko.js";var t=e(),n=`relative hover:bg-muted/60 has-[a[data-row-link]:focus-visible]:bg-muted/60`,r=`rounded-sm outline-none after:absolute after:inset-0 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,i=({id:e,title:n,count:r})=>(0,t.jsxs)(`h2`,{id:e,className:`flex items-baseline gap-2`,children:[(0,t.jsx)(`span`,{className:`text-lg font-semibold`,children:n}),(0,t.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:r})]}),a=({title:e,children:n})=>(0,t.jsxs)(`div`,{className:`flex max-w-prose flex-col gap-1 border-t py-3`,children:[(0,t.jsx)(`p`,{className:`font-medium`,children:e}),(0,t.jsx)(`p`,{className:`text-muted-foreground`,children:n})]});export{r as i,i as n,n as r,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lt as e}from"./button-C4yvcSko.js";import{on as t}from"./operator-copy-DsM7LJx6.js";import{G as n}from"./index-BljdfRBm.js";import{t as r}from"./section-Cm-j3zHs.js";var i=e(),a=e=>(0,i.jsx)(`span`,{className:`text-muted-foreground`,children:e}),o=e=>(0,i.jsx)(`code`,{className:`font-mono text-xs`,children:e}),s=e=>[[`Polling`,[{key:`settings.poll_interval`,value:o(e.pollInterval),effect:`Seconds between the starts of two GitHub poll cycles.`}]],[`Attempts`,[{key:`settings.max_children`,value:o(e.maxChildren),effect:`Maximum child sessions per attempt. Starting one more fails the attempt.`},{key:`settings.max_attempt_minutes`,value:e.maxAttemptMinutes===null?a(`Not set`):o(e.maxAttemptMinutes),effect:e.maxAttemptMinutes===null?`No wall-clock ceiling.`:`Minutes an attempt may run before the runaway guard fails it.`},{key:`settings.max_attempt_tokens`,value:e.maxAttemptTokens===null?a(`Not set`):o(e.maxAttemptTokens),effect:e.maxAttemptTokens===null?`No token ceiling.`:`Tokens an attempt may use, parent and children combined, before the runaway guard fails it.`}]],[`Parent`,[{key:`settings.parent_model`,value:e.parentModel===null?a(`Not set`):o(e.parentModel),effect:e.parentModel===null?`Chosen by Pi unless the agent file sets parent_model.`:`Parent model when the agent file sets no parent_model.`},{key:`settings.parent_effort`,value:e.parentEffort===null?a(`Not set`):o(e.parentEffort),effect:e.parentEffort===null?`parent_effort from the agent file, or effort if it is not set.`:`Parent effort when the agent file sets no parent_effort.`}]],[`Operator`,[{key:`operator`,value:e.operator===null?a(`Not set`):o(e.operator),effect:e.operator===null?`Approvals from the UI record no approver; messages show as local operator.`:`The GitHub login recorded on approvals and messages from the UI, and the only login that can answer an ask on GitHub.`}]],[`Webhooks`,[{key:`webhooks.mode`,value:o(e.webhooks),effect:`Parsed and validated but not used: this version reads GitHub changes by polling only. A change applies after usine up restarts.`},...e.webhooksPublicUrl===null?[]:[{key:`webhooks.public_url`,value:o(e.webhooksPublicUrl),effect:`Where GitHub would deliver webhooks.`}]]]],c=({configuration:e})=>(0,i.jsx)(r,{title:`Settings`,children:(0,i.jsx)(`div`,{className:`flex max-w-4xl flex-col gap-8 pt-2`,children:s(e.settings).map(([e,t])=>(0,i.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,i.jsx)(`h2`,{className:`text-md font-semibold`,children:e}),(0,i.jsx)(`dl`,{className:`border-t`,children:t.map(({key:e,value:t,effect:n})=>(0,i.jsxs)(`div`,{className:`grid gap-x-6 gap-y-1 border-b py-3 sm:grid-cols-[16rem_minmax(0,1fr)]`,children:[(0,i.jsx)(`dt`,{className:`font-mono text-xs leading-5 text-muted-foreground`,children:e}),(0,i.jsxs)(`dd`,{className:`flex flex-col gap-0.5 wrap-anywhere`,children:[(0,i.jsx)(`span`,{children:t}),(0,i.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n})]})]},e))})]},e))})}),l=()=>{let{data:e}=t(n());return(0,i.jsx)(c,{configuration:e})};export{l as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as e,lt as t}from"./button-C4yvcSko.js";var n=t(),r=e=>{switch(e){case`Succeeded`:case`Merged`:case`clear`:case`live`:return`text-run-succeeded`;case`Running`:case`Pending`:case`Queued`:case`active`:return`text-run-active`;case`Waiting`:return`text-run-waiting`;case`needs-you`:return`text-needs-you`;case`Failed`:return`text-run-failed`;case`Canceled`:case`Closed`:case`paused`:return`text-run-canceled`;default:return`text-muted-foreground`}},i=({state:t,className:i})=>(0,n.jsx)(`span`,{"data-slot":`state-mark`,"aria-hidden":`true`,className:e(`inline-block size-1.5 shrink-0 rounded-full bg-current`,r(t),t===`Running`&&`animate-pulse motion-reduce:animate-none`,i)}),a=({state:e,label:t=e})=>(0,n.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-foreground`,children:[(0,n.jsx)(i,{state:e}),t]}),o=()=>(0,n.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-needs-you`,children:[(0,n.jsx)(i,{state:`needs-you`}),`Needs attention`]});export{i as n,a as r,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./rolldown-runtime-XKyaHtl9.js";import{k as e,lt as t,ut as n}from"./button-C4yvcSko.js";n();var r=t();function i({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:e(`w-full caption-bottom text-sm`,t),...n})})}function a({className:t,...n}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:e(`[&_tr]:border-b`,t),...n})}function o({className:t,...n}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:e(`[&_tr:last-child]:border-0`,t),...n})}function s({className:t,...n}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:e(`border-b transition-colors hover:bg-muted/40 has-aria-expanded:bg-muted/40 data-[state=selected]:bg-muted`,t),...n})}function c({className:t,...n}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:e(`h-9 px-2 text-left align-middle text-xs font-medium whitespace-nowrap text-muted-foreground [&:has([role=checkbox])]:pr-0`,t),...n})}function l({className:t,...n}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:e(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,t),...n})}export{a,c as i,o as n,s as o,l as r,i as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{M as t,U as n,b as r,k as i,lt as a,o,s,ut as c}from"./button-C4yvcSko.js";import{O as l,ct as u,j as d,k as f,l as p,on as m,t as h}from"./operator-copy-DsM7LJx6.js";import{n as g,t as _}from"./use-now-CcFZyFvf.js";import{Bt as v,D as y,O as b,R as x,Rt as S,S as C,T as w,X as T,_ as E,a as D,b as O,c as k,d as A,f as j,k as ee,l as M,o as te,p as N,s as ne,sn as re,st as ie,u as ae,ut as oe,v as se,y as ce}from"./useScrollLock-BOb01sL8.js";import{a as le,l as ue,n as de,o as fe,r as pe,s as me,t as he}from"./usePositioner-WErrA3Ah.js";import{$ as ge,J as _e,K as ve,Y as ye,n as be,ot as xe,q as Se}from"./index-BljdfRBm.js";import{a as Ce,i as P,n as we,o as F,r as I,t as Te}from"./table-B6NH8hTW.js";import{n as L}from"./status-badge-CNlyvwWL.js";import{n as Ee,r as De}from"./section-BBnBOk-U.js";import{S as Oe,_ as ke,a as Ae,b as je,f as Me,g as Ne,h as Pe,l as Fe,m as Ie,n as Le,p as Re,s as ze,t as Be,x as Ve,y as He}from"./copy-BM1l6IGB.js";import{t as Ue}from"./query-DWN8IHdt.js";import{t as We}from"./project-not-found-CQVclgb0.js";import{t as Ge}from"./usage-DPUTTLGs.js";import{i as Ke,r as qe}from"./section-DkBCDv4D.js";function R(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function Je(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function z(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push(Je(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:R(r,i,a,o)}}function B(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function V(e){return R(e.left,e.top,e.right,e.bottom)}function Ye(e,t,n){let{lines:r}=z(e.getClientRects());if(r.length<2)return;let i=B(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function Xe(e,t,n){let{lines:r,fallback:i}=z(e.getClientRects());if(r.length<2)return null;let a=n?.x,o=n?.y,s=t[0];if(n?.lineIndex!=null&&r[n.lineIndex])return V(r[n.lineIndex]);if(a!=null&&o!=null){let e=B(r,a,o);if(e!==-1)return V(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return R(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return R(l,f.top,u,p.bottom)}function Ze(e){return`contextElement`in e&&e.contextElement?e.contextElement:r(e)?e:void 0}function Qe(e,t){function n(t){H(e,t.currentTarget,t.clientX,t.clientY)}function r(e){t||n(e)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function H(e,t,n,r){let i=Ye(t,n,r);return e.current=i,i}function $e(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof n?.getClientRects!=`function`)return{};let r=Ze(n),i=e.current,a=i?.element===n||i?.element===r?i:void 0,o=Xe(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var U=e(c(),1),W=U.createContext(void 0);function G(e){let t=U.useContext(W);if(t===void 0&&!e)throw Error(o(50));return t}var et={...te,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay},tt=class extends ne{constructor(e,t,n){let r=new ae;super(nt(e,r,t,n),rt(r),et)}setOpen=(e,t)=>{let{inlineRectCoordsRef:n}=this.context;N(this,e,t,{onBeforeDispatch(){let r=t.event;e&&t.reason===`trigger-hover`&&t.trigger&&`clientX`in r&&`clientY`in r&&n.current?.element!==t.trigger&&H(n,t.trigger,r.clientX,r.clientY)}})}};function nt(e,t,n,r=!1){return{...D(t,n,r),instantType:void 0,adaptiveOrigin:void 0,closeDelay:300,...e}}function rt(e){return{popupRef:U.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}var K=a();function q(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:i,actionsRef:a,handle:o,triggerId:c,defaultTriggerId:l=null,children:u}=e,d=O((e,r)=>new tt({open:n,openProp:t,activeTriggerId:l,triggerIdProp:c},e,r));d.useControlledProp(`openProp`,t),d.useControlledProp(`triggerIdProp`,c),d.useContextCallback(`onOpenChange`,r),d.useContextCallback(`onOpenChangeComplete`,i);let f=d.useState(`open`),p=d.useState(`activeTriggerId`),m=d.useState(`mounted`),h=d.useState(`payload`);E(d,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:g}=se(f,d,()=>{d.context.inlineRectCoordsRef.current=void 0});s(()=>{f&&(p??d.set(`payload`,void 0))},[d,p,f]),U.useImperativeHandle(a,()=>({unmount:g,close:()=>d.setOpen(!1,ie(T))}),[g,d]);let _=f||m||o!=null;return(0,K.jsxs)(W.Provider,{value:d,children:[o&&(0,K.jsx)(j,{handle:o,store:d}),_&&(0,K.jsx)(it,{store:d}),typeof u==`function`?u({payload:h}):u]})}function it({store:e}){let t=e.useState(`floatingRootContext`),n=w(t);return ce(e,{activeTriggerProps:n.reference,inactiveTriggerProps:n.trigger,popupProps:n.floating}),null}var at=k(function(e){return G(!0)?(0,K.jsx)(q,{...e}):(0,K.jsx)(b,{children:(0,K.jsx)(q,{...e})})}),J=U.createContext(void 0);function ot(){let e=U.useContext(J);if(e===void 0)throw Error(o(48));return e}var st=U.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return G().useState(`mounted`)||n?(0,K.jsx)(J.Provider,{value:n,children:(0,K.jsx)(ge,{ref:t,...r})}):null}),ct=M(function(e,n){let{render:r,className:i,delay:a,closeDelay:s,id:c,payload:l,handle:u,style:d,...f}=e,p=G(!0),m=ue(u)??p;if(!m)throw Error(o(89));let h=re(c),g=m.useState(`isTriggerActive`,h),_=m.useState(`isOpenedByTrigger`,h),y=m.useState(`floatingRootContext`),b=m.context.inlineRectCoordsRef,x=U.useRef(null),S=a??600,w=s??300,{registerTrigger:T,isMountedByThisTrigger:E}=C(h,x,m,{payload:l,closeDelay:w}),D=fe(y,{mouseOnly:!0,move:!1,handleClose:le(),delay:()=>({open:S,close:w}),triggerElementRef:x,isActiveTrigger:g,isClosing:()=>m.select(`transitionStatus`)===`ending`}),O=xe(y,{delay:S}),k={open:_},A=m.useState(`triggerProps`,E),j=Qe(b,_);return t(`a`,e,{state:k,ref:[n,T,x],props:[D,O.reference,A,j,{id:h},f],stateAttributesMapping:v})}),Y=U.createContext(void 0);function lt(){let e=U.useContext(Y);if(e===void 0)throw Error(o(49));return e}var ut=U.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:c=`center`,sideOffset:l=0,alignOffset:u=0,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f=5,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:h=!1,collisionAvoidance:g=x,style:_,...v}=e,b=G(),S=ot(),C=ee(),w=b.useState(`open`),T=b.useState(`mounted`),E=b.useState(`floatingRootContext`),D=b.useState(`instantType`),O=b.useState(`transitionStatus`),k=b.useState(`adaptiveOrigin`),A=b.context.inlineRectCoordsRef,j=pe({anchor:i,floatingRootContext:E,positionMethod:a,mounted:T,side:o,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:S,nodeId:C,collisionAvoidance:g,adaptiveOrigin:k,inline:$e(A)}),M=j.update;s(()=>{w&&T&&M()},[w,T,M]);let te={open:w,side:j.side,align:j.align,anchorHidden:j.anchorHidden,instant:D},N=he(e,te,{styles:j.positionerStyles,transitionStatus:O,props:v,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!T,inert:!w});return(0,K.jsx)(Y.Provider,{value:j,children:(0,K.jsx)(y,{id:C,children:N})})}),dt=U.forwardRef(function(e,n){let{className:r,render:i,style:a,...o}=e,s=G(),{side:c,align:l}=lt(),u=s.useState(`open`),d=s.useState(`instantType`),f=s.useState(`transitionStatus`),p=s.useState(`popupProps`),m=s.useState(`floatingRootContext`),h=s.useState(`closeDelay`);return oe({open:u,ref:s.context.popupRef,onComplete(){u&&s.context.onOpenChangeComplete?.(!0)}}),me(m,{closeDelay:h}),t(`div`,e,{state:{open:u,side:c,align:l,instant:d,transitionStatus:f},ref:[n,s.context.popupRef,s.useStateSetter(`popupElement`)],props:[A,p,de(f),o],stateAttributesMapping:S})});function ft({...e}){return(0,K.jsx)(at,{"data-slot":`hover-card`,...e})}function pt({...e}){return(0,K.jsx)(ct,{"data-slot":`hover-card-trigger`,...e})}function mt({className:e,side:t=`bottom`,sideOffset:n=4,align:r=`center`,alignOffset:a=4,...o}){return(0,K.jsx)(st,{"data-slot":`hover-card-portal`,children:(0,K.jsx)(ut,{align:r,alignOffset:a,side:t,sideOffset:n,className:`isolate z-50`,children:(0,K.jsx)(dt,{"data-slot":`hover-card-content`,className:i(`z-50 w-72 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-xs/relaxed text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}var ht=`relative z-10 rounded-sm font-mono text-xs text-primary underline-offset-4 outline-none hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,X=`hidden @5xl:table-cell`,Z=`hidden @4xl:table-cell`,gt=[`@md:[--side:clamp(7rem,calc((100cqw-26rem-var(--rest))/var(--sides)),13rem)]`,`[--rest:7rem] [--sides:1] @4xl:[--rest:16.5rem] @5xl:[--rest:23rem] @5xl:[--sides:2]`].join(` `),_t=`py-3 align-top whitespace-normal`,Q=`@md:w-max @md:max-w-(--side)`,$=`py-3 text-right align-top font-mono text-xs/5 whitespace-nowrap tabular-nums`,vt=`relative z-10 rounded-sm underline-offset-4 outline-none hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,yt=({reason:e})=>u(e,{AwaitingApproval:()=>`Waiting`,SuppressedForOperator:()=>`needs-you`,CycleBudgetUsedUp:()=>`needs-you`,RunFailed:()=>`Failed`,ClosedUnchanged:({run:e})=>e.state,LoopPaused:()=>`paused`,QueuedForWorker:({run:e})=>e.state,AwaitingPoll:()=>`Pending`}),bt=({task:e,last:t,status:n},r)=>{let i=Fe(t),a=e=>({state:yt(e),words:`${t.loop!==e.loop&&!Be(e)?`${e.loop} `:``}${Le(e,r)}`,at:null});return u(n,{Running:({run:e})=>({state:`Running`,words:`Running ${e.loop}`,at:i}),AwaitingApproval:()=>({state:`Waiting`,words:`Waiting for approval`,at:i}),Queued:({run:e})=>({state:e.state,words:e.state,at:i}),Stalled:({stall:e})=>a(e),Idle:({stall:e})=>a(e),NeedsAttention:()=>({state:`needs-you`,words:`Needs attention`,at:i}),Done:()=>({state:ze(e.state),words:`Done`,at:i}),Ended:({run:e})=>({state:e.state,words:e.state,at:i})})},xt=({row:e,now:t})=>{let{state:n,words:r,at:a}=bt(e,t);return(0,K.jsxs)(`span`,{className:i(`flex items-start gap-1.5 text-xs/5 font-medium`,Q),children:[(0,K.jsx)(L,{state:n,className:`mt-1.75`}),(0,K.jsxs)(`span`,{className:`min-w-0 wrap-break-word`,children:[r,a!==null&&(0,K.jsxs)(K.Fragment,{children:[` `,(0,K.jsxs)(`span`,{className:`font-normal whitespace-nowrap text-muted-foreground`,children:[`·`,` `,(0,K.jsx)(`time`,{dateTime:a,title:l(a),className:`font-mono tabular-nums`,children:h(a,t)})]})]})]})]})},St=({task:e})=>{let t=Ie(e);return(0,K.jsxs)(`span`,{className:i(`flex items-baseline gap-2`,Q),children:[(0,K.jsx)(`span`,{className:`truncate`,title:t.map(({loop:e})=>e).join(` · `),children:t.map(({loop:e,state:t},n)=>(0,K.jsxs)(U.Fragment,{children:[n>0&&(0,K.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,K.jsx)(L,{state:t,className:`mr-1.5 align-middle`}),e,(0,K.jsxs)(`span`,{className:`sr-only`,children:[` `,t]})]},e))}),(0,K.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground tabular-nums`,children:e.runs.length})]})},Ct=()=>(0,K.jsx)(`span`,{className:`absolute left-full text-muted-foreground`,children:`*`}),wt=({task:e,now:t})=>{let{usage:n}=e;if(e.runs.every(({attempts:e})=>e.length===0))return null;let r=n.unmeasured>0;return(0,K.jsxs)(`span`,{className:`relative`,title:r?Oe:`Total attempt time`,children:[p(Re(n,t)),r&&(0,K.jsx)(Ct,{})]})},Tt=({usage:e,label:t,note:n,children:r})=>(0,K.jsxs)(ft,{children:[(0,K.jsx)(pt,{delay:200,"aria-label":t,render:(0,K.jsx)(`button`,{type:`button`,className:vt}),children:r}),(0,K.jsxs)(mt,{align:`end`,className:`w-[26rem] max-w-[calc(100vw-2rem)] p-3 font-sans text-xs shadow-raised`,children:[n!==null&&(0,K.jsxs)(`p`,{className:`pb-2 text-muted-foreground`,children:[n,`.`]}),(0,K.jsx)(Ge,{pools:e.pools})]})]}),Et=({usage:e})=>{if(e.cost===null)return null;let t=Ae(e),n=d(e.cost.usd);return(0,K.jsxs)(Tt,{usage:e,label:`Estimated cost: ${t?`at least `:``}${n}. Show per pool`,note:t?Ve:null,children:[n,t&&(0,K.jsx)(Ct,{})]})},Dt=({pullRequest:e})=>(0,K.jsxs)(`span`,{className:`inline-flex items-baseline gap-1.5`,children:[(0,K.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,className:ht,children:[`#`,e.number]}),(0,K.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.state===`pr-merged`?`merged`:`open`})]}),Ot=({row:e,repository:t,now:r})=>(0,K.jsxs)(F,{className:qe,children:[(0,K.jsx)(I,{className:`w-full max-w-0 py-3 align-top`,children:(0,K.jsx)(n,{"data-row-link":!0,to:`/projects/$owner/$name/tasks/$number`,params:{...Se(t),number:Pe(e.task)},className:i(`block min-w-0`,Ke),children:(0,K.jsx)(De,{item:Ne(e.task)})})}),(0,K.jsx)(I,{className:_t,children:(0,K.jsx)(xt,{row:e,now:r})}),(0,K.jsx)(I,{className:i(`py-3 align-top`,X),children:(0,K.jsx)(St,{task:e.task})}),(0,K.jsx)(I,{className:i(`py-3 text-right align-top`,X),children:e.task.pullRequest!==null&&(0,K.jsx)(Dt,{pullRequest:e.task.pullRequest})}),(0,K.jsx)(I,{className:$,children:(0,K.jsx)(wt,{task:e.task,now:r})}),(0,K.jsx)(I,{className:i($,Z),children:e.task.usage.pools.length>0&&(0,K.jsx)(Tt,{usage:e.task.usage,label:`Tokens: ${f(e.task.usage.tokens)}. Show per pool`,note:null,children:f(e.task.usage.tokens)})}),(0,K.jsx)(I,{className:i($,Z),children:(0,K.jsx)(Et,{usage:e.task.usage})})]}),kt=({totals:e})=>(0,K.jsx)(`p`,{className:`-mt-2 text-sm text-muted-foreground tabular-nums`,children:je(e).map(({figure:e,words:t,lowerBound:n},r)=>(0,K.jsxs)(U.Fragment,{children:[r>0&&`, `,n===null?e:(0,K.jsx)(`span`,{title:n,children:`${e}*`}),` `,t]},t))}),At=({project:e,stalled:t})=>{let n=_(3e4),r=ke(e.board.lanes,t);return(0,K.jsxs)(_e,{width:`full`,children:[(0,K.jsx)(ye,{title:`Tasks`,counts:Me(r)}),r.length===0?(0,K.jsx)(Ee,{children:`No runs yet`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(kt,{totals:He(r,n)}),(0,K.jsx)(`div`,{className:`@container -mx-2`,children:(0,K.jsxs)(Te,{"aria-label":`${e.repository} tasks`,className:gt,children:[(0,K.jsx)(Ce,{children:(0,K.jsxs)(F,{className:`hover:bg-transparent`,children:[(0,K.jsx)(P,{children:`Task`}),(0,K.jsx)(P,{children:`Status`}),(0,K.jsx)(P,{className:X,children:`Runs`}),(0,K.jsx)(P,{className:i(`text-right`,X),children:`Pull request`}),(0,K.jsx)(P,{className:`text-right`,children:`Elapsed time`}),(0,K.jsx)(P,{className:i(`text-right`,Z),children:`Tokens`}),(0,K.jsx)(P,{className:i(`text-right`,Z),children:`Estimated cost`})]})}),(0,K.jsx)(we,{children:r.map(t=>(0,K.jsx)(Ot,{row:t,repository:e.repository,now:n},t.task.itemKey))})]})})]})]})},jt=()=>{let{repository:e}=be.useParams(),{data:t}=m(ve()),n=g(Ue()),r=t.projects.find(t=>t.repository===e);return r===void 0?(0,K.jsx)(We,{}):(0,K.jsx)(At,{project:r,stalled:n.data?.notMoving??[]})};export{jt as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{M as t,c as n,k as r,lt as i,o as a,r as o,ut as s,x as c}from"./button-C4yvcSko.js";import{j as l,k as u,v as d}from"./operator-copy-DsM7LJx6.js";import{Bt as f,D as p,E as m,F as h,N as g,O as _,R as v,Rt as y,S as b,T as x,V as S,X as C,_ as w,a as T,at as E,b as D,c as O,d as k,f as A,g as j,h as M,i as N,k as P,l as F,ln as I,m as L,mt as R,n as z,o as B,r as ee,s as V,sn as te,st as H,u as ne,ut as re,v as U,x as ie,y as ae,zt as oe}from"./useScrollLock-BOb01sL8.js";import{a as se,l as ce,n as le,o as ue,r as de,s as fe,t as pe}from"./usePositioner-WErrA3Ah.js";import{i as me,n as he,o as ge,r as _e,s as ve,t as ye}from"./useTriggerFocusGuards-B0FItfLc.js";var W=e(s(),1),G=W.createContext(void 0);function K(e){let t=W.useContext(G);if(t===void 0&&!e)throw Error(a(47));return t}var be=e(I(),1),xe={...B,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!B.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&B.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>B.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},Se=class extends V{constructor(e,t,n){let r=new ne;super(Ce(e,r,t,n),we(r),xe)}setOpen=(e,t)=>{let n=t.reason===E,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),a=L(t),o=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&o!=null&&(t.trigger=this.context.triggerElements.getById(o)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let s=()=>{let n=j(this.state,e,t.trigger,a());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),be.flushSync(s)):s();let c;r?c=`click`:i?c=`dismiss`:t.reason===`focus-out`&&(c=`focus`),this.set(`instantType`,c)}};function Ce(e,t,n,r=!1){let i={...T(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function we(e){return{popupRef:W.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:W.createRef(),beforeTriggerFocusGuardRef:W.createRef(),beforeContentFocusGuardRef:W.createRef(),stickIfOpenTimeout:new R,stickIfOpen:!0,triggerElements:e}}var q=i(),J=O(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,modal:o=!1,handle:s,triggerId:c,defaultTriggerId:l=null}=e,u=Ee(s,{modal:o,open:r,openProp:n,activeTriggerId:l,triggerIdProp:c});u.useControlledProp(`openProp`,n),u.useControlledProp(`triggerIdProp`,c);let d=u.useState(`open`),f=u.useState(`mounted`),p=u.useState(`payload`);u.useContextCallback(`onOpenChange`,i),u.useContextCallback(`onOpenChangeComplete`,a),ie(u,d),w(u);let{forceUnmount:m}=U(d,u,()=>{u.context.stickIfOpen=!0,u.set(`openChangeReason`,null)});u.useSyncedValues({modal:o}),W.useEffect(()=>{d||u.context.stickIfOpenTimeout.clear()},[u,d]),W.useImperativeHandle(e.actionsRef,()=>({unmount:m,close:()=>u.setOpen(!1,H(C))}),[m,u]);let h=d||f||s!=null;return(0,q.jsxs)(G.Provider,{value:u,children:[s&&(0,q.jsx)(A,{handle:s,store:u}),h&&(0,q.jsx)(De,{store:u,modal:o}),typeof t==`function`?t({payload:p}):t]})});function Te(e){return K(!0)?(0,q.jsx)(J,{props:e}):(0,q.jsx)(_,{children:(0,q.jsx)(J,{props:e})})}function Ee(e,t){let n=D((e,n)=>new Se(t,e,n));return W.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function De({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=x(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return ae(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}var Oe=F(function(e,r){let{render:i,className:s,style:c,disabled:l=!1,nativeButton:u=!0,handle:d,payload:p,openOnHover:m=!1,delay:g=300,closeDelay:_=0,id:v,...y}=e,x=K(!0),C=ce(d)??x;if(!C)throw Error(a(74));let w=te(v),T=C.useState(`isTriggerActive`,w),E=C.useState(`floatingRootContext`),D=C.useState(`isOpenedByTrigger`,w),O=C.useState(`triggerPopupId`,w),k=W.useRef(null),{registerTrigger:A,isMountedByThisTrigger:j}=b(w,k,C,{payload:p,disabled:l,openOnHover:m,closeDelay:_}),M=C.useState(`isPressOpenedByTrigger`,w),N=C.useState(`isTouchPressOpen`,m),P=C.useState(`hasTriggerFocusGuards`,w),F=ue(E,{enabled:!l&&m&&!N,mouseOnly:!0,move:!1,handleClose:se(),restMs:g,delay:{close:_},triggerElementRef:k,isActiveTrigger:T,isClosing:()=>C.select(`transitionStatus`)===`ending`}),I=n(()=>C.context.stickIfOpen),L=ve(E,{stickIfOpen:I}),R=ge(()=>C.select(`open`),e=>{C.set(`openMethod`,e)}),z=C.useState(`triggerProps`,j),{getButtonProps:B,buttonRef:ee}=o({disabled:l,native:u}),V={open(e){return M?oe.open(e):f.open(e)}},{handlePreFocusGuardFocus:H,handleFocusTargetFocus:ne}=ye(C,k),re=t(`button`,e,{state:{disabled:l,open:D},ref:[ee,r,A,k],props:[L.reference,F,z,R,{[h]:``,id:w,"aria-haspopup":`dialog`,"aria-expanded":D,"aria-controls":O},y,B],stateAttributesMapping:V}),U=(0,q.jsx)(W.Fragment,{children:re},w);return P?(0,q.jsxs)(W.Fragment,{children:[(0,q.jsx)(S,{ref:C.context.beforeTriggerFocusGuardRef,onFocus:H}),U,(0,q.jsx)(S,{ref:C.context.triggerFocusTargetRef,onFocus:ne})]}):U}),Y=W.createContext(void 0);function ke(){let e=W.useContext(Y);if(e===void 0)throw Error(a(45));return e}var Ae=W.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return K().useState(`mounted`)||n?(0,q.jsx)(Y.Provider,{value:n,children:(0,q.jsx)(g,{ref:t,...r})}):null}),X=W.createContext(void 0);function je(){let e=W.useContext(X);if(!e)throw Error(a(46));return e}var Me=W.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:m,sticky:h,disableAnchorTracking:g=!1,collisionAvoidance:_=v,...y}=e,b=K(),x=ke(),S=P(),C=b.useState(`floatingRootContext`),w=b.useState(`mounted`),T=b.useState(`open`),E=b.useState(`openChangeReason`),D=b.useState(`activeTriggerElement`),O=b.useState(`modal`),k=b.useState(`openMethod`),A=b.useState(`positionerElement`),j=b.useState(`instantType`),M=b.useState(`transitionStatus`),N=b.useState(`adaptiveOrigin`),F=de({anchor:a,floatingRootContext:C,positionMethod:o,mounted:w,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:m,collisionBoundary:d,collisionPadding:f,sticky:h,disableAnchorTracking:g,keepMounted:x,nodeId:S,collisionAvoidance:_,adaptiveOrigin:N}),I=C.useState(`domReferenceElement`);_e({store:b,domReference:I,positionerElement:A,open:T});let L=O===!0&&E!==`trigger-hover`;he(T&&L,k===`touch`,A,D);let R=b.useStateSetter(`positionerElement`),B={open:T,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:j},V=pe(e,B,{styles:F.positionerStyles,transitionStatus:M,props:y,refs:[t,R],hidden:!w,inert:!T});return(0,q.jsxs)(X.Provider,{value:F,children:[w&&L&&(0,q.jsx)(z,{inert:ee(!T),cutout:D}),(0,q.jsx)(p,{id:S,children:V})]})}),Ne=W.createContext(void 0);function Pe(){let[e,t]=W.useState(0),r=n(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:W.useMemo(()=>({register:r}),[r]),hasClosePart:e>0}}var Fe=W.forwardRef(function(e,n){let{render:r,className:i,style:a,initialFocus:o,finalFocus:s,...l}=e,u=K(),d=je(),f=me(!0)!=null,{context:p,hasClosePart:h}=Pe(),g=u.useState(`open`),_=u.useState(`openMethod`),v=u.useState(`instantType`),b=u.useState(`transitionStatus`),x=u.useState(`popupProps`),S=u.useState(`titleElementId`),C=u.useState(`descriptionElementId`),w=u.useState(`modal`),T=u.useState(`mounted`),E=u.useState(`openChangeReason`),D=u.useState(`activeTriggerElement`),O=u.useState(`floatingRootContext`),A=O.useState(`floatingId`),j=u.useState(`disabled`),P=u.useState(`openOnHover`),F=u.useState(`closeDelay`);re({open:g,ref:u.context.popupRef,onComplete(){g&&u.context.onOpenChangeComplete?.(!0)}}),fe(O,{enabled:P&&!j,closeDelay:F});let I=o===void 0?M(u.context.popupRef):o,L=w!==!1&&h;u.useSyncedValue(`focusManagerModal`,L);let R=u.useStateSetter(`popupElement`),z={open:g,side:d.side,align:d.align,instant:v,transitionStatus:b},B=t(`div`,e,{state:z,ref:[n,u.context.popupRef,R],props:[x,{id:A,role:`dialog`,...k,"aria-labelledby":S,"aria-describedby":C,onKeyDown(e){f&&N.has(e.key)&&e.stopPropagation()}},le(b),l],stateAttributesMapping:y});return(0,q.jsx)(m,{context:O,openInteractionType:_,modal:L,disabled:!T||E===`trigger-hover`,initialFocus:I,returnFocus:s,restoreFocus:`popup`,getInsideElements:()=>[u.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:c(D)?D:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:(0,q.jsx)(Ne.Provider,{value:p,children:B})})});function Ie({...e}){return(0,q.jsx)(Te,{"data-slot":`popover`,...e})}function Z({...e}){return(0,q.jsx)(Oe,{"data-slot":`popover-trigger`,...e})}function Le({className:e,align:t=`center`,alignOffset:n=0,side:i=`bottom`,sideOffset:a=4,...o}){return(0,q.jsx)(Ae,{children:(0,q.jsx)(Me,{align:t,alignOffset:n,side:i,sideOffset:a,className:`isolate z-50`,children:(0,q.jsx)(Fe,{"data-slot":`popover-content`,className:r(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-lg bg-popover p-2.5 text-xs text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...o})})})}var Q=new Intl.NumberFormat(`en`),Re=({cost:e})=>e===null?null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`span`,{className:`font-mono text-foreground tabular-nums`,children:l(e.usd)}),e.estimate&&(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` estimate`})]}),ze=({session:e})=>e._tag===`ParentSession`?`Parent`:e.agent,Be=`grid grid-cols-[minmax(0,1fr)_auto_7rem] items-baseline gap-x-3 py-0.5`,Ve=`grid grid-cols-[minmax(0,1fr)_auto_10rem] items-baseline gap-x-3 py-0.5`,He=e=>`unpriced`in e&&e.unpriced,$=({pools:e})=>{let t=e.some(e=>He(e)&&e.cost!==null);return(0,q.jsxs)(`section`,{"aria-label":`Tokens per pool`,children:[(0,q.jsx)(`h2`,{className:`pb-1 text-sm font-medium text-foreground`,children:`Tokens per pool`}),e.map(e=>(0,q.jsxs)(`div`,{className:t?Ve:Be,children:[(0,q.jsx)(`span`,{className:`truncate text-foreground`,children:d(e.pool)}),(0,q.jsx)(`span`,{className:`text-right font-mono text-foreground tabular-nums`,children:Q.format(e.tokens)}),(0,q.jsx)(`span`,{className:`text-right`,children:e.pool===`chatgptPlan`?(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`No dollar rate`}):(0,q.jsxs)(q.Fragment,{children:[He(e)&&e.cost!==null&&(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:`at least `}),(0,q.jsx)(Re,{cost:e.cost})]})})]},e.pool))]})},Ue=({usage:e,attempts:t})=>(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)($,{pools:e.pools}),(0,q.jsxs)(`section`,{"aria-label":`Tokens per session`,className:`border-t pt-2.5`,children:[(0,q.jsx)(`h2`,{className:`pb-1 text-sm font-medium text-foreground`,children:`Tokens per session`}),t.map(t=>{let n=e.sessions.filter(({attemptId:e})=>e===t.id);return n.length===0?null:(0,q.jsxs)(`div`,{className:`pb-1`,children:[(0,q.jsxs)(`h3`,{className:`pt-1 text-muted-foreground`,children:[`Attempt `,t.number]}),n.map(e=>(0,q.jsxs)(`div`,{className:Be,children:[(0,q.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,q.jsx)(`span`,{className:`shrink-0 text-foreground`,children:ze(e)}),(0,q.jsx)(`span`,{className:`truncate font-mono text-muted-foreground`,children:e.session.brain.model})]}),(0,q.jsx)(`span`,{className:`text-right font-mono text-foreground tabular-nums`,children:Q.format(e.tokens)}),(0,q.jsx)(`span`,{className:`text-right`,children:(0,q.jsx)(Re,{cost:e.cost})})]},e.session.id))]},t.id)})]}),(0,q.jsx)(`p`,{className:`text-muted-foreground`,children:`Tokens are output and uncached input. Dollars are the price each harness reports.`})]}),We=({usage:e,attempts:t})=>(0,q.jsxs)(`span`,{className:`inline-flex items-baseline gap-1.5`,children:[`Tokens`,(0,q.jsxs)(Ie,{children:[(0,q.jsx)(Z,{"aria-label":`Tokens: ${Q.format(e.tokens)}. Show per pool and session`,className:`rounded-sm font-mono text-xs text-primary tabular-nums underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring/70`,children:u(e.tokens)}),(0,q.jsx)(Le,{align:`start`,className:`w-[26rem] max-w-[calc(100vw-2rem)] gap-3 p-3 text-xs shadow-raised`,children:(0,q.jsx)(Ue,{usage:e,attempts:t})})]})]});export{Z as a,Le as i,We as n,Ie as r,$ as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ut as t}from"./button-C4yvcSko.js";import{cn as n,sn as r}from"./operator-copy-DsM7LJx6.js";function i(e,t){return r(e,n,t)}var a=e(t(),1),o=e=>{let[t,n]=(0,a.useState)(Date.now);return(0,a.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t};export{i as n,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{K as t,ut as n}from"./button-C4yvcSko.js";import{n as r}from"./utils-BEQKLGgi.js";var i=e(n(),1);function a(e){let n=t();return i.useCallback(t=>n.navigate({...t,from:t.from??e?.from}),[e?.from,n])}function o(e){let n=t(),o=a(),s=i.useRef(null);return r(()=>{s.current!==e&&(o(e),s.current=e)},[n,e,o]),null}export{a as n,o as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{D as t,E as n,F as r,I as i,M as a,O as o,S as s,_ as c,b as l,c as u,d,f,g as p,h as m,m as h,p as g,s as _,u as v,ut as y,v as b,w as x,x as S,y as C,z as w}from"./button-C4yvcSko.js";import{n as T}from"./with-selector-NsM_5qXG.js";import{$t as E,A as D,H as O,I as k,Lt as A,Mt as j,Tt as M,U as N,W as P,at as F,cn as ee,en as I,gt as L,ht as R,j as te,jt as ne,kt as re,ln as ie,mt as ae,st as z,tn as oe}from"./useScrollLock-BOb01sL8.js";var B=e(y(),1),V=T(),se=e(ie(),1),ce=Math.min,H=Math.max,le=Math.round,ue=Math.floor,U=e=>({x:e,y:e}),de={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function fe(e,t,n){return H(e,ce(t,n))}function W(e,t){return typeof e==`function`?e(t):e}function G(e){return e.split(`-`)[0]}function K(e){return e.split(`-`)[1]}function pe(e){return e===`x`?`y`:`x`}function q(e){return e===`y`?`height`:`width`}function J(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function me(e){return pe(J(e))}function he(e,t,n){n===void 0&&(n=!1);let r=K(e),i=me(e),a=q(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=X(o)),[o,X(o)]}function ge(e){let t=X(e);return[_e(e),t,_e(t)]}function _e(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var ve=[`left`,`right`],Y=[`right`,`left`],ye=[`top`,`bottom`],be=[`bottom`,`top`];function xe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Y:ve:t?ve:Y;case`left`:case`right`:return t?ye:be;default:return[]}}function Se(e,t,n,r){let i=K(e),a=xe(G(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(_e)))),a}function X(e){let t=G(e);return de[t]+e.slice(t.length)}function Ce(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function we(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ce(e)}function Z(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Te(e,t){return t!=null&&!M(t)?0:typeof e==`function`?e():e}function Ee(e,t,n){let r=Te(e,n);return typeof r==`number`?r:r?.[t]}function De(e){return typeof e==`function`?e():e}function Oe(e,t){return t||e===`click`||e===`mousedown`}function ke(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Ae(e){let t=B.useCallback(t=>e===void 0?i:e.subscribeStore(t),[e]),n=B.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,V.useSyncExternalStore)(t,n,()=>e?.serverStore)}var je=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new ae;restTimeout=new ae;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Me=new WeakMap;function Q(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Me.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Me.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ne(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Me.get(n);a&&a!==e&&Q(a),Q(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Me.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function Pe(e){let t=e.context.dataRef.current,n=w(()=>t.hoverInteractionState??je.create()).current;return t.hoverInteractionState||=n,L(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Fe(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,d=te(),f=D(),p=Pe(e),m=R(),h=u(()=>Oe(c.current.openEvent?.type,p.interactedInside)),g=u(()=>ke(c.current.openEvent?.type)),v=u(()=>{Q(p)});_(()=>{a||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,v())},[a,p,v]),B.useEffect(()=>v,[v]),_(()=>{if(n&&a&&p.handleCloseOptions?.blockPointerEvents&&g()&&l(s)&&o){let e=s,t=o,n=ee(o),r=d?.nodesRef.current.find(e=>e.id===f)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=p.pointerEventsScopeElement===t?null:p.pointerEventsScopeElement,a=r===t?null:r,c=p.handleCloseOptions?.getScope?.()??i??a??E(e,`[data-rootownerid]`)??n.body;return Ne(p,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{v()}}},[n,a,s,o,p,g,d,f,v]),B.useEffect(()=>{if(!n)return;function t(){return!!(d&&f&&re(d.nodesRef.current,f).length>0)}function a(t){let n=Ee(r,`close`,p.pointerType),i=()=>{e.setOpen(!1,z(F,t)),d?.events.emit(`floating.closed`,t)};n?p.openChangeTimeout.start(n,i):(p.openChangeTimeout.clear(),i())}function s(e){let t=oe(e);ne(t)?p.interactedInside=E(t,`[aria-haspopup]`)!=null:p.interactedInside=!1}function u(){p.openChangeTimeout.clear(),m.clear(),d?.events.off(`floating.closed`,y),v()}function _(n){if(t()&&d){d.events.on(`floating.closed`,y);return}if(j(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;d&&r&&l(o)&&re(d.nodesRef.current,r,!1).some(e=>I(e.context?.elements.floating,o))||(p.handler?p.handler(n):(v(),g()&&!h()&&a(n)))}function y(n){d&&f&&!t()&&m.start(0,()=>{d.events.off(`floating.closed`,y),e.setOpen(!1,z(F,n)),d.events.emit(`floating.closed`,n)})}let b=o;return N(b&&P(b,`mouseenter`,u),b&&P(b,`mouseleave`,_),b&&P(b,`pointerdown`,s,!0),()=>{d?.events.off(`floating.closed`,y)})},[n,o,e,c,r,i,g,h,v,p,d,f,m])}var Ie={current:null};function Le(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Ie,externalTree:d,isActiveTrigger:f=!0,getHandleCloseContext:p,isClosing:m,shouldOpen:h,guardStaleOpen:g=!1}=t,{dataRef:_,events:v}=e.context,y=te(d),b=Pe(e),x=B.useRef(!1),S=O(i),C=O(r),w=O(o),T=O(n),E=O(h),D=O(m),k=u(()=>Oe(_.current.openEvent?.type,b.interactedInside)),A=u(()=>E.current?.()!==!1),L=u((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!I(t,n);if(!l(r))return!1;let a=r;return i.hasMatchingElement(e=>I(e,a))&&(!t||!I(t,a))}),R=u(()=>{b.handler&&=(ee(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,b.handler),void 0)}),ne=u(()=>{Q(b)});return f&&(b.handleCloseOptions=i?.__options),B.useEffect(()=>R,[R]),B.useEffect(()=>{if(!n)return;function e(e){e.open?x.current=!1:(x.current=e.reason===F,R(),b.openChangeTimeout.clear(),b.restTimeout.clear(),b.blockMouseMove=!0,b.restTimeoutPending=!1)}return v.on(`openchange`,e),()=>{v.off(`openchange`,e)}},[n,v,b,R]),B.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Ee(C.current,`close`,b.pointerType);r?b.openChangeTimeout.start(r,()=>{e.setOpen(!1,z(F,t)),y?.events.emit(`floating.closed`,t)}):n&&(b.openChangeTimeout.clear(),e.setOpen(!1,z(F,t)),y?.events.emit(`floating.closed`,t))}let r=c.current??(f?e.select(`domReferenceElement`):null);if(!l(r))return;function i(t){if(b.openChangeTimeout.clear(),b.blockMouseMove=!1,a&&!M(b.pointerType))return;let n=De(w.current),r=Ee(C.current,`open`,b.pointerType),i=oe(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(l(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(I(t,i)){c=t;break}}l(o)&&l(s)&&!e.context.triggerElements.hasElement(o)&&I(o,s)&&(c=s);let u=c!=null&&L(s,c,i),d=e.select(`open`),f=D.current?.()??e.select(`transitionStatus`)===`ending`,p=!d&&f&&x.current,m=!u&&l(c)&&l(s)&&I(s,c)&&p,h=n>0&&!r,g=u&&(d||p)||m,_=!d||u;g?A()&&e.setOpen(!0,z(F,t,c)):h||(r?b.openChangeTimeout.start(r,()=>{_&&A()&&e.setOpen(!0,z(F,t,c))}):_&&A()&&e.setOpen(!0,z(F,t,c)))}function o(n){if(k()){ne();return}R();let r=e.select(`domReferenceElement`),i=ee(r);b.restTimeout.clear(),b.restTimeoutPending=!1;let a=_.current.floatingContext??p?.();if(!j(n.relatedTarget,e.context.triggerElements)){if(S.current&&a){e.select(`open`)||b.openChangeTimeout.clear();let r=c.current;b.handler=S.current({...a,tree:y,x:n.clientX,y:n.clientY,onClose(){ne(),R(),T.current&&!k()&&r===e.select(`domReferenceElement`)&&t(n,!0)}}),i.addEventListener(`mousemove`,b.handler),b.handler(n)}else(b.pointerType!==`touch`||!I(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function u(e){I(r,e.relatedTarget)||(b.openChangeTimeout.clear(),b.restTimeout.clear(),b.restTimeoutPending=!1)}let d=g?P(r,`mouseout`,u):void 0;return s?N(P(r,`mousemove`,i,{once:!0}),P(r,`mouseenter`,i),P(r,`mouseleave`,o),d):N(P(r,`mouseenter`,i),P(r,`mouseleave`,o),d)},[R,ne,_,C,e,n,S,b,f,L,k,a,s,w,c,y,T,p,D,A,g]),B.useMemo(()=>{if(!n)return;function t(e){b.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=L(i,r,t.target);if(a&&!M(b.pointerType))return;if(o&&s&&b.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=b.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Ne(b,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=De(w.current);if(o&&!s||c===0||!s&&b.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;b.restTimeout.clear();function l(){if(b.restTimeoutPending=!1,k())return;let t=e.select(`open`);!b.blockMouseMove&&(!t||s)&&A()&&e.setOpen(!0,z(F,n,r))}b.pointerType===`touch`?se.flushSync(()=>{l()}):s&&o?l():(b.restTimeoutPending=!0,b.restTimeout.start(c,l))}}},[n,b,k,L,a,e,w,A])}var Re=.1,ze=Re*Re,$=.5;function Be(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Ve(e,t,n,r,i,a,o,s,c,l){let u=!1;return Be(e,t,n,r,i,a)&&(u=!u),Be(e,t,i,a,o,s)&&(u=!u),Be(e,t,o,s,c,l)&&(u=!u),Be(e,t,c,l,n,r)&&(u=!u),u}function He(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ue(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function We(e={}){let{blockPointerEvents:t=!1}=e,n=new ae,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],u=!1,d=null,f=null,p=typeof performance<`u`?performance.now():0;function m(e,t){let n=performance.now(),r=n-p;if(d===null||f===null||r===0)return d=e,f=t,p=n,!1;let i=e-d,a=t-f,o=i*i+a*a,s=r*r*ze;return d=e,f=t,p=n,o<s}function h(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,d=i.floating;if(!a||!d||c==null||e==null||t==null)return;let{clientX:f,clientY:p}=r,g=oe(r),_=r.type===`mouseleave`,v=I(d,g),y=I(a,g);if(v&&(u=!0,!_))return;if(y&&(u=!1,!_)){u=!0;return}if(_&&l(r.relatedTarget)&&I(d,r.relatedTarget))return;function b(){return!!(s&&re(s.nodesRef.current,o).length>0)}function x(){b()||h()}if(b())return;let S=a.getBoundingClientRect(),C=d.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>S.width,D=C.height>S.height,O=(E?S:C).left,k=(E?S:C).right,A=(D?S:C).top,j=(D?S:C).bottom;if(c===`top`&&t>=S.bottom-1||c===`bottom`&&t<=S.top+1||c===`left`&&e>=S.right-1||c===`right`&&e<=S.left+1){x();return}let M=!1;switch(c){case`top`:M=Ue(f,p,O,S.top+1,k,C.bottom-1);break;case`bottom`:M=Ue(f,p,O,C.top+1,k,S.bottom-1);break;case`left`:M=Ue(f,p,C.right-1,j,S.left+1,A);break;case`right`:M=Ue(f,p,S.right-1,j,C.left+1,A)}if(M)return;if(u&&!He(f,p,S)||!_&&m(f,p)){x();return}let N=!1;switch(c){case`top`:{let n=E?$/2:$*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+$+1,o=w||E?C.bottom-$:C.top,s=w?E?C.bottom-$:C.top:C.bottom-$;N=Ve(f,p,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?$/2:$*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-$,o=w||E?C.top+$:C.bottom,s=w?E?C.top+$:C.bottom:C.top+$;N=Ve(f,p,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?$/2:$*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+$+1,o=T||D?C.right-$:C.left,s=T?D?C.right-$:C.left:C.right-$;N=Ve(f,p,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?$/2:$*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-$,o=T||D?C.left+$:C.right,s=T?D?C.left+$:C.right:C.left+$;N=Ve(f,p,a,r,a,i,o,C.top,s,C.bottom);break}}N?u||n.start(40,x):x()}};return r.__options={...e,blockPointerEvents:t},r}function Ge(e,t,n){let{reference:r,floating:i}=e,a=J(t),o=me(t),s=q(o),c=G(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=K(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ke(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=W(t,e),p=we(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Z(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Z(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var qe=50,Je=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ke},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ge(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<qe&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ge(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ye=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=W(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=G(r),_=J(o),v=G(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[X(o)]:ge(o)),x=p!==`none`;!d&&x&&b.push(...Se(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=he(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===J(t)||T.every(e=>J(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=J(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Xe=new Set([`left`,`top`]);async function Ze(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=G(n),s=K(n),c=J(n)===`y`,l=Xe.has(o)?-1:1,u=a&&c?-1:1,d=W(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Qe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Ze(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},$e=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=W(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=J(i),p=pe(f),m=u[p],h=u[f],g=(e,t)=>fe(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},et=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=W(e,t),u={x:n,y:r},d=J(i),f=pe(d),p=u[f],m=u[d],h=W(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Xe.has(G(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},tt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=W(e,t),c=await i.detectOverflow(t,s),l=G(n),u=K(n),d=J(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ce(p-c[m],g),y=ce(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*H(c.left,c.right):S=p-2*H(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function nt(e){let t=v(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=S(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=le(n)!==a||le(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function rt(e){return l(e)?e:e.contextElement}function it(e){let t=rt(e);if(!S(t))return U(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=nt(t),o=(a?le(n.width):n.width)/r,s=(a?le(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var at=U(0);function ot(e){let t=b(e);return!o()||!t.visualViewport?at:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function st(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===b(e)}function ct(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=rt(e),o=U(1);t&&(r?l(r)&&(o=it(r)):o=it(e));let s=st(a,n,r)?ot(a):U(0),c=(i.left+s.x)/o.x,u=(i.top+s.y)/o.y,d=i.width/o.x,f=i.height/o.y;if(a&&r){let e=b(a),t=l(r)?b(r):r,n=e,i=g(n);for(;i&&t!==n;){let e=it(i),t=i.getBoundingClientRect(),r=v(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=a,u+=o,n=b(i),i=g(n)}}return Z({width:d,height:f,x:c,y:u})}function lt(e,t){let n=m(e).scrollLeft;return t?t.left+n:ct(f(e)).left+n}function ut(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-lt(e,n),y:n.top+t.scrollTop}}function dt(e){let{elements:n,rect:r,offsetParent:i,strategy:a}=e,o=a===`fixed`,s=f(i),c=n?t(n.floating):!1;if(i===s||c&&o)return r;let l={scrollLeft:0,scrollTop:0},u=U(1),d=U(0),p=S(i);if((p||!o)&&((h(i)!==`body`||x(s))&&(l=m(i)),p)){let e=ct(i);u=it(i),d.x=e.x+i.clientLeft,d.y=e.y+i.clientTop}let g=s&&!p&&!o?ut(s,l):U(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+d.x+g.x,y:r.y*u.y-l.scrollTop*u.y+d.y+g.y}}function ft(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function pt(e){let t=m(e),n=e.ownerDocument.body,r=H(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=H(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+lt(e),o=-t.scrollTop;return v(n).direction===`rtl`&&(a+=H(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var mt=25;function ht(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=b(e),a=f(e),s=i.visualViewport,c=a.clientWidth,l=a.clientHeight,u=0,d=0;if(s){let e=!o()||t===`fixed`;r?e||(u=-s.offsetLeft,d=-s.offsetTop):(c=s.width,l=s.height,e&&(u=s.offsetLeft,d=s.offsetTop))}if(lt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=mt&&(c-=o)}return{width:c,height:l,x:u,y:d}}function gt(e,t){let n=ct(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=it(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function _t(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ht(e,n,t);else if(t===`document`)r=pt(f(e));else if(l(t))r=gt(t,n);else{let n=ot(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Z(r)}function vt(e,t){let n=t.get(e);if(n)return n;let r=p(e,[],!1).filter(e=>l(e)&&h(e)!==`body`),i=null,a=v(e).position===`fixed`,o=a?c(e):e;for(;l(o)&&!s(o);){let e=v(o),t=C(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=c(o)}return t.set(e,r),r}function yt(e){let{element:n,boundary:r,rootBoundary:i,strategy:a}=e,o=[...r===`clippingAncestors`?t(n)?[]:vt(n,this._c):[].concat(r),i],s=_t(n,o[0],a),c=s.top,l=s.right,u=s.bottom,d=s.left;for(let e=1;e<o.length;e++){let t=_t(n,o[e],a);c=H(t.top,c),l=ce(t.right,l),u=ce(t.bottom,u),d=H(t.left,d)}return{width:l-d,height:u-c,x:d,y:c}}function bt(e){let{width:t,height:n}=nt(e);return{width:t,height:n}}function xt(e,t,n){let r=S(t),i=f(t),a=n===`fixed`,o=ct(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=U(0);if((r||!a)&&((h(t)!==`body`||x(i))&&(s=m(t)),r)){let e=ct(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=lt(i));let l=i&&!r&&!a?ut(i,s):U(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function St(e){return v(e).position===`static`}function Ct(e,t){if(!S(e)||v(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return f(e)===n&&(n=n.ownerDocument.body),n}function wt(e,r){let i=b(e);if(t(e))return i;if(!S(e)){let t=c(e);for(;t&&!s(t);){if(l(t)&&!St(t))return t;t=c(t)}return i}let a=Ct(e,r);for(;a&&n(a)&&St(a);)a=Ct(a,r);return a&&s(a)&&St(a)&&!C(a)?i:a||d(e)||i}var Tt=async function(e){let t=this.getOffsetParent||wt,n=this.getDimensions,r=await n(e.floating);return{reference:xt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Et(e){return v(e).direction===`rtl`}var Dt={convertOffsetParentRelativeRectToViewportRelativeRect:dt,getDocumentElement:f,getClippingRect:yt,getOffsetParent:wt,getElementRects:Tt,getClientRects:ft,getDimensions:bt,getScale:it,isElement:l,isRTL:Et};function Ot(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kt(e,t,n){let r=null,i,a=f(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=ue(d),h=ue(a.clientWidth-(u+f)),g=ue(a.clientHeight-(d+p)),_=ue(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:H(0,ce(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ot(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=b(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function At(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=rt(e),u=i||a?[...l?p(l):[],...t?p(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?kt(l,n,a):null,f=-1,m=null;o&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=m)==null||e.observe(t)})),n()}),l&&!c&&m.observe(l),t&&m.observe(t));let h,g=c?ct(e):null;c&&_();function _(){let t=ct(e);g&&!Ot(g,t)&&n(),g=t,h=requestAnimationFrame(_)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=m)==null||e.disconnect(),m=null,c&&cancelAnimationFrame(h)}}var jt=Qe,Mt=$e,Nt=Ye,Pt=tt,Ft=et,It=(e,t,n)=>{let r=new Map,i=n??{},a={...Dt,...i.platform,_c:r};return Je(e,t,{...i,platform:a})},Lt=typeof document<`u`?B.useLayoutEffect:function(){};function Rt(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,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Rt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Rt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function zt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bt(e,t){let n=zt(e);return Math.round(t*n)/n}function Vt(e){let t=B.useRef(e);return Lt(()=>{t.current=e}),t}function Ht(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=B.useState(r);Rt(f,r)||p(r);let[m,h]=B.useState(null),[g,_]=B.useState(null),v=B.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=B.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=B.useRef(null),C=B.useRef(null),w=B.useRef(u),T=c!=null,E=Vt(c),D=Vt(i),O=Vt(l),k=B.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),It(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Rt(w.current,t)&&(w.current=t,se.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Lt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=B.useRef(!1);Lt(()=>(A.current=!0,()=>{A.current=!1}),[]),Lt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=B.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=B.useMemo(()=>({reference:b,floating:x}),[b,x]),N=B.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Bt(M.floating,u.x),r=Bt(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...zt(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return B.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Ut=(e,t)=>{let n=jt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wt=(e,t)=>{let n=Mt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>({fn:Ft(e).fn,options:[e,t]}),Kt=(e,t)=>{let n=Nt(e);return{name:n.name,fn:n.fn,options:[e,t]}},qt=(e,t)=>{let n=Pt(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Jt(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[u,d]=B.useState(null),f=B.useRef(null),p=te(n),m=B.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),h=Ht({...e,elements:{...m,...u&&{reference:u}}}),g=B.useCallback(e=>{let t=l(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),h.refs.setReference(t)},[h.refs]),v=B.useMemo(()=>({...h.refs,setPositionReference:g,domReference:f}),[h.refs,g]),y=B.useMemo(()=>({...h.elements,domReference:o}),[h.elements,o]),b=B.useMemo(()=>({...h,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:v,elements:y,nodeId:t,rootStore:r}),[h,v,y,t,r,s,c]);return _(()=>{o&&(f.current=o)},[o]),_(()=>{r.context.dataRef.current.floatingContext=b;let e=p?.nodesRef.current.find(e=>e.id===t);e&&(e.context=b)}),B.useMemo(()=>({...h,context:b,refs:v,elements:y,rootStore:r}),[h,v,y,b,r])}var Yt=B.createContext(void 0);function Xt(){return B.useContext(Yt)?.direction??`ltr`}var Zt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=W(e,t)||{};if(l==null)return{};let d=we(u),f={x:n,y:r},p=me(i),m=q(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=fe(D,k,O),j=!c.arrow&&K(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Qt=(e,t)=>{let{name:n,fn:r}=Zt(e);return{name:n,fn:r,options:[e,t]}},$t={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},en={sideX:`left`,sideY:`top`},tn=`--available-width`,nn=`--available-height`,rn=`--anchor-width`,an=`--anchor-height`,on=`--transform-origin`,sn=tn,cn=nn;function ln(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function un(e,t,n){let{rects:r,placement:i}=e;return{side:ln(t,G(i),n),align:K(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function dn(e){return fn(e,Jt)}function fn(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:v,collisionAvoidance:y,shift:x,nodeId:S,adaptiveOrigin:C,lazyFlip:w=!1,externalTree:T}=e,E=y.side||`flip`,D=y.align||`flip`,k=y.fallbackAxisSide||`end`,A=x?.crossAxis??!1,j=x?.rootBoundary,M=typeof n==`function`?n:void 0,N=u(M),P=M?N:n,F=O(n),I=O(v),L=Xt()===`rtl`,[R,te]=B.useState(null);!v&&R!==null&&te(null);let ne=w===`placement`,re=R?G(R):null,ie=R&&ne?K(R)||`center`:null,ae=re||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":L?`left`:`right`,"inline-start":L?`right`:`left`}[i],z=ie||o,oe=z===`center`?ae:`${ae}-${z}`,V=l;typeof V==`number`?V={top:V,right:V,bottom:V,left:V}:V&&={top:V.top||0,right:V.right||0,bottom:V.bottom||0,left:V.left||0};let se=+(i===`bottom`),ce=+(i===`top`),H=+(i===`right`),le=+(i===`left`),ue={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:V},U=B.useRef(null),de=O(a),fe=O(s),W=typeof a==`function`?0:a,pe=typeof s==`function`?0:s,q=[];m&&q.push(m),q.push(Ut(e=>{let t=un(e,i,L),n=typeof de.current==`function`?de.current(t):de.current,r=typeof fe.current==`function`?fe.current(t):fe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[W,pe,L,i]));let me=D===`none`&&E!==`shift`,he=!me&&(d||A||E===`shift`),ge=E===`none`?null:Kt({...ue,padding:{top:V.top+1+se,right:V.right+1+le,bottom:V.bottom+1+ce,left:V.left+1+H},mainAxis:!A&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:k}),_e=me?null:Wt({...ue,rootBoundary:j,mainAxis:D!==`none`,crossAxis:he,limiter:d||A?void 0:Gt(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=J(G(e.placement)),i=r===`y`?t:n,a=r===`y`?V.left+V.right:V.top+V.bottom;return{offset:i/2+a/2}})},[ue,d,A,j,V,D]);E===`shift`||D===`shift`||z===`center`?q.push(_e,ge):q.push(ge,_e),q.push(qt({...ue,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!I.current)return;let i=e.style;i.setProperty(sn,`${t}px`),i.setProperty(cn,`${n}px`);let a=b(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(rn,`${u}px`),i.setProperty(an,`${d}px`)}}),Qt(e=>({element:U.current||ee(e.elements.floating).createElement(`div`),padding:U.current?f:0}),[f]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=G(r),u=K(r),d=J(l)===`y`,f=U.current,p=typeof a==`function`?a(un(e,i,L)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return he&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(on,d?`${m} ${h}`:`${h} ${m}`),{}}},$t,C),_(()=>{!v&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[v,g]);let ve=B.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:Y,elements:ye,x:be,y:xe,middlewareData:Se,update:X,placement:Ce,context:we,isPositioned:Z,floatingStyles:Te}=t({rootContext:g,open:h?v:void 0,placement:oe,middleware:q,strategy:r,whileElementsMounted:h?void 0:(...e)=>At(...e,ve),nodeId:S,externalTree:T}),{sideX:Ee,sideY:De}=Se.adaptiveOrigin||en,Oe=Z?r:`fixed`,ke=B.useMemo(()=>{let e;return e=Z?C?{position:Oe,[Ee]:be,[De]:xe}:{...Te,position:Oe}:{position:Oe,top:0,left:0},e[sn]=`100vw`,e[cn]=`100vh`,Z||(e.opacity=0),e},[C,Oe,Ee,be,De,xe,Te,Z]),Ae=B.useRef(null);_(()=>{if(!v)return;let e=F.current,t=typeof e==`function`?e():e,n=(pn(t)?t.current:t)||null;n!==Ae.current&&(Y.setPositionReference(n),Ae.current=n)},[v,Y,P,F]),B.useEffect(()=>{if(!v)return;let e=F.current;typeof e!=`function`&&pn(e)&&e.current!==Ae.current&&(Y.setPositionReference(e.current),Ae.current=e.current)},[v,Y,P,F]),B.useEffect(()=>{if(h&&v&&ye.reference&&ye.floating)return At(ye.reference,ye.floating,X,ve)},[h,v,ye,X,ve]);let je=G(Ce),Me=ln(i,je,L),Q=K(Ce)||`center`,Ne=!!Se.hide?.referenceHidden;_(()=>{w&&v&&Z&&(je!==ae||ne&&Q!==z)&&te(Ce)},[w,ne,v,Z,Ce,je,Q,ae,z]);let Pe=B.useMemo(()=>({position:`absolute`,top:Se.arrow?.y,left:Se.arrow?.x}),[Se.arrow]),Fe=Se.arrow?.centerOffset!==0;return B.useMemo(()=>({positionerStyles:ke,arrowStyles:Pe,arrowRef:U,arrowUncentered:Fe,side:Me,align:Q,physicalSide:je,anchorHidden:Ne,refs:Y,context:we,isPositioned:Z,update:X}),[ke,Pe,U,Fe,Me,Q,je,Ne,Y,we,Z,X])}function pn(e){return e!=null&&`current`in e}function mn(e){return e===`starting`?k:r}function hn(e,t,{styles:n,transitionStatus:r,props:i,refs:o,hidden:s,inert:c=!1}){let l={...n};return c&&(l.pointerEvents=`none`),a(`div`,e,{state:t,ref:o,props:[{role:`presentation`,hidden:s,style:l},mn(r),i],stateAttributesMapping:A})}export{We as a,Pe as c,Xt as i,Ae as l,mn as n,Le as o,dn as r,Fe as s,hn as t,Ee as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,t}from"./rolldown-runtime-XKyaHtl9.js";import{C as n,F as r,I as i,L as a,M as o,P as s,R as c,S as l,T as u,_ as d,b as f,c as p,l as m,lt as h,m as g,s as _,u as v,ut as y,v as b,w as x,x as S,z as C}from"./button-C4yvcSko.js";import{n as ee,t as w}from"./with-selector-NsM_5qXG.js";var T=t((e=>{var t=y();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),te=t(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=T()})),E=e(y(),1);function D(e){return e?.ownerDocument||document}function O(){let[,e]=E.useState({});return E.useCallback(()=>{e({})},[])}var k=0;function A(e,t=`mui`){let n=E.useRef(void 0),r=O(),i=e??n.current;return E.useEffect(()=>{n.current??(k+=1,n.current=`${t}-${k}`,e??r())},[e,t,r]),i}var j=m.useId;function M(e,t){if(j!==void 0){let n=j();return e??(t?`${t}-${n}`:n)}return A(e,t)}function N(e){return M(e,`base-ui`)}function P(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:F,platform:I,maxTouchPoints:L}=P(),R=F.toLowerCase(),z=I.toLowerCase(),B=/^i(os$|p)/.test(z)||z===`macintel`&&L>1,V=`android`,H=z===V||R.includes(V),U=!B&&z.startsWith(`mac`);z.startsWith(`win`),!H&&/^(linux|chrome os)/.test(z);var ne=U||B,re=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!re&&R.includes(`firefox`),!re&&R.includes(`chrom`);var ie=ne,ae=/jsdom|happydom/.test(R),W=h();function G(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function K(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&u(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function oe(e,t){let n=e;for(;n;){if(f(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(u(n)?n.host:null)}return null}function se(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var ce=`data-base-ui-focusable`,le=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,ue=`ArrowLeft`,q=`ArrowRight`,J=`ArrowUp`,Y=`ArrowDown`,X=`data-starting-style`,de=`data-ending-style`,fe={[X]:``},pe={[de]:``},me={transitionStatus(e){return e===`starting`?fe:e===`ending`?pe:null}},he=`data-open`,ge=`data-closed`,_e=X,ve=de,ye=`data-anchor-hidden`,be=`data-popup-open`,xe=`data-pressed`,Se={[be]:``},Ce={[be]:``,[xe]:``},we={[he]:``},Te={[ge]:``},Ee={[ye]:``},De={open(e){return e?Se:null}},Oe={open(e){return e?Ce:null}},ke={open(e){return e?we:Te},anchorHidden(e){return e?Ee:null}},Ae={...ke,...me},je=`data-trigger-disabled`;function Me(e,t){if(!f(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(je);for(let[,e]of t.entries())if(K(e,n))return!e.hasAttribute(je);return!1}function Ne(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Pe(e){return e.matches(`html,body`)}function Fe(e){return S(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Ie(e){return oe(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${le}`)!=null}function Le(e){return e?e.getAttribute(`role`)===`combobox`&&Fe(e):!1}function Re(e){if(!e||ae)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ze(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Be(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Be(e,t.id,n)])}function Ve(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function He(e){e.preventDefault(),e.stopPropagation()}function Ue(e){return`nativeEvent`in e}function We(e){return e.pointerType===``&&e.isTrusted?!0:H&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ge(e){return ae?!1:!H&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(H||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ke(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function qe(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Je(e,t){return t<0||t>=e.length}function Ye(e,t){return Qe(e.current,{disabledIndices:t})}function Xe(e,t){return Qe(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ze(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Qe(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Je(e,u)?-1:u,wrapped:d}}function Qe(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&$e(e,a,r));return a}function $e(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!tt(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function et(e){return e.visibility===`hidden`||e.visibility===`collapse`}function tt(e,t=e?v(e):null){return!e||!e.isConnected||!t||et(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var nt=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function rt(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return u(n)?n.host:null}function it(e){for(let t of Array.from(e.children))if(g(t)===`summary`)return t;return null}function at(e,t){let n=it(t);return!!n&&(e===n||K(n,e))}function ot(e){let t=e?g(e):``;return e!=null&&e.matches(nt)&&(t!==`summary`||e.parentElement!=null&&g(e.parentElement)===`details`&&it(e.parentElement)===e)&&(t!==`details`||it(e)==null)&&(t!==`input`||e.type!==`hidden`)}function st(e){if(!ot(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=rt(t)){let n=t!==e,r=g(t)===`slot`;if(t.hasAttribute(`inert`)||n&&g(t)===`details`&&!t.open&&!at(e,t)||t.hasAttribute(`hidden`)||!r&&!ct(t,n))return!1}return!0}function ct(e,t){let n=v(e);return t?n.display!==`none`:tt(e,n)}function lt(e){let t=e.tabIndex;if(t<0){let t=g(e);if(t===`details`||t===`audio`||t===`video`||S(e)&&e.isContentEditable)return 0}return t}function ut(e){if(g(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function dt(e,t){let n=ut(e);if(!n)return!0;let r=t.find(e=>{let t=ut(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=ut(e);return t?.name===n.name&&t.form===n.form})===n}function ft(e){if(S(e)&&g(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return S(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function pt(e,t){ft(e).forEach(e=>{ot(e)&&t.push(e),pt(e,t)})}function mt(e,t,n){ft(e).forEach(e=>{S(e)&&e.matches(t)&&n.push(e),mt(e,t,n)})}function ht(e){return st(e)&<(e)>=0}function gt(e){let t=[];return pt(e,t),t.filter(st)}function _t(e){let t=gt(e);return t.filter(e=>lt(e)>=0&&dt(e,t))}function vt(e,t){let n=_t(e),r=n.length;if(r===0)return;let i=G(D(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function yt(e){return vt(D(e).body,1)||e}function bt(e){return vt(D(e).body,-1)||e}function xt(e,t,n){if(!e)return null;let r=[];pt(D(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(st);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!K(n,o)&&ht(o)&&dt(o,a))return o}return r[i]}function St(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!K(n,r)}function Ct(e){_t(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function wt(e){let t=[];mt(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function Tt(e){E.useEffect(e,s)}var Et=0,Dt=class e{static create(){return new e}currentId=Et;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Et,t()},e)}isStarted(){return this.currentId!==Et}clear=()=>{this.currentId!==Et&&(clearTimeout(this.currentId),this.currentId=Et)};disposeEffect=()=>this.clear};function Ot(){let e=C(Dt.create).current;return Tt(e.disposeEffect),e}var kt=null;globalThis.requestAnimationFrame;var At=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},Z=class e{static create(){return new e}static request(e){return At.request(e)}static cancel(e){return At.cancel(e)}currentId=kt;request(e){this.cancel(),this.currentId=At.request(()=>{this.currentId=kt,e()})}cancel=()=>{this.currentId!==kt&&(At.cancel(this.currentId),this.currentId=kt)};disposeEffect=()=>this.cancel};function jt(){let e=C(Z.create).current;return Tt(e.disposeEffect),e}var Mt=e(te(),1);function Q(e){return e==null?e:`current`in e?e.current:e}function Nt(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Pt=null;function Ft(e){if(!Pt){let e=[];Pt=e,queueMicrotask(()=>{Pt=null,Mt.flushSync(()=>{for(let t of e)t()})})}Pt.push(e)}function It(e,t=!1,n=!1){let r=jt();return p((a,o=null)=>{r.cancel();let s=Q(e);if(s==null)return;let c=s,l=()=>{n?Ft(()=>{o?.aborted||a()}):Mt.flushSync(a)};if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){a();return}function u(){Promise.all(Nt(c).map(e=>e.finished.then(i))).then(()=>{o?.aborted||l()},()=>{o?.aborted||(Nt(c).some(e=>e.pending||e.playState!==`finished`)?u():l())})}if(t){let e=X;if(!c.hasAttribute(e)){r.request(u);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),u())});t.observe(c,{attributes:!0,attributeFilter:[e]}),o?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(u)})}function Lt(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=p(a),s=It(r,n,i);E.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Rt(e,t=!1,n=!1,r=!1){let[i,a]=E.useState(e&&t?`idle`:void 0),[o,s]=E.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),_(()=>{if(!e&&o&&i!==`ending`&&n){let e=Z.request(()=>{a(`ending`)});return()=>{Z.cancel(e)}}},[e,o,i,n]),_(()=>{if(!e||t||i===void 0)return;let n=Z.request(()=>{a(void 0)});return()=>{Z.cancel(n)}},[t,e,i]),_(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Z.request(()=>{a(`idle`)});return()=>{Z.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function zt(e,t,n,i){let a=!1,o=!1,s=i??r;return{reason:e,event:t??new Event(`base-ui`),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:n,...s}}function Bt(e,t,n){let i=n??r;return{reason:e,event:t??new Event(`base-ui`),...i}}var Vt=`none`,Ht=`trigger-press`,Ut=`trigger-hover`,Wt=`trigger-focus`,Gt=`outside-press`,Kt=`item-press`,qt=`close-press`,Jt=`focus-out`,Yt=`escape-key`,Xt=`list-navigation`,Zt=`keyboard`,Qt=`pointer`,$t=`cancel-open`,en=`sibling-open`,tn=`disabled`,nn=`imperative-action`;function $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function rn(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function an(e){let t=C(on,e).current;return t.next=e,_(t.effect),t}function on(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var sn={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},cn={...sn,position:`fixed`,margin:0,top:0,left:0};({...sn});var ln=E.forwardRef(function(e,t){let[n,r]=E.useState();_(()=>{ie&&re&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,W.jsx)(`span`,{...e,ref:t,style:cn,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function un(e){return`data-base-ui-${e}`}var dn=0;function fn(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:a}=t;cancelAnimationFrame(dn);function o(){(!a||a())&&e?.focus({preventScroll:n})}if(r)return o(),i;let s=requestAnimationFrame(o);return dn=s,()=>{dn===s&&(cancelAnimationFrame(s),dn=0)}}var pn=`data-base-ui-inert`,mn=new WeakMap,hn=new WeakSet,gn=new WeakMap,_n=0;function vn(e){return e?u(e)?e.host:vn(e.parentNode):null}var yn=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=vn(t);return e.contains(n)?n:null}).filter(e=>e!=null),bn=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},xn=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{g(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Sn(e,t,n,{mark:r=!0}){let i=yn(t,e),a=r?xn(t,bn(i),new Set(i)):[],o=[],s=[];if(n){let e=yn(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);xn(t,bn(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(mn.get(e)||0)+1;mn.set(e,r),o.push(e),r===1&&n&&hn.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(gn.get(e)||0)+1;gn.set(e,t),s.push(e),t===1&&e.setAttribute(pn,``)}),_n+=1,()=>{o.forEach(e=>{let t=(mn.get(e)||0)-1;mn.set(e,t),t||(hn.has(e)||e.removeAttribute(`aria-hidden`),hn.delete(e))}),r&&s.forEach(e=>{let t=(gn.get(e)||0)-1;gn.set(e,t),t||e.removeAttribute(pn)}),--_n,_n||(mn=new WeakMap,hn=new WeakSet,gn=new WeakMap)}}function Cn(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=D(e[0]).body;return Sn(e,i,n,{mark:r})}var wn={style:{transition:`none`}},Tn=`data-base-ui-click-trigger`,En={fallbackAxisSide:`none`},Dn={fallbackAxisSide:`end`},On={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},kn=E.createContext(null),An=()=>E.useContext(kn),jn=un(`portal`);function Mn(e={}){let{ref:t,container:i,componentProps:a=r,elementProps:s}=e,c=M(),l=An()?.portalNode,[u,d]=E.useState(null),[f,m]=E.useState(null),h=p(e=>{e!==null&&m(e)}),g=E.useRef(null);_(()=>{if(i===null){g.current&&(g.current=null,m(null),d(null));return}let e=(i&&(n(i)?i:i.current))??l??document.body;e==null?g.current&&(g.current=null,m(null),d(null)):g.current!==e&&(g.current=e,m(null),d(e))},[i,l]);let v=o(`div`,a,{ref:[t,h],props:[{id:c,[jn]:``},s]}),y=u&&v?Mt.createPortal(v,u):null;return{node:f,nodeId:E.isValidElement(v)?v.props.id:void 0,subtree:y}}var Nn=E.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Mn({container:o,ref:t,componentProps:e,elementProps:c}),f=E.useRef(null),p=E.useRef(null),m=E.useRef(null),h=E.useRef(null),[g,v]=E.useState(null),y=E.useRef(!1),b=g?.modal,x=g?.open,S=!!g&&!g.modal&&g.open&&!!l;E.useEffect(()=>{if(!l||b)return;function e(e){l&&e.relatedTarget&&St(e)&&(e.type===`focusin`?y.current&&=(wt(l),!1):(Ct(l),y.current=!0))}return rn($(l,`focusin`,e,!0),$(l,`focusout`,e,!0))},[l,b]),_(()=>{l&&x===!0&&y.current&&(wt(l),y.current=!1)},[x,l]);let C=E.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:v}),[l]);return(0,W.jsxs)(E.Fragment,{children:[d,(0,W.jsxs)(kn.Provider,{value:C,children:[S&&l&&(0,W.jsx)(ln,{"data-type":`outside`,ref:f,onFocus:e=>{St(e,l)?m.current?.focus():bt(g?g.domReference:null)?.focus()}}),S&&l&&(0,W.jsx)(`span`,{role:s,"aria-owns":u,style:On}),l&&Mt.createPortal(a,l),S&&l&&(0,W.jsx)(ln,{"data-type":`outside`,ref:p,onFocus:e=>{St(e,l)?h.current?.focus():(yt(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,zt(`focus-out`,e.nativeEvent)))}})]})]})});function Pn(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var Fn=class{nodesRef={current:[]};events=Pn();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},In=E.createContext(null),Ln=E.createContext(null),Rn=()=>E.useContext(In)?.id||null,zn=e=>{let t=E.useContext(Ln);return e??t};function Bn(e){let t=M(),n=zn(e),r=Rn();return _(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function Vn(e){let{children:t,id:n}=e,r=Rn();return(0,W.jsx)(In.Provider,{value:E.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Hn(e){let{children:t,externalTree:n}=e,r=C(()=>n??new Fn).current;return(0,W.jsx)(Ln.Provider,{value:r,children:t})}function Un(e,t){let n=b(se(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(We(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Wn=20,Gn=[];function Kn(){Gn=Gn.filter(e=>e.deref()?.isConnected)}function qn(e){Kn(),e&&g(e)!==`body`&&(Gn.push(new WeakRef(e)),Gn.length>Wn&&(Gn=Gn.slice(-20)))}function Jn(){return Kn(),Gn[Gn.length-1]?.deref()}function Yn(e){return e?ht(e)?e:_t(e)[0]||e:null}function Xn(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=gt(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return ht(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function Zn(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:l=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:m,beforeContentFocusGuardRef:h,externalTree:v,getInsideElements:y}=e,b=t.useState(`open`),x=t.useState(`domReferenceElement`),C=t.useState(`floatingElement`),{events:ee,dataRef:w}=t.context,T=p(()=>w.current.floatingContext?.nodeId),te=i===!1,O=Le(x)&&te,k=an(i),A=an(a),j=an(o),M=an(d),N=an(b),P=zn(v),F=An(),I=E.useRef(!1),L=E.useRef(!1),R=E.useRef(!1),z=E.useRef(null),B=E.useRef(``),V=E.useRef(``),H=E.useRef(null),U=E.useRef(null),ne=c(H,h,F?.beforeInsideRef),ie=c(U,F?.afterInsideRef),ae=Ot(),ce=Ot(),le=jt(),ue=F!=null,q=ze(C),J=p((e=q)=>e?_t(e):[]),Y=p(()=>y?.().filter(e=>e!=null)??[]);E.useEffect(()=>{if(r||!l)return;function e(e){e.key===`Tab`&&K(q,G(D(q)))&&J().length===0&&!O&&He(e)}return $(D(q),`keydown`,e)},[r,q,l,O,J]),E.useEffect(()=>{if(r||!b)return;let e=D(q);function t(){R.current=!1}function n(e){let t=se(e),n=Y(),r=K(C,t)||K(x,t)||K(F?.portalNode,t)||n.some(e=>e===t||K(e,t));R.current=!r,V.current=e.pointerType||`keyboard`,oe(t,`[data-base-ui-click-trigger]`)&&(L.current=!0,ce.start(0,()=>{L.current=!1}))}function i(){V.current=`keyboard`}return rn($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,C,x,q,b,F,ce,Y]),E.useEffect(()=>{if(r||!u)return;let e=D(q);function n(){L.current=!0,ce.start(0,()=>{L.current=!1})}function i(e){let t=se(e);ht(t)&&(z.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=se(n);l&&r==null&&a!=null&&K(C,a)&&qn(a),queueMicrotask(()=>{let o=T(),c=t.context.triggerElements,u=Y(),d=r?.hasAttribute(un(`focus-guard`))&&[H.current,U.current,F?.beforeInsideRef.current,F?.afterInsideRef.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,Q(m),Q(f)].includes(r),p=!(K(x,r)||K(C,r)||K(r,C)||K(F?.portalNode,r)||u.some(e=>e===r||K(e,r))||c.hasMatchingElement(e=>K(e,r))||d||P&&(Be(P.nodesRef.current,o).find(e=>K(e.context?.elements.floating,r)||K(e.context?.elements.domReference,r))||Ve(P.nodesRef.current,o).find(e=>[e.context?.elements.floating,ze(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===x&&q&&Xn(q),s&&i!==x&&!tt(a)&&G(e)===e.body){if(S(q)&&(q.focus(),s===`popup`)){le.request(()=>{q.focus()});return}let e=J(),t=z.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||q;S(n)&&n.focus()}w.current.insideReactTree?w.current.insideReactTree=!1:(O||!l)&&r&&p&&!L.current&&(O||r!==Jn())&&(I.current=!0,t.setOpen(!1,zt(Jt,n)))})}function o(){R.current||(w.current.insideReactTree=!0,ae.start(0,()=>{w.current.insideReactTree=!1}))}let c=S(x)?x:null;if(C||c)return rn(c&&$(c,`focusout`,a),c&&$(c,`pointerdown`,n),C&&$(C,`focusin`,i),C&&$(C,`focusout`,a),C&&F&&$(C,`focusout`,o,!0))},[r,x,C,q,l,P,F,t,u,s,J,O,T,w,ae,ce,le,f,m,Y]),E.useEffect(()=>{if(r||!C||!b)return;let e=Array.from(F?.portalNode?.querySelectorAll(`[${un(`portal`)}]`)||[]),t=(P?Ve(P.nodesRef.current,T()):[]).find(e=>Le(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Cn([C,...e,H.current,U.current,F?.beforeOutsideRef.current,F?.afterOutsideRef.current,...Y(),t,Q(m),Q(f),O?x:null].filter(e=>e!=null),{ariaHidden:l||O,mark:!1}),i=Cn([C,...e].filter(e=>e!=null));return()=>{i(),n()}},[b,r,x,C,l,F,O,P,T,f,m,Y]),_(()=>{if(!b||r||!S(q))return;B.current=``,V.current=``;let e=D(q),t=G(e);queueMicrotask(()=>{let n=k.current,r=typeof n==`function`?n(M.current||``):n;if(r===void 0||r===!1||K(q,t))return;let i=null,a=()=>(i??=J(q),i[0]||q),o;o=r===!0||r===null?a():Q(r),o||=a();let s=K(q,G(e)),c=w.current.openEvent,l=c?.type===`mousedown`&&We(c);fn(o,{sync:l,preventScroll:o===q,shouldFocus(){if(!N.current)return!1;if(s)return!0;let t=G(e);return!(t!==o&&K(q,t))}})})},[r,b,q,J,k,M,N,w]);let X=E.useRef(null);_(()=>{if(r||!q){X.current=null;return}X.current&&=(X.current.cancelled=!0,null);let e=D(q),t=G(e),n=M.current==null;qn(t);function i(e){if(e.open||(B.current=Un(e.nativeEvent,V.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(un(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(I.current=!0),e.reason===`outside-press`){if(e.nested)I.current=!1;else if(We(e.nativeEvent)||Ge(e.nativeEvent))I.current=!1;else{let e=!1;D(q).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?I.current=!1:I.current=!0}}}ee.on(`openchange`,i);function a(e){let r=A.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=x?.isConnected?x:null,o=t?.isConnected&&g(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Jn()||null,typeof i==`boolean`?s:Q(i)||s||null}return()=>{ee.off(`openchange`,i);let t=G(e),n=Y(),r=K(C,t)||n.some(e=>e===t||K(e,t))||P&&Be(P.nodesRef.current,T(),!1).some(e=>K(e.context?.elements.floating,t)),o=A.current,s=B.current,c=a(s),l={cancelled:!1};X.current=l,queueMicrotask(()=>{X.current===l&&(X.current=null);let n=Yn(c),i=j.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!I.current&&S(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}I.current=!1})}},[r,C,q,A,j,M,ee,P,x,T,Y]),_(()=>{if(!re||b||!C)return;let e=G(D(C));S(e)&&Fe(e)&&K(C,e)&&e.blur()},[b,C]),_(()=>{if(!r&&F)return F.setFocusManagerState({modal:l,closeOnFocusOut:u,open:b,onOpenChange:t.setOpen,domReference:x}),()=>{F.setFocusManagerState(null)}},[r,F,l,b,t,u,x]),_(()=>{if(!r&&q)return Xn(q),()=>{queueMicrotask(Kn)}},[r,q]);let de=!r&&(!l||!O)&&(ue||l);return(0,W.jsxs)(E.Fragment,{children:[de&&(0,W.jsx)(ln,{"data-type":`inside`,ref:ne,onFocus:e=>{if(l){let e=J();fn(e[e.length-1])}else F?.portalNode&&(I.current=!1,St(e,F.portalNode)?yt(x)?.focus():Q(m??F.beforeOutsideRef)?.focus())}}),n,de&&(0,W.jsx)(ln,{"data-type":`inside`,ref:ie,onFocus:e=>{l?fn(J()[0]):F?.portalNode&&(u&&(I.current=!0),St(e,F.portalNode)?bt(x)?.focus():Q(f??F.afterOutsideRef)?.focus())}})]})}function Qn(){return!1}function $n(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function er(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=Qn,bubbles:s,externalTree:c}=t,m=e.useState(`open`),h=e.useState(`floatingElement`),{dataRef:g,events:_}=e.context,y=zn(c),b=p(typeof i==`function`?i:()=>!1),x=typeof i==`function`?b:i,C=x!==!1,ee=p(()=>a),{escapeKey:w,outsidePress:T}=$n(s),te=E.useRef(!1),O=E.useRef(!1),k=E.useRef(!1),A=E.useRef(!1),j=E.useRef(!1),M=E.useRef(``),N=E.useRef(null),P=Ot(),F=Ot(),I=Ot(),L=p(()=>{F.clear(),g.current.insideReactTree=!1}),R=p(e=>{let t=g.current.floatingContext?.nodeId;return(y?Be(y.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),z=p(t=>Ne(t,e.select(`floatingElement`))||Ne(t,e.select(`domReferenceElement`))),B=p(t=>{o()&&e.setOpen(!1,zt(Ht,t.nativeEvent))}),V=p(t=>{if(!m||!n||!r||t.key!==`Escape`)return;let i=Ue(t)?t.nativeEvent:t;if(j.current||i.isComposing||!w&&R(`__escapeKeyBubbles`))return;let a=zt(Yt,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!w&&!a.isPropagationAllowed&&t.stopPropagation()}),H=p(()=>{g.current.insideReactTree=!0,F.start(0,L)}),U=p(t=>{if(!m||!n||t.button!==0)return;let r=se(t.nativeEvent);K(e.select(`floatingElement`),r)&&(te.current||(te.current=!0,O.current=!1))}),ne=p(e=>{m&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&te.current&&(O.current=!0)});E.useEffect(()=>{function e(e){e.open||(A.current=!1)}return _.on(`openchange`,e),()=>{_.off(`openchange`,e)}},[_]),E.useEffect(()=>L,[L]),E.useEffect(()=>{if(!m||!n)return m||(A.current=!1,j.current=!1,M.current=``,N.current=null),L;g.current.__escapeKeyBubbles=w,g.current.__outsidePressBubbles=T;let t=new Dt,i=D(h);function a(){I.clear(),j.current=!0}function o(){j.current=!0,I.start(re?5:0,()=>{j.current=!1})}function s(){k.current=!0,t.start(0,()=>{k.current=!1})}function c(){te.current=!1,O.current=!1}function p(){let e=M.current,t=e===`pen`||!e?`mouse`:e,n=ee(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function _(e){let t=p();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function b(e){let t=g.current.floatingContext?.nodeId,n=y&&Be(y.nodesRef.current,t).some(t=>Ne(e,t.context?.elements.floating));return z(e)||n}function E(n){if(_(n)){n.type!==`click`&&!z(n)&&(t.clear(),k.current=!1),L();return}if(g.current.insideReactTree){L();return}let r=se(n),i=`[${un(`inert`)}]`,a=f(r)?r.getRootNode():null,o=Array.from((u(a)?a:D(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>K(e,r))))return;let c=f(r)?r:null;for(;c&&!l(c);){let e=d(c);if(l(e)||!f(e))break;c=e}if(!(o.length&&f(r)&&!Pe(r)&&!K(r,e.select(`floatingElement`))&&o.every(e=>!K(c,e)))){if(S(r)&&!(`touches`in n)){let e=l(r),t=v(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,u=t.direction===`rtl`,d=c&&(u?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),f=s&&n.offsetY>r.clientHeight;if(d||f)return}if(!b(n)){if(p()===`intentional`){if(n.detail!==0&&!We(n)&&!A.current)return;if(k.current){t.clear(),k.current=!1;return}}(typeof x!=`function`||x(n))&&(R(`__outsidePressBubbles`)||(e.setOpen(!1,zt(Gt,n)),L()))}}}function F(t){p()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!z(t)&&E(t)}function B(t){if(p()!==`sloppy`||!e.select(`open`)||!n||z(t))return;let r=t.touches[0];r&&(N.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{N.current&&(N.current.dismissOnTouchEnd=!1,N.current.dismissOnMouseDown=!1)}))}function H(e,t){let n=se(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function U(e){M.current=`touch`,H(e,B)}function ne(e){P.clear(),e.type===`pointerdown`&&(e.button===0&&(A.current=!0),M.current=e.pointerType),(e.type!==`mousedown`||!N.current||N.current.dismissOnMouseDown)&&H(e,e=>{e.type===`pointerdown`?F(e):E(e)})}function ie(e){if(e.type===`pointercancel`&&(A.current=!1),!te.current)return;let n=O.current;c(),p()===`intentional`&&(e.type===`pointercancel`?n&&s():b(e)||(n?s():(typeof x!=`function`||x(e))&&(t.clear(),k.current=!0,L())))}function ae(e){if(p()!==`sloppy`||!N.current||z(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-N.current.startX),r=Math.abs(t.clientY-N.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(N.current.dismissOnTouchEnd=!0),i>10&&(E(e),P.clear(),N.current=null)}function W(e){H(e,ae)}function G(e){p()===`sloppy`&&N.current&&!z(e)&&(N.current.dismissOnTouchEnd&&E(e),P.clear(),N.current=null)}function oe(e){H(e,G)}let ce=rn(r&&rn($(i,`keydown`,V),$(i,`compositionstart`,a),$(i,`compositionend`,o)),C&&rn($(i,`click`,ne,!0),$(i,`pointerdown`,ne,!0),$(i,`pointerup`,ie,!0),$(i,`pointercancel`,ie,!0),$(i,`mousedown`,ne,!0),$(i,`mouseup`,ie,!0),$(i,`touchstart`,U,{capture:!0,passive:!0}),$(i,`touchmove`,W,{capture:!0,passive:!0}),$(i,`touchend`,oe,{capture:!0,passive:!0})));return()=>{ce(),t.clear(),c(),k.current=!1}},[g,h,r,C,x,m,n,w,T,V,L,ee,R,z,y,e,P,I]);let ie=E.useMemo(()=>({onKeyDown:V,onPointerDown:B,onClick:B}),[V,B]),ae=E.useMemo(()=>({onKeyDown:V,onPointerDown:ne,onMouseDown:ne,onClickCapture:H,onMouseDownCapture(e){H(),U(e)},onPointerDownCapture(e){H(),U(e)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[V,H,U,ne]);return E.useMemo(()=>n?{reference:ie,floating:ae,trigger:ie}:{},[n,ie,ae])}function tr(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),_(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};f(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function nr(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=p(i),{mounted:c,setMounted:l,transitionStatus:u}=Rt(t,!1,!1,o),d=!t&&r;_(()=>{t&&s(!1)},[t,s]);let f=E.useRef(c),m=E.useRef(!1),h=O(),g=()=>{f.current=!1,l(!1),a()};_(()=>{f.current=c,m.current&&(m.current=!1,!t&&c&&g())});let v=p(()=>{f.current&&(t?(m.current=!0,h()):g())});return Lt({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||v()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:v}}var rr={tabIndex:-1,[ce]:``};function ir(e){return t=>t!==`touch`||e.current}function ar(e,t=!1){let n=M(),r=Rn()!=null,i=C(()=>e(n,r)).current;return tr({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function or({handle:e,store:t}){return _(()=>e.attachStore(t),[e,t]),null}function sr(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function cr(e,t){let n=E.useRef(null);return p(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),sr(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),sr(t))})}function lr(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function ur(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function dr(e,t,n,r={}){let i=n.reason,a=i===Ut,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=ur(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=lr(e.state,t,n.trigger,c()),l={...r.extraState,...i};o?l.instantType=`focus`:s?l.instantType=`dismiss`:a&&(l.instantType=void 0),e.update(l)};a?Mt.flushSync(l):l()}function fr(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=cr(e,n),o=p(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=p(e=>{a(e),e&&o(e)});return _(()=>(s(t.current),()=>s(null)),[s,t,n,e]),_(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function pr(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=E.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);_(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=zt(Vt);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function mr(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=nr({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return C(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function hr(e,t){e.useSyncedValues(t),_(()=>()=>{e.update({activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r})},[e])}function gr(e,t){_(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),_(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var _r=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},vr=ee(),yr=w(),br=[],xr=void 0;function Sr(){return xr}function Cr(e){br.push(e)}function wr(e){let t=(t,n)=>{let r=C(Er).current,i;try{xr=r;for(let e of br)e.before(r);i=e(t,n);for(let e of br)e.after(r);r.didInitialize=!0}finally{xr=void 0}return i};return t.displayName=e.displayName||e.name,t}function Tr(e){return E.forwardRef(wr(e))}function Er(){return{didInitialize:!1}}var Dr=a(19)?Ar:jr;function Or(e,t,n,r,i){return Dr(e,t,n,r,i)}function kr(e,t,n,r,i){let a=E.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,vr.useSyncExternalStore)(e.subscribe,a,a)}Cr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,vr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ar(e,t,n,r,i){let a=Sr();if(!a)return kr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function jr(e,t,n,r,i){return(0,yr.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Mr=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Or(this,e,t,n,r)}},Nr=class extends Mr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){E.useDebugValue(e);let n=this;_(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;_(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);_(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){E.useDebugValue(e);let n=this,r=t!==void 0;_(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return E.useDebugValue(e),Or(this,this.selectors[e],t,n,r)}useContextCallback(e,t){E.useDebugValue(e);let n=p(t??i);this.context[e]=n}useStateSetter(e){let t=E.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},Pr={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},Fr=class extends Nr{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Pn(),nested:n,triggerElements:i},Pr),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&qe(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Ir(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Fr({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:r,inactiveTriggerProps:r,popupProps:r}}var Lr=e=>e.triggerIdProp??e.activeTriggerId,Rr=e=>e.openProp??e.open,zr=e=>(e.popupElement?.id??e.floatingId)||void 0;function Br(e,t){return t!==void 0&&Rr(e)&&Lr(e)===t}function Vr(e,t){return Br(e,t)?!0:t!==void 0&&Rr(e)&&Lr(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Hr={open:Rr,mounted:e=>e.mounted,transitionStatus:e=>Rr(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Lr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:zr,isTriggerActive:(e,t)=>t!==void 0&&Lr(e)===t,isOpenedByTrigger:(e,t)=>Br(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Lr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Vr(e,t)?zr(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},Ur=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function Wr(e){return a(19)?e:e?`true`:void 0}var Gr=E.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,W.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Kr={},qr={},Jr=``;function Yr(e,t){return x(e)?e:t}function Xr(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Yr(t,n)).overflowY)}function Zr(e){if(typeof document>`u`)return!1;let t=D(e);return b(t).innerWidth-t.documentElement.clientWidth>0}function Qr(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=D(e),n=t.documentElement,r=t.body,i=Yr(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function $r(e){let t=D(e),n=t.documentElement,r=t.body,i=Yr(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function ei(e){let t=D(e),n=t.documentElement,r=t.body,i=b(n),a=0,o=0,s=!1,c=Z.create();if(re&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Kr={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},Jr=n.style.scrollBehavior,qr={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Yr(n,r);s=Qr(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Kr),Object.assign(r.style,qr),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=Jr)}function d(){u(),c.request(l)}l();let f=$(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ti=new class{lockCount=0;restore=null;timeoutLock=Dt.create();timeoutUnlock=Dt.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=D(e),n=t.documentElement,r=t.body,i=b(n);if(Xr(i,n,r)){let t=new i.MutationObserver(()=>{Xr(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=B||!Zr(e);this.restore=a?$r(e):ei(e)}};function ni(e=!0,t=null){_(()=>{if(e)return ti.acquire(t)},[e,t])}export{Xt as $,oe as $t,Rn as A,ze as At,un as B,De as Bt,cr as C,Je as Ct,Vn as D,Ge as Dt,Zn as E,We as Et,Tn as F,Re as Ft,$t as G,me as Gt,an as H,ve as Ht,wn as I,je as It,Yt as J,Y as Jt,qt as K,de as Kt,En as L,ke as Lt,Fn as M,Me as Mt,Nn as N,Le as Nt,Hn as O,He as Ot,Mn as P,Fe as Pt,Zt as Q,G as Qt,Dn as R,Ae as Rt,fr as S,tt as St,er as T,Ke as Tt,rn as U,he as Ut,ln as V,ge as Vt,$ as W,_e as Wt,nn as X,q as Xt,Jt as Y,ue as Yt,Kt as Z,J as Zt,pr as _,xt as _t,Ir as a,B as an,Ut as at,ar as b,Ye as bt,wr as c,D as cn,Bt as ct,rr as d,It as dt,K as en,Vt as et,or as f,Z as ft,lr as g,Tt as gt,ir as h,Ot as ht,Ur as i,re as in,Wt as it,zn as j,Ie as jt,Bn as k,Be as kt,Tr as l,te as ln,Rt as lt,ur as m,Dt as mt,Gr as n,ae as nn,Qt as nt,Hr as o,U as on,Ht as ot,dr as p,jt as pt,tn as q,X as qt,Wr as r,ie as rn,en as rt,Nr as s,N as sn,zt as st,ni as t,se as tn,Gt as tt,_r as u,Lt as ut,mr as v,St as vt,tr as w,$e as wt,gr as x,Ze as xt,hr as y,Xe as yt,fn as z,Oe as zt};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{F as t,c as n,o as r,s as i,ut as a}from"./button-C4yvcSko.js";import{Dt as o,Pt as s,Tt as c,Y as l,_t as u,an as d,cn as f,dt as p,ht as m,ln as h,ot as g,pt as _,st as v,t as y,tn as b,vt as x}from"./useScrollLock-BOb01sL8.js";var S=e(a(),1);function C(e,t){let r=S.useRef(e),a=n(t);i(()=>{r.current!==e&&a(r.current),r.current=e},[e,a])}function w(e,n={}){let{enabled:r=!0,event:i=`click`,toggle:a=!0,ignoreMouse:l=!1,stickIfOpen:u=!0,touchOpenDelay:d=0,reason:f=g}=n,p=e.context.dataRef,h=S.useRef(void 0),y=_(),x=m(),C=S.useMemo(()=>{function t(t,n,r,i){let a=v(f,n,r);t&&i===`touch`&&d>0?x.start(d,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let i=p.current.openEvent,o=e.select(`domReferenceElement`)!==n;return t&&o||!t||!a?!0:i&&(typeof u==`function`?u():u)?!r(i.type):!1}return{onPointerDown(e){h.current=c(e.pointerType,!0)&&o(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(r){let a=h.current,o=r.nativeEvent,u=e.select(`open`);if(r.button!==0||i===`click`||c(a,!0)&&l)return;let d=n(u,r.currentTarget,e=>e===`click`||e===`mousedown`),f=b(o),p=s(f);if(p||a===`virtual`){t(d,o,p?f:r.currentTarget,a);return}let m=r.currentTarget;y.request(()=>{t(d,o,m,a)})},onClick(r){if(i===`mousedown-only`)return;let a=h.current;i===`mousedown`&&a?h.current=void 0:c(a,!0)&&l||t(n(e.select(`open`),r.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),r.nativeEvent,r.currentTarget,a)},onKeyDown(){h.current=void 0}}},[p,i,l,f,e,u,a,y,x,d]);return S.useMemo(()=>r?{reference:C}:t,[r,C])}function T(e){let t=S.useRef(``),n=S.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:S.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function E(e,t){let{onClick:r,onPointerDown:i}=T(n((n,r)=>{(typeof e==`function`?e():e)||t(r||(d?`touch`:``))}));return S.useMemo(()=>({onClick:r,onPointerDown:i}),[r,i])}function D(e){let[t,n]=S.useState(null),r=E(e,n);return C(e,t=>{t&&!e&&n(null)}),S.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var O=S.createContext(void 0);function k(e){let t=S.useContext(O);if(t===void 0&&!e)throw Error(r(69));return t}function A(e){let{store:t,domReference:n,positionerElement:r,open:a}=e,o=S.useRef(null),s=S.useRef(null),c=p(r);i(()=>{a||(s.current?.abort(),s.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[a,t]),i(()=>{let e=n,r=o.current;if(e&&(o.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return s.current=i,c(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,c,t])}var j=20;function M(e,t,n,r){let[a,o]=S.useState(!1);i(()=>{if(!e||!t||n==null){o(!1);return}let r=f(n).documentElement.clientWidth,i=n.offsetWidth;o(r>0&&i>0&&i>=r-j)},[e,t,n]),y(e&&(!t||a),r)}var N=e(h(),1);function P(e,t){function n(n,r,i){let a=n.currentTarget;N.flushSync(()=>{e.setOpen(!1,v(l,n.nativeEvent,a))}),u(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&x(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}export{D as a,k as i,M as n,E as o,A as r,w as s,P as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{ut as t}from"./button-C4yvcSko.js";var n=e(t(),1),r=n.use,i=n.useLayoutEffect;export{i as n,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./rolldown-runtime-XKyaHtl9.js";import{ut as t}from"./button-C4yvcSko.js";var n=e((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),r=e(((e,t)=>{t.exports=n()})),i=e((e=>{var n=t(),i=r();function a(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var o=typeof Object.is==`function`?Object.is:a,s=i.useSyncExternalStore,c=n.useRef,l=n.useEffect,u=n.useMemo,d=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=c(null);if(a.current===null){var f={hasValue:!1,value:null};a.current=f}else f=a.current;a=u(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,o(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var a=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=s(e,a[0],a[1]);return l(function(){f.hasValue=!0,f.value=p},[p]),d(p),p}})),a=e(((e,t)=>{t.exports=i()}));export{r as n,a as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as e,k as t,lt as n}from"./button-C4yvcSko.js";import{c as r}from"./operator-copy-DsM7LJx6.js";import{n as i}from"./useNavigate-lXd3v3E0.js";import{B as a,F as o,P as s,R as c,V as l,z as u}from"./index-BljdfRBm.js";import{a as d,i as f,n as p,o as m,r as h,t as g}from"./table-B6NH8hTW.js";import{r as _}from"./status-badge-CNlyvwWL.js";import{a as v,d as y,i as b,l as x,n as S,r as C,s as w,t as T,u as E}from"./section-Cm-j3zHs.js";var D=n(),O=({capacity:e,leased:t})=>`${t} of ${c(e,`slot`)} in use`,k=({slots:e})=>(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`inline-flex flex-wrap gap-1`,children:Array.from({length:Math.max(e.capacity,e.leased)},(n,r)=>(0,D.jsx)(`span`,{className:t(`size-2.5 rounded-xs ring-1 ring-inset`,r<e.leased?`bg-run-active ring-run-active`:`ring-input`)},r))}),A=({worker:e})=>{let{state:t,checkedAt:n}=u(e);return t===`unchecked`?(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:`Not checked`}):(0,D.jsxs)(`span`,{className:`inline-flex items-baseline gap-2`,children:[(0,D.jsx)(_,{state:t===`failed`?`Failed`:`Succeeded`,label:t===`failed`?`Failed`:`Passed`}),n!==null&&(0,D.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground tabular-nums`,children:r(n)})]})},j=({worker:t})=>{let n=i(),r={worker:t.name};return(0,D.jsxs)(x,{open:()=>void n({to:`/configuration/workers/$worker`,params:r}),children:[(0,D.jsx)(h,{className:`py-3`,children:(0,D.jsx)(e,{to:`/configuration/workers/$worker`,params:r,onClick:e=>e.stopPropagation(),className:y,children:t.name})}),(0,D.jsx)(h,{children:a[t.kind]}),(0,D.jsx)(h,{className:`hidden font-mono text-xs md:table-cell`,children:l(t)}),(0,D.jsx)(h,{className:`tabular-nums`,children:t.slots===null?(0,D.jsxs)(`span`,{className:`text-muted-foreground`,children:[t.maxConcurrentAttempts,` max`]}):(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,D.jsx)(k,{slots:t.slots}),(0,D.jsxs)(`span`,{className:`max-sm:sr-only`,children:[t.slots.leased,` of `,t.slots.capacity]})]})}),(0,D.jsx)(h,{className:`w-full`,children:(0,D.jsx)(A,{worker:t})})]})},M=({configuration:e})=>{let t=e.workers.some(({slots:e})=>e!==null);return(0,D.jsxs)(T,{title:`Workers`,counts:c(e.workers.length,`worker`),children:[!t&&(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempts run until the GitHub App is set up.`}),(0,D.jsx)(`div`,{className:`-mx-2`,children:(0,D.jsxs)(g,{children:[(0,D.jsx)(d,{children:(0,D.jsxs)(m,{className:`hover:bg-transparent`,children:[(0,D.jsx)(f,{children:`Worker`}),(0,D.jsx)(f,{children:`Kind`}),(0,D.jsx)(f,{className:`hidden md:table-cell`,children:`Location`}),(0,D.jsx)(f,{children:`Slots in use`}),(0,D.jsx)(f,{className:`w-full`,children:`Last preflight`})]})}),(0,D.jsx)(p,{children:e.workers.map(e=>(0,D.jsx)(j,{worker:e},e.name))})]})}),e.removedWorkers.length>0&&(0,D.jsx)(`ul`,{className:`flex flex-col gap-1 text-muted-foreground`,children:e.removedWorkers.map(({name:e,running:t})=>(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:e}),` removed by a reload,`,` `,c(t,`attempt`),` still running`]},e))})]})},N=({check:e})=>e._tag===`Passed`?(0,D.jsx)(_,{state:`Succeeded`,label:`Passed`}):(0,D.jsx)(_,{state:`Failed`,label:`Failed: ${s(e)}`}),P=({subject:e,detail:t,check:n})=>(0,D.jsxs)(m,{className:`hover:bg-transparent`,children:[(0,D.jsxs)(h,{className:`py-3 align-top whitespace-normal`,children:[(0,D.jsx)(`p`,{className:`font-medium`,children:e}),(0,D.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),(0,D.jsx)(h,{className:`py-3 align-top`,children:(0,D.jsx)(N,{check:n})}),(0,D.jsx)(h,{className:`py-3 align-top font-mono text-xs text-muted-foreground tabular-nums`,children:r(n.checkedAt)}),(0,D.jsx)(h,{className:`w-full py-3 align-top whitespace-normal wrap-anywhere`,children:n._tag===`Failed`?n.message:null})]}),F=({worker:e})=>(0,D.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,D.jsxs)(v,{children:[(0,D.jsx)(b,{label:`Kind`,children:a[e.kind]}),(0,D.jsxs)(b,{label:`Max attempts`,children:[(0,D.jsx)(`span`,{className:`tabular-nums`,children:e.maxConcurrentAttempts}),` `,(0,D.jsx)(E,{children:`at the same time`})]}),e.destination!==null&&(0,D.jsx)(b,{label:`Destination`,children:(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.destination})}),e.kind===`ssh`&&(0,D.jsx)(b,{label:`Port`,children:e.port===null?(0,D.jsx)(E,{children:`From the SSH configuration`}):(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.port})}),e.kind===`ssh`&&(0,D.jsx)(b,{label:`Identity file`,children:e.identityFile===null?(0,D.jsx)(E,{children:`From the SSH configuration`}):(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.identityFile})}),e.root!==null&&(0,D.jsx)(b,{label:`Root`,children:(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.root})})]}),e.gateway!==null&&(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsx)(`h2`,{className:`text-md font-semibold`,children:`Gateway`}),(0,D.jsxs)(v,{children:[(0,D.jsx)(b,{label:`Domain`,children:(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.gateway.domain})}),(0,D.jsx)(b,{label:`Destination`,children:(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.gateway.destination})}),(0,D.jsx)(b,{label:`Admin port`,children:(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.gateway.adminPort})}),(0,D.jsxs)(b,{label:`Admin token`,children:[(0,D.jsx)(E,{children:`Read from `}),(0,D.jsx)(`code`,{className:`font-mono text-xs`,children:e.gateway.adminTokenEnv})]}),(0,D.jsx)(b,{label:`LLM credentials`,children:e.gateway.llmProviders.length===0?(0,D.jsx)(E,{children:`None; each harness uses the login on the worker`}):e.gateway.llmProviders.join(`, `)})]})]})]}),I=({name:t,configuration:n})=>{let r=n.workers.find(e=>e.name===t);if(r===void 0)return(0,D.jsx)(T,{title:t,children:(0,D.jsxs)(w,{title:`Worker not found`,children:[(0,D.jsx)(`code`,{children:`usine.yaml`}),` has no worker `,t,`.`,` `,(0,D.jsx)(e,{to:`/configuration/workers`,className:`text-primary hover:underline`,children:`See all workers`}),`.`]})});let i=[...r.prerequisites===null?[]:[{subject:`Worker`,detail:`Machine, Git, memory, gateway, and credentials`,check:r.prerequisites}],...r.harnesses.map(({harness:e,check:t})=>({subject:o[e],detail:`Harness installed and logged in`,check:t}))];return(0,D.jsx)(T,{title:r.name,marks:(0,D.jsxs)(`span`,{className:`text-sm text-muted-foreground`,children:[a[r.kind],` worker`]}),children:(0,D.jsxs)(S,{facts:(0,D.jsx)(F,{worker:r}),children:[(0,D.jsx)(C,{title:`Slots`,children:r.slots===null?(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempts run until the GitHub App is set up.`}):(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(k,{slots:r.slots}),(0,D.jsx)(`p`,{className:`tabular-nums`,children:O(r.slots)})]})}),(0,D.jsx)(C,{title:`Preflight`,aside:`At startup, and when a reload adds workers, slots, or an agent with a new harness, model, or effort`,children:i.length===0?(0,D.jsx)(`p`,{className:`text-muted-foreground`,children:`No preflight since usine up started.`}):(0,D.jsx)(`div`,{className:`-mx-2`,children:(0,D.jsxs)(g,{children:[(0,D.jsx)(d,{children:(0,D.jsxs)(m,{className:`hover:bg-transparent`,children:[(0,D.jsx)(f,{children:`Check`}),(0,D.jsx)(f,{children:`Result`}),(0,D.jsx)(f,{children:`Checked`}),(0,D.jsx)(f,{className:`w-full`,children:`Detail`})]})}),(0,D.jsx)(p,{children:i.map(({subject:e,detail:t,check:n})=>(0,D.jsx)(P,{subject:e,detail:t,check:n},e))})]})})})]})})};export{M as n,I as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{lt as e}from"./button-C4yvcSko.js";import{on as t}from"./operator-copy-DsM7LJx6.js";import{G as n}from"./index-BljdfRBm.js";import{n as r}from"./workers-BgocBXT9.js";var i=e(),a=()=>{let{data:e}=t(n());return(0,i.jsx)(r,{configuration:e})};export{a as component};
|