@usine/server 0.4.1-next.262.g0f4d653 → 0.4.1-next.264.gfdecd7e
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/README.md +7 -9
- package/dist/backend.d.ts +4 -5
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +1 -3
- package/dist/backend.js.map +1 -1
- package/dist/configuration/catalog.d.ts +5 -0
- package/dist/configuration/catalog.d.ts.map +1 -0
- package/dist/configuration/catalog.js +38 -0
- package/dist/configuration/catalog.js.map +1 -0
- package/dist/http.d.ts +3 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +8 -19
- package/dist/http.js.map +1 -1
- package/dist/up.d.ts.map +1 -1
- package/dist/up.js +4 -2
- package/dist/up.js.map +1 -1
- package/dist/web/assets/Match-BsHjCE-9.js +1 -0
- package/dist/web/assets/_agent-CK1JZbEZ.js +1 -0
- package/dist/web/assets/_label-CkDrdgxa.js +1 -0
- package/dist/web/assets/_loop-DLKJmqFq.js +1 -0
- package/dist/web/assets/_name--06G9LKw.js +1 -0
- package/dist/web/assets/_name-BzeOsU08.js +1 -0
- package/dist/web/assets/_name-CCrJHJTI.js +1 -0
- package/dist/web/assets/_name-LWtfT5Eq.js +2 -0
- package/dist/web/assets/_number-BzeOsU08.js +1 -0
- package/dist/web/assets/{_number-BFZW4AfX.js → _number-CpU9ru_u.js} +1 -1
- package/dist/web/assets/_number-n4iejSEq.js +1 -0
- package/dist/web/assets/_run-BzeOsU08.js +1 -0
- package/dist/web/assets/_run-CHrGLkXR.js +5 -0
- package/dist/web/assets/_worker-BvlkSKMd.js +1 -0
- package/dist/web/assets/action-DQzkdVHs.js +1 -0
- package/dist/web/assets/actions-CG0hkpe7.js +1 -0
- package/dist/web/assets/agents-CgWsAMoz.js +1 -0
- package/dist/web/assets/agents-D3eAK_60.js +1 -0
- package/dist/web/assets/code-block-Y9Y-8fHK.js +4 -0
- package/dist/web/assets/collapsible-BKcakxvM.js +1 -0
- package/dist/web/assets/drawer-ClcvABkO.js +1 -0
- package/dist/web/assets/dropdown-menu-BHKHYfLs.js +1 -0
- package/dist/web/assets/edit-and-retry-DZ5FH7N6.js +1 -0
- package/dist/web/assets/error-alert-hABzwCSY.js +1 -0
- package/dist/web/assets/{file-error-Befud4JV.js → file-error-B5tv6DhJ.js} +1 -1
- package/dist/web/assets/heading-zIOXe3qT.js +1 -0
- package/dist/web/assets/history-PYEz5wbe.js +1 -0
- package/dist/web/assets/index-C_S4sA5L.css +2 -0
- package/dist/web/assets/index-Dki55xSv.js +10 -0
- package/dist/web/assets/{label-badge-nrvxD46n.js → label-badge-JdNthOHh.js} +1 -1
- package/dist/web/assets/labels-Dr9t-xYj.js +1 -0
- package/dist/web/assets/lazyRouteComponent-BnRF0Crs.js +1 -0
- package/dist/web/assets/list-NcxSR9Ja.js +1 -0
- package/dist/web/assets/loops-DI4kElkX.js +1 -0
- package/dist/web/assets/mark-uyeJ8aPC.js +1 -0
- package/dist/web/assets/model-87X7P9Uh.js +1 -0
- package/dist/web/assets/moves-DS1ecXd6.js +1 -0
- package/dist/web/assets/native-select-BzF8xUnx.js +1 -0
- package/dist/web/assets/{not-found-Bexl2Syq.js → not-found-D7GT8Sj7.js} +1 -1
- package/dist/web/assets/outcome-DvqnSso3.js +5 -0
- package/dist/web/assets/{overview-CVIU9T_Q.js → overview-C73v5kbv.js} +1 -1
- package/dist/web/assets/page-C47YAWAl.js +1 -0
- package/dist/web/assets/preload-helper-BLdHbfdN.js +1 -0
- package/dist/web/assets/pull-request-marks-B4f7z4xa.js +1 -0
- package/dist/web/assets/queries-BZMW2wiD.js +1 -0
- package/dist/web/assets/queries-oea_Y4on.js +1 -0
- package/dist/web/assets/repositories-CZBhubWh.js +1 -0
- package/dist/web/assets/route-BtU2HI1M.js +1 -0
- package/dist/web/assets/route-CD6OvH-7.js +1 -0
- package/dist/web/assets/route-status-DGpeFNCC.js +1 -0
- package/dist/web/assets/routes-BzeOsU08.js +1 -0
- package/dist/web/assets/routes-g6SHTgCO.js +65 -0
- package/dist/web/assets/run-again-DPa5c27z.js +1 -0
- package/dist/web/assets/{section-DkPPj0Qz.js → section-BZs0sQLB.js} +1 -1
- package/dist/web/assets/section-eyIYzZrG.js +24 -0
- package/dist/web/assets/settings-DusVdmgP.js +1 -0
- package/dist/web/assets/skeleton-87E84B2f.js +1 -0
- package/dist/web/assets/sortable.esm-Lp8AM6j2.js +5 -0
- package/dist/web/assets/{strings-skTeG228.js → strings-Bexnszes.js} +1 -1
- package/dist/web/assets/{strings-DONjvHz8.js → strings-DXB6PB2g.js} +69 -61
- package/dist/web/assets/tasks-BzeOsU08.js +1 -0
- package/dist/web/assets/tasks-ClShPUFW.js +1 -0
- package/dist/web/assets/usage-BMYuEDo9.js +1 -0
- package/dist/web/assets/use-open-run-B8nD_BT1.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-NN99o6YU.js +1 -0
- package/dist/web/assets/useControlled-B5kAMgo-.js +1 -0
- package/dist/web/assets/useSelector-CRBsgquS.js +1 -0
- package/dist/web/assets/useSuspenseQuery-DbhQN-t-.js +1 -0
- package/dist/web/assets/visuallyHidden-BUGCJ1D9.js +1 -0
- package/dist/web/assets/workers-CDWbu1Tb.js +1 -0
- package/dist/web/index.html +20 -13
- package/package.json +9 -9
- package/dist/web/assets/X.es-ClvLjC9g.js +0 -1
- package/dist/web/assets/_agent-DAEoPdV-.js +0 -1
- package/dist/web/assets/_loop-vCYTiV8K.js +0 -1
- package/dist/web/assets/_name-BU5JK5xh.js +0 -1
- package/dist/web/assets/_name-BzehryAG.js +0 -1
- package/dist/web/assets/_name-CqC1_Tkp.js +0 -1
- package/dist/web/assets/_name-PTdpQrSQ.js +0 -6
- package/dist/web/assets/_number-BzehryAG.js +0 -1
- package/dist/web/assets/_number-CTGqOC7Y.js +0 -1
- package/dist/web/assets/_run-BzehryAG.js +0 -1
- package/dist/web/assets/_run-CobdymLR.js +0 -8
- package/dist/web/assets/_worker-o45ziAln.js +0 -1
- package/dist/web/assets/action-D59leH3d.js +0 -1
- package/dist/web/assets/agents-DejXWwOW.js +0 -1
- package/dist/web/assets/agents-_VTnE2uR.js +0 -1
- package/dist/web/assets/collapsible-DfWPTljV.js +0 -1
- package/dist/web/assets/drawer-CG2uC8mz.js +0 -1
- package/dist/web/assets/dropdown-menu-BuVimdT5.js +0 -1
- package/dist/web/assets/edit-and-retry-DoBXzKs4.js +0 -1
- package/dist/web/assets/error-alert-B1wP9JKx.js +0 -1
- package/dist/web/assets/heading-CmCH5X04.js +0 -1
- package/dist/web/assets/index-C1tcW0Kz.js +0 -10
- package/dist/web/assets/index-Y-UpTvwI.css +0 -2
- package/dist/web/assets/list-C0Krf4aU.js +0 -1
- package/dist/web/assets/loops-BUL6rqOz.js +0 -1
- package/dist/web/assets/model-CYcw80ka.js +0 -1
- package/dist/web/assets/moves-BP3lsIkJ.js +0 -1
- package/dist/web/assets/outcome-CzVmfAHO.js +0 -5
- package/dist/web/assets/page-BuzrT_cg.js +0 -1
- package/dist/web/assets/pull-request-marks-oqSgsb3K.js +0 -1
- package/dist/web/assets/queries-CMOWVU8o.js +0 -1
- package/dist/web/assets/queries-DPtA2w4k.js +0 -1
- package/dist/web/assets/reload-DepSabvQ.js +0 -1
- package/dist/web/assets/repositories-C_W6sMMC.js +0 -1
- package/dist/web/assets/route-CEwJ12I0.js +0 -1
- package/dist/web/assets/route-DSZaQYtb.js +0 -1
- package/dist/web/assets/routes-BzehryAG.js +0 -1
- package/dist/web/assets/routes-CwATPoN5.js +0 -65
- package/dist/web/assets/run-again-hwgO0X30.js +0 -1
- package/dist/web/assets/section-DKHXjfWs.js +0 -1
- package/dist/web/assets/settings-BqZbr0qg.js +0 -1
- package/dist/web/assets/tasks-BzehryAG.js +0 -1
- package/dist/web/assets/tasks-DeTOoEpw.js +0 -1
- package/dist/web/assets/usage-BQwJd-Ch.js +0 -1
- package/dist/web/assets/useAnchoredPopupScrollLock-D1zkXMhu.js +0 -1
- package/dist/web/assets/usePositioner-BRxzSVtE.js +0 -1
- package/dist/web/assets/useTimeout-BC05Ghyu.js +0 -1
- package/dist/web/assets/workers-Oh2L44Fk.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{d as t,r as n}from"./overview-C73v5kbv.js";import{t as r}from"./link-C7GfYrMt.js";import{D as i}from"./button-4rhhIcK8.js";import{Mn as a,a as o,f as s,jn as c,zn as l}from"./strings-DXB6PB2g.js";var u=e(),d=({approval:e,className:n})=>{if(e===null)return null;let r=a(e.source),d=c(r,({approver:e})=>e);return(0,u.jsxs)(`span`,{className:i(`text-muted-foreground`,n),children:[(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:l(d,{onNone:()=>`Approved`,onSome:e=>`Approved by ${e}`})}),` · `,(0,u.jsx)(`time`,{dateTime:e.approvedAt,title:s(e.approvedAt),className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:o(e.approvedAt)}),l(r,{onNone:()=>null,onSome:({channel:e})=>(0,u.jsxs)(u.Fragment,{children:[` · `,(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:t[e]})]})})]})},f=({run:e,source:t,className:a})=>{if(e.runAgain===null)return null;let{from:c,requestedBy:d}=e.runAgain,f=c.slice(0,8);return(0,u.jsxs)(`span`,{className:i(`text-muted-foreground`,a),children:[(0,u.jsx)(`span`,{className:`whitespace-nowrap`,children:l(d,{onNone:()=>`Run again`,onSome:e=>`Run again by ${e}`})}),` · `,(0,u.jsx)(`time`,{dateTime:e.openedAt,title:s(e.openedAt),className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:o(e.openedAt)}),` · `,(0,u.jsxs)(`span`,{className:`whitespace-nowrap`,children:[`from run`,` `,t===`link`?(0,u.jsx)(r,{to:`/projects/$owner/$name/runs/$run`,params:{...n(e.repository),run:c},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 +1 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{r as t}from"./overview-
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{r as t}from"./overview-C73v5kbv.js";import{n}from"./useNavigate-AT5VkfZa.js";import{t as r}from"./link-C7GfYrMt.js";import{D as i}from"./button-4rhhIcK8.js";import{o as a}from"./table-hbKjhjeL.js";var o=e(),s=({id:e,title:t,count:n,countTone:r=`muted`,note:a,actions:s,children:c})=>(0,o.jsxs)(`section`,{"aria-labelledby":e,className:`flex min-w-0 flex-col gap-2`,children:[(0,o.jsxs)(`header`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-0.5`,children:[(0,o.jsx)(`h2`,{id:e,className:`text-lg font-semibold`,children:t}),n!==void 0&&n>0&&(0,o.jsx)(`span`,{className:i(`text-sm tabular-nums`,r===`needs-you`?`text-needs-you`:`text-muted-foreground`),children:n}),a!==void 0&&(0,o.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:a}),s!==void 0&&(0,o.jsx)(`div`,{className:i(`self-center`,a===void 0&&`ml-auto`),children:s})]}),c]}),c=({children:e})=>(0,o.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e}),l=({run:e,children:n})=>(0,o.jsx)(r,{to:`/projects/$owner/$name/runs/$run`,params:{...t(e.repository),run:e.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}),u=({run:e,className:r,children:s})=>{let c=n();return(0,o.jsx)(a,{className:i(e===null?`hover:bg-transparent`:`cursor-pointer hover:bg-muted/60 has-[a:focus-visible]:bg-muted/60`,r),onClick:e===null?void 0:n=>{n.target instanceof Element&&n.target.closest(`a, button`)!==null||c({to:`/projects/$owner/$name/runs/$run`,params:{...t(e.repository),run:e.id}})},children:s})};export{u as i,c as n,l as r,s as t};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{M as r,c as i,d as a,i as o,o as s,t as c,u as l}from"./page-C47YAWAl.js";import{t as u}from"./error-alert-hABzwCSY.js";import{D as d,E as f,L as p,O as m,f as h,n as ee,t as te,x as ne,y as re}from"./visuallyHidden-BUGCJ1D9.js";import{a as ie,c as g,i as ae,n as _,o as v,r as oe,t as se,u as ce}from"./queries-oea_Y4on.js";import{n as le}from"./useNavigate-AT5VkfZa.js";import{c as ue,l as de,s as fe,t as pe}from"./code-block-Y9Y-8fHK.js";import{i as me,r as y,t as he}from"./native-select-BzF8xUnx.js";import{D as ge,F as _e,M as ve,P as ye,R as be,V as xe,W as Se,h as Ce,i as we,k as Te,r as Ee,t as b}from"./button-4rhhIcK8.js";import{Bn as De,Bt as x,C as S,D as C,Dn as w,En as T,Et as E,G as Oe,Gt as ke,H as Ae,In as je,It as Me,J as D,K as Ne,Kt as Pe,L as Fe,Nt as Ie,O,Pn as Le,Pt as Re,R as ze,Rt as k,S as A,Tn as Be,U as Ve,V as j,Vt as He,W as M,Y as N,Yt as P,_n as Ue,_t as We,an as Ge,b as Ke,fn as F,gn as qe,hn as Je,kt as Ye,ln as Xe,lt as Ze,pn as Qe,qt as $e,sn as et,st as tt,un as nt,vt as rt,x as it,xt as at,y as ot,yn as st,yt as ct,z as lt}from"./strings-DXB6PB2g.js";import{i as ut,o as dt,r as ft,t as pt}from"./empty-B9bymfss.js";import{n as I}from"./queries-BZMW2wiD.js";import{G as mt,J as ht,K as gt,Q as _t,W as L,X as vt,Y as yt,Z as bt,q as xt}from"./index-Dki55xSv.js";import{r as St}from"./status-badge-CLPsMXtK.js";import{t as Ct}from"./useControlled-B5kAMgo-.js";import{t as wt}from"./markdown-BNebzGGH.js";import{o as Tt}from"./table-hbKjhjeL.js";import{a as Et,c as Dt,g as Ot,h as kt,i as At,l as jt,m as Mt,n as Nt,o as Pt,r as Ft,t as It,u as Lt}from"./sortable.esm-Lp8AM6j2.js";import{t as Rt}from"./label-badge-JdNthOHh.js";var zt=class extends i{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:o,isError:s,isRefetchError:c}=r,u=n.fetchMeta?.fetchMore?.direction,d=s&&u===`forward`,f=i&&u===`forward`,p=s&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:l(t,n.data),hasPreviousPage:a(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:c&&!d&&!p,isRefetching:o&&!f&&!m}}};function Bt(e,t){return s(e,zt,t)}var R=n(e(),1),Vt=new Map([[`bold`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M108,60A16,16,0,1,1,92,44,16,16,0,0,1,108,60Zm56,16a16,16,0,1,0-16-16A16,16,0,0,0,164,76ZM92,112a16,16,0,1,0,16,16A16,16,0,0,0,92,112Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,112ZM92,180a16,16,0,1,0,16,16A16,16,0,0,0,92,180Zm72,0a16,16,0,1,0,16,16A16,16,0,0,0,164,180Z`}))],[`duotone`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M208,32V224a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V32A16,16,0,0,1,64,16H192A16,16,0,0,1,208,32Z`,opacity:`0.2`}),R.createElement(`path`,{d:`M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z`}))],[`fill`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M192,16H64A16,16,0,0,0,48,32V224a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V32A16,16,0,0,0,192,16ZM100,200a12,12,0,1,1,12-12A12,12,0,0,1,100,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,100,80Zm56,120a12,12,0,1,1,12-12A12,12,0,0,1,156,200Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,140Zm0-60a12,12,0,1,1,12-12A12,12,0,0,1,156,80Z`}))],[`light`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M102,60A10,10,0,1,1,92,50,10,10,0,0,1,102,60Zm62,10a10,10,0,1,0-10-10A10,10,0,0,0,164,70ZM92,118a10,10,0,1,0,10,10A10,10,0,0,0,92,118Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,118ZM92,186a10,10,0,1,0,10,10A10,10,0,0,0,92,186Zm72,0a10,10,0,1,0,10,10A10,10,0,0,0,164,186Z`}))],[`regular`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M104,60A12,12,0,1,1,92,48,12,12,0,0,1,104,60Zm60,12a12,12,0,1,0-12-12A12,12,0,0,0,164,72ZM92,116a12,12,0,1,0,12,12A12,12,0,0,0,92,116Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,116ZM92,184a12,12,0,1,0,12,12A12,12,0,0,0,92,184Zm72,0a12,12,0,1,0,12,12A12,12,0,0,0,164,184Z`}))],[`thin`,R.createElement(R.Fragment,null,R.createElement(`path`,{d:`M100,60a8,8,0,1,1-8-8A8,8,0,0,1,100,60Zm64,8a8,8,0,1,0-8-8A8,8,0,0,0,164,68ZM92,120a8,8,0,1,0,8,8A8,8,0,0,0,92,120Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,120ZM92,188a8,8,0,1,0,8,8A8,8,0,0,0,92,188Zm72,0a8,8,0,1,0,8,8A8,8,0,0,0,164,188Z`}))]]),Ht=R.forwardRef((e,t)=>R.createElement(Se,{ref:t,...e,weights:Vt}));Ht.displayName=`DotsSixVerticalIcon`;var{workers:Ut,repos:Wt,labels:Gt,...Kt}=Ae.fields,qt=He(Kt),Jt={agent:ce,worker:M,repository:j,settings:qt},Yt=Me(Be(Jt)),Xt=P(Yt),Zt=(e,t)=>{if(!Xt(e.kind))return F(new D({file:N.make(e.key),stage:`schema`,expression:De(),message:`Use the text editor for this configuration entity.`}));let n=Jt[e.kind];return ke(n)(t,{onExcessProperty:`error`,errors:`all`}).pipe(Xe(t),qe(t=>D.fromSchema(N.make(e.key),t)))},Qt=(e,t)=>{let n=N.make(e.key);return e.kind===`agent`?Fe(N.make(`agents/${e.identifier}.md`),t).pipe(Je($e(ce)),Qe(e=>ke(Re)(e)),nt(`SchemaError`,e=>F(D.fromSchema(n,e)))):lt(n,t).pipe(Qe(e=>ke(Re)(e.toJS())),nt(`SchemaError`,e=>F(D.fromSchema(n,e))),Qe(t=>Zt(e,t)))};function $t(e,t,n,r=!0,i,a){let[o,s]=R.useState(),c=ne(i?`${i}-label`:void 0),l=!!a?.trim(),u=e??(l?void 0:t)??o;return Te(()=>{let i=e||t||l||!r?void 0:en(n.current,c);o!==i&&s(i)}),u}function en(e,t){let n=tn(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function tn(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}var nn=R.createContext({disabled:!1});function rn(){return R.useContext(nn)}var z=t(),B=(e,t)=>new O({kind:e,identifier:C.make(t)}),an=({kind:e,identifier:t})=>{switch(e){case`settings`:return`/configuration/settings`;case`repository`:return`/configuration/repositories/${t.split(`/`).map(encodeURIComponent).join(`/`)}`;default:return`/configuration/${e}s/${encodeURIComponent(t)}`}},on=(e,t)=>{let n=e.identifier;switch(e.kind){case`agent`:return t.agents.find(({name:e})=>e===n)?.loops.map(e=>`loop ${e}`)??[];case`loop`:return t.loops.find(({name:e})=>e===n)?.repositories.map(e=>`project ${e}`)??[];case`repository`:return t.loops.filter(({repositories:e})=>e.some(e=>e===n)).map(({name:e})=>`loop ${e}`);case`label`:return t.repositories.filter(({declaredLabels:e})=>e.some(({name:e})=>e===n)).map(({name:e})=>`project ${e}`);case`worker`:return t.repositories.map(({name:e})=>`project ${e}`);case`settings`:return t.repositories.map(({name:e})=>`project ${e}`)}},sn=(e,t,n)=>{switch(e){case`agent`:return`---
|
|
2
|
+
harness: codex
|
|
3
|
+
model: gpt-6-astra
|
|
4
|
+
effort: medium
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Complete one repository task at a time. Follow the repository instructions, run the required checks, and record any blocker on the issue or pull request.
|
|
8
|
+
`;case`loop`:return`---\ntrigger:\n on: issue\n if: item.state == "OPEN" && item.labels.nodes.exists(label, label.name == "ready-for-agent")\nagent: ${JSON.stringify(n)}\n---\n\nComplete issue #{{ item.number }}: {{ item.title }}.\n`;case`worker`:return`name: ${JSON.stringify(t)}\nkind: local\nmax_concurrent_attempts: 1\n`;case`repository`:return`name: ${JSON.stringify(t)}\n`;case`label`:return`name: ${JSON.stringify(t)}\ncolor: "808080"\n`;case`settings`:return`settings:
|
|
9
|
+
poll_interval: 60
|
|
10
|
+
`}},cn=(e,t)=>`${e} ${t}${e===1?``:`s`}`,ln={claude:`Claude Code`,codex:`Codex`,pi:`Pi`},un={local:`Local`,"exe.dev":`exe.dev`,ssh:`SSH`,cloudflare:`Cloudflare`},dn=`Harness checks run on the first machine, then on the next machine created after the configured interval since the last successful check.`,fn={none:`Not required`,required:`Required`},pn={write:`Write: push and merge`,read:`Read: review and comment, no push`},mn={machine:`machine`,toolchain:`toolchain`,memory:`memory`,"harness-login":`harness login`,credentials:`credentials`,gateway:`gateway`,container:`Docker`,provider:`provider`},hn={cpus:e=>`${e} ${e===1?`CPU`:`CPUs`}`,memoryMib:e=>`${e} MiB`,pids:e=>`${e} processes`},gn={cpus:`CPUs`,memoryMib:`memory`,pids:`processes`},_n=new Intl.ListFormat(`en`,{type:`conjunction`}),vn=e=>We.map(t=>hn[t](e[t])).join(`, `),yn=e=>{let t=We.flatMap(t=>{let n=e[t];return n===null?[]:[hn[t](n)]}),n=We.filter(t=>e[t]===null);return{configured:t.length===0?null:t.join(`, `),derived:n.length===0?null:_n.format(n.map(e=>gn[e]))}},bn=e=>e.capability===null?`check failed`:mn[e.capability],xn=e=>{switch(e.kind){case`local`:return`This machine`;case`exe.dev`:return`exe.dev VM ${e.name}`;case`ssh`:{let{provisioner:t}=e;return t===null?e.destination??``:`${t._tag===`hetzner`?`hetzner ${t.serverType} in ${t.location}`:`boat ${t.size}`}, one machine per attempt`}case`cloudflare`:return`A Cloudflare sandbox per attempt`}},Sn=e=>{let t=[...e.prerequisites===null?[]:[e.prerequisites],...e.harnesses.map(({check:e})=>e)],n=t.filter(({_tag:e})=>e===`Failed`),r=e=>e.reduce((e,{checkedAt:t})=>e===null||t>e?t:e,null);if(n.length>0)return{state:`failed`,checkedAt:r(n)};let i=t.filter(({_tag:e})=>e===`Degraded`);if(i.length>0)return{state:`degraded`,checkedAt:r(i)};let a=t.reduce((e,t)=>e===void 0||t.checkedAt>e.checkedAt?t:e,void 0);return a===void 0?{state:`unchecked`,checkedAt:null}:{state:a._tag===`Deferred`?`deferred`:`passed`,checkedAt:a.checkedAt}},Cn=e=>{let t=e.loops.filter(({paused:e})=>e).length,n=e.quarantinedLoops.length;return[cn(e.loops.length,`loop`),...t>0?[`${t} paused`]:[],...n>0?[`${n} not loaded`]:[]].join(`, `)},wn=`Server upgrades`,Tn=`Upgrade when idle`,En=`Upgrade now`,Dn=`View changes`,On=`Wait for running attempts to finish. No new attempt starts while waiting.`,kn=`Restart now. Running attempts reattach after the server restarts.`,An=`App upgrades require a global npm install managed by systemd. Use usine status and usine upgrade for this instance.`,jn=`No newer version is available.`,Mn=`Upgrade checks are off.`,Nn=`Waiting for running attempts to finish. No new attempts will start.`,Pn=`Installing and restarting. This page reconnects when the server answers.`,Fn=(e,t,n)=>`Upgrade to ${t} failed. Restored ${e}. ${n}`,In=`Running version`,Ln=`Channel`,Rn=`Mode`,zn=e=>`Version ${e} is available.`,V={noLabels:`No labels`,addLabel:`Choose New to declare a label.`,localOperator:`Local operator`,edit:`Edit`,save:`Save`,saving:`Saving…`,cancel:`Cancel`,delete:`Delete`,confirmDelete:`Confirm delete`,new:`New`,history:`History`,revert:`Revert`,confirmRevert:`Confirm revert`,message:`Message (optional)`,name:`Name`,source:`Configuration text`,draft:`Unsaved draft`,reload:`Reload text`,deletedConflict:`This entity was deleted. Reload text to start a new version; your draft remains available below.`,conflict:`The configuration changed since this editor opened. Review the newer revision before saving. Reloading keeps your unsaved draft below for copying.`,paused:`New loops start paused. Review the loop before resuming it.`,emptyHistory:`No revisions`,more:`Older revisions`,loading:`Loading…`,noDiff:`No text changes`,saved:`Saved`,deleted:`Deleted`,reverted:`Revision reverted`,deleteWarning:e=>`Delete ${e}?`,references:e=>e.length===0?`No loops or projects reference this entity.`:`Referenced by: ${e.join(`, `)}.`,revertWarning:`Revert restores every entity in this revision. Later changes can prevent a revert.`,alreadyExists:`This name already exists. Open the entity to edit it.`,create:e=>`New ${e}`,revision:e=>`Revision ${e}`},Bn={add:`Choose New to add an agent.`,parentOverride:`Set on this agent`,parentModelUnset:`Not set on this agent or in settings`},Vn=`Choose New to add a loop. New loops start paused.`,Hn=`Choose New to register a repository.`,Un=`At startup, and when a revision adds workers, slots, or an agent with a new harness, model, or effort`,H={text:`Edit as text`,form:`Edit as form`,choose:`Choose…`,name:`Name`,identity:`The name identifies this entity. Choose a name when creating it.`,harness:`Harness`,effort:`Effort`,model:`Model`,persona:`Persona`,modelHint:`Suggestions use models configured for this harness. Any model ID is accepted.`,preview:`Preview persona`,hidePreview:`Hide preview`,loading:`Loading choices…`,secret:`Enter an environment variable name. The value lives in .env.`,restartWorker:`For an existing worker, changes other than the slot count require a restart. Slot changes apply live.`,restartSettings:`Changes to webhooks or tracing require a restart.`,derived:`Derived at preflight when unset`,lastPreflight:`Last preflight`,repositories:`Repository`,noRepositories:`All installation repositories are registered.`,tags:`Tags (comma-separated)`,lanes:`Lanes`,addLane:`Add lane`,removeLane:`Remove lane`,laneName:`Lane name`,labels:`Labels`,states:`Item states`,noLabels:`No labels on this repository`,moveUp:`Move up`,moveDown:`Move down`,reorder:`Reorder lane`,orderHint:`Drag a lane handle, or focus it and use Space, Arrow Up or Arrow Down, then Space.`,gateway:`Gateway`,provisioner:`Machine provider`,existing:`Existing machine`,container:`Container`,add:`Add`,remove:`Remove`,key:`Key`,value:`Value`,providerKeys:`Provider environment variables`},Wn=[{path:`settings.poll_interval`,label:`Poll interval (seconds)`,kind:`number`,description:`Seconds between the starts of two GitHub poll cycles.`},{path:`settings.max_children`,label:`Maximum child sessions`,kind:`number`,description:`Maximum child sessions per attempt. Starting one more fails the attempt.`},{path:`settings.max_attempt_minutes`,label:`Attempt limit (minutes)`,kind:`number`,description:`Minutes an attempt may run before the runaway guard fails it. Leave blank for no ceiling.`},{path:`settings.max_attempt_tokens`,label:`Attempt token limit`,kind:`number`,description:`Tokens per attempt, parent and children combined. Leave blank for no ceiling.`},{path:`settings.parent_model`,label:`Parent model`,description:`Parent model when the agent sets none. Leave blank to let Pi choose.`},{path:`settings.parent_effort`,label:`Parent effort`,description:`Parent effort when the agent sets none. Leave blank to use the agent's effort.`},{path:`settings.upgrade_channel`,label:`Upgrade channel`,options:Oe.literals,description:`npm channel used to check for upgrades.`},{path:`settings.upgrade_mode`,label:`Upgrade mode`,options:Ne.literals,description:`Disable upgrade checks, propose upgrades, or install automatically when idle.`},{path:`operator`,label:`Operator GitHub login`,description:`The login recorded on approvals and messages, and the only login that can answer an ask on GitHub.`},{path:`webhooks.mode`,label:`Webhooks mode`,options:[`off`,`deliveries`,`endpoint`],description:`Parsed and validated; GitHub changes are read by polling. A change requires a restart.`}],U={publicUrl:`Public webhook URL`,publicUrlHint:`Where GitHub would deliver webhooks.`,tracing:`Export traces`,otlp:`OTLP URL`,otlpHint:`Collector endpoint that receives every span as OTLP/HTTP protobuf.`,service:`Service name`,serviceHint:`The service.name resource attribute of every exported span.`},W={kind:`Worker kind`,slots:`Concurrent attempts`,slotsHint:`Maximum attempts running on this worker at once.`,root:`Working directory`,destination:`SSH destination`,identity:`SSH identity file`,port:`SSH port`,image:`Container image`,cpus:`Container CPUs`,memory:`Container memory (MiB)`,pids:`Container process limit`,url:`Worker URL`,clientId:`Access client ID variable`,clientSecret:`Access client secret variable`,instanceType:`Instance type`,token:`Provider token variable`,serverType:`Server type`,location:`Location`,snapshot:`Snapshot`,network:`Network`,firewall:`Firewall`,sshKey:`SSH key name`,sshUser:`SSH user`,size:`Sandbox size`,domain:`Gateway domain`,gatewayDestination:`Gateway SSH destination`,adminPort:`Gateway admin port`,adminToken:`Gateway token variable`,providers:`Gateway LLM providers (comma-separated)`,tailnet:`Join a tailnet`,gatewayAddress:`Tailnet gateway address`,tailnetId:`Tailnet client ID variable`,tailnetSecret:`Tailnet client secret variable`,anthropic:`Anthropic API key variable`,openai:`OpenAI API key variable`,labels:`Machine labels`,sshWait:`SSH wait (seconds)`,backoffMin:`Minimum creation backoff (seconds)`,backoffMax:`Maximum creation backoff (seconds)`,checkInterval:`Machine check interval (seconds)`},G=e=>P(Re)(e)?e:{},Gn=e=>P(Ye(Ie))(e)?e:[],Kn=e=>P(x)(e)?e:P(k)(e)?String(e):``,K=(e,t)=>t.split(`.`).reduce((e,t)=>G(e)[t],e),q=(e,t,n)=>{let[r,...i]=t.split(`.`);if(r===void 0)return e;let a={...e};return i.length>0?a[r]=q(G(e[r]),i.join(`.`),n):n===void 0?delete a[r]:a[r]=n,a},qn=(e,t)=>st(Ue(Qt(e,t))),Jn=(e,t)=>st(Ue(Zt(e,t))),Yn=(e,t)=>{if(e.kind!==`agent`)return ze(t);let{name:n,persona:r,parentModel:i,parentEffort:a,...o}=t,s=o,c=G(i),l=G(a);return c._tag===`Some`&&c.value!==void 0&&(s={...s,parent_model:c.value}),l._tag===`Some`&&l.value!==void 0&&(s={...s,parent_effort:l.value}),`---\n${ze(s)}---\n${Kn(r)}`},Xn=e=>P(Yt)(e.kind),J=({value:e,onChange:t,problems:n,path:r,label:i,description:a,kind:o,options:s,suggestions:c,readOnly:l,optional:u})=>{let d=(0,R.useId)(),f=n.filter(e=>e.path.join(`.`)===r),p={id:d,value:Kn(K(e,r)),readOnly:l,"aria-invalid":f.length>0,"aria-describedby":`${d}-help`,onChange:n=>{let i=n.target.value;t(q(e,r,u&&i===``?void 0:o===`number`?i===``?void 0:Number(i):i))}};return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,z.jsx)(y,{htmlFor:d,children:i}),s===void 0?o===`textarea`?(0,z.jsx)(me,{...p,className:`min-h-36 min-w-0 [field-sizing:fixed]`}):(0,z.jsx)(L,{...p,type:o===`number`?`number`:`text`,step:`any`,list:c===void 0?void 0:`${d}-options`}):(0,z.jsxs)(he,{...p,className:`w-full`,disabled:l,children:[(0,z.jsx)(`option`,{value:``,children:H.choose}),s.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]}),c!==void 0&&(0,z.jsx)(`datalist`,{id:`${d}-options`,children:c.map(e=>(0,z.jsx)(`option`,{value:e},e))}),(0,z.jsxs)(`div`,{id:`${d}-help`,className:`space-y-1 text-xs wrap-anywhere`,children:[a&&(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:a}),f.map((e,t)=>(0,z.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message},t))]})]})},Y=({definitions:e,...t})=>(0,z.jsx)(`div`,{className:`grid min-w-0 gap-4 sm:grid-cols-2`,children:e.map(e=>(0,z.jsx)(J,{...t,...e},e.path))}),Zn=e=>{let t=p(se()),n=p(I()),[r,i]=(0,R.useState)(!1),a=[...new Set(n.data?.agents.filter(t=>t.harness===e.value.harness).map(e=>e.model)??[])];return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[t.isPending&&(0,z.jsx)(`p`,{role:`status`,children:H.loading}),t.isError&&(0,z.jsx)(u,{message:t.error.message}),(0,z.jsx)(Y,{...e,definitions:[{path:`name`,label:H.name,readOnly:!0,description:H.identity},{path:`harness`,label:H.harness,options:t.data?.harnesses??[]},{path:`model`,label:H.model,suggestions:a,description:H.modelHint},{path:`effort`,label:H.effort,options:t.data?.efforts??[]}]}),(0,z.jsx)(J,{...e,path:`persona`,label:H.persona,kind:`textarea`}),(0,z.jsx)(b,{type:`button`,variant:`outline`,className:`self-start`,onClick:()=>i(!r),"aria-expanded":r,children:r?H.hidePreview:H.preview}),r&&(0,z.jsx)(`div`,{className:`min-w-0 wrap-anywhere`,children:(0,z.jsx)(wt,{children:Kn(e.value.persona)})})]})},Qn=({value:e,onChange:t,problems:n,path:r,label:i})=>{let a=(0,R.useId)(),[o,s]=(0,R.useState)(()=>Gn(K(e,r)).map(Kn).join(`, `)),c=n.filter(e=>e.path.join(`.`).startsWith(r));return(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(y,{htmlFor:a,children:i}),(0,z.jsx)(L,{id:a,value:o,"aria-invalid":c.length>0,"aria-describedby":`${a}-errors`,onChange:n=>{s(n.target.value),t(q(e,r,n.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)))}}),(0,z.jsx)(`div`,{id:`${a}-errors`,children:c.map((e,t)=>(0,z.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message},t))})]})};function $n(e){if(!e)return null;for(let t of e.elements){let e=t.tagName;if(e===`BUTTON`||e===`INPUT`){let e=t;if(e.type===`submit`)return e}}return null}var er=`data-checked`,tr=`data-unchecked`;function nr(e){return{checked(t){return e.indeterminate?{}:t?{[er]:``}:{[tr]:``}},..._t}}var rr=R.createContext(void 0);function ir(){return R.useContext(rr)}var ar=R.createContext(void 0);function or(){let e=R.useContext(ar);if(e===void 0)throw Error(ve(14));return e}var sr=`data-parent`,cr=R.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,form:s,id:c,indeterminate:l=!1,inputRef:u,name:d,onCheckedChange:f,parent:p=!1,readOnly:m=!1,render:ie,required:g=!1,uncheckedValue:ae,value:_,nativeButton:v=!1,style:oe,...se}=e,{clearErrors:ce}=vt(),{disabled:le,name:ue,setDirty:de,setFilled:fe,setTouched:pe,state:me,validationMode:y,validityData:he,validation:ge}=bt(),ve=rn(),{labelId:Se,registerControlId:b,getDescriptionProps:De}=yt(),x=ir(),S=x?.allValues===void 0?void 0:x.parent,C=S!==void 0,w=le||ve.disabled||x?.disabled||o,T=ue??d,E=_??T,Oe=ne(),ke=x?.registerControlId!==b,Ae=ht({id:c||void 0,enabled:ke}),je=v?Ae:Oe,Me={};C&&(p?Me=S.getParentProps():E!==void 0&&(Me=S.getChildProps(E)));let{checked:D=n,indeterminate:Ne=l,onCheckedChange:Pe,...Fe}=Me,Ie=x?.value,O=R.useRef(null),Le=xt(w,O),{getButtonProps:Re,buttonRef:ze}=Ee({disabled:w,native:v}),k=x?.validation??ge,[A,Be]=Ct({controlled:E!==void 0&&Ie!==void 0&&!p?Ie.includes(E):D,default:i,name:`Checkbox`,state:`checked`}),Ve=C?!!D:A,j=C&&Ne||l;gt(O,Oe,A,void 0,!x&&!w,d);let He=S?.registerChildId,M=R.useRef(null),N=k.registerInput,P=x?E:void 0,Ue=R.useCallback(e=>N(e,{controlRef:O,value:P}),[N,P]),We=xe(u,M,p?void 0:Ue),Ge=$t(a,Se,M,!v,Ae,se[`aria-label`]);Te(()=>{M.current&&(M.current.indeterminate=j),x||fe(A)},[A,j,x,fe]),mt(A,()=>{x||(ce(T),de(A!==he.initialValue),k.change(A))});let Ke=_e({checked:A,disabled:w,form:s,name:p?void 0:T,id:v?void 0:Ae,required:g,ref:We,style:T?ee:te,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(m){e.preventDefault();return}let t=e.currentTarget.checked,n=re(h,e.nativeEvent);if(f?.(t,n),!n.isCanceled&&(Pe?.(t,n),!n.isCanceled&&(Be(t),E!==void 0&&x!==void 0&&!p&&!C))){let e=t?[...x.value,E]:x.value.filter(e=>e!==E);x.setValue(e,n)}},onClick(e){e.stopPropagation()},onFocus(){O.current?.focus()}},_===void 0?be:{value:(x?A&&_:_)||``},De,e=>k.getValidationProps(w,e));R.useEffect(()=>{if(!S||E===void 0)return;let e=S.disabledStatesRef.current;return e.set(E,w),()=>{e.delete(E)}},[S,w,E]);let F=R.useMemo(()=>({...me,checked:Ve,disabled:w,readOnly:m,required:g,indeterminate:j}),[me,Ve,w,m,g,j]),qe=nr(F),Je=ye(`span`,e,{state:F,ref:[ze,O,t],props:[{id:je,role:`checkbox`,"aria-checked":j?`mixed`:Ve,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":Ge,[sr]:p?``:void 0,onFocus(){Le(!0)},onBlur(){let e=M.current;e&&(pe(!0),Le(!1),y===`onBlur`&&k.commit(x?Ie:e.checked))},onKeyDown(e){if(e.key!==`Enter`||(e.preventBaseUIHandler(),e.defaultPrevented))return;let t=M.current?.form??null,n=e.currentTarget,r=e.nativeEvent,i=e.preventDefault,a=r.preventDefault,o=!1;e.preventDefault=()=>{o=!0,i.call(e)},r.preventDefault=()=>{o=!0,a.call(r)},a.call(r),Ce(n).queueMicrotask(()=>{e.preventDefault=i,r.preventDefault=a,o||$n(t)?.click()})},onClick(e){if(m||w)return;e.preventDefault();let t=M.current;t&&we(t,e)}},se,Fe,Re,De,e=>k.getValidationProps(w,e)],stateAttributesMapping:qe}),Ye=Je.props.id;return Te(()=>{if(He&&!p&&E!==void 0&&Ye!==void 0)return He(E,Ye)},[He,p,E,Ye]),(0,z.jsxs)(ar.Provider,{value:F,children:[Je,!A&&!x&&T&&!p&&ae!==void 0&&(0,z.jsx)(`input`,{type:`hidden`,form:s,name:T,value:ae,disabled:w}),(0,z.jsx)(`input`,{...Ke,suppressHydrationWarning:!0})]})}),lr=R.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=or(),c=s.checked||s.indeterminate,{mounted:l,transitionStatus:u,setMounted:p}=f(c),h=R.useRef(null),ee={...s,transitionStatus:u};m({batch:!0,enabled:!c,open:c,ref:h,onComplete(){c||p(!1)}});let te={...nr(s),...d},ne=a||l,re=ye(`span`,e,{ref:[t,h],state:ee,stateAttributesMapping:te,props:o});return ne?re:null});function X({className:e,...t}){return(0,z.jsx)(cr,{"data-slot":`checkbox`,className:ge(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-shadow outline-none group-has-disabled/field:opacity-50 group-has-[:focus-visible]/field-label:ring-0 group-has-[:focus-visible]/field-label:not-data-checked:border-input after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground group-has-[:focus-visible]/field-label:data-checked:border-primary dark:data-checked:bg-primary`,e),...t,children:(0,z.jsx)(lr,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,z.jsx)(fe,{})})})}var ur=({path:e,label:t,value:n,onChange:r,problems:i})=>{let[a,o]=(0,R.useState)(``),s=G(K(n,e)),c=e.split(`.`),l=i.filter(e=>c.every((t,n)=>e.path[n]===t));return(0,z.jsxs)(`fieldset`,{className:`min-w-0 space-y-3`,children:[(0,z.jsx)(`legend`,{className:`mb-2 font-medium`,children:t}),Object.entries(s).map(([t,i])=>(0,z.jsxs)(`div`,{className:`flex min-w-0 items-end gap-2`,children:[(0,z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,z.jsx)(J,{path:`value`,label:t,value:{value:i},problems:l.filter(e=>e.path[c.length]===t).map(e=>({...e,path:[`value`]})),onChange:i=>r(q(n,e,{...s,[t]:i.value??``}))})}),(0,z.jsx)(b,{type:`button`,variant:`ghost`,onClick:()=>{let i={...s};delete i[t],r(q(n,e,i))},children:H.remove})]},t)),l.filter(e=>e.path.length===c.length).map((e,t)=>(0,z.jsx)(`p`,{role:`alert`,className:`text-destructive wrap-anywhere`,children:e.message},t)),(0,z.jsxs)(`div`,{className:`flex min-w-0 items-end gap-2`,children:[(0,z.jsxs)(y,{className:`min-w-0 flex-1 flex-col items-start gap-2`,children:[H.key,(0,z.jsx)(L,{value:a,onChange:e=>o(e.target.value)})]}),(0,z.jsx)(b,{type:`button`,variant:`outline`,disabled:a.trim()===``||a in s,onClick:()=>{r(q(n,e,{...s,[a]:``})),o(``)},children:H.add})]})]})},dr=[{path:`provisioner.timings.ssh_wait`,label:W.sshWait,kind:`number`,optional:!0},{path:`provisioner.timings.creation_backoff_min`,label:W.backoffMin,kind:`number`,optional:!0},{path:`provisioner.timings.creation_backoff_max`,label:W.backoffMax,kind:`number`,optional:!0},{path:`provisioner.timings.machine_check_interval`,label:W.checkInterval,kind:`number`,optional:!0}],fr=e=>{let t=K(e.value,`provisioner.provider`);return(0,z.jsxs)(`div`,{className:`space-y-4`,children:[(0,z.jsx)(Y,{...e,definitions:[{path:`provisioner.token_env`,label:W.token,description:H.secret},...t===`hetzner`?[{path:`provisioner.server_type`,label:W.serverType},{path:`provisioner.location`,label:W.location},{path:`provisioner.image`,label:W.snapshot},{path:`provisioner.network`,label:W.network,optional:!0},{path:`provisioner.firewall`,label:W.firewall,optional:!0},{path:`provisioner.ssh_key`,label:W.sshKey},{path:`provisioner.ssh_user`,label:W.sshUser,optional:!0}]:[{path:`provisioner.size`,label:W.size,optional:!0},{path:`provisioner.snapshot`,label:W.snapshot,optional:!0}],{path:`provisioner.api_keys.anthropic`,label:W.anthropic,optional:!0,description:H.secret},{path:`provisioner.api_keys.openai`,label:W.openai,optional:!0,description:H.secret},...dr]}),t===`hetzner`&&(0,z.jsx)(ur,{...e,path:`provisioner.labels`,label:W.labels}),t===`boat`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(y,{children:[(0,z.jsx)(X,{checked:K(e.value,`provisioner.tailnet`)!==void 0,onCheckedChange:t=>e.onChange(q(e.value,`provisioner.tailnet`,t?{}:void 0))}),W.tailnet]}),K(e.value,`provisioner.tailnet`)!==void 0&&(0,z.jsx)(Y,{...e,definitions:[{path:`provisioner.tailnet.gateway_address`,label:W.gatewayAddress},{path:`provisioner.tailnet.client_id_env`,label:W.tailnetId,description:H.secret},{path:`provisioner.tailnet.client_secret_env`,label:W.tailnetSecret,description:H.secret}]})]})]})},pr=e=>{let t=Gn(e.value.llm_providers).map(G);return(0,z.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:ct.literals.map(n=>{let r=t.findIndex(e=>e.provider===n);return(0,z.jsx)(J,{path:`api_key_env`,label:n===`anthropic`?W.anthropic:W.openai,description:H.secret,optional:!0,value:r<0?{}:G(t[r]),problems:e.problems.filter(e=>e.path[0]===`llm_providers`&&e.path[1]===r).map(e=>({...e,path:e.path.slice(2)})),onChange:r=>e.onChange({...e.value,llm_providers:[...t.filter(e=>e.provider!==n),...r.api_key_env===void 0?[]:[{provider:n,api_key_env:r.api_key_env}]]})},n)})})},mr=e=>{let t=p(I()).data?.workers.find(t=>t.name===e.value.name)?.containerLimits,n=Kn(K(e.value,`provisioner.provider`)),r=e=>e===void 0?H.derived:`${H.lastPreflight}: ${e}. ${H.derived}.`;return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-5`,children:[(0,z.jsx)(Y,{...e,onChange:t=>e.onChange(t.kind===e.value.kind?t:{name:t.name??``,kind:t.kind??`local`,max_concurrent_attempts:t.max_concurrent_attempts??1}),definitions:[{path:`name`,label:H.name,readOnly:!0,description:H.identity},{path:`kind`,label:W.kind,options:Ve.members.map(e=>e.fields.kind.literal)},{path:`max_concurrent_attempts`,label:W.slots,kind:`number`,description:W.slotsHint}]}),e.value.kind===`ssh`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(y,{className:`flex flex-col items-start gap-2`,children:[H.provisioner,(0,z.jsxs)(he,{value:n,onChange:t=>{let n=t.target.value,r=q(e.value,`provisioner`,n===``?void 0:{provider:n});e.onChange(q(q(r,`destination`,n===``?``:void 0),`port`,void 0))},children:[(0,z.jsx)(`option`,{value:``,children:H.existing}),(0,z.jsx)(`option`,{value:`hetzner`,children:`Hetzner`}),(0,z.jsx)(`option`,{value:`boat`,children:`Boat`})]})]}),(0,z.jsx)(Y,{...e,definitions:[{path:`root`,label:W.root},{path:`identity_file`,label:W.identity,optional:!0},...n===``?[{path:`destination`,label:W.destination},{path:`port`,label:W.port,kind:`number`,optional:!0}]:[]]}),n!==``&&(0,z.jsx)(fr,{...e}),(0,z.jsxs)(`fieldset`,{className:`space-y-3`,children:[(0,z.jsx)(`legend`,{className:`mb-3 font-medium`,children:H.container}),(0,z.jsx)(Y,{...e,definitions:[{path:`container.image`,label:W.image,optional:!0},{path:`container.cpus`,label:W.cpus,kind:`number`,description:r(t?.cpus)},{path:`container.memory_mib`,label:W.memory,kind:`number`,description:r(t?.memoryMib)},{path:`container.pids`,label:W.pids,kind:`number`,description:r(t?.pids)}]})]}),(0,z.jsxs)(y,{children:[(0,z.jsx)(X,{checked:e.value.gateway!==void 0,onCheckedChange:t=>e.onChange(q(e.value,`gateway`,t?{}:void 0))}),H.gateway]}),e.value.gateway!==void 0&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Y,{...e,definitions:[{path:`gateway.domain`,label:W.domain},{path:`gateway.destination`,label:W.gatewayDestination},{path:`gateway.admin_port`,label:W.adminPort,kind:`number`},{path:`gateway.admin_token_env`,label:W.adminToken,description:H.secret}]}),(0,z.jsx)(Qn,{...e,path:`gateway.llm_providers`,label:W.providers})]})]}),e.value.kind===`cloudflare`&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Y,{...e,definitions:[{path:`worker_url`,label:W.url},{path:`access_client_id_env`,label:W.clientId,description:H.secret},{path:`access_client_secret_env`,label:W.clientSecret,description:H.secret},{path:`image`,label:W.image},{path:`instance_type`,label:W.instanceType,options:rt.literals}]}),(0,z.jsx)(pr,{...e})]}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:H.restartWorker})]})},hr=e=>(0,z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,z.jsx)(Y,{...e,onChange:t=>{let n=K(e.value,`webhooks.mode`),r=K(t,`webhooks.mode`);e.onChange(n===r?t:q(t,`webhooks`,r===`endpoint`?{mode:r,public_url:``}:{mode:r??`off`}))},definitions:Wn.map(e=>e.path===`settings.parent_effort`?{...e,options:at.literals,optional:!0}:{...e,optional:e.path===`operator`||e.path===`settings.parent_model`})}),K(e.value,`webhooks.mode`)===`endpoint`&&(0,z.jsx)(Y,{...e,definitions:[{path:`webhooks.public_url`,label:U.publicUrl,description:U.publicUrlHint}]}),(0,z.jsxs)(y,{children:[(0,z.jsx)(X,{checked:e.value.tracing!==void 0,onCheckedChange:t=>e.onChange(q(e.value,`tracing`,t?{otlp_url:``,service_name:`usine`}:void 0))}),U.tracing]}),e.value.tracing!==void 0&&(0,z.jsx)(Y,{...e,definitions:[{path:`tracing.otlp_url`,label:U.otlp,description:U.otlpHint},{path:`tracing.service_name`,label:U.service,description:U.serviceHint}]}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:H.restartSettings})]}),gr=({id:e,index:t,count:n,labels:r,remove:i,move:a,...o})=>{let s=At({id:e}),c=Gn(o.value.sources).map(G),l=(e,t,n)=>o.onChange({...o.value,sources:n?[...c,{[e]:t}]:c.filter(n=>n[e]!==t)}),u=c.flatMap(e=>`label`in e&&!r.some(t=>t.name===e.label)?[String(e.label)]:[]);return(0,z.jsxs)(`div`,{ref:s.setNodeRef,style:{transform:Ot.Transform.toString(s.transform),transition:s.transition},className:`min-w-0 space-y-4 border-b py-4`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(b,{ref:s.setActivatorNodeRef,...s.attributes,...s.listeners,type:`button`,variant:`ghost`,className:`touch-none`,"aria-label":`${H.reorder} ${t+1}`,children:(0,z.jsx)(Ht,{})}),(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t+1}),(0,z.jsx)(b,{type:`button`,variant:`ghost`,"aria-label":`${H.moveUp} ${t+1}`,disabled:t===0,onClick:()=>a(-1),children:(0,z.jsx)(ue,{})}),(0,z.jsx)(b,{type:`button`,variant:`ghost`,"aria-label":`${H.moveDown} ${t+1}`,disabled:t===n-1,onClick:()=>a(1),children:(0,z.jsx)(de,{})}),(0,z.jsx)(b,{type:`button`,variant:`ghost`,className:`ml-auto`,onClick:i,children:H.removeLane})]}),(0,z.jsx)(J,{...o,path:`name`,label:H.laneName}),(0,z.jsxs)(`fieldset`,{className:`min-w-0`,children:[(0,z.jsx)(`legend`,{className:`mb-2 font-medium`,children:H.labels}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[r.map(e=>(0,z.jsxs)(y,{className:`min-w-0`,children:[(0,z.jsx)(X,{checked:c.some(t=>t.label===e.name),onCheckedChange:t=>l(`label`,e.name,t===!0)}),(0,z.jsx)(Rt,{name:e.name,label:{name:Ze.make(e.name),color:e.color,description:Le(e.description)},className:`max-w-full whitespace-normal wrap-anywhere`})]},e.name)),u.map(e=>(0,z.jsxs)(y,{children:[(0,z.jsx)(X,{checked:!0,onCheckedChange:()=>l(`label`,e,!1)}),(0,z.jsx)(Rt,{name:e,label:void 0})]},e))]}),r.length===0&&(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:H.noLabels})]}),(0,z.jsxs)(`fieldset`,{children:[(0,z.jsx)(`legend`,{className:`mb-2 font-medium`,children:H.states}),(0,z.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:tt.literals.map(e=>(0,z.jsxs)(y,{children:[(0,z.jsx)(X,{checked:c.some(t=>t.state===e),onCheckedChange:t=>l(`state`,e,t===!0)}),e]},e))})]}),o.problems.filter(e=>e.path[0]===`sources`).map((e,t)=>(0,z.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message},t))]})},_r=({repository:e,...t})=>{let n=p(ae(e)),r=Gn(t.value.lanes).map(G),[i,a]=(0,R.useState)(()=>r.map((e,t)=>t)),o=kt(Mt(jt,{activationConstraint:{distance:5}}),Mt(Dt,{coordinateGetter:Ft})),s=(e,n)=>{e<0||n<0||e===n||(a(Nt(i,e,n)),t.onChange({...t.value,lanes:Nt(r,e,n)}))};return(0,z.jsxs)(`div`,{className:`min-w-0 space-y-5`,children:[(0,z.jsx)(J,{...t,path:`name`,label:H.repositories,readOnly:!0}),(0,z.jsx)(Qn,{...t,path:`tags`,label:H.tags}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(`h2`,{className:`text-md font-semibold`,children:H.lanes}),(0,z.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:H.orderHint})]}),n.isPending&&(0,z.jsx)(`p`,{role:`status`,children:H.loading}),n.isError&&(0,z.jsx)(u,{message:n.error.message}),(0,z.jsx)(Pt,{sensors:o,collisionDetection:Lt,onDragEnd:({active:e,over:t})=>{t!==null&&s(i.findIndex(t=>t===e.id),i.findIndex(e=>e===t.id))},children:(0,z.jsx)(It,{items:i,strategy:Et,children:r.map((e,o)=>(0,z.jsx)(gr,{id:i[o]??o,index:o,count:r.length,value:e,labels:n.data??[],problems:t.problems.filter(e=>e.path[0]===`lanes`&&e.path[1]===o).map(e=>({...e,path:e.path.slice(2)})),onChange:e=>t.onChange({...t.value,lanes:r.map((t,n)=>n===o?e:t)}),remove:()=>{a(i.filter((e,t)=>t!==o)),t.onChange({...t.value,lanes:r.filter((e,t)=>t!==o)})},move:e=>s(o,o+e)},i[o]))})}),(0,z.jsx)(b,{type:`button`,variant:`outline`,onClick:()=>{a([...i,Math.max(-1,...i)+1]),t.onChange({...t.value,lanes:[...r,{name:``,sources:[]}]})},children:H.addLane})]})},vr=({entity:e,...t})=>{switch(e.kind){case`agent`:return(0,z.jsx)(Zn,{...t});case`worker`:return(0,z.jsx)(mr,{...t});case`settings`:return(0,z.jsx)(hr,{...t});case`repository`:return(0,z.jsx)(_r,{...t,repository:E.make(e.identifier)});default:return null}},Z=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r)setTimeout(function(){r(e)},0);else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h)d[r]=void 0;else{if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends Z{};function yr(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function br(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function xr(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Sr(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Cr(e,t){return xr(e,t,``)}function wr(e,t){return Sr(e,t,``)}function Tr(e,t){return t.slice(0,Er(e,t))}function Er(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Dr(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Or(e,t){if(t)return kr(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function Q(e,t){if(t)return kr(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function kr(e,t){if(!t)return[Q(e),Or(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Dr(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var Ar=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,jr=RegExp(`[${Ar}]+|\\s+|[^${Ar}]`,`ug`);new class extends Z{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Dr(e,r)}else n=e.match(jr)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&Mr(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&Mr(n,i,r,null,t.intlSegmenter),e}};function Mr(e,t,n,r,i){if(t&&n){let[a,o]=kr(t.value,i),[s,c]=kr(n.value,i);if(e){let r=yr(a,s);e.value=Sr(e.value,s,r),t.value=Cr(t.value,r),n.value=Cr(n.value,r)}if(r){let e=br(o,c);r.value=xr(r.value,c,e),t.value=wr(t.value,e),n.value=wr(n.value,e)}}else if(n){if(e){let e=Q(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=Q(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=Q(r.value,i),[a,o]=kr(t.value,i),s=yr(n,a);t.value=Cr(t.value,s);let c=br(Cr(n,s),o);t.value=wr(t.value,c),r.value=xr(r.value,n,c),e.value=Sr(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=Q(r.value,i),n=Tr(Or(t.value,i),e);t.value=wr(t.value,n)}else if(e){let n=Tr(Or(e.value,i),Q(t.value,i));t.value=Cr(t.value,n)}}new class extends Z{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Ar}]+|[^\\S\\n\\r]+|[^${Ar}]`,`ug`);return e.match(t)||[]}};var Nr=new class extends Z{constructor(){super(...arguments),this.tokenize=Fr}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
11
|
+
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
12
|
+
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
13
|
+
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
14
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Pr(e,t,n){return Nr.diff(e,t,n)}function Fr(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
15
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function Ir(e){return e==`.`||e==`!`||e==`?`}new class extends Z{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(Ir(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends Z{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Z{constructor(){super(...arguments),this.tokenize=Fr}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(Lr(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function Lr(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Lr(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=Lr(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Z{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Rr(e){for(let t=0;t<e.length;t++)if(e[t]<` `||e[t]>`~`||e[t]===`"`||e[t]===`\\`)return!0;return!1}function $(e){if(!Rr(e))return e;let t=`"`,n=new TextEncoder().encode(e),r=0;for(;r<n.length;){let e=n[r];t+=e===7?`\\a`:e===8?`\\b`:e===9?`\\t`:e===10?`\\n`:e===11?`\\v`:e===12?`\\f`:e===13?`\\r`:e===34?`\\"`:e===92?`\\\\`:e>=32&&e<=126?String.fromCharCode(e):`\\`+e.toString(8).padStart(3,`0`),r++}return t+=`"`,t}var zr={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Br(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;Pr(n,r,Object.assign(Object.assign({},s),{callback:t=>{let n=l(t);e(n)}}))}else return l(Pr(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||Ur(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s){if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
16
|
+
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function Vr(e,t){if(t||=zr,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(e=>e.isGit))throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>Vr(e,t)).join(`
|
|
17
|
+
`)}let n=[];if(e.isGit){if(t=zr,!e.oldFileName)throw Error(`oldFileName must be specified for Git patches`);if(!e.newFileName)throw Error(`newFileName must be specified for Git patches`);let r=e.oldFileName,i=e.newFileName;e.isCreate&&r===`/dev/null`?r=i.replace(/^b\//,`a/`):e.isDelete&&i===`/dev/null`&&(i=r.replace(/^a\//,`b/`)),n.push(`diff --git `+$(r)+` `+$(i)),e.isDelete&&n.push(`deleted file mode `+(e.oldMode??`100644`)),e.isCreate&&n.push(`new file mode `+(e.newMode??`100644`)),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(n.push(`old mode `+e.oldMode),n.push(`new mode `+e.newMode)),e.isRename&&(n.push(`rename from `+$((e.oldFileName??``).replace(/^a\//,``))),n.push(`rename to `+$((e.newFileName??``).replace(/^b\//,``)))),e.isCopy&&(n.push(`copy from `+$((e.oldFileName??``).replace(/^a\//,``))),n.push(`copy to `+$((e.newFileName??``).replace(/^b\//,``))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`);let r=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||r)&&(n.push(`--- `+$(e.oldFileName)+(e.oldHeader?` `+e.oldHeader:``)),n.push(`+++ `+$(e.newFileName)+(e.newHeader?` `+e.newHeader:``)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t],i=r.oldLines===0?r.oldStart-1:r.oldStart,a=r.newLines===0?r.newStart-1:r.newStart;n.push(`@@ -`+i+`,`+r.oldLines+` +`+a+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
18
|
+
`)+`
|
|
19
|
+
`}function Hr(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;Br(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?Vr(e,o.headerOptions):void 0)}}))}else{let s=Br(e,t,n,r,i,a,o);return s?Vr(s,o?.headerOptions):void 0}}function Ur(e){let t=e.endsWith(`
|
|
20
|
+
`),n=e.split(`
|
|
21
|
+
`).map(e=>e+`
|
|
22
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}var Wr=(e,t,n)=>t===n?``:Hr(t===``?`/dev/null`:`a/${e}`,n===``?`/dev/null`:`b/${e}`,t,n),Gr=({entity:e,before:t,number:n,reload:r})=>{let i=p({..._(e),staleTime:0,refetchOnMount:`always`}),a=i.error instanceof A&&i.error.error===`ConfigurationNotFound`,o=a?``:i.data?.text,s=a?n:i.data?.number;return(0,z.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,"aria-label":V.conflict,children:[(0,z.jsx)(`p`,{role:`alert`,className:`text-warning`,children:V.conflict}),i.isPending&&(0,z.jsx)(`p`,{role:`status`,children:V.loading}),i.isError&&!a&&(0,z.jsx)(u,{message:i.error.message}),o!==void 0&&s!==void 0&&!i.isFetching&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`p`,{children:V.revision(s)}),a&&(0,z.jsx)(`p`,{children:V.deletedConflict}),(0,z.jsx)(pe,{code:Wr(e.key,t,o)||V.noDiff,language:`diff`}),(0,z.jsx)(`div`,{children:(0,z.jsx)(b,{variant:`outline`,onClick:()=>{r({text:o,number:s})},children:V.reload})})]})]})},Kr=({error:e})=>(0,z.jsxs)(`div`,{role:`alert`,className:`min-w-0 space-y-2 wrap-anywhere`,children:[(0,z.jsx)(u,{message:ot(e)}),e instanceof Ke&&(0,z.jsx)(`ul`,{className:`space-y-1 text-destructive`,children:e.problems.map((e,t)=>(0,z.jsxs)(`li`,{children:[(0,z.jsxs)(`code`,{children:[e.entity.key,e.path.length>0?`.${e.path.join(`.`)}`:``]}),`: `,e.message]},t))}),e instanceof it&&(0,z.jsx)(`ul`,{className:`text-destructive`,children:e.entities.map(e=>(0,z.jsx)(`li`,{children:e.key},e.key))})]}),qr=({value:e,onChange:t,label:n=V.source,disabled:r})=>{let i=(0,R.useId)(),a=(0,R.useRef)(null);return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[(0,z.jsx)(y,{htmlFor:i,children:n}),(0,z.jsxs)(`div`,{className:`flex min-w-0 overflow-hidden rounded-md border bg-card`,children:[(0,z.jsx)(`pre`,{ref:a,"aria-hidden":`true`,className:`m-0 max-h-96 shrink-0 overflow-hidden border-r px-3 py-2 text-right font-mono text-xs leading-5 text-muted-foreground select-none`,children:e.split(`
|
|
23
|
+
`).map((e,t)=>t+1).join(`
|
|
24
|
+
`)}),(0,z.jsx)(me,{id:i,value:e,readOnly:t===void 0,disabled:r,spellCheck:!1,wrap:`off`,className:`h-96 min-w-0 flex-1 rounded-none border-0 font-mono text-xs leading-5 [field-sizing:fixed]`,onScroll:e=>{a.current!==null&&(a.current.scrollTop=e.currentTarget.scrollTop)},onChange:e=>t?.(e.target.value)})]})]})},Jr=(e,t)=>{if(Xn(e)){let n=qn(e,t);if(w(n))return{mode:`form`,value:n.success}}return{mode:`text`,text:t}},Yr=({entity:e,initial:t,onSaved:n,cancel:r})=>{let[i,a]=(0,R.useState)(t),[o,s]=(0,R.useState)(()=>Jr(e,t.text)),[c,l]=(0,R.useState)(null),[u,d]=(0,R.useState)([]),[f,p]=(0,R.useState)(``),m=g(),h=o.mode===`text`?o.text:Yn(e,o.value),ee=m.error instanceof Ke?m.error.problems.filter(t=>t.entity.key===e.key):[];return(0,z.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-4`,noValidate:!0,onSubmit:t=>{if(t.preventDefault(),m.isPending||m.error instanceof S)return;if(o.mode===`form`){let t=Jn(e,o.value);if(T(t)){d(t.failure.details??[{path:[],message:t.failure.message}]);return}}d([]);let r=o.mode===`text`?{text:h,expected:i.number,message:f}:{value:o.value,expected:i.number,message:f};m.mutate({action:`save`,key:e,payload:r},{onSuccess:n})},children:[Xn(e)&&(0,z.jsx)(b,{type:`button`,variant:`outline`,className:`self-start`,disabled:m.isPending,onClick:()=>{if(o.mode===`form`){s({mode:`text`,text:h}),d([]);return}let t=qn(e,o.text);T(t)?d(t.failure.details??[{path:[],message:t.failure.message}]):(d([]),s({mode:`form`,value:t.success}))},children:o.mode===`form`?H.text:H.form}),(0,z.jsx)(`fieldset`,{disabled:m.isPending,className:`min-w-0`,children:o.mode===`text`?(0,z.jsx)(qr,{value:o.text,onChange:e=>s({mode:`text`,text:e}),disabled:m.isPending}):(0,z.jsx)(vr,{entity:e,value:o.value,onChange:e=>s({mode:`form`,value:e}),problems:[...u,...ee]},i.number)}),u.length>0&&(0,z.jsx)(`ul`,{role:`alert`,className:`space-y-1 text-destructive wrap-anywhere`,children:u.map((e,t)=>(0,z.jsxs)(`li`,{children:[e.path.join(`.`),`: `,e.message]},t))}),m.isError&&(m.error instanceof S?(0,z.jsx)(Gr,{entity:e,before:i.text,number:m.error.current,reload:t=>{l(h),s(Jr(e,t.text)),a(t),d([]),m.reset()}}):(0,z.jsx)(Kr,{error:m.error})),(0,z.jsxs)(y,{className:`flex flex-col items-start gap-2`,children:[V.message,(0,z.jsx)(L,{value:f,onChange:e=>p(e.target.value),disabled:m.isPending})]}),(0,z.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,z.jsx)(b,{type:`submit`,disabled:m.isPending||m.error instanceof S,children:m.isPending?V.saving:V.save}),(0,z.jsx)(b,{type:`button`,variant:`ghost`,onClick:r,disabled:m.isPending,children:V.cancel})]}),c!==null&&(0,z.jsx)(qr,{label:V.draft,value:c})]})},Xr=({number:e,entity:t})=>{let n=p(ie(e)),r=p(_(B(`settings`,`instance`))),[i,a]=(0,R.useState)(!1),[o,s]=(0,R.useState)(``),c=g();return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 pb-4`,children:[n.isPending&&(0,z.jsx)(`p`,{role:`status`,children:V.loading}),n.isError&&(0,z.jsx)(u,{message:n.error.message}),n.data?.changes.filter(({key:e})=>t===void 0||e.key===t.key).map(e=>(0,z.jsxs)(`div`,{className:`min-w-0 space-y-2`,children:[(0,z.jsx)(`a`,{href:an(e.key),className:`text-primary hover:underline`,children:e.key.key}),(0,z.jsx)(pe,{code:Wr(e.key.key,e.beforeText,e.afterText)||V.noDiff,language:`diff`})]},e.key.key)),r.isError&&(0,z.jsx)(u,{message:r.error.message}),n.data!==void 0&&(0,z.jsx)(`div`,{children:(0,z.jsx)(b,{variant:`outline`,onClick:()=>a(!i),children:V.revert})}),i&&(0,z.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:t=>{t.preventDefault(),r.data!==void 0&&c.mutate({action:`revert`,number:e,payload:{expected:r.data.number,message:o}},{onSuccess:()=>a(!1)})},children:[(0,z.jsx)(`p`,{children:V.revertWarning}),(0,z.jsx)(`ul`,{className:`text-muted-foreground`,children:n.data?.entities.map(e=>(0,z.jsx)(`li`,{children:e.key},e.key))}),(0,z.jsxs)(y,{className:`flex flex-col items-start gap-2`,children:[V.message,(0,z.jsx)(L,{value:o,onChange:e=>s(e.target.value)})]}),(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(b,{type:`submit`,disabled:c.isPending||r.data===void 0,children:c.isPending?V.saving:V.confirmRevert}),(0,z.jsx)(b,{type:`button`,variant:`ghost`,disabled:c.isPending,onClick:()=>a(!1),children:V.cancel})]})]}),c.isError&&(0,z.jsx)(Kr,{error:c.error}),c.isSuccess&&(0,z.jsx)(`p`,{role:`status`,children:V.reverted})]})},Zr=({entity:e})=>{let t=Bt(v(e)),[n,r]=(0,R.useState)(null),i=t.data?.pages.flatMap(e=>e.revisions)??[];return(0,z.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,"aria-label":V.history,children:[(0,z.jsx)(`h2`,{className:`text-md font-semibold`,children:V.history}),t.isPending&&(0,z.jsx)(`p`,{role:`status`,children:V.loading}),t.isError&&(0,z.jsx)(u,{message:t.error.message}),t.isSuccess&&i.length===0&&(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:V.emptyHistory}),(0,z.jsx)(`ul`,{className:`min-w-0 divide-y border-y`,children:i.map(t=>(0,z.jsxs)(`li`,{className:`min-w-0 py-3`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-4 gap-y-1`,children:[(0,z.jsx)(b,{variant:`ghost`,"aria-expanded":n===t.number,onClick:()=>r(n===t.number?null:t.number),children:V.revision(t.number)}),(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:t.actor??V.localOperator}),(0,z.jsx)(`time`,{className:`text-xs text-muted-foreground`,dateTime:Ge(t.time),children:et(t.time).toLocaleString()}),t.message!==null&&(0,z.jsx)(`span`,{className:`min-w-0 wrap-anywhere`,children:t.message})]}),e===void 0&&(0,z.jsx)(`ul`,{className:`flex flex-wrap gap-x-4 gap-y-1 py-2`,children:t.entities.map(e=>(0,z.jsx)(`li`,{className:`min-w-0 wrap-anywhere`,children:(0,z.jsx)(`a`,{className:`text-primary hover:underline`,href:an(e),children:e.key})},e.key))}),n===t.number&&(0,z.jsx)(Xr,{number:t.number,entity:e})]},t.number))}),t.hasNextPage&&(0,z.jsx)(`div`,{children:(0,z.jsx)(b,{variant:`outline`,disabled:t.isFetchingNextPage,onClick:()=>void t.fetchNextPage(),children:t.isFetchingNextPage?V.loading:V.more})})]})},Qr=({entity:e,children:t})=>{let n=p(_(e)),r=p(I()),[i,a]=(0,R.useState)({_tag:`read`}),[o,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(!1),d=g();return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-6`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsx)(b,{variant:`outline`,disabled:n.data===void 0||n.isError||i._tag!==`read`,onClick:()=>{l(!1),n.data!==void 0&&a({_tag:`edit`,initial:n.data})},children:V.edit}),(0,z.jsx)(b,{variant:`ghost`,disabled:n.data===void 0||n.isError||i._tag!==`read`,onClick:()=>{d.reset(),n.data!==void 0&&a({_tag:`delete`,initial:n.data})},children:V.delete}),n.isPending&&(0,z.jsx)(`span`,{role:`status`,children:V.loading}),c&&(0,z.jsx)(`span`,{role:`status`,children:V.saved}),d.isSuccess&&n.isError&&(0,z.jsx)(`span`,{role:`status`,children:V.deleted})]}),n.isError&&!d.isSuccess&&(0,z.jsx)(u,{message:n.error.message}),i._tag===`edit`&&(0,z.jsx)(Yr,{entity:e,initial:i.initial,onSaved:()=>{a({_tag:`read`}),l(!0)},cancel:()=>a({_tag:`read`})}),i._tag===`delete`&&(0,z.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:t=>{t.preventDefault(),!d.isPending&&d.mutate({action:`delete`,key:e,payload:{expected:i.initial.number,message:o}},{onSuccess:()=>a({_tag:`read`})})},children:[(0,z.jsx)(`h2`,{className:`text-md font-semibold`,children:V.deleteWarning(e.identifier)}),r.data!==void 0&&(0,z.jsx)(`p`,{className:`wrap-anywhere`,children:V.references(on(e,r.data))}),(0,z.jsxs)(y,{className:`flex flex-col items-start gap-2`,children:[V.message,(0,z.jsx)(L,{value:o,onChange:e=>s(e.target.value)})]}),d.isError&&(0,z.jsx)(Kr,{error:d.error}),(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(b,{type:`submit`,variant:`destructive`,disabled:d.isPending||r.data===void 0,children:d.isPending?V.saving:V.confirmDelete}),(0,z.jsx)(b,{type:`button`,variant:`ghost`,disabled:d.isPending,onClick:()=>a({_tag:`read`}),children:V.cancel})]})]}),i._tag===`read`&&t,(0,z.jsx)(Zr,{entity:e})]})},$r=({value:e,onChange:t,disabled:n})=>{let r=p(oe()),i=p(I()),a=new Set(i.data?.repositories.map(({name:e})=>e.toLowerCase())),o=r.data?.filter(e=>!a.has(e.toLowerCase()))??[];return(0,z.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col gap-2`,children:[(0,z.jsxs)(y,{className:`flex flex-col items-start gap-2`,children:[H.repositories,(0,z.jsxs)(he,{className:`w-full`,value:e,disabled:n||r.isPending||i.data===void 0,onChange:e=>t(e.target.value),children:[(0,z.jsx)(`option`,{value:``,children:H.choose}),o.map(e=>(0,z.jsx)(`option`,{value:e,children:e},e))]})]}),r.isPending&&(0,z.jsx)(`p`,{role:`status`,children:H.loading}),r.isError&&(0,z.jsx)(u,{message:r.error.message}),i.isError&&(0,z.jsx)(u,{message:i.error.message}),r.isSuccess&&i.isSuccess&&o.length===0&&(0,z.jsx)(`p`,{children:H.noRepositories})]})},ei=({kind:e,cancel:t})=>{let[n,i]=(0,R.useState)(``),[a,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(null),[l,d]=(0,R.useState)(!1),f=r(),m=le(),h=p(_(B(`settings`,`instance`))),ee=p(I());return(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,z.jsx)(`h2`,{className:`text-md font-semibold`,children:V.create(e)}),e===`loop`&&(0,z.jsx)(`p`,{className:`text-muted-foreground`,children:V.paused}),a===null?(0,z.jsxs)(`form`,{className:`flex flex-col items-start gap-3`,onSubmit:t=>{t.preventDefault();let r=Pe(C)(n.trim());je(r)||(d(!0),c(null),f.fetchQuery(_(B(e,r.value))).then(()=>c(V.alreadyExists),e=>{e instanceof A&&e.error===`ConfigurationNotFound`?o(r.value):c(ot(e))}).finally(()=>d(!1)))},children:[e===`repository`?(0,z.jsx)($r,{value:n,onChange:i,disabled:l}):(0,z.jsxs)(y,{className:`flex w-full flex-col items-start gap-2`,children:[V.name,(0,z.jsx)(L,{required:!0,disabled:l,value:n,onChange:e=>i(e.target.value)})]}),s!==null&&(0,z.jsx)(u,{message:s}),h.isError&&(0,z.jsx)(u,{message:h.error.message}),(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsx)(b,{type:`submit`,disabled:l||h.data===void 0||n.trim()===``,children:l?V.loading:V.edit}),(0,z.jsx)(b,{type:`button`,variant:`ghost`,onClick:t,children:V.cancel})]})]}):h.data!==void 0&&(0,z.jsx)(Yr,{entity:B(e,a),initial:{number:h.data.number,text:sn(e,a,ee.data?.agents[0]?.name??`developer`)},cancel:t,onSaved:()=>{m({to:an(B(e,a))})}})]})},ti=({kind:e})=>{let[t,n]=(0,R.useState)(!1);return t?(0,z.jsx)(ei,{kind:e,cancel:()=>n(!1)}):(0,z.jsx)(`div`,{children:(0,z.jsx)(b,{onClick:()=>n(!0),children:V.new})})},ni=({title:e,entity:t,createKind:n,leading:r,counts:i,marks:a,file:s,actions:l,children:u})=>(0,z.jsxs)(c,{width:`full`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-x-6 gap-y-3`,children:[(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,z.jsx)(o,{title:e,leading:r,counts:i,children:a}),s!==void 0&&(0,z.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:s})]}),(0,z.jsx)(`div`,{className:`flex items-center gap-2`,children:l})]}),n!==void 0&&(0,z.jsx)(ti,{kind:n}),t===void 0?u:(0,z.jsx)(Qr,{entity:t,children:u},t.key)]}),ri=({facts:e,children:t})=>(0,z.jsxs)(`div`,{className:`grid gap-x-10 gap-y-8 pt-2 lg:grid-cols-[minmax(0,1fr)_21rem]`,children:[(0,z.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8 max-lg:order-2`,children:t}),(0,z.jsx)(`aside`,{className:`min-w-0 max-lg:order-1 lg:border-l lg:pl-6`,children:e})]}),ii=({title:e,aside:t,children:n})=>(0,z.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3`,children:[(0,z.jsxs)(`header`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,z.jsx)(`h2`,{className:`text-md font-semibold`,children:e}),t!==void 0&&(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),n]}),ai=({children:e})=>(0,z.jsx)(`dl`,{className:`grid grid-cols-[6.5rem_minmax(0,1fr)] gap-x-3 gap-y-3 text-sm`,children:e}),oi=({label:e,children:t})=>(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,z.jsx)(`dd`,{className:`min-w-0 wrap-anywhere`,children:t})]}),si=({children:e})=>(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:e}),ci=({entries:e,className:t})=>(0,z.jsx)(`dl`,{className:ge(`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`,t),children:e.map(([e,t])=>(0,z.jsxs)(`div`,{className:`contents`,children:[(0,z.jsxs)(`dt`,{className:`text-muted-foreground`,children:[e,`:`]}),(0,z.jsx)(`dd`,{className:`whitespace-pre-wrap text-foreground wrap-anywhere`,children:t})]},e))}),li=({open:e,children:t})=>(0,z.jsx)(Tt,{className:`cursor-pointer hover:bg-muted/60 has-[a:focus-visible]:bg-muted/60`,onClick:e,children:t}),ui=`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`,di=()=>(0,z.jsx)(St,{state:`Failed`,label:`Not loaded`}),fi=({title:e,children:t})=>(0,z.jsx)(pt,{className:`items-start p-0 py-6 text-left`,children:(0,z.jsxs)(ut,{className:`items-start`,children:[(0,z.jsx)(dt,{className:`text-md font-semibold tracking-normal`,children:e}),(0,z.jsx)(ft,{className:`text-sm text-muted-foreground`,children:t})]})});export{Ln as A,An as B,pn as C,dn as D,Un as E,En as F,xn as G,Tn as H,kn as I,B as K,Mn as L,On as M,Pn as N,zn as O,Rn as P,Fn as R,Cn as S,Sn as T,wn as U,Nn as V,un as W,yn as _,ai as a,bn as b,di as c,ui as d,Zr as f,fn as g,Bn as h,oi as i,jn as j,Dn as k,li as l,Hn as m,ri as n,ci as o,Vn as p,ii as r,fi as s,ni as t,si as u,vn as v,cn as w,ln as x,V as y,In as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{M as t}from"./page-C47YAWAl.js";import{A as n,B as r,K as i,L as a,N as o,O as s,P as c,R as l,U as u,V as d,j as f,t as p,z as m}from"./section-eyIYzZrG.js";import{u as h}from"./error-alert-hABzwCSY.js";import{t as g}from"./useSuspenseQuery-DbhQN-t-.js";import{s as _}from"./queries-oea_Y4on.js";import{t as v}from"./button-4rhhIcK8.js";import{Bn as y,v as b,w as x,y as S}from"./strings-DXB6PB2g.js";import{n as C}from"./queries-BZMW2wiD.js";var w=e(),T=e=>/-next\.\d+\.g([0-9a-f]{7,40})$/u.exec(e)?.[1]??`@usine/server@${e}`,E=()=>{let{data:e}=g(_()),i=t(),p=h({mutationFn:e=>b(t=>t.requestUpgrade({payload:new x({timing:e,version:y()})})),onSuccess:()=>i.invalidateQueries(_())}),C=e.phase===`waiting`||e.phase===`installing`,E=e.available===null?null:`https://github.com/basaltbytes/usine/compare/${encodeURIComponent(T(e.running))}...${encodeURIComponent(T(e.available))}`;return(0,w.jsxs)(`section`,{className:`flex flex-col gap-3`,"aria-labelledby":`upgrades-title`,children:[(0,w.jsx)(`h2`,{id:`upgrades-title`,className:`text-md font-semibold`,children:u}),(0,w.jsxs)(`dl`,{className:`grid gap-x-6 gap-y-2 border-y py-3 sm:grid-cols-[16rem_minmax(0,1fr)]`,children:[(0,w.jsx)(`dt`,{className:`text-muted-foreground`,children:m}),(0,w.jsx)(`dd`,{className:`font-mono text-xs`,children:e.running}),(0,w.jsx)(`dt`,{className:`text-muted-foreground`,children:n}),(0,w.jsx)(`dd`,{children:e.channel}),(0,w.jsx)(`dt`,{className:`text-muted-foreground`,children:c}),(0,w.jsx)(`dd`,{children:e.mode})]}),e.supported?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`p`,{role:`status`,children:e.phase===`waiting`?d:e.phase===`installing`?o:e.mode===`off`?a:e.available===null?f:s(e.available)}),E!==null&&(0,w.jsx)(`a`,{href:E,target:`_blank`,rel:`noreferrer`,className:`w-fit text-primary underline underline-offset-4`,children:`View changes`}),e.available!==null&&!C&&e.phase!==`failed`&&(0,w.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:gap-8`,children:[(0,w.jsxs)(`div`,{className:`flex max-w-sm flex-col items-start gap-2`,children:[(0,w.jsx)(v,{disabled:p.isPending,onClick:()=>p.mutate(`idle`),children:`Upgrade when idle`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Wait for running attempts to finish. No new attempt starts while waiting.`})]}),(0,w.jsxs)(`div`,{className:`flex max-w-sm flex-col items-start gap-2`,children:[(0,w.jsx)(v,{variant:`outline`,disabled:p.isPending,onClick:()=>p.mutate(`now`),children:`Upgrade now`}),(0,w.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Restart now. Running attempts reattach after the server restarts.`})]})]})]}):(0,w.jsx)(`p`,{className:`text-muted-foreground`,children:r}),e.outcome?.status===`rolled-back`&&(0,w.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:l(e.outcome.previous,e.outcome.target,e.outcome.reason)}),e.outcome?.status===`failed`&&(0,w.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.outcome.reason}),e.message!==null&&(0,w.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:e.message}),p.isError&&(0,w.jsx)(`p`,{role:`alert`,className:`text-destructive`,children:S(p.error)})]})},D=e=>(0,w.jsx)(`span`,{className:`text-muted-foreground`,children:e}),O=e=>(0,w.jsx)(`code`,{className:`font-mono text-xs`,children:e}),k=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?D(`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?D(`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?D(`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?D(`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?D(`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.`}]]],[`Tracing`,e.tracing===null?[{key:`tracing.otlp_url`,value:D(`Not set`),effect:`No span export. A change applies after usine up restarts.`}]:[{key:`tracing.otlp_url`,value:O(e.tracing.otlpUrl),effect:`Collector endpoint that receives every span as OTLP/HTTP protobuf. A change applies after usine up restarts.`},{key:`tracing.service_name`,value:O(e.tracing.serviceName),effect:`The service.name resource attribute of every exported span.`}]]],A=({configuration:e,children:t})=>(0,w.jsx)(p,{entity:i(`settings`,`instance`),title:`Settings`,children:(0,w.jsxs)(`div`,{className:`flex max-w-4xl flex-col gap-8 pt-2`,children:[t,k(e.settings).map(([e,t])=>(0,w.jsxs)(`section`,{className:`flex flex-col gap-3`,children:[(0,w.jsx)(`h2`,{className:`text-md font-semibold`,children:e}),(0,w.jsx)(`dl`,{className:`border-t`,children:t.map(({key:e,value:t,effect:n})=>(0,w.jsxs)(`div`,{className:`grid gap-x-6 gap-y-1 border-b py-3 sm:grid-cols-[16rem_minmax(0,1fr)]`,children:[(0,w.jsx)(`dt`,{className:`font-mono text-xs leading-5 text-muted-foreground`,children:e}),(0,w.jsxs)(`dd`,{className:`flex flex-col gap-0.5 wrap-anywhere`,children:[(0,w.jsx)(`span`,{children:t}),(0,w.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n})]})]},e))})]},e))]})}),j=()=>{let{data:e}=g(C());return(0,w.jsx)(A,{configuration:e,children:(0,w.jsx)(E,{})})};export{j as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t}from"./button-4rhhIcK8.js";var n=e();function r({className:e,...r}){return(0,n.jsx)(`div`,{"data-slot":`skeleton`,className:t(`animate-pulse rounded-md bg-muted`,e),...r})}export{r as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{I as n}from"./visuallyHidden-BUGCJ1D9.js";var r=t(n()),i=t(e());function a(){var e=[...arguments];return(0,i.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var o=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function s(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function c(e){return`nodeType`in e}function l(e){return e?s(e)?e:c(e)?e.ownerDocument?.defaultView??window:window:window}function u(e){let{Document:t}=l(e);return e instanceof t}function d(e){return!s(e)&&e instanceof l(e).HTMLElement}function f(e){return e instanceof l(e).SVGElement}function p(e){return e?s(e)?e.document:c(e)?u(e)?e:d(e)||f(e)?e.ownerDocument:document:document:document}var m=o?i.useLayoutEffect:i.useEffect;function h(e){let t=(0,i.useRef)(e);return m(()=>{t.current=e}),(0,i.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function g(){let e=(0,i.useRef)(null);return[(0,i.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,i.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function _(e,t){t===void 0&&(t=[e]);let n=(0,i.useRef)(e);return m(()=>{n.current!==e&&(n.current=e)},t),n}function v(e,t){let n=(0,i.useRef)();return(0,i.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function y(e){let t=h(e),n=(0,i.useRef)(null);return[n,(0,i.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function b(e){let t=(0,i.useRef)();return(0,i.useEffect)(()=>{t.current=e},[e]),t.current}var x={};function S(e,t){return(0,i.useMemo)(()=>{if(t)return t;let n=x[e]==null?0:x[e]+1;return x[e]=n,e+`-`+n},[e,t])}function C(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var w=C(1),T=C(-1);function E(e){return`clientX`in e&&`clientY`in e}function D(e){if(!e)return!1;let{KeyboardEvent:t}=l(e.target);return t&&e instanceof t}function ee(e){if(!e)return!1;let{TouchEvent:t}=l(e.target);return t&&e instanceof t}function te(e){if(ee(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return E(e)?{x:e.clientX,y:e.clientY}:null}var O=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[O.Translate.toString(e),O.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),k=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function A(e){return e.matches(k)?e:e.querySelector(k)}var ne={display:`none`};function re(e){let{id:t,value:n}=e;return i.createElement(`div`,{id:t,style:ne},n)}function j(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return i.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function ie(){let[e,t]=(0,i.useState)(``);return{announce:(0,i.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var ae=(0,i.createContext)(null);function M(e){let t=(0,i.useContext)(ae);(0,i.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function oe(){let[e]=(0,i.useState)(()=>new Set),t=(0,i.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,i.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var se={draggable:`
|
|
2
|
+
To pick up a draggable item, press the space bar.
|
|
3
|
+
While dragging, use the arrow keys to move the item.
|
|
4
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
5
|
+
`},ce={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function N(e){let{announcements:t=ce,container:n,hiddenTextDescribedById:a,screenReaderInstructions:o=se}=e,{announce:s,announcement:c}=ie(),l=S(`DndLiveRegion`),[u,d]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{d(!0)},[]),M((0,i.useMemo)(()=>({onDragStart(e){let{active:n}=e;s(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&s(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;s(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;s(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;s(t.onDragCancel({active:n,over:r}))}}),[s,t])),!u)return null;let f=i.createElement(i.Fragment,null,i.createElement(re,{id:a,value:o.draggable}),i.createElement(j,{id:l,announcement:c}));return n?(0,r.createPortal)(f,n):f}var P;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(P||={});function F(){}function I(e,t){return(0,i.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function L(){var e=[...arguments];return(0,i.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var R=Object.freeze({x:0,y:0});function z(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function le(e,t){let n=te(e);if(!n)return`0 0`;let r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+`% `+r.y+`%`}function B(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ue(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function V(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function de(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function fe(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var H=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=fe(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=z(fe(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(B)},pe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=V(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=V(r),o=i.reduce((e,t,r)=>e+z(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(B)};function U(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var me=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=U(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(ue)};function he(e,t){let{top:n,left:r,bottom:i,right:a}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=a}var W=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];let i=[];for(let e of t){let{id:t}=e,a=n.get(t);if(a&&he(r,a)){let n=V(a).reduce((e,t)=>e+z(r,t),0),o=Number((n/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:o}})}}return i.sort(B)};function ge(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function _e(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:R}function ve(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var ye=ve(1);function be(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function G(e,t,n){let r=be(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var xe={ignoreTransform:!1};function K(e,t){t===void 0&&(t=xe);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=l(e).getComputedStyle(e);t&&(n=G(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function Se(e){return K(e,{ignoreTransform:!0})}function Ce(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function we(e,t){return t===void 0&&(t=l(e).getComputedStyle(e)),t.position===`fixed`}function Te(e,t){t===void 0&&(t=l(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}function q(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(u(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!d(i)||f(i)||n.includes(i))return n;let a=l(e).getComputedStyle(i);return i!==e&&Te(i,a)&&n.push(i),we(i,a)?n:r(i.parentNode)}return e?r(e):n}function J(e){let[t]=q(e,1);return t??null}function Y(e){return!o||!e?null:s(e)?e:c(e)?u(e)||e===p(e).scrollingElement?window:d(e)?e:null:null}function Ee(e){return s(e)?e.scrollX:e.scrollLeft}function X(e){return s(e)?e.scrollY:e.scrollTop}function De(e){return{x:Ee(e),y:X(e)}}var Z;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Z||={});function Oe(e){return!o||!e?!1:e===document.scrollingElement}function ke(e){let t={x:0,y:0},n=Oe(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Ae={x:.2,y:.2};function je(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Ae);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=ke(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=Z.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Z.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Z.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Z.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Me(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ne(e){return e.reduce((e,t)=>w(e,De(t)),R)}function Pe(e){return e.reduce((e,t)=>e+Ee(t),0)}function Fe(e){return e.reduce((e,t)=>e+X(t),0)}function Ie(e,t){if(t===void 0&&(t=K),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);J(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Le=[[`x`,[`left`,`right`],Pe],[`y`,[`top`,`bottom`],Fe]],Re=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=q(t),r=Ne(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Le)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},ze=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Be(e){let{EventTarget:t}=l(e);return e instanceof t?e:p(e)}function Ve(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}var Q;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Q||={});function He(e){e.preventDefault()}function Ue(e){e.stopPropagation()}var $;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})($||={});var We={start:[$.Space,$.Enter],cancel:[$.Esc],end:[$.Space,$.Enter,$.Tab]},Ge=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case $.Right:return{...n,x:n.x+25};case $.Left:return{...n,x:n.x-25};case $.Down:return{...n,y:n.y+25};case $.Up:return{...n,y:n.y-25}}},Ke=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new ze(p(t)),this.windowListeners=new ze(l(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Q.Resize,this.handleCancel),this.windowListeners.add(Q.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Q.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&Ie(n),t(R)}handleKeyDown(e){if(D(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=We,coordinateGetter:a=Ge,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:R;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=T(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=ke(n),p=Me(n),m={x:Math.min(i===$.Right?p.right-p.width/2:p.right,Math.max(i===$.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===$.Down?p.bottom-p.height/2:p.bottom,Math.max(i===$.Down?p.top:p.top+p.height/2,u.y))},h=i===$.Right&&!s||i===$.Left&&!c,g=i===$.Down&&!l||i===$.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===$.Right&&e<=d.x||i===$.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}r.x=a?n.scrollLeft-e:i===$.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===$.Down&&e<=d.y||i===$.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}r.y=a?n.scrollTop-e:i===$.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,w(T(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Ke.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=We,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function qe(e){return!!(e&&`distance`in e)}function Je(e){return!!(e&&`delay`in e)}var Ye=class{constructor(e,t,n){n===void 0&&(n=Be(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=p(i),this.documentListeners=new ze(this.document),this.listeners=new ze(n),this.windowListeners=new ze(l(i)),this.initialCoordinates=te(r)??R,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Q.Resize,this.handleCancel),this.windowListeners.add(Q.DragStart,He),this.windowListeners.add(Q.VisibilityChange,this.handleCancel),this.windowListeners.add(Q.ContextMenu,He),this.documentListeners.add(Q.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Je(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(qe(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Q.Click,Ue,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Q.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=te(e)??R,s=T(n,o);if(!t&&a){if(qe(a)){if(a.tolerance!=null&&Ve(s,a.tolerance))return this.handleCancel();if(Ve(s,a.distance))return this.handleStart()}if(Je(a)&&Ve(s,a.tolerance))return this.handleCancel();this.handlePending(a,s)}else e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===$.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},Xe={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},Ze=class extends Ye{constructor(e){let{event:t}=e,n=p(t.target);super(e,Xe,n)}};Ze.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var Qe={move:{name:`mousemove`},end:{name:`mouseup`}},$e;(function(e){e[e.RightClick=2]=`RightClick`})($e||={});var et=class extends Ye{constructor(e){super(e,Qe,p(e.event.target))}};et.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==$e.RightClick&&(r?.({event:n}),!0)}}];var tt={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},nt=class extends Ye{constructor(e){super(e,tt)}static setup(){return window.addEventListener(tt.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(tt.move.name,e)};function e(){}}};nt.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var rt;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(rt||={});var it;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(it||={});function at(e){let{acceleration:t,activator:n=rt.Pointer,canScroll:r,draggingRect:a,enabled:o,interval:s=5,order:c=it.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e,m=st({delta:f,disabled:!o}),[h,_]=g(),v=(0,i.useRef)({x:0,y:0}),y=(0,i.useRef)({x:0,y:0}),b=(0,i.useMemo)(()=>{switch(n){case rt.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case rt.DraggableRect:return a}},[n,a,l]),x=(0,i.useRef)(null),S=(0,i.useCallback)(()=>{let e=x.current;if(!e)return;let t=v.current.x*y.current.x,n=v.current.y*y.current.y;e.scrollBy(t,n)},[]),C=(0,i.useMemo)(()=>c===it.TreeOrder?[...u].reverse():u,[c,u]);(0,i.useEffect)(()=>{if(!o||!u.length||!b)_();else{for(let e of C){if(r?.(e)===!1)continue;let n=u.indexOf(e),i=d[n];if(!i)continue;let{direction:a,speed:o}=je(e,i,b,t,p);for(let e of[`x`,`y`])m[e][a[e]]||(o[e]=0,a[e]=0);if(o.x>0||o.y>0){_(),x.current=e,h(S,s),v.current=o,y.current=a;return}}v.current={x:0,y:0},y.current={x:0,y:0},_()}},[t,S,r,_,o,s,JSON.stringify(b),JSON.stringify(m),h,u,C,d,JSON.stringify(p)])}var ot={x:{[Z.Backward]:!1,[Z.Forward]:!1},y:{[Z.Backward]:!1,[Z.Forward]:!1}};function st(e){let{delta:t,disabled:n}=e,r=b(t);return v(e=>{if(n||!r||!e)return ot;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Z.Backward]:e.x[Z.Backward]||i.x===-1,[Z.Forward]:e.x[Z.Forward]||i.x===1},y:{[Z.Backward]:e.y[Z.Backward]||i.y===-1,[Z.Forward]:e.y[Z.Forward]||i.y===1}}},[n,t,r])}function ct(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return v(e=>t==null?null:r??e??null,[r,t])}function lt(e,t){return(0,i.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var ut;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(ut||={});var dt;(function(e){e.Optimized=`optimized`})(dt||={});var ft=new Map;function pt(e,t){let{dragging:n,dependencies:r,config:a}=t,[o,s]=(0,i.useState)(null),{frequency:c,measure:l,strategy:u}=a,d=(0,i.useRef)(e),f=y(),p=_(f),m=(0,i.useCallback)(function(e){e===void 0&&(e=[]),!p.current&&s(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),h=(0,i.useRef)(null),g=v(t=>{if(f&&!n)return ft;if(!t||t===ft||d.current!==e||o!=null){let t=new Map;for(let n of e){if(!n)continue;if(o&&o.length>0&&!o.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Re(l(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,o,n,f,l]);return(0,i.useEffect)(()=>{d.current=e},[e]),(0,i.useEffect)(()=>{f||m()},[n,f]),(0,i.useEffect)(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),(0,i.useEffect)(()=>{f||typeof c!=`number`||h.current!==null||(h.current=setTimeout(()=>{m(),h.current=null},c))},[c,f,m,...r]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:o!=null};function y(){switch(u){case ut.Always:return!1;case ut.BeforeDragging:return n;default:return!n}}}function mt(e,t){return v(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function ht(e,t){return mt(e,t)}function gt(e){let{callback:t,disabled:n}=e,r=h(t),a=(0,i.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,i.useEffect)(()=>()=>a?.disconnect(),[a]),a}function _t(e){let{callback:t,disabled:n}=e,r=h(t),a=(0,i.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,i.useEffect)(()=>()=>a?.disconnect(),[a]),a}function vt(e){return new Re(K(e),e)}function yt(e,t,n){t===void 0&&(t=vt);let[r,a]=(0,i.useState)(null);function o(){a(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let s=gt({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){o();break}}}}),c=_t({callback:o});return m(()=>{o(),e?(c?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),s?.disconnect())},[e]),r}function bt(e){return _e(e,mt(e))}var xt=[];function St(e){let t=(0,i.useRef)(e),n=v(n=>e?n&&n!==xt&&e&&t.current&&e.parentNode===t.current.parentNode?n:q(e):xt,[e]);return(0,i.useEffect)(()=>{t.current=e},[e]),n}function Ct(e){let[t,n]=(0,i.useState)(null),r=(0,i.useRef)(e),a=(0,i.useCallback)(e=>{let t=Y(e.target);t&&n(e=>e?(e.set(t,De(t)),new Map(e)):null)},[]);return(0,i.useEffect)(()=>{let t=r.current;if(e!==t){i(t);let o=e.map(e=>{let t=Y(e);return t?(t.addEventListener(`scroll`,a,{passive:!0}),[t,De(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{Y(e)?.removeEventListener(`scroll`,a)})}},[a,e]),(0,i.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>w(e,t),R):Ne(e):R,[e,t])}function wt(e,t){t===void 0&&(t=[]);let n=(0,i.useRef)(null);return(0,i.useEffect)(()=>{n.current=null},t),(0,i.useEffect)(()=>{let t=e!==R;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?T(e,n.current):R}function Tt(e){(0,i.useEffect)(()=>{if(!o)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function Et(e,t){return(0,i.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function Dt(e){return(0,i.useMemo)(()=>e?Ce(e):null,[e])}var Ot=[];function kt(e,t){t===void 0&&(t=K);let[n]=e,r=Dt(n?l(n):null),[a,o]=(0,i.useState)(Ot);function s(){o(()=>e.length?e.map(e=>Oe(e)?r:new Re(t(e),e)):Ot)}let c=_t({callback:s});return m(()=>{c?.disconnect(),s(),e.forEach(e=>c?.observe(e))},[e]),a}function At(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return d(t)?t:e}function jt(e){let{measure:t}=e,[n,r]=(0,i.useState)(null),a=_t({callback:(0,i.useCallback)(e=>{for(let{target:n}of e)if(d(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[o,s]=y((0,i.useCallback)(e=>{let n=At(e);a?.disconnect(),n&&a?.observe(n),r(n?t(n):null)},[t,a]));return(0,i.useMemo)(()=>({nodeRef:o,rect:n,setRef:s}),[n,o,s])}var Mt=[{sensor:Ze,options:{}},{sensor:Ke,options:{}}],Nt={current:{}},Pt={draggable:{measure:Se},droppable:{measure:Se,strategy:ut.WhileDragging,frequency:dt.Optimized},dragOverlay:{measure:K}},Ft=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},It={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ft,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:F},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Pt,measureDroppableContainers:F,windowRect:null,measuringScheduled:!1},Lt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:F,draggableNodes:new Map,over:null,measureDroppableContainers:F},Rt=(0,i.createContext)(Lt),zt=(0,i.createContext)(It);function Bt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ft}}}function Vt(e,t){switch(t.type){case P.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case P.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case P.DragEnd:case P.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case P.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Ft(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case P.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Ft(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case P.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Ft(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Ht(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:a}=(0,i.useContext)(Rt),o=b(r),s=b(n?.id);return(0,i.useEffect)(()=>{if(!t&&!r&&o&&s!=null){if(!D(o)||document.activeElement===o.target)return;let e=a.get(s);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=A(e);if(t){t.focus();break}}})}},[r,t,a,s,o]),null}function Ut(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function Wt(e){return(0,i.useMemo)(()=>({draggable:{...Pt.draggable,...e?.draggable},droppable:{...Pt.droppable,...e?.droppable},dragOverlay:{...Pt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Gt(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e,o=(0,i.useRef)(!1),{x:s,y:c}=typeof a==`boolean`?{x:a,y:a}:a;m(()=>{if(!s&&!c||!t){o.current=!1;return}if(o.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=_e(n(e),r);if(s||(i.x=0),c||(i.y=0),o.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=J(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,s,c,r,n])}var Kt=(0,i.createContext)({...R,scaleX:1,scaleY:1}),qt;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(qt||={});var Jt=(0,i.memo)(function(e){let{id:t,accessibility:n,autoScroll:a=!0,children:o,sensors:s=Mt,collisionDetection:c=me,measuring:u,modifiers:d,...f}=e,[p,h]=(0,i.useReducer)(Vt,void 0,Bt),[g,v]=oe(),[y,b]=(0,i.useState)(qt.Uninitialized),x=y===qt.Initialized,{draggable:{active:C,nodes:T,translate:E},droppable:{containers:D}}=p,ee=C==null?null:T.get(C),O=(0,i.useRef)({initial:null,translated:null}),k=(0,i.useMemo)(()=>C==null?null:{id:C,data:ee?.data??Nt,rect:O},[C,ee]),A=(0,i.useRef)(null),[ne,re]=(0,i.useState)(null),[j,ie]=(0,i.useState)(null),M=_(f,Object.values(f)),se=S(`DndDescribedBy`,t),ce=(0,i.useMemo)(()=>D.getEnabled(),[D]),F=Wt(u),{droppableRects:I,measureDroppableContainers:L,measuringScheduled:R}=pt(ce,{dragging:x,dependencies:[E.x,E.y],config:F.droppable}),z=ct(T,C),le=(0,i.useMemo)(()=>j?te(j):null,[j]),B=Ne(),ue=ht(z,F.draggable.measure);Gt({activeNode:C==null?null:T.get(C),config:B.layoutShiftCompensation,initialRect:ue,measure:F.draggable.measure});let V=yt(z,F.draggable.measure,ue),fe=yt(z?z.parentElement:null),H=(0,i.useRef)({activatorEvent:null,active:null,activeNode:z,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:D,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),pe=D.getNodeFor(H.current.over?.id),U=jt({measure:F.dragOverlay.measure}),he=U.nodeRef.current??z,W=x?U.rect??V:null,_e=!!(U.nodeRef.current&&U.rect),ve=bt(_e?null:V),be=Dt(he?l(he):null),G=St(x?pe??z:null),xe=kt(G),K=Ut(d,{transform:{x:E.x-ve.x,y:E.y-ve.y,scaleX:1,scaleY:1},activatorEvent:j,active:k,activeNodeRect:V,containerNodeRect:fe,draggingNodeRect:W,over:H.current.over,overlayNodeRect:U.rect,scrollableAncestors:G,scrollableAncestorRects:xe,windowRect:be}),Se=le?w(le,E):null,Ce=Ct(G),we=wt(Ce),Te=wt(Ce,[V]),q=w(K,we),J=W?ye(W,K):null,Y=k&&J?c({active:k,collisionRect:J,droppableRects:I,droppableContainers:ce,pointerCoordinates:Se}):null,Ee=de(Y,`id`),[X,De]=(0,i.useState)(null),Z=ge(_e?K:w(K,Te),X?.rect??null,V),Oe=(0,i.useRef)(null),ke=(0,i.useCallback)((e,t)=>{let{sensor:n,options:i}=t;if(A.current==null)return;let a=T.get(A.current);if(!a)return;let o=e.nativeEvent,s=new n({active:A.current,activeNode:a,event:o,options:i,context:H,onAbort(e){if(!T.get(e))return;let{onDragAbort:t}=M.current,n={id:e};t?.(n),g({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!T.get(e))return;let{onDragPending:i}=M.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),g({type:`onDragPending`,event:a})},onStart(e){let t=A.current;if(t==null)return;let n=T.get(t);if(!n)return;let{onDragStart:i}=M.current,a={activatorEvent:o,active:{id:t,data:n.data,rect:O}};(0,r.unstable_batchedUpdates)(()=>{i?.(a),b(qt.Initializing),h({type:P.DragStart,initialCoordinates:e,active:t}),g({type:`onDragStart`,event:a}),re(Oe.current),ie(o)})},onMove(e){h({type:P.DragMove,coordinates:e})},onEnd:c(P.DragEnd),onCancel:c(P.DragCancel)});Oe.current=s;function c(e){return async function(){let{active:t,collisions:n,over:i,scrollAdjustedTranslate:a}=H.current,s=null;if(t&&a){let{cancelDrop:r}=M.current;s={activatorEvent:o,active:t,collisions:n,delta:a,over:i},e===P.DragEnd&&typeof r==`function`&&await Promise.resolve(r(s))&&(e=P.DragCancel)}A.current=null,(0,r.unstable_batchedUpdates)(()=>{h({type:e}),b(qt.Uninitialized),De(null),re(null),ie(null),Oe.current=null;let t=e===P.DragEnd?`onDragEnd`:`onDragCancel`;if(s){let e=M.current[t];e?.(s),g({type:t,event:s})}})}}},[T]),Ae=lt(s,(0,i.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=T.get(r);if(A.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},A.current=r,ke(n,t))},[T,ke]));Tt(s),m(()=>{V&&y===qt.Initializing&&b(qt.Initialized)},[V,y]),(0,i.useEffect)(()=>{let{onDragMove:e}=M.current,{active:t,activatorEvent:n,collisions:i,over:a}=H.current;if(!t||!n)return;let o={active:t,activatorEvent:n,collisions:i,delta:{x:q.x,y:q.y},over:a};(0,r.unstable_batchedUpdates)(()=>{e?.(o),g({type:`onDragMove`,event:o})})},[q.x,q.y]),(0,i.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:i,scrollAdjustedTranslate:a}=H.current;if(!e||A.current==null||!t||!a)return;let{onDragOver:o}=M.current,s=i.get(Ee),c=s&&s.rect.current?{id:s.id,rect:s.rect.current,data:s.data,disabled:s.disabled}:null,l={active:e,activatorEvent:t,collisions:n,delta:{x:a.x,y:a.y},over:c};(0,r.unstable_batchedUpdates)(()=>{De(c),o?.(l),g({type:`onDragOver`,event:l})})},[Ee]),m(()=>{H.current={activatorEvent:j,active:k,activeNode:z,collisionRect:J,collisions:Y,droppableRects:I,draggableNodes:T,draggingNode:he,draggingNodeRect:W,droppableContainers:D,over:X,scrollableAncestors:G,scrollAdjustedTranslate:q},O.current={initial:W,translated:J}},[k,z,Y,J,T,he,W,I,D,X,G,q]),at({...B,delta:E,draggingRect:J,pointerCoordinates:Se,scrollableAncestors:G,scrollableAncestorRects:xe});let je=(0,i.useMemo)(()=>({active:k,activeNode:z,activeNodeRect:V,activatorEvent:j,collisions:Y,containerNodeRect:fe,dragOverlay:U,draggableNodes:T,droppableContainers:D,droppableRects:I,over:X,measureDroppableContainers:L,scrollableAncestors:G,scrollableAncestorRects:xe,measuringConfiguration:F,measuringScheduled:R,windowRect:be}),[k,z,V,j,Y,fe,U,T,D,I,X,L,G,xe,F,R,be]),Me=(0,i.useMemo)(()=>({activatorEvent:j,activators:Ae,active:k,activeNodeRect:V,ariaDescribedById:{draggable:se},dispatch:h,draggableNodes:T,over:X,measureDroppableContainers:L}),[j,Ae,k,V,h,se,T,X,L]);return i.createElement(ae.Provider,{value:v},i.createElement(Rt.Provider,{value:Me},i.createElement(zt.Provider,{value:je},i.createElement(Kt.Provider,{value:Z},o)),i.createElement(Ht,{disabled:n?.restoreFocus===!1})),i.createElement(N,{...n,hiddenTextDescribedById:se}));function Ne(){let e=ne?.autoScrollEnabled===!1,t=typeof a==`object`?a.enabled===!1:a===!1,n=x&&!e&&!t;return typeof a==`object`?{...a,enabled:n}:{enabled:n}}}),Yt=(0,i.createContext)(null),Xt=`button`,Zt=`Draggable`;function Qt(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e,o=S(Zt),{activators:s,activatorEvent:c,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=(0,i.useContext)(Rt),{role:h=Xt,roleDescription:g=`draggable`,tabIndex:v=0}=a??{},b=l?.id===t,x=(0,i.useContext)(b?Kt:Yt),[C,w]=y(),[T,E]=y(),D=Et(s,t),ee=_(n);return m(()=>(f.set(t,{id:t,key:o,node:C,activatorNode:T,data:ee}),()=>{let e=f.get(t);e&&e.key===o&&f.delete(t)}),[f,t]),{active:l,activatorEvent:c,activeNodeRect:u,attributes:(0,i.useMemo)(()=>({role:h,tabIndex:v,"aria-disabled":r,"aria-pressed":b&&h===Xt?!0:void 0,"aria-roledescription":g,"aria-describedby":d.draggable}),[r,h,v,b,g,d.draggable]),isDragging:b,listeners:r?void 0:D,node:C,over:p,setNodeRef:w,setActivatorNodeRef:E,transform:x}}function $t(){return(0,i.useContext)(zt)}var en=`Droppable`,tn={timeout:25};function nn(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e,o=S(en),{active:s,dispatch:c,over:l,measureDroppableContainers:u}=(0,i.useContext)(Rt),d=(0,i.useRef)({disabled:n}),f=(0,i.useRef)(!1),p=(0,i.useRef)(null),m=(0,i.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:v}={...tn,...a},b=_(g??r),x=_t({callback:(0,i.useCallback)(()=>{f.current?(m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),m.current=null},v)):f.current=!0},[v]),disabled:h||!s}),[C,w]=y((0,i.useCallback)((e,t)=>{x&&(t&&(x.unobserve(t),f.current=!1),e&&x.observe(e))},[x])),T=_(t);return(0,i.useEffect)(()=>{x&&C.current&&(x.disconnect(),f.current=!1,x.observe(C.current))},[C,x]),(0,i.useEffect)(()=>(c({type:P.RegisterDroppable,element:{id:r,key:o,disabled:n,node:C,rect:p,data:T}}),()=>c({type:P.UnregisterDroppable,key:o,id:r})),[r]),(0,i.useEffect)(()=>{n!==d.current.disabled&&(c({type:P.SetDroppableDisabled,id:r,key:o,disabled:n}),d.current.disabled=n)},[r,o,n,c]),{active:s,rect:p,isOver:l?.id===r,node:C,over:l,setNodeRef:w}}function rn(e){let{animation:t,children:n}=e,[r,a]=(0,i.useState)(null),[o,s]=(0,i.useState)(null),c=b(n);return!n&&!r&&c&&a(c),m(()=>{if(!o)return;let e=r?.key,n=r?.props.id;e==null||n==null?a(null):Promise.resolve(t(n,o)).then(()=>{a(null)})},[t,r,o]),i.createElement(i.Fragment,null,n,r?(0,i.cloneElement)(r,{ref:s}):null)}var an={x:0,y:0,scaleX:1,scaleY:1};function on(e){let{children:t}=e;return i.createElement(Rt.Provider,{value:Lt},i.createElement(Kt.Provider,{value:an},t))}var sn={position:`fixed`,touchAction:`none`},cn=e=>D(e)?`transform 250ms ease`:void 0,ln=(0,i.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:a,children:o,className:s,rect:c,style:l,transform:u,transition:d=cn}=e;if(!c)return null;let f=a?u:{...u,scaleX:1,scaleY:1},p={...sn,width:c.width,height:c.height,top:c.top,left:c.left,transform:O.Transform.toString(f),transformOrigin:a&&r?le(r,c):void 0,transition:typeof d==`function`?d(r):d,...l};return i.createElement(n,{className:s,style:p,ref:t},o)}),un={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:O.Transform.toString(t)},{transform:O.Transform.toString(n)}]},sideEffects:(e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}})({styles:{active:{opacity:`0`}}})};function dn(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return h((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=At(a);if(!c)return;let{transform:u}=l(a).getComputedStyle(a),d=be(u);if(!d)return;let f=typeof t==`function`?t:fn(t);return Ie(s,i.draggable.measure),f({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function fn(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...un,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},u={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},d={x:s.x-l.x,y:s.y-l.y,...u},f=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:d}}),[p]=f,m=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;let h=r?.({active:a,dragOverlay:o,...c}),g=o.node.animate(f,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{g.onfinish=()=>{h?.(),e()}})}}var pn=0;function mn(e){return(0,i.useMemo)(()=>{if(e!=null)return pn++,pn},[e])}var hn=i.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:a,transition:o,modifiers:s,wrapperElement:c=`div`,className:l,zIndex:u=999}=e,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggableNodes:h,droppableContainers:g,dragOverlay:_,over:v,measuringConfiguration:y,scrollableAncestors:b,scrollableAncestorRects:x,windowRect:S}=$t(),C=(0,i.useContext)(Kt),w=mn(f?.id),T=Ut(s,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggingNodeRect:_.rect,over:v,overlayNodeRect:_.rect,scrollableAncestors:b,scrollableAncestorRects:x,transform:C,windowRect:S}),E=mt(p),D=dn({config:r,draggableNodes:h,droppableContainers:g,measuringConfiguration:y}),ee=E?_.setRef:void 0;return i.createElement(on,null,i.createElement(rn,{animation:D},f&&w?i.createElement(ln,{key:w,id:f.id,ref:ee,as:c,activatorEvent:d,adjustScale:t,className:l,transition:o,rect:E,style:{zIndex:u,...a},transform:T},n):null))});function gn(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function _n(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function vn(e){return e!==null&&e>=0}function yn(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bn(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var xn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=gn(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},Sn={scaleX:1,scaleY:1},Cn=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...Sn}:null}let s=wn(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...Sn}:r<t&&r>=a?{x:0,y:o.height+s,...Sn}:{x:0,y:0,...Sn}};function wn(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var Tn=`Sortable`,En=i.createContext({activeIndex:-1,containerId:Tn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:xn,disabled:{draggable:!1,droppable:!1}});function Dn(e){let{children:t,id:n,items:r,strategy:a=xn,disabled:o=!1}=e,{active:s,dragOverlay:c,droppableRects:l,over:u,measureDroppableContainers:d}=$t(),f=S(Tn,n),p=c.rect!==null,h=(0,i.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),g=s!=null,_=s?h.indexOf(s.id):-1,v=u?h.indexOf(u.id):-1,y=(0,i.useRef)(h),b=!yn(h,y.current),x=v!==-1&&_===-1||b,C=bn(o);m(()=>{b&&g&&d(h)},[b,h,g,d]),(0,i.useEffect)(()=>{y.current=h},[h]);let w=(0,i.useMemo)(()=>({activeIndex:_,containerId:f,disabled:C,disableTransforms:x,items:h,overIndex:v,useDragOverlay:p,sortedRects:_n(h,l),strategy:a}),[_,f,C.draggable,C.droppable,x,h,v,l,p,a]);return i.createElement(En.Provider,{value:w},t)}var On=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return gn(n,r,i).indexOf(t)},kn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},An={duration:200,easing:`ease`},jn=`transform`,Mn=O.Transition.toString({property:jn,duration:0,easing:`linear`}),Nn={roleDescription:`sortable`};function Pn(e){let{disabled:t,index:n,node:r,rect:a}=e,[o,s]=(0,i.useState)(null),c=(0,i.useRef)(n);return m(()=>{if(!t&&n!==c.current&&r.current){let e=a.current;if(e){let t=K(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}n!==c.current&&(c.current=n)},[t,n,r,a]),(0,i.useEffect)(()=>{o&&s(null)},[o]),o}function Fn(e){let{animateLayoutChanges:t=kn,attributes:n,disabled:r,data:o,getNewIndex:s=On,id:c,strategy:l,resizeObserverConfig:u,transition:d=An}=e,{items:f,containerId:p,activeIndex:m,disabled:h,disableTransforms:g,sortedRects:_,overIndex:v,useDragOverlay:y,strategy:b}=(0,i.useContext)(En),x=In(r,h),S=f.indexOf(c),C=(0,i.useMemo)(()=>({sortable:{containerId:p,index:S,items:f},...o}),[p,o,S,f]),w=(0,i.useMemo)(()=>f.slice(f.indexOf(c)),[f,c]),{rect:T,node:E,isOver:ee,setNodeRef:te}=nn({id:c,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...u}}),{active:k,activatorEvent:A,activeNodeRect:ne,attributes:re,setNodeRef:j,listeners:ie,isDragging:ae,over:M,setActivatorNodeRef:oe,transform:se}=Qt({id:c,data:C,attributes:{...Nn,...n},disabled:x.draggable}),ce=a(te,j),N=!!k,P=N&&!g&&vn(m)&&vn(v),F=!y&&ae,I=P?(F&&P?se:null)??(l??b)({rects:_,activeNodeRect:ne,activeIndex:m,overIndex:v,index:S}):null,L=vn(m)&&vn(v)?s({id:c,items:f,activeIndex:m,overIndex:v}):S,R=k?.id,z=(0,i.useRef)({activeId:R,items:f,newIndex:L,containerId:p}),le=f!==z.current.items,B=t({active:k,containerId:p,isDragging:ae,isSorting:N,id:c,index:S,items:f,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:d,wasDragging:z.current.activeId!=null}),ue=Pn({disabled:!B,index:S,node:E,rect:T});return(0,i.useEffect)(()=>{N&&z.current.newIndex!==L&&(z.current.newIndex=L),p!==z.current.containerId&&(z.current.containerId=p),f!==z.current.items&&(z.current.items=f)},[N,L,p,f]),(0,i.useEffect)(()=>{if(R===z.current.activeId)return;if(R!=null&&z.current.activeId==null){z.current.activeId=R;return}let e=setTimeout(()=>{z.current.activeId=R},50);return()=>clearTimeout(e)},[R]),{active:k,activeIndex:m,attributes:re,data:C,rect:T,index:S,newIndex:L,items:f,isOver:ee,isSorting:N,isDragging:ae,listeners:ie,node:E,overIndex:v,over:M,setNodeRef:ce,setActivatorNodeRef:oe,setDroppableNodeRef:te,setDraggableNodeRef:j,transform:ue??I,transition:V()};function V(){if(ue||le&&z.current.newIndex===S)return Mn;if(!(F&&!D(A)||!d)&&(N||B))return O.Transition.toString({...d,property:jn})}}function In(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function Ln(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var Rn=[$.Down,$.Right,$.Up,$.Left],zn=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(Rn.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case $.Down:r.top<a.top&&t.push(n);break;case $.Up:r.top>a.top&&t.push(n);break;case $.Left:r.left>a.left&&t.push(n);break;case $.Right:r.left<a.left&&t.push(n)}});let c=pe({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=de(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=q(c).some((e,t)=>s[t]!==e),i=Bn(e,t),a=Vn(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:T(u,l)}}}};function Bn(e,t){return!Ln(e)||!Ln(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Vn(e,t){return!Ln(e)||!Ln(t)||!Bn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}export{Cn as a,Ke as c,W as d,me as f,O as g,L as h,Fn as i,Ze as l,I as m,gn as n,Jt as o,nn as p,zn as r,hn as s,Dn as t,H as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,T as t,h as n}from"./overview-
|
|
1
|
+
import{A as e,T as t,h as n}from"./overview-C73v5kbv.js";import{Ot as r,t as i}from"./strings-DXB6PB2g.js";import{i as a}from"./model-87X7P9Uh.js";var o=e=>{let t=e.attempts.at(-1)?.outcome;return t?._tag===`Failed`&&t.failure._tag===`QuestionFailure`},s=({reason:e})=>e._tag===`LoopPaused`,c=({loop:s,reason:c},l)=>r(c,{AwaitingApproval:()=>`Waiting for approval`,SuppressedForOperator:({run:e})=>o(e)?`Question from the agent`:`Blocked by the agent`,CycleBudgetUsedUp:({ask:e})=>`Cycle budget used, ${e.limit} rounds`,RunFailed:({run:e})=>{let t=e.attempts.at(-1)?.outcome,r=t?._tag===`Failed`?`: ${n(t.failure)}`:``;return`Failed ${i(a(e),l)}${r}`},ClosedUnchanged:({run:e})=>`${e.state===`Succeeded`?`Succeeded`:`Canceled`} ${i(a(e),l)}, unchanged since`,LoopPaused:()=>`${s} paused`,WaitingForStop:({run:e,stop:n})=>t(e.id,n),QueuedForWorker:({ahead:t,creating:n})=>n===null?t===null?`Waiting for a free worker slot`:t===0?`Waiting for a free worker slot, next in queue`:`Waiting for a free worker slot, behind ${t} ${t===1?`run`:`runs`}`:e(n,l),AwaitingPoll:()=>`Waiting for the next poll`});export{c as n,s as t};
|