@wjarka/cezarion 0.18.0-dev.7405 → 0.18.0-dev.7406

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.
Files changed (82) hide show
  1. package/package.json +2 -2
  2. package/web/dist/assets/activity-motion-GWiNidwF.js +2 -0
  3. package/web/dist/assets/activity-route-ByFh99Eo.js +1 -0
  4. package/web/dist/assets/{agent-accounts-0EKsrgdJ.js → agent-accounts-BDB73Hg9.js} +1 -1
  5. package/web/dist/assets/attention-FrfXSNio.js +1 -0
  6. package/web/dist/assets/button-RJMdCnZw.js +3 -0
  7. package/web/dist/assets/centered-state-dmABwupF.js +1 -0
  8. package/web/dist/assets/commit-diff-panel-CM6ogknc.js +1 -0
  9. package/web/dist/assets/dialog-7Mg2IZCP.js +1 -0
  10. package/web/dist/assets/diff-BU25IR0d.js +3 -0
  11. package/web/dist/assets/diff-controls-BpQyN23g.js +1 -0
  12. package/web/dist/assets/{diff-view-Ch_cdfcV.js → diff-view-CnGdaz-L.js} +5 -5
  13. package/web/dist/assets/{dist-CwBtGUlU.js → dist-FHKv_Ysh.js} +1 -1
  14. package/web/dist/assets/dropdown-menu-Cr9RsmWG.js +1 -0
  15. package/web/dist/assets/es2015-VrVcR1vD.js +41 -0
  16. package/web/dist/assets/file-preview-COpe5-X0.js +2 -0
  17. package/web/dist/assets/git-toolbar-CMH0kDal.js +1 -0
  18. package/web/dist/assets/github-JeDKhIAK.js +1 -0
  19. package/web/dist/assets/{global-activity-route-DVSxx-ha.js → global-activity-route-x2Xn5g2h.js} +1 -1
  20. package/web/dist/assets/{image-preview-cn57tA1m.js → image-preview-BmcpjY75.js} +1 -1
  21. package/web/dist/assets/index-3JtARe0j.js +14 -0
  22. package/web/dist/assets/markdown-BDuLh9lK.js +4 -0
  23. package/web/dist/assets/{nav-row-styles-DSBuSnEE.js → nav-row-styles-D4xk5Osn.js} +1 -1
  24. package/web/dist/assets/picker-pill-DpZKt_In.js +15 -0
  25. package/web/dist/assets/preview-pane-connected-CwYbRQfS.js +3 -0
  26. package/web/dist/assets/project-router-DNqfLxdJ.js +1 -0
  27. package/web/dist/assets/project-scope-context-CFEoNQTg.js +4 -0
  28. package/web/dist/assets/{prompt-template-menu-i7FXpDOj.js → prompt-template-menu-DPEauS3z.js} +1 -1
  29. package/web/dist/assets/{queries-B4jd0jVr.js → queries-mk7hUEKT.js} +1 -1
  30. package/web/dist/assets/reference-chip-DQtQZJaX.js +1 -0
  31. package/web/dist/assets/repo-git-CcfbTImd.js +1 -0
  32. package/web/dist/assets/{report-reader-B1yQJCNt.js → report-reader-CWXDg8JE.js} +1 -1
  33. package/web/dist/assets/reports-Bau_TxUs.js +1 -0
  34. package/web/dist/assets/run-header-C5wDUTls.js +2 -0
  35. package/web/dist/assets/skills-CFl4V447.js +1 -0
  36. package/web/dist/assets/{tab-link-Bc-CvRBn.js → tab-link-B7SjdDeU.js} +1 -1
  37. package/web/dist/assets/{task-changes-DIU2Co-H.js → task-changes-Dnprgwc1.js} +1 -1
  38. package/web/dist/assets/{task-commits-Cccn7xrR.js → task-commits-B0SApZKn.js} +1 -1
  39. package/web/dist/assets/{task-files-C-66-xPc.js → task-files-B_mLju-K.js} +1 -1
  40. package/web/dist/assets/{task-github-item-5mF5DxKm.js → task-github-item-BUoUh8t0.js} +1 -1
  41. package/web/dist/assets/task-thread-BQi3cH3M.js +9 -0
  42. package/web/dist/assets/thread-state-BOUrIjKm.js +4 -0
  43. package/web/dist/assets/{toaster-CoMJoQvk.js → toaster-BWMQArHJ.js} +1 -1
  44. package/web/dist/assets/use-desktop-CkqdpZt0.js +1 -0
  45. package/web/dist/assets/use-hand-to-agent-state-PCPwKRR0.js +1 -0
  46. package/web/dist/assets/{useInfiniteQuery-DBV7oz3w.js → useInfiniteQuery-BL1dhFBm.js} +1 -1
  47. package/web/dist/assets/useQuery-B12MHZfS.js +1 -0
  48. package/web/dist/assets/{workflows-C1kx7nsU.js → workflows-BRZR4pVb.js} +3 -3
  49. package/web/dist/assets/{ws-D6M4b5Tw.js → ws-DX0R2MDS.js} +1 -1
  50. package/web/dist/assets/zoomable-image-DefjK4q5.js +1 -0
  51. package/web/dist/index.html +21 -21
  52. package/web/dist/assets/activity-motion-W7LQQzqR.js +0 -2
  53. package/web/dist/assets/activity-route-b-zH6KX6.js +0 -1
  54. package/web/dist/assets/attention-CvRtkmnP.js +0 -1
  55. package/web/dist/assets/button-DGwhwRuD.js +0 -3
  56. package/web/dist/assets/centered-state-B5QmAy2y.js +0 -1
  57. package/web/dist/assets/commit-diff-panel-BBZZbVgE.js +0 -1
  58. package/web/dist/assets/dialog-tMSuX5a7.js +0 -1
  59. package/web/dist/assets/diff-CkqVFsT7.js +0 -3
  60. package/web/dist/assets/diff-controls-fOOHkbPK.js +0 -1
  61. package/web/dist/assets/dropdown-menu-CzUYjvx4.js +0 -1
  62. package/web/dist/assets/es2015-DTn4s5Lh.js +0 -41
  63. package/web/dist/assets/file-preview-0T9fzXJY.js +0 -2
  64. package/web/dist/assets/git-toolbar-Ccpg_TKe.js +0 -1
  65. package/web/dist/assets/github-CPJXTYE-.js +0 -1
  66. package/web/dist/assets/index-FZIxXka9.js +0 -14
  67. package/web/dist/assets/markdown-BldkAL5N.js +0 -4
  68. package/web/dist/assets/picker-pill-DN0WFWoS.js +0 -15
  69. package/web/dist/assets/preview-pane-connected-xrHDiOdF.js +0 -3
  70. package/web/dist/assets/project-router-BVp1TVVP.js +0 -1
  71. package/web/dist/assets/project-scope-context-DSlnqjT3.js +0 -4
  72. package/web/dist/assets/reference-chip-DeYsiLdM.js +0 -1
  73. package/web/dist/assets/repo-git-BzPaI8dr.js +0 -1
  74. package/web/dist/assets/reports-DeRPb5Oo.js +0 -1
  75. package/web/dist/assets/run-header-DGZHSrbt.js +0 -2
  76. package/web/dist/assets/skills-2ng-kCCS.js +0 -1
  77. package/web/dist/assets/task-thread-B_AnobAW.js +0 -9
  78. package/web/dist/assets/thread-state-DQJxLYUo.js +0 -4
  79. package/web/dist/assets/use-desktop-CPzO9ufG.js +0 -1
  80. package/web/dist/assets/use-hand-to-agent-state-ClzuNnhO.js +0 -1
  81. package/web/dist/assets/useQuery-DqWzagrg.js +0 -1
  82. package/web/dist/assets/zoomable-image-C7mEDZaS.js +0 -1
@@ -1,2 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{L as t,p as n,t as r,u as i}from"./button-DGwhwRuD.js";import{i as a,t as o}from"./react-runtime-CCIEwYL0.js";import{t as s}from"./live-refetch-CZb2VOyu.js";import{An as c,Dn as l,Lr as u,Nn as d,Nt as f,Qn as p,Tr as m,f as ee,gn as te,gr as ne,i as re,vr as ie,xn as ae}from"./project-scope-context-DSlnqjT3.js";import{$ as oe,A as se,H as ce,Q as le,Y as h,Z as g,dt as ue,et as _,nt as v,ot as y,q as de,rt as b,st as fe,ut as pe,z as me}from"./live-protocol-kUxhOnN1.js";import{t as he}from"./useQuery-DqWzagrg.js";import{n as ge,t as _e}from"./ws-D6M4b5Tw.js";import{t as x}from"./createLucideIcon-BHp8sXmF.js";import{n as ve,r as ye,t as be}from"./hourglass-B0lPAJvT.js";import{t as xe}from"./eye-B8okNWXU.js";import{t as Se}from"./message-square-B-MD-8rD.js";import{t as S}from"./project-router-BVp1TVVP.js";import"./attention-CvRtkmnP.js";import{Jt as C,_n as Ce,ht as we}from"./index-FZIxXka9.js";var Te=x(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),Ee=x(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),De=x(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),Oe=x(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),ke=x(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),Ae=x(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),je=x(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),Me=x(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),Ne=x(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),w=e(a(),1),T=o(),E=ue(),D=v().int().nonnegative(),O=y().min(1),Pe=b({title:y().max(160),toolKind:h([`read`,`edit`,`delete`,`move`,`search`,`execute`,`think`,`fetch`,`task`,`plan`,`other`]),status:h([`pending`,`running`,`completed`,`failed`,`declined`]),startedAt:E,endedAt:E.optional()}).strict(),Fe=h([`pass`,`fail`,`pending`,`skipping`,`cancel`]),Ie=b({checks:g(b({name:y().max(100),bucket:Fe}).strict()).max(100),counts:b({pass:D,fail:D,pending:D,skipping:D,cancel:D}).strict(),truncated:_(!0).optional()}).strict(),Le=oe(`kind`,[b({kind:_(`human`),since:E,detail:b({question:y().max(500).optional(),reason:h([`question`,`turn-end`,`budget`,`completion`]),queuedMessages:v().int().positive().optional()}).strict()}).strict(),b({kind:_(`usage-limit`),detail:b({resumeAt:y()}).strict()}).strict(),b({kind:_(`workers`),since:E,deadline:E.optional(),detail:b({owed:D,total:D,settled:D,replies:_(!0).optional(),mode:se.optional(),recipientRunIds:g(O)}).strict()}).strict(),b({kind:_(`peers`),since:E,deadline:E,detail:b({peerRunIds:g(O)}).strict()}).strict(),b({kind:_(`subagents`),since:E,deadline:E,detail:b({running:D}).strict()}).strict(),b({kind:_(`pr`),since:E,deadline:E,detail:b({number:v().int().positive(),target:p,checks:Ie.shape.checks.optional(),counts:Ie.shape.counts.optional(),truncated:_(!0).optional()}).strict()}).strict(),b({kind:_(`process`),since:E,deadline:E,detail:b({pid:v().int(),note:y().optional()}).strict()}).strict(),b({kind:_(`timer`),since:E,deadline:E,detail:b({wakeAt:E,note:y().optional()}).strict()}).strict()]),Re={runId:O,title:y(),status:me,rung:h(l),runner:de.optional(),model:y().optional(),currentStepId:y().optional(),startedAt:y().optional(),wait:Le.optional(),tool:Pe.optional(),rate:g(D).length(30),error:y().max(200).optional()},ze=b({...Re,revision:D,collected:le()}).strict(),Be=b({...Re,workers:g(ze)}).strict(),Ve=b({requestId:pe(),relationship:h([`family`,`peer`]),senderRunId:O,recipientRunId:O,text:y().max(500),senderTitle:y().optional(),recipientTitle:y().optional(),createdAt:E,deadline:E.optional()}).strict(),He=b({requestId:pe(),senderRunId:O,recipientRunId:O,status:ce.shape.status,observedAt:E}).strict(),Ue=b({generatedAt:E,projects:g(b({projectId:y(),name:y(),loaded:le(),unavailable:b({status:fe([_(404),_(409),_(503)]),error:y()}).strict().optional(),inReview:D,tasks:g(Be),requests:g(Ve),closed:g(He)}).strict())}).strict();b({project:fe([_(`default`),y().regex(ae)]).optional()});var We=5e3,Ge=e=>[`workspace`,`activity`,e.kind===`project`?e.projectId:null],Ke=e=>e.kind===`project`?`activity:project:${e.projectId}`:`activity:workspace`,qe=e=>e.kind===`project`?`/api/v1/workspace/activity?project=${encodeURIComponent(e.projectId)}`:`/api/v1/workspace/activity`,Je=`the ${t(`cezar`)} server answered /workspace/activity with an unexpected body`;function Ye(e){let t=Ue.safeParse(e);if(!t.success)throw new re(200,Je);return t.data}async function Xe(e,t){let n=e.kind===`project`?{project:e.projectId}:{};return Ye(await te(await ee.api.v1.workspace.activity.$get({query:n},f(t)),`/workspace/activity`))}function Ze(e,t){return e!==void 0&&Date.parse(t.generatedAt)<Date.parse(e.generatedAt)?e:t}var Qe=new Date(0).toISOString();function $e(e){return e!==void 0&&e!==Qe&&!Number.isNaN(Date.parse(e))}var et=new Set([404,409,503]);function tt(e,t,n,r){let i=e?.projects.find(e=>e.projectId===t)?.name??t;return{generatedAt:e?.generatedAt??Qe,projects:[{projectId:t,name:i,loaded:!0,unavailable:{status:n,error:r},inReview:0,tasks:[],requests:[],closed:[]}]}}function nt(e,t){return new re(Number(/^HTTP (\d+)$/.exec(t)?.[1]??0),e&&typeof e==`object`&&typeof e.error==`string`?e.error:t)}var rt=(e,t)=>e.kind===`project`&&et.has(t.status)?t.status:void 0;function it(e){let t=e.kind===`project`?e.projectId:void 0,n=(0,w.useMemo)(()=>t===void 0?{kind:`workspace`}:{kind:`project`,projectId:t},[t]),r=(0,w.useMemo)(()=>Ge(n),[n]),i=u(),a=he({queryKey:r,queryFn:async({signal:e})=>{let t=i.getQueryData(r);try{return Ze(t,await Xe(n,{signal:e}))}catch(e){let r=e instanceof re?rt(n,e):void 0;if(r===void 0||n.kind!==`project`)throw e;return tt(t,n.projectId,r,e.message)}},staleTime:1/0});return(0,w.useEffect)(()=>{let e=!0,t=t=>{i.cancelQueries({queryKey:r,exact:!0}).then(()=>{if(!e)return;let a=rt(n,t);if(a!==void 0&&n.kind===`project`){i.setQueryData(r,e=>tt(e,n.projectId,a,t.message));return}let o=i.getQueryCache().find({queryKey:r,exact:!0});o?.setState({status:`error`,error:t,errorUpdatedAt:Date.now(),errorUpdateCount:o.state.errorUpdateCount+1,fetchStatus:`idle`})})},a=n=>{let a;try{a=Ye(n)}catch(e){t(e);return}i.cancelQueries({queryKey:r,exact:!0}).then(()=>{e&&i.setQueryData(r,e=>Ze(e,a))})},o=_e(Ke(n),a),c=s(We),l,u=()=>{let e=ne()===`finite`&&c!==!1;e&&!l?l=ge({path:qe(n),intervalMs:c},(e,n)=>{n===void 0?a(e):t(nt(e,n))}):!e&&l&&(l(),l=void 0)};u();let d=ie(u);return()=>{e=!1,d(),l?.(),o()}},[i,r,n]),a}var k=e=>String(e).padStart(2,`0`);function A(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t/60)%60,i=t%60;return n>0?`${n}:${k(r)}:${k(i)}`:`${r}:${k(i)}`}function at(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t} s`;let n=Math.floor(t/60);return n<60?`${n} min`:`${Math.floor(n/60)} h ${k(n%60)} min`}function j(e,t){let n=e===void 0?NaN:Date.parse(e);return Number.isNaN(n)?0:t-n}var ot=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`});function M(e){let t=Date.parse(e);return Number.isNaN(t)?e:ot.format(t)}function st(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var ct=new Set([`queued`,`running`,`waiting`]),lt={review:`In review`,failed:`Failed`,done:`Done`,cancelled:`Cancelled`},ut={review:`review`,failed:`failed`,done:`done`,cancelled:`cancelled`},N=e=>ct.has(e),P=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`,F=e=>c(e.rung).tone,I=(e,t=`Deadline`)=>e?`${t} ${M(e)}`:void 0;function dt(e,t,n){return t.length===1&&t[0]!==void 0?`${e} ${n.titleOf(t[0])}`:`${e} ${P(t.length,`task`)}`}function ft(e,t){let n=e.tool,r={verb:`Doing`,tone:F(e),icon:`tool`},i=n?.endedAt!==void 0&&j(n.endedAt,t.now)>1e4;if(n===void 0)return{...r,main:`Thinking`,...e.startedAt?{since:e.startedAt}:{}};let a=`Last tool ${at(j(n.endedAt??n.startedAt,t.now))} ago`;return i?{...r,main:`Thinking`,detail:a,since:n.endedAt??n.startedAt}:{...r,main:n.title,mono:!0,detail:a,since:n.startedAt}}function pt(e,t){let n={verb:`Needs you`,tone:F(e),icon:`user`,...t?{since:t.since}:{}};if(t?.detail.reason===`question`)return t.detail.question?{...n,main:t.detail.question,action:`answer`}:{...n,main:`Your turn`,action:`answer`};if(t?.detail.reason===`budget`){let e=t.detail.queuedMessages;return{...n,main:e?`Automatic wakes used up · ${P(e,`message`)} queued`:`Automatic wakes used up`,action:`open`}}return{...n,main:`Your turn`,action:`open`}}function mt(e){return{verb:`Needs you`,tone:F(e),icon:`user`,main:`Permission`,action:`open`}}function ht(e,t,n){let{owed:r,total:i,settled:a,replies:o,mode:s,recipientRunIds:c}=t.detail,l=i>0?a/i:0,u={tone:F(e),since:t.since};if(o){let e=c.length>0?dt(`From`,c,n):`Waiting for replies`;return{...u,verb:`Waiting for reply`,icon:`reply`,main:e,...L(`detail`,I(t.deadline,`Reply due`))}}let d=c.length>0?`${r} owed · ${a} settled`:s?`${gt[s]} of ${i} · ${a} settled`:`${r} owed`;return{...u,verb:`Waiting for workers`,icon:`workers`,main:d,bar:l,...L(`detail`,I(t.deadline))}}var gt={one:`One`,any:`Any`,all:`All`};function _t(e){let t=e.detail.counts;if(t===void 0)return`PR ${e.detail.number} checks`;let n=t.pass+t.fail+t.pending;return`PR ${e.detail.number} checks · ${t.pass} of ${n} passed`}var vt=[`fail`,`pending`,`pass`,`skipping`,`cancel`];function yt(e){let{counts:t,checks:n=[],truncated:r}=e.detail;if(!r||t===void 0)return;let i=e=>Math.max(0,t[e]-n.filter(t=>t.bucket===e).length),a=vt.reduce((e,t)=>e+i(t),0),o=vt.find(e=>i(e)>0);return a>0&&o?{count:a,bucket:o}:void 0}var bt=[[`pass`,`passed`],[`fail`,`failed`],[`pending`,`pending`],[`skipping`,`skipped`],[`cancel`,`cancelled`]];function xt(e){let{counts:t,checks:n}=e.detail,r=e=>t?t[e]:(n??[]).filter(t=>t.bucket===e).length,i=bt.filter(([e])=>r(e)>0).map(([e,t])=>`${r(e)} ${t}`),a=yt(e);return a&&i.push(`+${a.count} more not listed`),i.length>0?i.join(`, `):void 0}function St(e,t){let n={tone:F(e),since:t.since,...L(`detail`,I(t.deadline))};if(t.detail.target!==`checks`)return{...n,verb:`Waiting for merge`,icon:`merge`,main:`PR ${t.detail.number}`};let r=t.detail.checks?[...t.detail.checks].sort((e,t)=>e.name.localeCompare(t.name)):void 0;return{...n,verb:`Waiting for CI`,icon:`ci`,main:_t(t),...L(`checks`,r),...L(`overflow`,yt(t)),...L(`checkSummary`,xt(t))}}function L(e,t){return t===void 0?{}:{[e]:t}}function Ct(e,t,n){let r=F(e);switch(t.kind){case`workers`:return ht(e,t,n);case`peers`:return{verb:`Waiting for a peer`,tone:r,icon:`peer`,since:t.since,main:dt(`For`,t.detail.peerRunIds,n),detail:`Deadline ${M(t.deadline)}`};case`subagents`:return{verb:`Waiting for subagents`,tone:r,icon:`subagents`,since:t.since,main:P(t.detail.running,`native subagent`),detail:`Deadline ${M(t.deadline)}`};case`pr`:return St(e,t);case`process`:return{verb:`Waiting for command`,tone:r,icon:`command`,since:t.since,main:t.detail.note??`Process ${t.detail.pid}`,detail:`Running ${A(j(t.since,n.now))} · deadline ${M(t.deadline)}`};case`timer`:return{verb:`Waiting for timer`,tone:r,icon:`timer`,since:t.since,main:t.detail.note??`Timer`,detail:`Wakes ${M(t.detail.wakeAt)} · in ${A(-j(t.detail.wakeAt,n.now))}`};case`usage-limit`:return wt(e,t.detail.resumeAt,n);case`human`:return}}function wt(e,t,n){let r=Date.parse(t),i=Number.isNaN(r)?`Resumes ${t}`:`Resumes ${M(t)} · in ${A(r-n.now)}`;return{verb:`Paused`,tone:F(e),icon:`pause`,main:`Usage limit`,detail:i}}function Tt(e,t){let n=e.wait&&`since`in e.wait?e.wait.since:e.startedAt;return{verb:`Queued`,tone:F(e),icon:`queued`,main:`Waiting for a free slot`,...n?{since:n,detail:`Waiting ${at(j(n,t.now))}`}:{}}}function R(e,t){return{verb:lt[e.status]??e.status,tone:F(e),icon:ut[e.status]??`done`,main:t}}function z(e,t){return N(e.status)?Et(e,t):R(e,P(e.workers.filter(e=>N(e.status)).length,`live worker`))}function Et(e,t){let n=e.wait;switch(e.rung){case`running`:return ft(e,t);case`needs-permission`:return mt(e);case`needs-you`:return pt(e,n?.kind===`human`?n:void 0);case`usage-limit`:return n?.kind===`usage-limit`?wt(e,n.detail.resumeAt,t):{verb:`Paused`,tone:F(e),icon:`pause`,main:`Usage limit`};case`queued`:case`waiting-for-capacity`:return Tt(e,t);default:return(n&&Ct(e,n,t))??Tt(e,t)}}function Dt(e,t,n){if(n!==void 0&&N(e.status))return{verb:`Asks parent`,tone:F(e),main:`“${n}”`,asks:!0};let r=Ot(e,t);return{verb:r.verb,tone:r.tone,main:r.main,...r.mono?{mono:!0}:{}}}function Ot(e,t){switch(e.status){case`done`:return R(e,e.collected?`Collected`:`Ready to collect`);case`review`:return R(e,`Waiting for the parent’s review`);case`failed`:case`cancelled`:return R(e,e.error??lt[e.status]??e.status);default:return Et({...e,workers:[]},t)}}function kt(e){if(e.unavailable)return e.unavailable.error;if(!e.loaded)return`Not loaded in this cockpit`}function At(e){let t=new Map;for(let n of e.tasks){t.set(n.runId,{title:n.title,cardId:n.runId,role:`root`});for(let e of n.workers)t.set(e.runId,{title:e.title,cardId:n.runId,role:`worker`})}return t}function B(e,t,n){return e.get(t)?.title??n??`Unreadable task`}var V=(e,t)=>B(e,t.senderRunId,t.senderTitle),H=(e,t)=>B(e,t.recipientRunId,t.recipientTitle),jt=(e,t)=>`wait:${e}:${t}`;function Mt(e){let t=[];for(let n of e){let e=n.wait;if(!(!N(n.status)||e?.kind!==`peers`))for(let r of new Set(e.detail.peerRunIds))r!==n.runId&&t.push({id:jt(n.runId,r),waiterRunId:n.runId,peerRunId:r,since:e.since,deadline:e.deadline})}return t}function Nt(e,t){let n=new Set;for(let r of t)r.waiterRunId===e&&n.add(r.peerRunId),r.peerRunId===e&&n.add(r.waiterRunId);return n}function Pt(e,t){return t.filter(t=>t.waiterRunId===e)}function Ft(e,t,n,r=[]){let i=[];for(let r of t)r.senderRunId===e&&i.push(`Waiting for a reply from ${H(n,r)}`),r.recipientRunId===e&&i.push(`${V(n,r)} waits for your reply`);for(let t of r)t.waiterRunId===e&&i.push(`Waiting for a message from ${B(n,t.peerRunId)}`),t.peerRunId===e&&i.push(`${B(n,t.waiterRunId)} waits for you to write`);return i}function It(e,t,n){return n.find(n=>n.relationship===`family`&&n.senderRunId===e&&n.recipientRunId===t)}function Lt(e,t){let n=-j(e,t);return n>=1e3?`reply due in ${A(n)}`:`reply overdue`}function Rt(e,t){return t.filter(t=>t.relationship===`peer`&&t.senderRunId===e)}function zt(e,t){return e.relationship===`peer`?{kind:`Request`,relation:`Peer`}:{kind:`Question`,relation:Bt[Vt(e,t)]}}var Bt={worker:`Worker → parent`,parent:`Parent → worker`,unknown:`Family`};function Vt(e,t){let n=t.get(e.senderRunId)?.role;if(n)return n===`worker`?`worker`:`parent`;let r=t.get(e.recipientRunId)?.role;return r?r===`root`?`worker`:`parent`:`unknown`}var Ht=new Set([`queued`,`waiting-for-capacity`]);function Ut(e){if(N(e.status))return d(e.rung)?`needsYou`:e.rung===`running`?`working`:Ht.has(e.rung)?`queued`:`waiting`}function Wt(e){let t={needsYou:0,working:0,waiting:0,queued:0,activeWorkers:0,openRequests:0,inReview:0};for(let n of e){t.inReview+=n.inReview,t.openRequests+=n.requests.length;for(let e of n.tasks){let n=Ut(e);n&&(t[n]+=1),t.activeWorkers+=e.workers.filter(e=>N(e.status)).length}}return t}function Gt(e,t=()=>!1){let n=0,r=0;for(let i of e.workers)t(i.runId)||((i.status===`done`||i.status===`cancelled`)&&(n+=1),i.status===`failed`&&(n+=1,r+=1));return{finished:n,failed:r}}function Kt({finished:e,failed:t}){if(e!==0)return t>0?`✓ ${e} finished · ${t} failed`:`✓ ${e} worker${e===1?``:`s`} finished`}var U={flash:1300,cardEnter:700,cardLeave:500,workerEnter:700,workerHold:3e3,workerFold:500,comet:1100,replied:900,fade:800,bump:500,slide:450,check:800},W={flash:{},entering:{},leaving:{},workerEnter:{},workerHold:{},opening:{},closing:{},waitsClosing:{},comets:{},bumps:{},slides:{},checks:{}},qt=(e,t)=>`${e}\n${t}`;function Jt(e,t){let n=qt(t,``);return new Set(Object.keys(e.checks).filter(e=>e.startsWith(n)).map(e=>e.slice(n.length)))}var Yt=class{key;changes=[];timers=[];constructor(e){this.key=e}timed(e,t,n,r){this.changes.push({field:e,id:t,value:{...n,key:this.key}}),this.timers.push({after:r,change:{field:e,id:t,ifKey:this.key}})}later(e,t,n,r){this.timers.push({after:r,change:{field:e,id:t,value:{...n,key:this.key},ifKey:this.key}})}drop(e,t){this.changes.push({field:e,id:t})}},Xt={done:`success`,review:`success`,failed:`danger`,cancelled:`neutral`};function Zt(e,t){let n=Xt[t.status]??`success`;if(t.status===`review`){e.timed(`workerHold`,t.runId,{tone:n,phase:`flash`},U.flash);return}e.timed(`workerHold`,t.runId,{tone:n,phase:`flash`},U.workerHold+U.workerFold),e.later(`workerHold`,t.runId,{tone:n,phase:`fold`},U.workerHold)}function Qt(e,t){e.drop(`closing`,t.requestId),e.timed(`opening`,t.requestId,{},U.fade),e.timed(`comets`,`${t.requestId}:open:${e.key}`,{requestId:t.requestId,reverse:!1,tone:t.relationship},U.comet)}function $t(e,t,n,r){let i=n.requestId;if(e.drop(`opening`,i),!r){e.timed(`closing`,i,{projectId:t,request:n,replied:!1,phase:`fade`},U.fade);return}let a=U.comet+U.replied+U.fade;e.timed(`closing`,i,{projectId:t,request:n,replied:!0,phase:`reply`},a),e.later(`closing`,i,{projectId:t,request:n,replied:!0,phase:`replied`},U.comet),e.later(`closing`,i,{projectId:t,request:n,replied:!0,phase:`fade`},U.comet+U.replied),e.timed(`comets`,`${i}:reply:${e.key}`,{requestId:i,reverse:!0,tone:`success`},U.comet)}function en(e,t){switch(t.kind){case`rung-changed`:return e.timed(`flash`,t.task.runId,{tone:c(t.task.rung).tone},U.flash);case`tool-started`:return e.timed(`slides`,t.runId,{},U.slide);case`worker-started`:return e.timed(`workerEnter`,t.worker.runId,{},U.workerEnter);case`worker-settled`:return Zt(e,t.worker);case`card-entered`:return e.drop(`leaving`,t.task.runId),e.timed(`entering`,t.task.runId,{},U.cardEnter);case`card-left`:return e.timed(`leaving`,t.task.runId,{projectId:t.projectId,task:t.task},U.cardLeave);case`check-passed`:return e.timed(`checks`,qt(t.runId,t.name),{},U.check);case`request-opened`:return Qt(e,t.request);case`request-closed`:return $t(e,t.projectId,t.request,t.status===`replied`);case`chip-changed`:return e.timed(`bumps`,t.chip,{},U.bump);case`wait-opened`:return e.drop(`waitsClosing`,t.wait.id),e.timed(`opening`,t.wait.id,{},U.fade);case`wait-closed`:return e.drop(`opening`,t.wait.id),e.timed(`waitsClosing`,t.wait.id,{projectId:t.projectId,wait:t.wait},U.fade)}}function tn(e,t,n){let r=new Yt(t);if(!n)for(let t of e)en(r,t);return{changes:r.changes,timers:r.timers}}function nn(e,t){let n=e[t.field];if(t.ifKey!==void 0&&n[t.id]?.key!==t.ifKey||t.value===void 0&&!(t.id in n))return e;let r={...n};return t.value===void 0?delete r[t.id]:r[t.id]=t.value,{...e,[t.field]:r}}function rn(e,t){return t.reduce(nn,e)}function an(e,t,n){let r=new Set(t.map(e=>e.id));return Object.values(n.waitsClosing).filter(t=>t.projectId===e&&!r.has(t.wait.id)).map(e=>e.wait)}var on={success:`text-success`,pending:`text-signal-word-amber`,danger:`text-signal-word-red`,accent:`text-accent-text`,info:`text-info`,running:`text-status-running`,neutral:`text-muted-foreground`};function sn({tone:e,className:t,children:n,...r}){return(0,T.jsx)(`span`,{...r,className:i(`bg-card-2`,{"text-success":e===`success`,"text-signal-word-amber":e===`pending`,"text-signal-word-red":e===`danger`,"text-accent-text":e===`accent`,"text-info":e===`info`,"text-status-running":e===`running`,"text-muted-foreground":e===`neutral`},t),children:n})}var cn={success:`border-success`,pending:`border-pending-strong`,danger:`border-danger`,accent:`border-accent-strong`,info:`border-info`,running:`border-status-running`,neutral:`border-soft-foreground`},ln={success:`bg-success`,pending:`bg-pending-strong`,danger:`bg-danger`,accent:`bg-accent-strong`,info:`bg-info`,running:`bg-status-running`,neutral:`bg-soft-foreground`},un={tool:Ne,user:Me,workers:Ce,reply:Se,peer:ke,subagents:Ce,ci:Oe,merge:De,command:je,timer:Ee,pause:Ae,queued:be,review:xe,failed:ve,done:ye,cancelled:Te};function dn(e,t){let n=c(e.rung),r=e.rung===`waiting-on-workers`&&(t===`worker`||e.wait?.kind===`peers`);return{tone:n.tone,shape:r?`ring`:n.shape,label:pn(e,t)??n.label}}var fn=(e,t,n)=>`${e} ${t} ${n}${t===1?``:`s`}`;function pn(e,t){let n=e.wait;if(e.rung===`waiting-on-workers`){if(t===`worker`)return`waiting on parent reply`;if(n?.kind===`peers`&&n.detail.peerRunIds.length>0)return fn(`waiting on`,n.detail.peerRunIds.length,`task`);if(n?.kind===`workers`&&n.detail.replies)return`waiting on replies`;if(n?.kind===`workers`&&n.detail.owed>0)return fn(`waiting on`,n.detail.owed,`worker`)}if(e.rung===`waiting-on-subagents`&&n?.kind===`subagents`&&n.detail.running>0)return fn(`waiting for`,n.detail.running,`subagent`)}function mn(e,t){if(N(e.status))return e.rung===`running`&&t===`filled`?`activity-pulse`:t===`filled`?void 0:`activity-breathe`}function G({run:e,role:t}){let{tone:n,shape:r,label:a}=dn(e,t);return(0,T.jsx)(`span`,{"data-activity-anchor":e.runId,className:i(`inline-flex size-[12px] shrink-0 items-center justify-center`,mn(e,r)),children:(0,T.jsx)(C,{tone:n,shape:r,role:`img`,"aria-label":a})})}function hn({runId:e,requests:t,waits:n,index:r,link:i,pathOf:a,className:o,linkClassName:s}){let c=Rt(e,t),l=Pt(e,n);return c.length===0&&l.length===0?null:(0,T.jsxs)(`ul`,{"data-slot":`activity-peer-links`,className:o,children:[c.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(i,{to:a(e.recipientRunId),className:s,children:[`→ `,H(r,e)]})},e.requestId)),l.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsxs)(i,{to:a(e.peerRunId),className:s,children:[`⋯ waits on `,B(r,e.peerRunId)]})},e.id))]})}var gn={pass:`bg-success`,fail:`bg-danger`,pending:`bg-info`,skipping:`border border-soft-foreground`,cancel:`border border-soft-foreground`},_n=(e,t)=>t?`activity-check-pass`:e===`pending`?`activity-breathe-fast`:void 0;function vn({checks:e,overflow:t,passed:n}){return(0,T.jsxs)(`span`,{"data-slot":`activity-checks`,"aria-hidden":`true`,className:i(`col-start-2 mt-[5px] flex items-center`,e.length>40?`gap-px`:`gap-[3px]`),children:[e.map(e=>(0,T.jsx)(`i`,{"data-bucket":e.bucket,"data-passed":n.has(e.name)?`true`:void 0,title:e.name,className:i(`h-[5px] min-w-px flex-1 rounded-[2px]`,gn[e.bucket],_n(e.bucket,n.has(e.name)))},e.name)),t?(0,T.jsxs)(`span`,{"data-slot":`activity-checks-overflow`,"data-bucket":t.bucket,className:`ml-1 flex shrink-0 items-center gap-1 text-[10px] leading-none text-muted-foreground tabular-nums`,children:[(0,T.jsx)(`i`,{className:i(`h-[5px] w-2 rounded-[2px]`,gn[t.bucket])}),`+`,t.count]}):null]})}function yn({value:e,ink:t}){return(0,T.jsx)(`span`,{"data-slot":`activity-bar`,"aria-hidden":`true`,className:`col-start-2 mt-[5px] block h-1 overflow-hidden rounded-sm bg-border`,children:(0,T.jsx)(`span`,{className:i(`block h-full bg-current`,t),style:{width:`${Math.round(e*100)}%`}})})}var bn=new Set;function xn({box:e,now:t,dense:n,motion:r={}}){let a=un[e.icon],o=on[e.tone];return(0,T.jsxs)(`div`,{"data-slot":`activity-now`,"data-verb":e.verb,className:`relative grid grid-cols-[16px_minmax(0,1fr)] gap-x-2 gap-y-px overflow-hidden rounded-lg bg-card-2 px-2.5 py-2`,children:[r.sweep?(0,T.jsx)(`span`,{"data-slot":`activity-sweep`,"aria-hidden":`true`,className:`activity-sweep`}):null,(0,T.jsx)(a,{"aria-hidden":`true`,className:i(`mt-px size-[15px]`,o)}),(0,T.jsxs)(sn,{tone:e.tone,className:`flex gap-2 text-[11px] font-semibold tracking-[0.04em] uppercase`,children:[(0,T.jsx)(`span`,{"data-slot":`activity-verb`,children:e.verb}),e.since?(0,T.jsx)(`span`,{"data-slot":`activity-age`,className:`ml-auto font-medium tracking-normal text-muted-foreground normal-case tabular-nums`,children:A(j(e.since,t))}):null]}),(0,T.jsx)(`span`,{"data-slot":`activity-main`,className:i(`col-start-2 truncate text-[12.5px] text-foreground`,e.mono&&`font-mono text-[12px]`,r.slideKey!==void 0&&`activity-slide`),children:e.main},r.slideKey??`still`),e.checks?(0,T.jsx)(vn,{checks:e.checks,overflow:e.overflow,passed:r.passed??bn}):null,e.checkSummary?(0,T.jsx)(`span`,{"data-slot":`activity-checks-summary`,className:`sr-only`,children:e.checkSummary}):null,e.bar===void 0?null:(0,T.jsx)(yn,{value:e.bar,ink:o}),e.detail&&!n?(0,T.jsx)(`span`,{"data-slot":`activity-detail`,className:`col-start-2 text-[11.5px] text-muted-foreground tabular-nums`,children:e.detail}):null]})}function Sn({rate:e,className:t}){let n=e.reduce((e,t)=>e+t,0),r=Math.max(4,...e);return(0,T.jsxs)(`svg`,{"data-slot":`activity-heartbeat`,role:`img`,"aria-label":`${n} tool call${n===1?``:`s`} in the last ${e.length} s`,viewBox:`0 0 62 16`,className:i(`block h-4 w-[62px] shrink-0`,t),children:[(0,T.jsx)(`path`,{d:`M0 15.5h62`,className:`stroke-border`}),e.map((e,t)=>{if(e<=0)return null;let n=Math.max(1.5,e/r*14);return(0,T.jsx)(`rect`,{x:t*2.07,y:15-n,width:1.4,height:n,className:`fill-status-running`},t)})]})}var K=e=>`/tasks/${encodeURIComponent(e)}`;function Cn(e,t){return[e.runner,e.model,e.currentStepId?`step ${e.currentStepId}`:void 0,e.startedAt?at(j(e.startedAt,t)):void 0].filter(e=>!!e).join(` · `)}function wn({texts:e}){return e.length===0?null:(0,T.jsx)(`ul`,{"data-slot":`activity-line-text`,className:`sr-only`,children:e.map((e,t)=>(0,T.jsx)(`li`,{children:e},t))})}function Tn({worker:e,parentId:t,requests:n,index:r,ctx:a,motion:o}){let s=Dt(e,a,It(e.runId,t,n)?.text),c=o.workerHold[e.runId];return(0,T.jsxs)(`li`,{"data-slot":`activity-worker`,"data-run":e.runId,"data-asks":s.asks?`true`:void 0,"data-hold":c?.phase,className:i(`relative grid grid-cols-[14px_minmax(0,1fr)] items-start gap-x-2 rounded-lg py-[5px] before:absolute before:top-[13px] before:-left-3.5 before:w-2.5 before:border-t before:border-border`,s.asks&&`-mx-1.5 bg-message-inbound-bg px-1.5`,e.runId in o.workerEnter&&`activity-row-enter`,c?.phase===`fold`&&`activity-row-fold`),children:[c?(0,T.jsx)(`span`,{"aria-hidden":`true`,className:i(`activity-row-flash`,ln[c.tone])},c.key):null,(0,T.jsx)(`span`,{className:`mt-[3px]`,children:(0,T.jsx)(G,{run:e,role:`worker`})}),(0,T.jsxs)(`span`,{className:`min-w-0 truncate text-[12.5px] font-medium`,children:[(0,T.jsx)(S,{to:K(e.runId),className:`relative z-[1] hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`,children:e.title}),(0,T.jsx)(`span`,{className:`ml-1.5 text-[11px] font-normal text-muted-foreground`,children:[e.runner,e.model].filter(Boolean).join(` · `)})]}),(0,T.jsxs)(`span`,{"data-slot":`activity-worker-line`,className:`col-start-2 truncate text-[11.5px] text-muted-foreground tabular-nums`,children:[(0,T.jsx)(`b`,{className:i(`font-semibold`,on[s.tone]),children:s.verb}),` · `,(0,T.jsx)(`span`,{className:i(s.mono&&`font-mono`),children:s.main})]}),(0,T.jsx)(wn,{texts:Ft(e.runId,n,r)})]})}function En({workers:e}){return(0,T.jsxs)(`div`,{"data-slot":`activity-worker-dots`,className:`mt-2 ml-[18px] flex flex-wrap items-center gap-1 text-[11px] text-muted-foreground`,children:[e.map(e=>(0,T.jsx)(G,{run:e,role:`worker`},e.runId)),(0,T.jsxs)(`span`,{className:`ml-1`,children:[e.length,` worker`,e.length===1?``:`s`]})]})}function Dn({task:e,requests:t,index:n,ctx:r,dense:i,motion:a}){let o=e=>e in a.workerHold,s=e.workers.filter(e=>N(e.status)||e.status===`review`||o(e.runId)),c=Kt(Gt(e,o));return(0,T.jsxs)(T.Fragment,{children:[s.length>0&&i?(0,T.jsx)(En,{workers:s}):null,s.length>0&&!i?(0,T.jsx)(`ul`,{"data-slot":`activity-workers`,className:`mt-2 ml-1 border-l border-border pl-3.5`,children:s.map(i=>(0,T.jsx)(Tn,{worker:i,parentId:e.runId,requests:t,index:n,ctx:r,motion:a},i.runId))}):null,c?(0,T.jsx)(`p`,{"data-slot":`activity-finished`,className:`mt-1.5 ml-[18px] text-[11px] text-muted-foreground`,children:c}):null]})}var On=`relative z-[1] text-[12px] text-message-peer-accent hover:underline focus-visible:outline-2 focus-visible:outline-ring max-md:inline-flex max-md:min-h-11 max-md:items-center`;function kn(e,t){return t?{onPointerEnter:()=>t(`pointer`,e),onPointerLeave:()=>t(`pointer`,void 0),onFocus:()=>t(`focus`,e),onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t(`focus`,void 0)}}:{}}function An(e,t,n){return n?`activity-card-leave`:e.runId in t.entering?`activity-card-enter`:void 0}function jn({task:e,motion:t,glow:n}){let r=t.flash[e.runId];return(0,T.jsxs)(T.Fragment,{children:[n?(0,T.jsx)(`span`,{"aria-hidden":`true`,className:`activity-glow`}):null,r?(0,T.jsx)(`span`,{"data-slot":`activity-flash`,"data-tone":r.tone,"aria-hidden":`true`,className:i(`activity-flash`,cn[r.tone])},r.key):null]})}var Mn=[];function Nn({task:e,requests:t,waits:n=Mn,index:a,ctx:o,dense:s,narrow:c,motion:l=W,ghost:u=!1,linked:d=!1,onHover:f}){let p=z(e,o),m=u?{"data-activity-ghost":e.runId,inert:!0,"aria-hidden":!0}:{"data-activity-card":e.runId},ee={sweep:e.rung===`running`&&N(e.status),slideKey:l.slides[e.runId]?.key,passed:Jt(l,e.runId)};return(0,T.jsxs)(`article`,{...m,"data-flip":e.runId,"data-rung":e.rung,"data-action":p.action,"data-linked":d&&!u?`true`:void 0,...u?{}:kn(e.runId,f),className:i(`relative min-w-0 rounded-xl border bg-card px-3.5 py-3`,p.action?`border-pending`:`border-border`,d&&!u&&`outline-2 outline-offset-2 outline-message-peer-accent`,An(e,l,u)),children:[(0,T.jsx)(jn,{task:e,motion:l,glow:p.action!==void 0&&!u}),(0,T.jsxs)(`header`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(G,{run:e,role:`root`}),(0,T.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-[13.5px] font-semibold`,children:(0,T.jsx)(S,{to:K(e.runId),className:`after:absolute after:inset-0 after:rounded-xl after:content-[''] focus-visible:outline-2 focus-visible:outline-ring`,children:e.title})}),(0,T.jsx)(Sn,{rate:e.rate})]}),(0,T.jsx)(`p`,{className:`mt-0.5 mb-2 ml-5 truncate text-[11.5px] text-muted-foreground`,children:Cn(e,o.now)}),(0,T.jsx)(wn,{texts:Ft(e.runId,t,a,n)}),(0,T.jsx)(xn,{box:p,now:o.now,dense:s,motion:ee}),p.action?(0,T.jsx)(`div`,{className:`mt-2 flex gap-1.5`,children:(0,T.jsx)(r,{asChild:!0,size:`sm`,variant:p.action===`answer`?`primary`:`outline`,className:`relative z-[1] max-md:min-h-11`,children:(0,T.jsx)(S,{to:K(e.runId),children:p.action===`answer`?`Answer`:`Open task`})})}):null,c?(0,T.jsx)(hn,{runId:e.runId,requests:t,waits:n,index:a,link:S,pathOf:K,className:`mt-2 flex flex-col gap-1`,linkClassName:On}):null,(0,T.jsx)(Dn,{task:e,requests:t,index:a,ctx:o,dense:s,motion:l})]})}function Pn(e){return!Number.isFinite(e)||e<=0?1:Math.max(1,Math.floor((e+96)/396))}function Fn(e,t){let n=e[0],r=1/0;for(let i of e){let e=i.reduce((e,n)=>e+t(n),0);e<r&&(n=i,r=e)}return n}function In(e,t,n,r=()=>1){let i=Math.max(1,Math.floor(n)),a=new Set(t),o=e?.length===i?e.map(e=>e.filter(e=>a.has(e))):Array.from({length:i},()=>[]),s=new Set(o.flat());for(let e of t)s.has(e)||(Fn(o,r).push(e),s.add(e));return o}function Ln(e,t){return e!==void 0&&e.length===t.length&&e.every((e,n)=>e.length===t[n]?.length&&e.every((e,r)=>e===t[n]?.[r]))}var Rn=(e,t)=>({x0:Math.min(e.x,t.x),y0:Math.min(e.y,t.y),x1:Math.max(e.x,t.x),y1:Math.max(e.y,t.y)});function zn(e,t,n=1){return t.some(t=>t.x+n<e.x1&&e.x0<t.x+t.w-n&&t.y+n<e.y1&&e.y0<t.y+t.h-n)}var Bn=(e,...t)=>e.filter(e=>!t.some(t=>Vn(e,t))),Vn=(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h,Hn=e=>Math.round(e*10)/10,q=e=>`${Hn(e.x)} ${Hn(e.y)}`;function Un(e){let t=[];for(let n of e){let e=t[t.length-1];if(e&&e.x===n.x&&e.y===n.y)continue;let r=t[t.length-2];r&&e&&(r.x===e.x&&e.x===n.x||r.y===e.y&&e.y===n.y)&&t.pop(),t.push(n)}return t}function Wn(e,t=8){let n=Un(e),r=n[0];if(!r)return``;let i=`M${q(r)}`;for(let e=1;e<n.length;e++){let r=n[e],a=n[e-1],o=n[e+1];if(!o){i+=` L ${q(r)}`;continue}let s=Math.min(t,Math.hypot(r.x-a.x,r.y-a.y)/2,Math.hypot(o.x-r.x,o.y-r.y)/2),c=(e,t,n)=>{let r=Math.hypot(t.x-e.x,t.y-e.y)||1;return{x:e.x+(t.x-e.x)/r*n,y:e.y+(t.y-e.y)/r*n}};i+=` L ${q(c(r,a,s))} Q ${q(r)}, ${q(c(r,o,s))}`}return i}function Gn(e,t,n){let r=[];for(let i of[...e].sort((e,n)=>t(e)-t(n))){let e=r[r.length-1];e&&Math.abs(t(i)-e.from)<=2?e.to=Math.max(e.to,n(i)):r.push({from:t(i),to:n(i)})}return r}function Kn(e){return{rows:Gn(e,e=>e.y,e=>e.y+e.h).map(({from:e,to:t})=>({top:e,bottom:t})),cols:Gn(e,e=>e.x,e=>e.x+e.w).map(({from:e,to:t})=>({left:e,right:t}))}}var J=(e,t,n)=>Math.max(0,e.findIndex(e=>Math.abs(t(e)-n)<=2)),Y=(e,t)=>((e.rows[t]?.bottom??0)+(e.rows[t+1]?.top??(e.rows[t]?.bottom??0)+16))/2;function qn(e,t,n){let r=e.cols,i=e=>((r[e]?.right??0)+(r[e+1]?.left??0))/2;return t<n?i(t):t>n?i(t-1):t+1<r.length?i(t):t>0?i(t-1):(r[t]?.right??0)+8}function Jn(e,t,n,r=0){let i=Kn(n),a=J(i.rows,e=>e.top,e.y),o=J(i.rows,e=>e.top,t.y),s=o>a,c=e.x+e.w/2+r,l=t.x+t.w/2+r,u=(s?Y(i,a):Y(i,a-1))+r/2,d=(s?Y(i,o-1):Y(i,o))+r/2,f=qn(i,J(i.cols,e=>e.left,e.x),J(i.cols,e=>e.left,t.x))+r/2,p={x:c,y:s?e.y+e.h+1:e.y-1},m={x:l,y:s?t.y-3:t.y+t.h+3};return{points:[p,{x:c,y:u},{x:f,y:u},{x:f,y:d},{x:l,y:d},m],label:{x:(c+f)/2,y:u}}}var Yn=15;function Xn(e,t,n){let r=[...n,...e.flatMap(e=>[e.y-Yn,e.y+e.h+Yn])].filter(t=>t>=0&&!e.some(e=>e.y-6<t&&t<e.y+e.h+6));return r.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e,r[0]??t)}function Zn(e,t,n,r,i=0){let a=t.x>e.x?1:-1,o=e.x+a*n/2+i,s=t.x-a*n/2+i,c=Xn(r.filter(e=>e.x+e.w>Math.min(o,s)&&e.x<Math.max(o,s)),(e.y+t.y)/2,[e.y,t.y])+(i===0?0:Math.sign(i)*Math.min(Math.abs(i),Yn-6)),l=c===e.y?{x:s,y:(c+t.y)/2}:{x:o,y:(e.y+c)/2};return{points:[e,{x:o,y:e.y},{x:o,y:c},{x:s,y:c},{x:s,y:t.y},{x:t.x-a*2,y:t.y}],label:l}}function Qn(e){let t=new Map;for(let n of e){let e=[n.senderRunId,n.recipientRunId].sort().join(`
2
- `);t.set(e,[...t.get(e)??[],n.requestId])}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,(r-(e.length-1)/2)*12));return n}function $n(e,t,n,r=4){let i=[],a=new Map;for(let{id:o,at:s}of e){let e={...s};for(let a=0;a<=i.length;a++){let a=i.find(n=>Math.abs(e.x-n.x)<t.w+r&&Math.abs(e.y-n.y)<t.h+r);if(!a)break;n===`x`?e.x=a.x+t.w+r:e.y=a.y+t.h+r}i.push(e),a.set(o,e)}return a}var er=e=>Math.round(e*10)/10,X=e=>`${er(e.x)} ${er(e.y)}`;function tr(e,t,n){return t&&t.x>e.x+40?1:t&&t.x<e.x-40?-1:e.x+e.w+96<=n+1?1:-1}function nr(e,t,n,r,i,a){let o=r>0?Math.max(e.x+e.w,t.x+t.w):Math.min(e.x,t.x),s=(70+n)*r;return{d:`M${X({x:o,y:i})} C ${X({x:o+s,y:i})}, ${X({x:o+s,y:a})}, ${X({x:o+2*r,y:a})}`,label:{x:o+s*.75,y:(i+a)/2}}}function rr(e,t,n=[],r=0,i=1){let a=e.y+22+r,o=t.y+22+r;if(Math.abs(e.x-t.x)<40)return nr(e,t,r,i,a,o);let s=t.x>e.x,c=s?e.x+e.w:e.x,l=s?t.x:t.x+t.w,u=Math.max(40,Math.abs(l-c)*.5)*(s?1:-1),d=l-(s?2:-2);if(zn(Rn({x:c,y:a},{x:l,y:o}),Bn(n,e,t))){let i=Zn({x:c,y:a},{x:l,y:o},96,Bn(n,e,t),r);return{d:Wn(i.points),label:i.label}}return{d:`M${X({x:c,y:a})} C ${X({x:c+u,y:a})}, ${X({x:l-u,y:o})}, ${X({x:d,y:o})}`,label:{x:(c+l)/2,y:(a+o)/2}}}function ir(e,{other:t,view:n,labelHeight:r}){let i=r/2+4,a=!t||!n?e+44:t.y>e?Math.max(e+44,n.y1-i):Math.min(e-44,n.y0+i);return n?ar(a,n.y0+i,n.y1-i):a}var ar=(e,t,n)=>Math.max(t,Math.min(n,e));function or(e,t,n){let r=n.lane??0,i=e.y+22+r,a=n.side>0?e.x+e.w:e.x,o=a+n.side*96/2+r/2,s={x:o,y:ir(i,n)};return{d:Wn(t===`sender`?[{x:a,y:i},{x:o,y:i},s]:[s,{x:o,y:i},{x:a+2*n.side,y:i}]),label:s}}function sr(e,t,n,r=0){let i={x:e.x,y:e.y+e.h/2},a={x:t.x-2,y:t.y+t.h/2},o=n.x-18+r/2;return{d:`M${X(i)} C ${X({x:o,y:i.y})}, ${X({x:o,y:a.y})}, ${X(a)}`,label:{x:o,y:(i.y+a.y)/2}}}function cr(e,t,n=[],r=0){let i=e.x+e.w/2+r,a=t.x+t.w/2+r;if(t.y>=e.y+e.h||t.y+t.h<=e.y){let o=t.y>e.y,s=o?e.y+e.h+1:e.y-1,c=o?t.y-3:t.y+t.h+3,l=(c-s)/2;if(zn(Rn({x:i,y:s},{x:a,y:c}),Bn(n,e,t))){let i=Jn(e,t,n,r);return{d:Wn(i.points),label:i.label}}return{d:`M${X({x:i,y:s})} C ${X({x:i,y:s+l})}, ${X({x:a,y:c-l})}, ${X({x:a,y:c})}`,label:{x:(i+a)/2,y:(s+c)/2}}}let o=e.y-1,s=t.y-1,c=Math.min(o,s),l=Math.max(8,Math.min(30,18+Math.abs(a-i)*.05)+r);return{d:`M${X({x:i,y:o})} C ${X({x:i,y:c-l})}, ${X({x:a,y:c-l})}, ${X({x:a,y:s-3})}`,label:{x:(i+a)/2,y:c-l*.75}}}function lr(e,t){return{x:e.left-t.left,y:e.top-t.top,w:e.width,h:e.height}}function ur(e,t){let n=[];for(let r of e){let e=n.find(e=>Math.abs((e[0]?.at.x??NaN)-r.at.x)<t);e?e.push(r):n.push([r])}return n}function dr(e,t,n,r){let i=e.map(e=>Math.min(r,Math.max(n,e.at.y))),a=i.map((e,t)=>t).sort((e,t)=>i[e]-i[t]);for(let e=1;e<a.length;e++){let n=a[e];i[n]=Math.max(i[n],i[a[e-1]]+t)}for(let e=a.length-1;e>=0;e--){let n=a[e],o=e+1<a.length?i[a[e+1]]-t:r;i[n]=Math.min(i[n],o)}return e.map((e,t)=>({id:e.id,at:{x:e.at.x,y:i[t]}}))}function fr(e,t,n,r=4){let i=n?n.y0+t.h/2:-1/0,a=n?n.y1-t.h/2:1/0,o=new Map;for(let n of ur(e,t.w+r))for(let e of dr(n,t.h+r,i,a))o.set(e.id,e.at);return o}var pr=(e,t)=>e.x<=t.x1&&t.x0<=e.x+e.w&&e.y<=t.y1&&t.y0<=e.y+e.h;function mr(e,t,n){let r=e!==void 0&&pr(e,n),i=t!==void 0&&pr(t,n);return r&&i?`both`:r?`sender`:i?`recipient`:`none`}var hr=e=>/(auto|scroll|hidden|clip)/.test(getComputedStyle(e).overflowY);function gr(e){let t=[];for(let n=e.parentElement;n&&n!==document.body&&n!==document.documentElement;n=n.parentElement)hr(n)&&t.push(n);return t}function _r(e,t){return{x0:Math.max(e.x0,t.x0),y0:Math.max(e.y0,t.y0),x1:Math.min(e.x1,t.x1),y1:Math.min(e.y1,t.y1)}}function vr(e){let t=e.getBoundingClientRect(),n={x0:0,y0:0,x1:window.innerWidth,y1:window.innerHeight};for(let t of gr(e)){let e=t.getBoundingClientRect();e.width>0&&e.height>0&&(n=_r(n,{x0:e.left,y0:e.top,x1:e.right,y1:e.bottom}))}return{x0:n.x0-t.left,y0:n.y0-t.top,x1:n.x1-t.left,y1:n.y1-t.top}}var Z={w:88,h:40};function yr(e,t){let n=e.getBoundingClientRect(),r=new Map;for(let i of e.querySelectorAll(`[${t}]`)){let e=i.getAttribute(t);e&&r.set(e,lr(i.getBoundingClientRect(),n))}return r}function br({base:e,from:t,to:n,fromName:r,toName:i},a,o,s){let c=a.get(t),l=a.get(n),u=s.view??{x0:-1/0,y0:-1/0,x1:1/0,y1:1/0},d=(e,t)=>({side:tr(e,t,s.width),labelHeight:Z.h,lane:o??0,view:u,...t?{other:t}:{}});switch(mr(c,l,u)){case`both`:return c&&l?{...e,...rr(c,l,[...a.values()],o,tr(c,void 0,s.width))}:void 0;case`sender`:return c?{...e,...or(c,`sender`,d(c,l)),away:i()}:void 0;case`recipient`:return l?{...e,...or(l,`recipient`,d(l,c)),away:r()}:void 0;case`none`:return}}var xr=(e,t)=>({base:{id:e.requestId,kind:`peer`},from:e.senderRunId,to:e.recipientRunId,fromName:()=>V(t,e),toName:()=>H(t,e)}),Sr=(e,t)=>({base:{id:e.id,kind:`wait`},from:e.peerRunId,to:e.waiterRunId,fromName:()=>B(t,e.peerRunId),toName:()=>B(t,e.waiterRunId)}),Cr=e=>({requestId:e.id,senderRunId:e.peerRunId,recipientRunId:e.waiterRunId});function wr(e,t){return[...new Set([...e.values()].map(e=>Math.round(e.x+e.w)))].filter(e=>e+96<=t+1).map(e=>e+96/2)}function Tr(e,t){return t.length===0?e:{x:t.reduce((t,n)=>Math.abs(n-e.x)<Math.abs(t-e.x)?n:t),y:e.y}}function Er(e,t,n,r,i,a){let o=r.get(e.senderRunId)?.cardId??r.get(e.recipientRunId)?.cardId,s=o===void 0?void 0:t.get(o),c=n.get(e.senderRunId),l=n.get(e.recipientRunId);if(!(!s||!c||!l||a&&!pr(s,a)))return{id:e.requestId,kind:`family`,...sr(c,l,s,i)}}function Dr(e,t,n,{peers:r,frame:i={width:e.clientWidth},waits:a=[]}){let o=yr(e,`data-activity-card`),s=yr(e,`data-activity-anchor`),c=Qn([...t,...a.map(Cr)]),l=[];for(let e of t){let t=c.get(e.requestId),a=e.relationship===`peer`?r?br(xr(e,n),o,t,i):void 0:Er(e,o,s,n,t,i.view);a&&l.push(a)}for(let e of r?a:[]){let t=br(Sr(e,n),o,c.get(e.id),i);t&&l.push(t)}let u=wr(o,i.width),d=fr(l.filter(e=>e.kind!==`family`).map(e=>({id:e.id,at:Tr(e.label,u)})),Z,i.view);return l.map(e=>({...e,label:d.get(e.id)??e.label}))}function Or(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return r!==void 0&&e.id===r.id&&e.d===r.d&&e.away===r.away&&e.label.x===r.label.x&&e.label.y===r.label.y})}function kr({frame:e,cancel:t,draw:n}){let r=[],i,a=t=>{i=void 0,r=r.map(e=>({...e,start:e.start??t})).filter(e=>t<e.start+e.duration),n(r,t),r.length>0&&(i=e(a))};return{launch(t){r.some(e=>e.id===t.id)||(r.push(t),i===void 0&&(i=e(a)))},stop(){i!==void 0&&t(i),i=void 0,r=[],n([],0)},running:()=>i!==void 0}}var Ar=e=>e<.5?2*e*e:1-(-2*e+2)**2/2;function jr(e,t,n=0){let r=Math.min(1,Math.max(0,(t-e.start)/e.duration)),i=Math.max(0,Ar(r)-n);return e.reverse?1-i:i}var Mr=`http://www.w3.org/2000/svg`,Nr=[0,.03,.06,.09,.12],Pr=[4.5,3.5,3,2.5,2],Fr={peer:`fill-message-peer-accent`,family:`fill-message-inbound-accent`,success:`fill-success`};function Ir(e,t){let n=e.querySelector(`g[data-comet="${CSS.escape(t.id)}"]`);if(n)return n;let r=document.createElementNS(Mr,`g`);r.setAttribute(`data-comet`,t.id);let i=document.createElementNS(Mr,`circle`);return i.setAttribute(`r`,`9`),i.setAttribute(`class`,`${Fr[t.tone]} opacity-35`),r.append(i),Nr.forEach((e,n)=>{let i=document.createElementNS(Mr,`circle`);i.setAttribute(`r`,String(Pr[n])),i.setAttribute(`class`,n===0?`fill-foreground`:Fr[t.tone]),i.setAttribute(`opacity`,String(1-n*.15)),r.append(i)}),e.append(r),r}function Lr(e,t,n){let r=new Set(t.map(e=>e.id));for(let t of e.querySelectorAll(`g[data-comet]`))r.has(t.getAttribute(`data-comet`)??``)||t.remove();let i=e.ownerSVGElement;for(let r of t){let t=i?.querySelector(`path[data-request="${CSS.escape(r.requestId)}"]`);if(!t||typeof t.getTotalLength!=`function`)continue;let a=t.getTotalLength();Ir(e,r).querySelectorAll(`circle`).forEach((e,i)=>{let o=t.getPointAtLength(jr(r,n,Nr[Math.max(0,i-1)])*a);e.setAttribute(`transform`,`translate(${o.x} ${o.y})`)})}}var Rr=e=>typeof requestAnimationFrame==`function`?requestAnimationFrame(e):setTimeout(()=>e(performance.now()),16),zr=e=>typeof cancelAnimationFrame==`function`?cancelAnimationFrame(e):clearTimeout(e);function Br(e,t,n){let r=w.useRef(null),i=w.useRef(void 0),a=w.useRef(new Set);return w.useEffect(()=>{let e=r.current;if(!e)return;let t=kr({frame:Rr,cancel:zr,draw:(t,n)=>Lr(e,t,n)});return i.current=t,()=>{t.stop(),i.current=void 0}},[]),w.useEffect(()=>{if(n){i.current?.stop();return}for(let t of a.current)t in e||a.current.delete(t);for(let[n,r]of Object.entries(e))a.current.has(n)||!t.has(r.requestId)||(a.current.add(n),i.current?.launch({id:n,requestId:r.requestId,reverse:r.reverse,tone:r.tone,duration:U.comet}))},[e,t,n]),r}function Vr(e,t){let n=new Map;for(let[r,i]of t){let t=e.get(r);if(!t)continue;let a={x:t.x-i.x,y:t.y-i.y};(Math.abs(a.x)>=1||Math.abs(a.y)>=1)&&n.set(r,a)}return n}function Hr(e,t){let n=new Map;for(let r of e.querySelectorAll(`[${t}]`)){let e=r.getBoundingClientRect();n.set(r.getAttribute(t)??``,{el:r,at:{x:e.left,y:e.top}})}return n}var Ur=`activity-layout-settled`;function Wr(e,t,n,r){let i=w.useRef(void 0),a=w.useRef(new Set);w.useLayoutEffect(()=>{let o=e.current;if(!o)return;let s=Hr(o,t),c=new Map([...s].map(([e,t])=>[e,t.at])),l=i.current;if(i.current={key:n,at:c},!(!r||!l||l.key===n))for(let[e,t]of Vr(l.at,c)){let n=s.get(e)?.el.animate?.([{transform:`translate(${t.x}px, ${t.y}px)`},{transform:`none`}],{duration:400,easing:`cubic-bezier(0.2, 0, 0, 1)`});n&&Gr(n,a.current,o)}}),w.useEffect(()=>{if(!r)for(let e of[...a.current])e.cancel()},[r])}function Gr(e,t,n){t.add(e);let r=()=>{t.delete(e)&&t.size===0&&n.dispatchEvent(new Event(Ur))};e.addEventListener(`finish`,r),e.addEventListener(`cancel`,r)}function Kr(e,t,n,r,i,a=!1){let[o,s]=w.useState([]);return w.useLayoutEffect(()=>{let i=e.current?.parentElement;if(!i)return;let o=()=>{let e=t(i);s(t=>n(t,e)?t:e)};o();let c=a?qr(i,o):void 0;i.addEventListener(Ur,o);let l=typeof ResizeObserver>`u`?void 0:new ResizeObserver(o);l?.observe(i);for(let e of i.querySelectorAll(r))l?.observe(e);return()=>{l?.disconnect(),i.removeEventListener(Ur,o),c?.()}},[e,t,n,r,i,a]),o}function qr(e,t){let n,r=()=>{n===void 0&&(n=requestAnimationFrame(()=>{n=void 0,t()}))},i=[...gr(e),window];for(let e of i)e.addEventListener(`scroll`,r,{passive:!0});return window.addEventListener(`resize`,r),()=>{for(let e of i)e.removeEventListener(`scroll`,r);window.removeEventListener(`resize`,r),n!==void 0&&cancelAnimationFrame(n)}}var Jr=28;function Yr(e){let t=e.replace(/\s+/g,` `).trim();return t.length>Jr?`${t.slice(0,Jr-1).trimEnd()}…`:t}function Xr(e,t){if(e.deadline!==void 0)return Zr(e.createdAt,e.deadline,t)}function Zr(e,t,n){let r=Date.parse(e),i=Date.parse(t);return Number.isNaN(r)||Number.isNaN(i)||i<=r?1:Math.min(1,Math.max(0,(n-r)/(i-r)))}function Qr(e,t){if(e===`fade`)return`activity-line-out`;if(e!==`replied`)return i(`activity-march`,t&&`activity-line-in`)}function $r(e,t){return t in e.waitsClosing?`activity-line-out`:i(`activity-drift`,t in e.opening&&`activity-line-in`)}var ei=`pointer-events-none absolute z-[4] -translate-x-1/2 -translate-y-1/2 rounded-lg border bg-background px-1.5 py-[3px] text-[10px] leading-[1.3] text-foreground tabular-nums`;function ti({line:e,wait:t,now:n,motion:r}){return(0,T.jsxs)(`div`,{"data-slot":`activity-line-label`,"data-wait":t.id,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y,width:Z.w},className:i(ei,`border-dashed border-message-peer-accent`,t.id in r.waitsClosing&&`activity-line-out`),children:[(0,T.jsxs)(`span`,{className:`flex gap-1 font-semibold`,children:[(0,T.jsx)(`span`,{className:`min-w-0 truncate text-message-peer-accent`,children:`Waiting`}),(0,T.jsx)(`span`,{className:`ml-auto shrink-0`,children:A(j(t.since,n))})]}),e.away?(0,T.jsx)(`span`,{className:`block truncate`,children:e.away}):null,(0,T.jsx)(`span`,{"data-slot":`activity-wait-bar`,className:`mt-[3px] block h-[3px] overflow-hidden rounded-sm bg-border`,children:(0,T.jsx)(`span`,{className:`block h-full bg-message-peer-accent opacity-70`,style:{width:`${Math.round(Zr(t.since,t.deadline,n)*100)}%`}})})]})}function ni({line:e,request:t,now:n,phase:r,replied:a}){let o=Xr(t,n);return(0,T.jsxs)(`div`,{"data-slot":`activity-line-label`,"data-request":t.requestId,"data-phase":r,"aria-hidden":`true`,style:{left:e.label.x,top:e.label.y,width:Z.w},className:i(ei,a?`border-success`:`border-message-peer-accent`,r===`fade`&&`activity-line-out`),children:[(0,T.jsxs)(`span`,{className:`flex gap-1 font-semibold`,children:[a?(0,T.jsx)(`span`,{className:`text-success`,children:`Replied`}):(0,T.jsx)(`span`,{className:`min-w-0 truncate text-message-peer-accent`,children:`Request`}),(0,T.jsx)(`span`,{className:`ml-auto shrink-0`,children:A(j(t.createdAt,n))})]}),(0,T.jsx)(`span`,{className:`block truncate`,children:e.away??Yr(t.text)}),o===void 0||a?null:(0,T.jsx)(`span`,{className:`mt-[3px] block h-[3px] overflow-hidden rounded-sm bg-border`,children:(0,T.jsx)(`span`,{className:`block h-full bg-message-peer-accent`,style:{width:`${Math.round(o*100)}%`}})})]})}var Q=(e,t)=>e.closing[t]?.phase??`open`;function ri(e,t){let n=e.closing[t];return n!==void 0&&n.replied&&n.phase!==`reply`}var ii=new Set;function ai({line:e,motion:t}){let n=Q(t,e.id);return(0,T.jsx)(`path`,{"data-request":e.id,"data-kind":e.kind,"data-phase":n,d:e.d,fill:`none`,strokeDasharray:n===`replied`?void 0:`6 5`,strokeWidth:e.kind===`peer`?2.2:1.8,markerEnd:`url(#activity-arrow-${e.kind})`,className:i(e.kind===`peer`?`stroke-message-peer-accent`:`stroke-message-inbound-accent`,Qr(n,e.id in t.opening))})}function oi({line:e,motion:t,active:n}){return(0,T.jsx)(`path`,{"data-wait":e.id,"data-kind":`wait`,"data-active":n?`true`:void 0,d:e.d,fill:`none`,strokeDasharray:`0 8`,strokeLinecap:`round`,strokeWidth:n?3.2:2.4,markerEnd:`url(#activity-ring-wait)`,className:i(`stroke-message-peer-accent`,n?`opacity-100`:`opacity-80`,$r(t,e.id))})}function si({id:e}){return(0,T.jsx)(`marker`,{id:e,viewBox:`0 0 12 12`,refX:`10`,refY:`6`,markerWidth:`5`,markerHeight:`5`,markerUnits:`strokeWidth`,orient:`auto`,children:(0,T.jsx)(`circle`,{cx:`6`,cy:`6`,r:`4`,strokeWidth:`2.4`,className:`fill-background stroke-message-peer-accent`})})}var ci=[];function li({requests:e,waits:t=ci,active:n=ii,index:r,peers:i,layoutKey:a,now:o,motion:s=W,paused:c=!1}){let l=w.useRef(null),u=Kr(l,w.useCallback(n=>Dr(n,e,r,{peers:i,waits:t,frame:{width:n.clientWidth,view:vr(n)}}),[e,t,r,i]),Or,`[data-activity-card]`,a,!0),d=w.useMemo(()=>new Set(u.map(e=>e.id)),[u]),f=Br(s.comets,d,c),p=new Map(e.map(e=>[e.requestId,e])),m=new Map(t.map(e=>[e.id,e]));return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`svg`,{ref:l,"data-slot":`activity-lines`,"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 z-[3] size-full overflow-visible`,children:[(0,T.jsxs)(`defs`,{children:[(0,T.jsx)(`marker`,{id:`activity-arrow-peer`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`7`,markerHeight:`7`,orient:`auto`,children:(0,T.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-peer-accent`})}),(0,T.jsx)(`marker`,{id:`activity-arrow-family`,viewBox:`0 0 10 10`,refX:`8`,refY:`5`,markerWidth:`6`,markerHeight:`6`,orient:`auto`,children:(0,T.jsx)(`path`,{d:`M0 0 10 5 0 10z`,className:`fill-message-inbound-accent`})}),(0,T.jsx)(si,{id:`activity-ring-wait`})]}),u.map(e=>e.kind===`wait`?(0,T.jsx)(oi,{line:e,motion:s,active:n.has(e.id)},e.id):(0,T.jsx)(ai,{line:e,motion:s},e.id)),(0,T.jsx)(`g`,{ref:f,"data-slot":`activity-comets`})]}),u.map(e=>{let t=e.kind===`wait`?m.get(e.id):void 0;if(t)return(0,T.jsx)(ti,{line:e,wait:t,now:o,motion:s},e.id);let n=p.get(e.id);return e.kind===`peer`&&n?(0,T.jsx)(ni,{line:e,request:n,now:o,phase:Q(s,e.id),replied:ri(s,e.id)},e.id):null})]})}function ui(e,t){let n=new Map;for(let r of[...e?.projects??[],...t.projects])for(let[e,t]of At(r))n.set(e,t);return n}var di={"timed-out":`timed out`,cancelled:`was cancelled`,destroyed:`closed: the recipient was destroyed`,failed:`closed: the recipient failed`,"completed-without-reply":`closed without a reply`,"sender-closed":`was closed by its sender`,"human-fallback":`went to a human`,deleted:`closed: the recipient was deleted`};function fi(e,t,n){let r=n(e.senderRunId,e.senderTitle),i=n(e.recipientRunId,e.recipientTitle);return t===`replied`?`${i} replied to ${r}`:`${r}’s request to ${i} ${di[t??``]??`closed`}`}var pi={done:{tone:`success`,word:`finished`},failed:{tone:`danger`,word:`failed`},cancelled:{tone:`neutral`,word:`was cancelled`},review:{tone:`info`,word:`waits for review`}},mi=e=>e.relationship===`peer`?`peer`:`family`;function hi(e,t,n){let r=(e,n)=>B(t,e,n);switch(e.kind){case`request-opened`:return{tone:mi(e.request),text:`${r(e.request.senderRunId,e.request.senderTitle)} asked ${r(e.request.recipientRunId,e.request.recipientTitle)}`};case`request-closed`:return{tone:e.status===`replied`?`success`:`neutral`,text:fi(e.request,e.status,r)};case`rung-changed`:return{tone:c(e.task.rung).tone,text:`${e.task.title}: ${z(e.task,{now:n,titleOf:e=>r(e)}).verb}`};case`worker-started`:return{tone:`running`,text:`${e.worker.title} started`};case`worker-settled`:{let t=pi[e.worker.status]??{tone:`neutral`,word:`settled`};return{tone:t.tone,text:`${e.worker.title} ${t.word}`}}case`card-entered`:return{tone:c(e.task.rung).tone,text:`${e.task.title} started`};case`card-left`:return{tone:`neutral`,text:`${e.task.title} left active work`};case`check-passed`:return{tone:`success`,text:`PR ${e.pr}: check “${e.name}” passed`};default:return}}function gi(e,t,n,r){return[...t.map((e,t)=>({...e,id:r+t,at:n})),...e].slice(0,6)}function _i(e){let t=Math.max(0,Math.floor(e/1e3));return t<5?`now`:t<60?`${t} s`:`${Math.floor(t/60)} min`}var vi=new Set;function yi(e){let[t,n]=w.useState({}),r=t.pointer??t.focus,i=w.useCallback((e,t)=>n(n=>n[e]===t?n:{...n,[e]:t}),[]);return{linked:w.useMemo(()=>r===void 0?vi:Nt(r,e),[r,e]),active:w.useMemo(()=>r===void 0?vi:new Set(e.filter(e=>e.waiterRunId===r||e.peerRunId===r).map(e=>e.id)),[r,e]),onHover:i}}var bi=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}),xi=`inline-flex items-center px-3 py-[5px] text-[12px] font-medium focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring max-md:min-h-11`;function Si({scope:e,projectId:t}){let r=e=>i(xi,e?`bg-card-2 text-foreground`:`text-muted-foreground hover:text-foreground`);return(0,T.jsxs)(`nav`,{"aria-label":`Activity scope`,"data-slot":`activity-scope`,className:`ml-auto inline-flex overflow-hidden rounded-lg border border-border`,children:[t===null?null:(0,T.jsx)(n,{to:`/p/${encodeURIComponent(t)}/activity`,"aria-current":e===`project`?`page`:void 0,className:r(e===`project`),children:`This project`}),(0,T.jsx)(n,{to:`/activity`,state:{activityProjectId:t},"aria-current":e===`all`?`page`:void 0,className:r(e===`all`),children:`All projects`})]})}function Ci({now:e,stale:t}){return(0,T.jsxs)(`span`,{"data-slot":`activity-clock`,"data-stale":t?`true`:void 0,className:`inline-flex items-center gap-1.5 text-[12px] text-muted-foreground tabular-nums`,children:[(0,T.jsx)(`span`,{"data-tone":`success`,className:i(`inline-flex size-[12px] items-center justify-center`,!t&&`activity-pulse`),children:(0,T.jsx)(C,{tone:t?`neutral`:`success`,"aria-hidden":`true`})}),(0,T.jsx)(`b`,{className:i(`font-semibold`,t?`text-muted-foreground`:`text-success`),children:t?`Not updating`:`Live`}),bi.format(e),` `,st()]})}function wi({name:e,now:t,stale:n=!1,children:r}){return(0,T.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2`,children:[(0,T.jsxs)(`h1`,{className:`min-w-0 truncate text-[18px] font-semibold`,children:[`Activity `,(0,T.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,e]})]}),t===void 0?null:(0,T.jsx)(Ci,{now:t,stale:n}),r]})}function Ti({value:e,bump:t}){return(0,T.jsx)(`strong`,{"data-bump":t===void 0?void 0:`true`,className:i(`font-semibold text-foreground tabular-nums`,t!==void 0&&`activity-bump`),children:e},t??`still`)}function $({icon:e,count:t,label:n,bump:r}){return(0,T.jsxs)(`li`,{"data-slot":`activity-chip`,"data-chip":n,className:`inline-flex items-center gap-[7px] rounded-full border border-border bg-card px-[11px] py-[5px] text-[12px] text-muted-foreground`,children:[e,(0,T.jsx)(Ti,{value:t,bump:r}),` `,n]})}function Ei({summary:e,tasksTo:t,bumps:n={}}){let r=e=>n[e]?.key;return(0,T.jsxs)(`ul`,{"data-slot":`activity-summary`,"aria-live":`polite`,"aria-label":`Summary`,className:`flex flex-wrap gap-2`,children:[(0,T.jsx)($,{icon:(0,T.jsx)(C,{tone:`pending`,"aria-hidden":`true`}),count:e.needsYou,label:`needs you`,bump:r(`needsYou`)}),(0,T.jsx)($,{icon:(0,T.jsx)(C,{tone:`running`,"aria-hidden":`true`}),count:e.working,label:`working`,bump:r(`working`)}),(0,T.jsx)($,{icon:(0,T.jsx)(C,{tone:`running`,shape:`ring`,"aria-hidden":`true`}),count:e.waiting,label:`waiting`,bump:r(`waiting`)}),(0,T.jsx)($,{icon:(0,T.jsx)(C,{tone:`neutral`,shape:`ring`,"aria-hidden":`true`}),count:e.queued,label:`queued`,bump:r(`queued`)}),(0,T.jsx)($,{icon:(0,T.jsx)(Ce,{"aria-hidden":`true`,className:`size-3.5`}),count:e.activeWorkers,label:`active workers`,bump:r(`activeWorkers`)}),(0,T.jsx)($,{icon:(0,T.jsx)(Se,{"aria-hidden":`true`,className:`size-3.5 text-message-peer-accent`}),count:e.openRequests,label:`open requests`,bump:r(`openRequests`)}),(0,T.jsx)(`li`,{"data-slot":`activity-chip`,"data-chip":`in review`,children:(0,T.jsxs)(S,{to:t,className:`inline-flex items-center gap-[7px] rounded-full border border-border bg-card px-[11px] py-[5px] text-[12px] text-muted-foreground hover:text-foreground focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11`,children:[(0,T.jsx)(C,{tone:`info`,"aria-hidden":`true`}),(0,T.jsx)(Ti,{value:e.inReview,bump:r(`inReview`)}),` in review`]})})]})}var Di=e=>new Map(e.map(e=>[e.runId,e])),Oi=e=>e!==void 0&&kt(e)===void 0;function ki(e,t,n,r){let i=Di(t.workers);for(let t of n.workers){let a=i.get(t.runId);!a&&N(t.status)&&r({kind:`worker-started`,projectId:e,parentId:n.runId,worker:t}),a&&N(a.status)&&!N(t.status)&&r({kind:`worker-settled`,projectId:e,parentId:n.runId,worker:t})}}function Ai(e,t,n,r){if(t.wait?.kind!==`pr`||n.wait?.kind!==`pr`||t.wait.detail.number!==n.wait.detail.number)return;let i=new Set((t.wait.detail.checks??[]).filter(e=>e.bucket===`pending`).map(e=>e.name));for(let t of n.wait.detail.checks??[])t.bucket===`pass`&&i.has(t.name)&&r({kind:`check-passed`,projectId:e,runId:n.runId,pr:n.wait.detail.number,name:t.name})}var ji=(e,t)=>t.tool!==void 0&&(t.tool.startedAt!==e.tool?.startedAt||t.tool.title!==e.tool?.title);function Mi(e,t,n,r){t.rung!==n.rung&&r({kind:`rung-changed`,projectId:e,task:n,from:t.rung}),ji(t,n)&&r({kind:`tool-started`,projectId:e,runId:n.runId}),ki(e,t,n,r),Ai(e,t,n,r)}function Ni(e,t,n){let r=Di(e.tasks),i=Di(t.tasks);for(let e of t.tasks){let i=r.get(e.runId);i?Mi(t.projectId,i,e,n):n({kind:`card-entered`,projectId:t.projectId,task:e})}for(let r of e.tasks)i.has(r.runId)||n({kind:`card-left`,projectId:t.projectId,task:r})}function Pi(e,t,n){let r=new Set(e.requests.map(e=>e.requestId)),i=new Set(t.requests.map(e=>e.requestId)),a=new Map(t.closed.map(e=>[e.requestId,e.status]));for(let e of t.requests)r.has(e.requestId)||n({kind:`request-opened`,projectId:t.projectId,request:e});for(let r of e.requests){if(i.has(r.requestId))continue;let e=a.get(r.requestId);n({kind:`request-closed`,projectId:t.projectId,request:r,...e?{status:e}:{}})}}function Fi(e,t,n){let r=Mt(e.tasks),i=Mt(t.tasks),a=new Set(r.map(e=>e.id)),o=new Set(i.map(e=>e.id));for(let e of i)a.has(e.id)||n({kind:`wait-opened`,projectId:t.projectId,wait:e});for(let e of r)o.has(e.id)||n({kind:`wait-closed`,projectId:t.projectId,wait:e})}var Ii=[`needsYou`,`working`,`waiting`,`queued`,`activeWorkers`,`openRequests`,`inReview`];function Li(e,t,n){let r=Wt(e),i=Wt(t);for(let e of Ii)r[e]!==i[e]&&n({kind:`chip-changed`,chip:e,from:r[e],to:i[e]})}function Ri(e,t){if(e===void 0)return[];let n=[],r=e=>n.push(e),i=new Map(e.projects.map(e=>[e.projectId,e]));for(let e of t.projects){let t=i.get(e.projectId);!Oi(t)||!Oi(e)||(Ni(t,e,r),Pi(t,e,r),Fi(t,e,r))}return Li(e.projects,t.projects,r),n}function zi(e){return{input:e,reconcile:!1,seq:0,motion:W,feed:[],epoch:0,...e.snapshot?{seen:e.snapshot}:{}}}function Bi(e){let{plan:t,...n}=e;return{...n,motion:W,epoch:e.epoch+1}}function Vi(e,t,n){let r=Ri(t,n);if(r.length===0)return e;let i=Date.parse(n.generatedAt),a=ui(t,n),o=r.flatMap(e=>hi(e,a,i)??[]),s=e.seq+o.length+1,c=tn(r,s,e.input.reduced);return{...e,seq:s,feed:o.length>0?gi(e.feed,o,i,e.seq+1):e.feed,motion:rn(e.motion,c.changes),...c.timers.length>0?{plan:{key:s,timers:c.timers}}:{}}}function Hi(e,t){let n=e.seen;if(!t||t===n)return e;let r={...e,seen:t};return!n||!e.input.active?r:e.reconcile?{...r,reconcile:!1}:Vi(r,n,t)}function Ui(e,t){let n=e.input;if(t.scope!==n.scope)return{...zi(t),seq:e.seq,epoch:e.epoch+1};if(t.snapshot===n.snapshot&&t.active===n.active&&t.reduced===n.reduced)return e;let r={...e,input:t};return n.active&&!t.active&&(r={...Bi(r),reconcile:!0}),!n.reduced&&t.reduced&&(r=Bi(r)),Hi(r,t.snapshot)}var Wi=`(prefers-reduced-motion: reduce)`,Gi=()=>typeof window<`u`&&typeof window.matchMedia==`function`?window.matchMedia(Wi):void 0;function Ki(e){let t=Gi();return t?.addEventListener?.(`change`,e),()=>t?.removeEventListener?.(`change`,e)}function qi(){return Gi()?.matches??!1}function Ji(){return(0,w.useSyncExternalStore)(Ki,qi,()=>!1)}function Yi(e,t){let n=w.useRef(new Set);w.useEffect(()=>{let e=n.current;return()=>{for(let t of e)clearTimeout(t);e.clear()}},[e.epoch]),w.useEffect(()=>{for(let{after:r,change:i}of e.plan?.timers??[]){let e=setTimeout(()=>{n.current.delete(e),t(e=>({...e,motion:rn(e.motion,[i])}))},r);n.current.add(e)}},[e.plan?.key])}function Xi(e,t){let n=Ji(),r=m(),i={snapshot:e,scope:t,active:r,reduced:n},[a,o]=w.useState(()=>zi(i)),s=Ui(a,i);return s!==a&&o(s),Yi(s,o),{motion:s.motion,feed:s.feed,reduced:n,paused:!r}}function Zi(e,t){let n=we(1e3),[r,i]=w.useState({offset:0}),a=r.offset;return $e(e)&&e!==r.generatedAt&&t!==0&&(a=Date.parse(e)-t,i({generatedAt:e,offset:a})),n+a}export{Sn as A,Mt as B,Pn as C,jn as D,Nn as E,W as F,V as G,H,an as I,z as J,Wt as K,zt as L,G as M,ln as N,wn as O,sn as P,it as Q,Ft as R,$n as S,Ln as T,Lt as U,kt as V,At as W,A as X,M as Y,j as Z,Br as _,Ei as a,lr as b,li as c,Q as d,ri as f,Wr as g,Kr as h,Si as i,hn as j,kn as k,si as l,Xr as m,Xi as n,yi as o,$r as p,N as q,wi as r,_i as s,Zi as t,Qr as u,Cr as v,In as w,Qn as x,cr as y,B as z};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{M as t,t as n,u as r}from"./button-DGwhwRuD.js";import{i,t as a}from"./react-runtime-CCIEwYL0.js";import{t as o}from"./arrow-right-Dh_Lx3um.js";import{A as s,B as c,C as l,E as u,F as d,G as f,H as p,I as m,K as h,L as g,N as _,Q as v,T as y,U as b,V as x,W as S,X as C,Y as w,Z as T,a as E,c as D,g as O,i as k,m as A,n as j,o as M,r as N,s as P,t as F,w as I,z as L}from"./activity-motion-W7LQQzqR.js";import{s as R}from"./project-router-BVp1TVVP.js";import{B as z,Jt as B}from"./index-FZIxXka9.js";var V=e(i(),1),H=a(),U=`rounded-xl border border-border bg-card px-3.5 py-3`,W=`mb-2 flex gap-2 text-[11.5px] font-semibold tracking-[0.06em] text-muted-foreground uppercase`;function G({request:e,index:t,now:n,motion:i}){let{kind:a,relation:s}=g(e,t),c=A(e,n),l=e.relationship===`peer`?`text-message-peer-accent`:`text-message-inbound-accent`;return(0,H.jsxs)(`li`,{"data-slot":i===`fold`?`activity-request-closing`:`activity-request`,"data-request":e.requestId,"aria-hidden":i===`fold`||void 0,className:r(`border-t border-border py-2.5 first:border-t-0 first:pt-0`,i===`enter`&&`activity-row-enter`,i===`fold`&&`activity-row-fold`),children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[12px] font-medium`,children:[(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:f(t,e)}),(0,H.jsx)(o,{"aria-label":`to`,className:`size-3 shrink-0 text-muted-foreground`}),(0,H.jsx)(`span`,{className:`min-w-0 truncate`,children:p(t,e)}),(0,H.jsx)(`span`,{className:r(`ml-auto shrink-0 text-[10px] font-semibold tracking-[0.05em] uppercase`,l),children:a})]}),(0,H.jsxs)(`p`,{className:`my-1 line-clamp-3 text-[12px] text-muted-foreground`,children:[`“`,e.text,`”`]}),(0,H.jsxs)(`div`,{className:`flex gap-1.5 text-[11px] text-muted-foreground tabular-nums`,children:[(0,H.jsxs)(`span`,{children:[s,` · open `,C(T(e.createdAt,n))]}),e.deadline?(0,H.jsx)(`span`,{className:`ml-auto`,children:b(e.deadline,n)}):null]}),c===void 0?null:(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`mt-1.5 h-[3px] overflow-hidden rounded-sm bg-border`,children:(0,H.jsx)(`span`,{className:r(`block h-full bg-current`,l),style:{width:`${Math.round(c*100)}%`}})})]})}function K({className:e}){return(0,H.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:(0,H.jsx)(`path`,{d:`M2 5h30`,strokeWidth:2,strokeDasharray:`6 5`,className:e})})}function q(){return(0,H.jsxs)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:[(0,H.jsx)(`path`,{d:`M2 5h24`,strokeWidth:2.2,strokeLinecap:`round`,strokeDasharray:`0 6`,className:`stroke-message-peer-accent opacity-80`}),(0,H.jsx)(`circle`,{cx:`29.5`,cy:`5`,r:`3`,strokeWidth:1.6,className:`fill-card stroke-message-peer-accent`})]})}function J(){let e=`flex items-center gap-2`;return(0,H.jsxs)(`div`,{"data-slot":`activity-legend`,className:r(U,`grid gap-1.5 text-[11.5px] text-muted-foreground`),children:[(0,H.jsx)(`h2`,{className:`sr-only`,children:`Legend`}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`running`,"aria-hidden":`true`}),`Filled: working now`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`info`,shape:`ring`,"aria-hidden":`true`}),`Ring: waiting for something outside`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(B,{tone:`running`,shape:`workers`,"aria-hidden":`true`}),`Robot: waiting for its own workers`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(s,{rate:[0,2,5,1,3,0,4,2],className:`w-[34px]`}),`Heartbeat: tool calls, last 30 s`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(K,{className:`stroke-message-peer-accent`}),`Open request, task to task`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(q,{}),`Waits for a peer to write`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(K,{className:`stroke-message-inbound-accent`}),`Open question, worker to parent`]}),(0,H.jsxs)(`div`,{className:e,children:[(0,H.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 34 10`,className:`h-2.5 w-[34px] shrink-0`,children:(0,H.jsx)(`circle`,{cx:`17`,cy:`5`,r:`4`,className:`fill-foreground`})}),`Comet: a message is travelling`]})]})}var Y={..._,peer:`bg-message-peer-accent`,family:`bg-message-inbound-accent`};function X({feed:e,now:t,watchingSince:n}){return(0,H.jsxs)(`section`,{"data-slot":`activity-just-now`,className:U,children:[(0,H.jsx)(`h2`,{className:W,children:`Just now`}),e.length>0?(0,H.jsx)(`ul`,{"data-slot":`activity-feed`,children:e.map((e,n)=>(0,H.jsxs)(`li`,{"data-slot":`activity-feed-entry`,className:r(`grid grid-cols-[10px_minmax(0,1fr)_auto] items-baseline gap-2 py-1 text-[12px] text-muted-foreground`,n===0&&`activity-feed-enter`),children:[(0,H.jsx)(`span`,{"aria-hidden":`true`,className:r(`size-[7px] -translate-y-px rounded-full`,Y[e.tone])}),(0,H.jsx)(`span`,{className:`min-w-0`,children:e.text}),(0,H.jsx)(`span`,{"data-slot":`activity-feed-age`,className:`text-[11px] tabular-nums`,children:P(t-e.at)})]},e.id))}):null,(0,H.jsxs)(`p`,{className:`py-1.5 text-[12px] text-muted-foreground`,children:[`Watching since `,w(n)]})]})}function Z({requests:e,closing:t=[],index:n,now:r,watchingSince:i,feed:a=[],motion:o=d}){return(0,H.jsxs)(`aside`,{"data-slot":`activity-rail`,"aria-label":`Activity details`,className:`grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-4`,children:[(0,H.jsxs)(`section`,{"data-slot":`activity-open-requests`,className:U,children:[(0,H.jsxs)(`h2`,{className:W,children:[`Open requests `,(0,H.jsx)(`b`,{className:`text-foreground`,children:e.length})]}),e.length===0&&t.length===0?(0,H.jsx)(`p`,{className:`py-1.5 text-[12px] text-muted-foreground`,children:`No task waits for a reply.`}):(0,H.jsxs)(`ul`,{children:[e.map(e=>(0,H.jsx)(G,{request:e,index:n,now:r,motion:e.requestId in o.opening?`enter`:void 0},e.requestId)),t.map(e=>(0,H.jsx)(G,{request:e,index:n,now:r,motion:`fold`},e.requestId))]})]}),(0,H.jsx)(X,{feed:a,now:r,watchingSince:i}),(0,H.jsx)(J,{})]})}function Q(e){let[t,n]=V.useState(0);return V.useLayoutEffect(()=>{let t=e.current;if(!t)return;let r=()=>n(t.clientWidth);if(r(),typeof ResizeObserver>`u`)return;let i=new ResizeObserver(r);return i.observe(t),()=>i.disconnect()},[e]),t}function $(e,t,n){let[r,i]=V.useState(void 0),a=I(r,e,t,n);return y(r,a)||i(a),a}function ee(e,t,n=c(e.tasks)){let r=new Set(e.tasks.map(e=>e.runId)),i=new Set(e.requests.map(e=>e.requestId)),a=Object.values(t.closing).filter(t=>t.projectId===e.projectId&&!i.has(t.request.requestId));return{cards:Object.values(t.leaving).filter(t=>t.projectId===e.projectId&&!r.has(t.task.runId)).map(e=>e.task),requests:a.map(e=>e.request),waits:m(e.projectId,n,t),folding:a.filter(e=>e.phase===`reply`||!e.replied).map(e=>e.request)}}function te({project:e,now:t,watchingSince:n,motion:r=d,feed:i,still:a=!1,paused:o=!1}){let s=V.useRef(null),f=l(Q(s)),p=V.useMemo(()=>S(e),[e]),m=V.useMemo(()=>c(e.tasks),[e.tasks]),h=V.useMemo(()=>ee(e,r,m),[e,r,m]),g=V.useMemo(()=>[...e.requests,...h.requests],[e.requests,h.requests]),_=V.useMemo(()=>[...m,...h.waits],[m,h.waits]),v=M(m),y=new Map([...h.cards,...e.tasks].map(e=>[e.runId,e])),b=new Set(h.cards.map(e=>e.runId)),x=e=>1+.35*(y.get(e)?.workers.length??0),C=$([...y.keys()],f,x),w=f===1,T=e.tasks.length>12,E={now:t,titleOf:e=>L(p,e)},k=C.map(e=>e.join(`,`)).join(`|`),A=`${e.tasks.length}:${f}:${T}:${k}:${g.map(e=>e.requestId).join(`,`)}:${_.map(e=>e.id).join(`,`)}`;return O(s,`data-flip`,k,!a&&!o),(0,H.jsxs)(`div`,{className:`grid items-start gap-6 xl:grid-cols-[minmax(0,1fr)_300px]`,children:[(0,H.jsxs)(`div`,{className:`min-w-0 pl-5`,children:[e.tasks.length===0?(0,H.jsx)(`p`,{"data-slot":`activity-empty`,className:`py-6 text-[13px] text-muted-foreground`,children:`No active work in this project.`}):null,(0,H.jsxs)(`div`,{ref:s,"data-slot":`activity-graph`,"data-columns":f,"data-dense":T?`true`:void 0,className:`relative grid items-start`,style:{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`,columnGap:w?0:96},children:[C.map((t,n)=>(0,H.jsx)(`div`,{"data-slot":`activity-column`,className:`grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-[30px] max-md:gap-4`,children:t.map(t=>{let n=y.get(t);return n?(0,H.jsx)(u,{task:n,requests:e.requests,waits:m,index:p,ctx:E,dense:T,narrow:w,motion:r,ghost:b.has(t),linked:v.linked.has(t),onHover:v.onHover},t):null})},n)),(0,H.jsx)(D,{requests:g,waits:_,active:v.active,index:p,peers:!w,layoutKey:A,now:t,motion:r,paused:o||a})]})]}),(0,H.jsx)(Z,{requests:e.requests,closing:h.folding,index:p,now:t,watchingSince:n,feed:i,motion:r})]})}function ne(){let e=t(),r=v({kind:`project`,projectId:e}),i=R(),[a]=V.useState(()=>new Date().toISOString()),o=F(r.data?.generatedAt,r.dataUpdatedAt),{motion:s,feed:c,reduced:l,paused:u}=j(r.data,e),d=r.data?.projects[0];if(r.isPending)return(0,H.jsx)(z,{});let f=d?x(d):void 0;return d?(0,H.jsxs)(`div`,{"data-route":`activity`,"data-activity-paused":u?`true`:void 0,className:`flex min-h-full w-full flex-col gap-4 px-[18px] py-6 md:px-7`,children:[(0,H.jsx)(N,{name:d.name,now:o,stale:r.isError,children:(0,H.jsx)(k,{scope:`project`,projectId:i??d.projectId})}),(0,H.jsx)(E,{summary:h([d]),tasksTo:`/`,bumps:s.bumps}),f?(0,H.jsx)(`p`,{"data-slot":`activity-project-notice`,role:`status`,className:`py-6 text-[13px] text-muted-foreground`,children:f}):(0,H.jsx)(te,{project:d,now:o,watchingSince:a,motion:s,feed:c,still:l,paused:u})]}):(0,H.jsxs)(`div`,{"data-route":`activity`,className:`min-h-full w-full px-[18px] py-6 md:px-7`,children:[(0,H.jsx)(N,{name:i??`project`,children:(0,H.jsx)(k,{scope:`project`,projectId:i})}),(0,H.jsxs)(`div`,{role:`alert`,className:`mt-6 flex items-center gap-3 text-[13px] text-muted-foreground`,children:[r.error?`Could not load activity: ${r.error.message}`:`This project has no activity snapshot.`,(0,H.jsx)(n,{size:`sm`,variant:`outline`,onClick:()=>void r.refetch(),className:`max-md:min-h-11`,children:`Retry`})]})]})}export{ne as ProjectActivityRoute};
@@ -1 +0,0 @@
1
- import{En as e,jn as t}from"./project-scope-context-DSlnqjT3.js";function n(n){return e[t(n).bucket]<=e.waiting}export{n as t};
@@ -1,3 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{i as r,r as i,t as a}from"./bundle-mjs-BT31bpU6.js";function o(e,t={displayName:`Squawk`,command:`hsq`,npx:`npx -p @hearsay-tools/squawk hsq`}){return t.displayName}function s(e={displayName:`Squawk`,command:`hsq`,npx:`npx -p @hearsay-tools/squawk hsq`}){return e.command}var c=`/api/v1`,l=``;function u(e){l=e.replace(/\/+$/,``)}function d(){return l}var f=null;function p(e){f=e===``?null:e}function m(){return f}function h(){return f??`default`}var g=/^\/(?:health$|models(?:$|[/?])|providers(?:$|[/?])|projects(?:$|[/?])|workspace\/|fs\/)/;function _(e){return`${l}${c}${v(e)}`}function v(e){return f===null||g.test(e)?e:`/p/${encodeURIComponent(f)}${e}`}var y=/^\/api(?:\/v1)?(\/.*)$/;function b(e){let t=/^[a-z][a-z0-9+.-]*:/i.exec(e);if(t){let n=e.indexOf(`//`,t[0].length);if(n!==t[0].length)return e;let r=e.indexOf(`/`,n+2);if(r===-1)return e;let i=e.slice(0,r),a=x(e.slice(r));return a===null?e:`${i}${a}`}let n=x(l&&e.startsWith(l)?e.slice(l.length):e);return n===null?e:`${l}${n}`}function x(e){let t=y.exec(e);if(!t)return null;let n=t[1];return n.startsWith(`/p/`)?`${c}${n}`:`${c}${v(n)}`}var S=e(t(),1),C=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,w=/^[\\/]{2}/;function T(e,t){return t+e.replace(/\\/g,`/`)}var E=`popstate`;function ee(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function te(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return ie(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:k(t)}return ae(t,n,null,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ne(){return Math.random().toString(36).substring(2,10)}function re(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ie(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?A(t):t,state:n,key:t&&t.key||r||ne(),mask:i}}function k({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function A(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ae(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ee(e)?e:ie(h.location,e,t);n&&n(r,e),l=u()+1;let d=re(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ee(e)?e:ie(h.location,e,t);n&&n(r,e),l=u();let i=re(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return oe(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(E,d),c=e,()=>{i.removeEventListener(E,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function oe(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),D(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:k(t);return i=i.replace(/ $/,`%20`),!n&&w.test(i)&&(i=r+i),new URL(i,r)}function se(e,t,n=`/`){return ce(e,t,n,!1)}function ce(e,t,n,r,i){let a=M((typeof t==`string`?A(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ue(e),s=null,c=Ee(a);for(let e=0;s==null&&e<o.length;++e)s=Ce(o[e],c,r);return s}function le(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ue(e){let t=de(e);return pe(t),t}function de(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;D(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=P([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),de(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:xe(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Te(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of fe(e.path))a(e,t,!0,n)}),t}function fe(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=fe(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function pe(e){e.sort((e,t)=>e.score===t.score?Se(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var me=/^:[\w-]+$/,he=3,ge=2,_e=1,ve=10,ye=-2,be=e=>e===`*`;function xe(e,t){let n=e.split(`/`),r=n.length;return n.some(be)&&(r+=ye),t&&(r+=ge),n.filter(e=>!be(e)).reduce((e,t)=>e+(me.test(t)?he:t===``?_e:ve),r)}function Se(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Ce(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?we(u,l,s.matcher,s.compiledParams):j(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=j({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:P([a,d.pathname]),pathnameBase:Ne(P([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=P([a,d.pathnameBase]))}return o}function j(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Te(e.path,e.caseSensitive,e.end);return we(e,t,n,r)}function we(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Te(e,t=!1,n=!0){O(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ee(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function M(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function De(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?A(e):e,a;return n?(n=Me(n),a=n.startsWith(`/`)?Oe(n.substring(1),`/`):Oe(n,t)):a=t,{pathname:a,search:Pe(r),hash:Fe(i)}}function Oe(e,t){let n=F(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ke(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Ae(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function je(e){let t=Ae(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function N(e,t,n,r=!1){let i;typeof e==`string`?i=A(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),ke(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),ke(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),ke(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=De(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Me=e=>e.replace(/[\\/]{2,}/g,`/`),P=e=>Me(e.join(`/`)),F=e=>e.replace(/\/+$/,``),Ne=e=>F(e).replace(/^\/*/,`/`),Pe=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Fe=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Ie=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Le(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Re(e){return P(e.map(e=>e.route.path).filter(Boolean))||`/`}var ze=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Be(e,t){let n=e;if(typeof n!=`string`||!C.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ze)try{let e=new URL(window.location.href),r=w.test(n)?new URL(T(n,e.protocol)):new URL(n),a=M(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Ve=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Ve);var He=[`GET`,...Ve];new Set(He);var Ue=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function We(e){try{return Ue.includes(new URL(e).protocol)}catch{return!1}}var I=S.createContext(null);I.displayName=`DataRouter`;var L=S.createContext(null);L.displayName=`DataRouterState`;var Ge=S.createContext(!1);function Ke(){return S.useContext(Ge)}var qe=S.createContext({isTransitioning:!1});qe.displayName=`ViewTransition`;var Je=S.createContext(new Map);Je.displayName=`Fetchers`;var Ye=S.createContext(null);Ye.displayName=`Await`;var R=S.createContext(null);R.displayName=`Navigation`;var z=S.createContext(null);z.displayName=`Location`;var B=S.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName=`Route`;var Xe=S.createContext(null);Xe.displayName=`RouteError`;var Ze=`REACT_ROUTER_ERROR`,Qe=`REDIRECT`,$e=`ROUTE_ERROR_RESPONSE`;function et(e){if(e.startsWith(`${Ze}:${Qe}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function tt(e){if(e.startsWith(`${Ze}:${$e}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Ie(t.status,t.statusText,t.data)}catch{}}function nt(e,{relative:t}={}){D(V(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=S.useContext(R),{hash:i,pathname:a,search:o}=W(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:P([n,a])),r.createHref({pathname:s,search:o,hash:i})}function V(){return S.useContext(z)!=null}function H(){return D(V(),`useLocation() may be used only in the context of a <Router> component.`),S.useContext(z).location}function rt(){return S.useContext(z).navigationType}var it=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function at(e){S.useContext(R).static||S.useLayoutEffect(e)}function U(){let{isDataRoute:e}=S.useContext(B);return e?Ot():ot()}function ot(){D(V(),`useNavigate() may be used only in the context of a <Router> component.`);let e=S.useContext(I),{basename:t,navigator:n}=S.useContext(R),{matches:r}=S.useContext(B),{pathname:i}=H(),a=JSON.stringify(je(r)),o=S.useRef(!1);return at(()=>{o.current=!0}),S.useCallback((r,s={})=>{if(O(o.current,it),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=N(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:P([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var st=S.createContext(null);function ct(e){let t=S.useContext(B).outlet;return S.useMemo(()=>t&&S.createElement(st.Provider,{value:e},t),[t,e])}function lt(){let{matches:e}=S.useContext(B);return e[e.length-1]?.params??{}}function W(e,{relative:t}={}){let{matches:n}=S.useContext(B),{pathname:r}=H(),i=JSON.stringify(je(n));return S.useMemo(()=>N(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ut(e,t){return dt(e,t)}function dt(e,t,n){D(V(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=S.useContext(R),{matches:i}=S.useContext(B),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;At(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
2
-
3
- Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=H(),d;if(t){let e=typeof t==`string`?A(t):t;D(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):se(e,{pathname:p});O(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=vt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:P([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:P([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?S.createElement(z.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function ft(){let e=Dt(),t=Le(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=S.createElement(S.Fragment,null,S.createElement(`p`,null,`💿 Hey developer 👋`),S.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,S.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,S.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),S.createElement(S.Fragment,null,S.createElement(`h2`,null,`Unexpected Application Error!`),S.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?S.createElement(`pre`,{style:i},n):null,o)}var pt=S.createElement(ft,null),mt=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=tt(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:S.createElement(B.Provider,{value:this.props.routeContext},S.createElement(Xe.Provider,{value:e,children:this.props.component}));return this.context?S.createElement(gt,{error:e},t):t}};mt.contextType=Ge;var ht=new WeakMap;function gt({children:e,error:t}){let{basename:n}=S.useContext(R);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=et(t.digest);if(e){let r=ht.get(t);if(r)throw r;let i=Be(e.location,n),a=i.absoluteURL||i.to;if(We(a))throw Error(`Invalid redirect location`);if(ze&&!ht.get(t))if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw ht.set(t,n),n}return S.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function _t({routeContext:e,match:t,children:n}){let r=S.useContext(I);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement(B.Provider,{value:e},n)}function vt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);D(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Re(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||pt,o&&(s<0&&c===0?(At(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?S.createElement(n.route.Component,null):n.route.element?n.route.element:e,S.createElement(_t,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?S.createElement(mt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function yt(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bt(e){let t=S.useContext(I);return D(t,yt(e)),t}function xt(e){let t=S.useContext(L);return D(t,yt(e)),t}function St(e){let t=S.useContext(B);return D(t,yt(e)),t}function Ct(e){let t=St(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function wt(){return Ct(`useRouteId`)}function Tt(){let e=xt(`useNavigation`);return S.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function Et(){let{matches:e,loaderData:t}=xt(`useMatches`);return S.useMemo(()=>e.map(e=>le(e,t)),[e,t])}function Dt(){let e=S.useContext(Xe),t=xt(`useRouteError`),n=Ct(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Ot(){let{router:e}=bt(`useNavigate`),t=Ct(`useNavigate`),n=S.useRef(!1);return at(()=>{n.current=!0}),S.useCallback(async(r,i={})=>{O(n.current,it),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var kt={};function At(e,t,n){!t&&!kt[e]&&(kt[e]=!0,O(!1,n))}S.memo(jt);function jt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return dt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Mt({to:e,replace:t,state:n,relative:r}){D(V(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=S.useContext(R);O(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=S.useContext(B),{pathname:o}=H(),s=U(),c=N(e,je(a),o,r===`path`),l=JSON.stringify(c);return S.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Nt(e){return ct(e.context)}function Pt(e){D(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Ft({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){D(!V(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=S.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=A(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=S.useMemo(()=>{let e=M(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return O(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:S.createElement(R.Provider,{value:c},S.createElement(z.Provider,{children:t,value:h}))}function It({children:e,location:t}){return ut(G(e),t)}S.Component;function G(e,t=[]){let n=[];return S.Children.forEach(e,(e,r)=>{if(!S.isValidElement(e))return;let i=[...t,r];if(e.type===S.Fragment){n.push.apply(n,G(e.props.children,i));return}D(e.type===Pt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),D(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=G(e.props.children,i)),n.push(a)}),n}var Lt=G,K=`get`,q=`application/x-www-form-urlencoded`;function J(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Rt(e){return J(e)&&e.tagName.toLowerCase()===`button`}function zt(e){return J(e)&&e.tagName.toLowerCase()===`form`}function Bt(e){return J(e)&&e.tagName.toLowerCase()===`input`}function Vt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ht(e,t){return e.button===0&&(!t||t===`_self`)&&!Vt(e)}function Ut(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Wt(e,t){let n=Ut(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Y=null;function Gt(){if(Y===null)try{new FormData(document.createElement(`form`),0),Y=!1}catch{Y=!0}return Y}var Kt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function qt(e){return e!=null&&!Kt.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${q}"`),null):e}function Jt(e,t){let n,r,i,a,o;if(zt(e)){let o=e.getAttribute(`action`);r=o?M(o,t):null,n=e.getAttribute(`method`)||K,i=qt(e.getAttribute(`enctype`))||q,a=new FormData(e)}else if(Rt(e)||Bt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?M(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||K,i=qt(e.getAttribute(`formenctype`))||qt(o.getAttribute(`enctype`))||q,a=new FormData(o,e),!Gt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(J(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=K,r=null,i=q,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Yt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Xt=/[&><\u2028\u2029]/g;function Zt(e){return e.replace(Xt,e=>Yt[e])}function Qt(e,t){if(e===!1||e==null)throw Error(t)}function $t(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&M(i.pathname,t)===`/`?i.pathname=`${F(t)}/_root.${r}`:i.pathname=`${F(i.pathname)}.${r}`,i}async function en(e,t){if(e.id in t)return t[e.id];try{let n=await r(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function tn(e){return e!=null&&typeof e.page==`string`}function nn(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function rn(e,t,n){return ln((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await en(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(nn).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function an(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function on(e,t,{includeHydrateFallback:n}={}){return sn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function sn(e){return[...new Set(e)]}function cn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function ln(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!tn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(cn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function un(){let e=S.useContext(I);return Qt(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function dn(){let e=S.useContext(L);return Qt(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var X=S.createContext(void 0);X.displayName=`FrameworkContext`;function Z(){let e=S.useContext(X);return Qt(e,`You must render this element inside a <HydratedRouter> element`),e}function fn(e,t){let n=S.useContext(X),[r,i]=S.useState(!1),[a,o]=S.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=S.useRef(null);S.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),S.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Q(s,p),onBlur:Q(c,m),onMouseEnter:Q(l,p),onMouseLeave:Q(u,m),onTouchStart:Q(d,p)}]:[a,f,{}]:[!1,f,{}]}function Q(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function pn({page:e,...t}){let n=Ke(),{nonce:r}=Z(),{router:i}=un(),a=S.useMemo(()=>se(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?S.createElement(hn,{page:e,matches:a,...t}):S.createElement(gn,{page:e,matches:a,...t})):null}function mn(e){let{manifest:t,routeModules:n}=Z(),[r,i]=S.useState([]);return S.useEffect(()=>{let r=!1;return rn(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function hn({page:e,matches:t,...n}){let r=H(),{future:i}=Z(),{basename:a}=un(),o=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=$t(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return S.createElement(S.Fragment,null,o.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function gn({page:e,matches:t,...n}){let r=H(),{future:i,manifest:a,routeModules:o}=Z(),{basename:s}=un(),{loaderData:c,matches:l}=dn(),u=S.useMemo(()=>an(e,t,l,a,r,`data`),[e,t,l,a,r]),d=S.useMemo(()=>an(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=$t(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=S.useMemo(()=>on(d,a),[d,a]),m=mn(d);return S.createElement(S.Fragment,null,f.map(e=>S.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>S.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>S.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function _n(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}S.Component;var vn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{vn&&(window.__reactRouterVersion=`7.18.1`)}catch{}function yn({basename:e,children:t,useTransitions:n,window:r}){let i=S.useRef();i.current??=te({window:r,v5Compat:!0});let a=i.current,[o,s]=S.useState({action:a.action,location:a.location}),c=S.useCallback(e=>{n===!1?s(e):S.startTransition(()=>s(e))},[n]);return S.useLayoutEffect(()=>a.listen(c),[a,c]),S.createElement(Ft,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function bn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=S.useState({action:n.action,location:n.location}),o=S.useCallback(e=>{r===!1?a(e):S.startTransition(()=>a(e))},[r]);return S.useLayoutEffect(()=>n.listen(o),[n,o]),S.createElement(Ft,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}bn.displayName=`unstable_HistoryRouter`;var xn=S.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=S.useContext(R),v=typeof l==`string`&&C.test(l),y=Be(l,h);l=y.to;let b=nt(l,{relative:r}),x=H(),w=null;if(o){let e=N(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:P([h,e.pathname])),w=g.createHref(e)}let[T,E,ee]=fn(n,p),te=On(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||te(t)}let O=!(y.isExternal||i),ne=S.createElement(`a`,{...p,...ee,href:(O?w:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:_n(m,E),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return T&&!v?S.createElement(S.Fragment,null,ne,S.createElement(pn,{page:b})):ne});xn.displayName=`Link`;var Sn=S.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=W(a,{relative:c.relative}),d=H(),f=S.useContext(L),{navigator:p,basename:m}=S.useContext(R),h=f!=null&&Rn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=M(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:x,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return S.createElement(xn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Sn.displayName=`NavLink`;var Cn=S.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=K,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=S.useContext(R),g=Mn(),_=Nn(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&C.test(s);return S.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?S.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Cn.displayName=`Form`;function wn({getKey:e,storageKey:t,...n}){let r=S.useContext(X),{basename:i}=S.useContext(R),a=H(),o=Et();In({getKey:e,storageKey:t});let s=S.useMemo(()=>{if(!r||!e)return null;let t=Fn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),S.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Zt(JSON.stringify(t||Pn))}, ${Zt(JSON.stringify(s))})`}})}wn.displayName=`ScrollRestoration`;function Tn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function En(e){let t=S.useContext(I);return D(t,Tn(e)),t}function Dn(e){let t=S.useContext(L);return D(t,Tn(e)),t}function On(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=U(),d=H(),f=W(e,{relative:o});return S.useCallback(p=>{if(Ht(p,t)){p.preventDefault();let t=n===void 0?k(d)===k(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?S.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function kn(e){O(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=S.useRef(Ut(e)),n=S.useRef(!1),r=H(),i=S.useMemo(()=>Wt(r.search,n.current?null:t.current),[r.search]),a=U();return[i,S.useCallback((e,t)=>{let r=Ut(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var An=0,jn=()=>`__${String(++An)}__`;function Mn(){let{router:e}=En(`useSubmit`),{basename:t}=S.useContext(R),n=wt(),r=e.fetch,i=e.navigate;return S.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Jt(e,t);if(a.navigate===!1){let e=a.fetcherKey||jn();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Nn(e,{relative:t}={}){let{basename:n}=S.useContext(R),r=S.useContext(B);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...W(e||`.`,{relative:t})},o=H();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:P([n,a.pathname])),k(a)}var Pn=`react-router-scroll-positions`,$={};function Fn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:M(e.pathname,n)||e.pathname},t)),i??=e.key,i}function In({getKey:e,storageKey:t}={}){let{router:n}=En(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Dn(`useScrollRestoration`),{basename:a}=S.useContext(R),o=H(),s=Et(),c=Tt();S.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Ln(S.useCallback(()=>{if(c.state===`idle`){let t=Fn(o,s,a,e);$[t]=window.scrollY}try{sessionStorage.setItem(t||Pn,JSON.stringify($))}catch(e){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(S.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Pn);e&&($=JSON.parse(e))}catch{}},[t]),S.useLayoutEffect(()=>{let t=n?.enableScrollRestoration($,()=>window.scrollY,e?(t,n)=>Fn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),S.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{O(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Ln(e,t){let{capture:n}=t||{};S.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Rn(e,{relative:t}={}){let n=S.useContext(qe);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=En(`useViewTransitionState`),i=W(e,{relative:t});if(!n.isTransitioning)return!1;let a=M(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=M(n.nextLocation.pathname,r)||n.nextLocation.pathname;return j(i.pathname,o)!=null||j(i.pathname,a)!=null}var zn=a({extend:{classGroups:{shadow:[`shadow-modal`]}}});function Bn(...e){return zn(i(e))}function Vn(e){return typeof e==`string`&&/^https?:\/\//i.test(e)}function Hn(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var Un=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Wn=i,Gn=(e,t)=>n=>{if(t?.variants==null)return Wn(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Un(t)||Un(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Wn(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function Kn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function qn(...e){return t=>{let n=!1,r=e.map(e=>{let r=Kn(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Kn(e[t],null)}}}}function Jn(...e){return S.useCallback(qn(...e),e)}function Yn(e){let t=S.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];ir(r)&&typeof cr==`function`&&(r=cr(r._payload)),S.Children.forEach(r,e=>{if(nr(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;ir(n)&&typeof cr==`function`&&(n=cr(n._payload)),a=$n(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=S.cloneElement(a,void 0,s):!o&&S.Children.count(r)===1&&S.isValidElement(r)&&(a=r);let c=a?tr(a):void 0,l=Jn(n,c);if(!a){if(r||r===0)throw Error(o?sr(e):or(e));return r}let u=er(i,a.props??{});return a.type!==S.Fragment&&(u.ref=n?l:c),S.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}var Xn=Yn(`Slot`),Zn=Symbol.for(`radix.slottable`);function Qn(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=Zn,t}var $n=(e,t)=>{if(`child`in e.props){let t=e.props.child;return S.isValidElement(t)?S.cloneElement(t,void 0,e.props.children(t.props.children)):null}return S.isValidElement(t)?t:null};function er(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function tr(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function nr(e){return S.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Zn}var rr=Symbol.for(`react.lazy`);function ir(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===rr&&`_payload`in e&&ar(e._payload)}function ar(e){return typeof e==`object`&&!!e&&`then`in e}var or=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,sr=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,cr=S.use,lr=n(),ur=Gn(`inline-flex shrink-0 items-center justify-center gap-[7px] rounded-md font-semibold whitespace-nowrap transition-[background-color,border-color,opacity,filter] outline-hidden focus-visible:ring-[3px] focus-visible:ring-ring/50 enabled:active:brightness-90 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{primary:`bg-action text-action-foreground pointer-hover:brightness-[0.96]`,contrast:`bg-contrast text-contrast-foreground pointer-hover:brightness-[0.96]`,outline:`border border-border bg-card text-foreground pointer-hover:bg-muted`,ghost:`text-muted-foreground pointer-hover:bg-muted pointer-hover:text-foreground`,"danger-ghost":`text-danger pointer-hover:bg-danger/10`},size:{default:`h-11 px-3.5 text-[13px]`,sm:`h-[30px] rounded-sm px-2.5 text-[13px]`,icon:`size-9`,"icon-sm":`size-[30px] rounded-sm`}},defaultVariants:{variant:`primary`,size:`default`}});function dr({className:e,variant:t=`primary`,size:n=`default`,asChild:r=!1,...i}){return(0,lr.jsx)(r?Xn:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:Bn(ur({variant:t,size:n,className:e})),...i})}export{d as A,H as C,kn as D,lt as E,p as F,s as I,o as L,h as M,b as N,c as O,u as P,V as S,rt as T,Pt as _,Qn as a,j as b,Gn as c,Vn as d,yn as f,Nt as g,Mt as h,Yn as i,m as j,_ as k,Hn as l,Sn as m,ur as n,qn as o,xn as p,Xn as r,Jn as s,dr as t,Bn as u,It as v,U as w,se as x,Lt as y};
@@ -1 +0,0 @@
1
- import{u as e}from"./button-DGwhwRuD.js";import{t}from"./react-runtime-CCIEwYL0.js";var n=t(),r={primary:`border-accent-strong/25 bg-accent-strong/15 text-link-foreground`,neutral:`border-border bg-card text-foreground shadow-xs`,danger:`border-danger/20 bg-danger/15 text-danger`};function i({icon:t,tone:i=`neutral`,title:a,subtitle:o,children:c,actions:l,backdrop:u=!1,heading:d=`h1`,className:f}){return(0,n.jsxs)(`div`,{"data-slot":`centered-state`,"data-tone":i,className:e(`relative isolate flex min-h-full flex-1 flex-col items-center justify-center px-6 py-12 text-center`,f),children:[u?(0,n.jsx)(s,{}):null,(0,n.jsxs)(`div`,{className:`flex w-full max-w-md flex-col items-center gap-4`,children:[(0,n.jsx)(`div`,{"data-slot":`centered-state-tile`,className:e(`flex size-[72px] items-center justify-center rounded-[18px] border [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-7`,r[i]),children:t}),(0,n.jsx)(d,{className:`text-2xl font-semibold text-balance text-foreground`,children:a}),o?(0,n.jsx)(`p`,{className:`text-sm text-pretty text-muted-foreground`,children:o}):null,c?(0,n.jsx)(`div`,{className:`w-full pt-2`,children:c}):null,l?(0,n.jsx)(`div`,{className:`flex items-center justify-center gap-3 pt-2`,children:l}):null]})]})}var a=[{top:`6%`,left:`14%`,size:2,tone:`accent`,opacity:.5},{top:`11%`,left:`31%`,size:3,tone:`accent`,opacity:.45},{top:`8%`,left:`52%`,size:2,tone:`pending`,opacity:.4},{top:`15%`,left:`71%`,size:2,tone:`accent`,opacity:.5},{top:`9%`,left:`86%`,size:3,tone:`primary`,opacity:.4},{top:`22%`,left:`8%`,size:2,tone:`pending`,opacity:.4},{top:`27%`,left:`24%`,size:2,tone:`primary`,opacity:.35},{top:`20%`,left:`44%`,size:3,tone:`accent`,opacity:.35},{top:`25%`,left:`62%`,size:2,tone:`accent`,opacity:.4},{top:`30%`,left:`79%`,size:2,tone:`primary`,opacity:.35},{top:`36%`,left:`12%`,size:3,tone:`accent`,opacity:.3},{top:`42%`,left:`35%`,size:2,tone:`pending`,opacity:.28},{top:`47%`,left:`58%`,size:2,tone:`primary`,opacity:.28},{top:`52%`,left:`88%`,size:2,tone:`accent`,opacity:.25},{top:`60%`,left:`29%`,size:3,tone:`accent`,opacity:.22}],o={accent:`bg-accent-strong`,primary:`bg-action`,pending:`bg-pending`};function s({className:t}){return(0,n.jsx)(`div`,{"data-slot":`twinkle-backdrop`,"aria-hidden":`true`,className:e(`pointer-events-none absolute inset-0 -z-10 overflow-hidden [mask-image:linear-gradient(to_bottom,black_25%,transparent_88%)]`,t),children:a.map((t,r)=>(0,n.jsx)(`span`,{className:e(`absolute rounded-[1px] motion-safe:animate-pulse`,t.size===3?`size-[3px]`:`size-0.5`,o[t.tone]),style:{top:t.top,left:t.left,opacity:t.opacity,animationDuration:`3.5s`,animationDelay:`${r%5*700}ms`}},r))})}export{s as n,i as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./button-DGwhwRuD.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./project-scope-context-DSlnqjT3.js";import{n as a}from"./use-desktop-CPzO9ufG.js";import{j as o,ot as s,r as c}from"./design-icons-B6-0w7Aw.js";import{n as l}from"./diff-controls-fOOHkbPK.js";import{u}from"./reference-chip-DeYsiLdM.js";import{t as d}from"./project-router-BVp1TVVP.js";import{t as f}from"./centered-state-B5QmAy2y.js";import{At as p}from"./index-FZIxXka9.js";import{t as m}from"./diff-CkqVFsT7.js";var h=e(n(),1),g=r();function _({commit:e,sha:n,backTo:r,backLabel:_,slot:v,className:y,diffClassName:b}){let x=a(),[S,C]=(0,h.useState)(`unified`),[w,T]=(0,h.useState)(!1),E=e.isError&&e.error instanceof i&&e.error.status===409,D=x?S:`unified`,O=!x||w;return(0,g.jsxs)(`section`,{"data-slot":v,"data-sha":n,className:y,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-b border-border px-4 py-2 md:px-6`,children:[(0,g.jsx)(t,{asChild:!0,variant:`ghost`,size:`sm`,"data-slot":`commit-back`,children:(0,g.jsxs)(d,{to:r,children:[(0,g.jsx)(c,{size:16,"aria-hidden":`true`}),_]})}),e.data?(0,g.jsx)(p,{stat:e.data.stat}):null,(0,g.jsx)(`span`,{className:`ml-auto hidden items-center gap-1 md:flex`,children:(0,g.jsx)(l,{mode:S,wrap:w,onModeChange:C,onWrapChange:T})})]}),e.isPending?(0,g.jsx)(`p`,{"data-slot":`commit-loading`,className:`px-4 py-6 text-center text-xs text-soft-foreground md:px-6`,children:`Loading commit…`}):e.isError?(0,g.jsx)(f,{icon:E?(0,g.jsx)(u,{}):(0,g.jsx)(s,{size:16}),tone:E?`neutral`:`danger`,heading:`h2`,title:E?`Commit not found`:`Could not load the commit`,subtitle:e.error.message}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{"data-slot":`commit-meta`,className:`border-b border-border px-4 py-3 md:px-6`,children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:e.data.subject}),(0,g.jsxs)(`p`,{className:`mt-0.5 text-[11px] text-soft-foreground`,children:[e.data.author,` · `,e.data.when,` ·`,` `,(0,g.jsx)(`span`,{className:`font-mono select-all`,children:e.data.sha})]})]}),e.data.files.length===0?(0,g.jsx)(f,{icon:(0,g.jsx)(o,{size:16}),tone:`neutral`,heading:`h2`,title:`No file changes`,subtitle:`This commit carries no diff of its own — a merge commit's changes live on the commits it merged.`}):(0,g.jsx)(`div`,{className:b,children:(0,g.jsx)(m,{files:e.data.files,mode:D,wrap:O,className:`min-w-0`})})]})]})}export{_ as t};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-QTnfLwEv.js";import{t as e,u as t}from"./button-DGwhwRuD.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{ft as i}from"./design-icons-B6-0w7Aw.js";import{a,i as o,n as s,o as c,r as l,s as u,t as d}from"./dist-CwBtGUlU.js";n();var f=r();function p({...e}){return(0,f.jsx)(d,{"data-slot":`dialog`,...e})}function m({...e}){return(0,f.jsx)(c,{"data-slot":`dialog-portal`,...e})}function h({className:e,...n}){return(0,f.jsx)(a,{"data-slot":`dialog-overlay`,className:t(`fixed inset-0 z-50 bg-black/50 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...n})}function g({className:e,children:n,showCloseButton:r=!0,overlayClassName:a,...o}){return(0,f.jsxs)(m,{"data-slot":`dialog-portal`,children:[(0,f.jsx)(h,{className:a}),(0,f.jsxs)(l,{"data-slot":`dialog-content`,className:t(`fixed inset-bs-[50%] start-[50%] z-50 grid max-h-[calc(100dvh-2rem)] overflow-y-auto overscroll-contain w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-card p-6 shadow-modal duration-200 outline-hidden motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...o,children:[n,r&&(0,f.jsxs)(s,{"data-slot":`dialog-close`,className:`absolute inset-bs-4 end-4 rounded-sm opacity-70 ring-offset-background transition-opacity pointer-hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,f.jsx)(i,{}),(0,f.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function _({className:e,...n}){return(0,f.jsx)(`div`,{"data-slot":`dialog-header`,className:t(`flex shrink-0 flex-col gap-2 text-center sm:text-start`,e),...n})}function v({className:e,...n}){return(0,f.jsx)(`div`,{"data-slot":`dialog-body`,className:t(`min-h-0 min-w-0 overflow-y-auto overscroll-contain`,e),...n})}function y({className:n,showCloseButton:r=!1,children:i,...a}){return(0,f.jsxs)(`div`,{"data-slot":`dialog-footer`,className:t(`flex shrink-0 flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n),...a,children:[i,r&&(0,f.jsx)(s,{asChild:!0,children:(0,f.jsx)(e,{variant:`outline`,children:`Close`})})]})}function b({className:e,...n}){return(0,f.jsx)(u,{"data-slot":`dialog-title`,className:t(`text-lg leading-none font-semibold`,e),...n})}function x({className:e,...n}){return(0,f.jsx)(o,{"data-slot":`dialog-description`,className:t(`text-sm text-muted-foreground`,e),...n})}export{y as a,x as i,v as n,_ as o,g as r,b as s,p as t};
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-Ch_cdfcV.js","assets/rolldown-runtime-QTnfLwEv.js","assets/button-DGwhwRuD.js","assets/react-runtime-CCIEwYL0.js","assets/bundle-mjs-BT31bpU6.js","assets/eye-B8okNWXU.js","assets/createLucideIcon-BHp8sXmF.js","assets/index-FZIxXka9.js","assets/live-refetch-CZb2VOyu.js","assets/project-scope-context-DSlnqjT3.js","assets/live-protocol-kUxhOnN1.js","assets/useInfiniteQuery-DBV7oz3w.js","assets/queries-B4jd0jVr.js","assets/useQuery-DqWzagrg.js","assets/ws-D6M4b5Tw.js","assets/toaster-CoMJoQvk.js","assets/cez-idle-DreV5r0B.js","assets/use-desktop-CPzO9ufG.js","assets/es2015-DTn4s5Lh.js","assets/dropdown-menu-CzUYjvx4.js","assets/design-icons-B6-0w7Aw.js","assets/attention-CvRtkmnP.js","assets/nav-row-styles-DSBuSnEE.js","assets/format-BNCkW110.js","assets/play-CmVAj_fu.js","assets/reference-chip-DeYsiLdM.js","assets/dist-CwBtGUlU.js","assets/dialog-tMSuX5a7.js","assets/prompt-template-menu-i7FXpDOj.js","assets/project-router-BVp1TVVP.js","assets/picker-pill-DN0WFWoS.js","assets/agent-accounts-0EKsrgdJ.js","assets/runner-facts-BpvNgJqf.js","assets/skills-pM_PouEs.js","assets/sortable.esm-zp_qkYGV.js","assets/centered-state-B5QmAy2y.js","assets/index-D6Jjh8b7.css","assets/image-preview-cn57tA1m.js","assets/zoomable-image-C7mEDZaS.js","assets/markdown-BBDDg-4t.js","assets/markdown-BldkAL5N.js","assets/chunk-BO2N2NFS-CM5F_Wdn.js","assets/lib-DrPFkMXk.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{u as t}from"./button-DGwhwRuD.js";import{i as n,t as r}from"./react-runtime-CCIEwYL0.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{At as a}from"./index-FZIxXka9.js";import{n as o,t as s}from"./image-preview-cn57tA1m.js";var c=e(n(),1),l=r();function u(e){let[n,r]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-Ch_cdfcV.js`).then(t=>{e||r({View:t.DiffView})},()=>{e||r(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):n===`failed`?(0,l.jsx)(d,{...e}):n===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:t(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(n.View,{...e})}function d({files:e,wrap:n=!1,imageSrc:r,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:t(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:n,imageSrc:r,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:n,imageSrc:r,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:r,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:t(`py-2 font-mono text-xs leading-[1.7]`,n?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
3
- `).map((e,n)=>(0,l.jsxs)(`span`,{className:t(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},n))})]})}export{u as t};
@@ -1 +0,0 @@
1
- import{t as e,u as t}from"./button-DGwhwRuD.js";import{t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,_ as i}from"./design-icons-B6-0w7Aw.js";import{t as a}from"./createLucideIcon-BHp8sXmF.js";import{t as o}from"./eye-B8okNWXU.js";var s=a(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),c=a(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),l=n();function u({mode:n,wrap:r,onModeChange:i,onWrapChange:a}){return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center gap-2`,children:[(0,l.jsx)(f,{current:n,value:`unified`,onModeChange:i}),(0,l.jsx)(f,{current:n,value:`split`,onModeChange:i})]}),(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":r,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:t(`size-11`,r&&`bg-muted text-foreground`),onClick:()=>a(!r),children:(0,l.jsx)(c,{"aria-hidden":`true`})})]})}function d({preview:n,onPreviewChange:r}){return(0,l.jsx)(e,{variant:`ghost`,size:`icon-sm`,"data-slot":`markdown-preview-toggle`,"aria-pressed":n,"aria-label":`Preview Markdown`,title:n?`Show Markdown as a diff`:`Preview Markdown`,className:t(`size-11`,n&&`bg-muted text-foreground`),onClick:()=>r(!n),children:(0,l.jsx)(o,{"aria-hidden":`true`})})}function f({current:e,value:n,onModeChange:r}){let a=e===n;return(0,l.jsxs)(`button`,{type:`button`,"data-mode":n,"aria-pressed":a,onClick:()=>r(n),className:t(`inline-flex items-center gap-2 min-h-11 rounded-lg border border-border bg-card px-3 text-xs font-medium capitalize`,a?`border-accent-text/40 text-accent-text`:`text-muted-foreground hover:text-foreground`),children:[n===`unified`?(0,l.jsx)(s,{"aria-hidden":`true`,className:`size-4`}):(0,l.jsx)(i,{size:16,"aria-hidden":`true`,className:`size-4`}),n]})}function p({branch:e}){return(0,l.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,l.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,l.jsx)(`span`,{className:`truncate`,children:e})]})}export{u as n,d as r,p as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,l as n,s as r,u as i}from"./button-DGwhwRuD.js";import{i as a,r as o,t as s}from"./react-runtime-CCIEwYL0.js";import{c,m as l,u}from"./design-icons-B6-0w7Aw.js";import{a as d,c as f,d as p,f as m,g as h,h as g,i as _,l as v,m as y,n as b,o as x,p as S,r as C,t as w,u as T}from"./es2015-DTn4s5Lh.js";var E=e(a(),1),D=s();function O(e){let n=e+`CollectionProvider`,[i,a]=y(n),[o,s]=i(n,{collectionRef:{current:null},itemMap:new Map}),c=e=>{let{scope:t,children:n}=e,r=E.useRef(null),i=E.useRef(new Map).current;return(0,D.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})};c.displayName=n;let l=e+`CollectionSlot`,u=t(l),d=E.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=r(t,s(l,n).collectionRef);return(0,D.jsx)(u,{ref:a,children:i})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=t(f),h=E.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=E.useRef(null),c=r(t,o),l=s(f,n);return E.useEffect(()=>(l.itemMap.set(o,{ref:o,...a}),()=>void l.itemMap.delete(o))),(0,D.jsx)(m,{[p]:``,ref:c,children:i})});h.displayName=f;function g(t){let n=s(e+`CollectionConsumer`,t);return E.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:c,Slot:d,ItemSlot:h},g,a]}var k=E.createContext(void 0);function A(e){let t=E.useContext(k);return e||t||`ltr`}var j=e(o(),1);function M(e){let[t,n]=E.useState(void 0);return m(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var N=[`top`,`right`,`bottom`,`left`],P=Math.min,F=Math.max,I=Math.round,L=Math.floor,R=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function z(e,t,n){return F(e,P(t,n))}function B(e,t){return typeof e==`function`?e(t):e}function V(e){return e.split(`-`)[0]}function H(e){return e.split(`-`)[1]}function te(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function U(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return te(U(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=H(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=H(e),a=de(V(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=V(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function _e(e,t,n){let{reference:r,floating:i}=e,a=U(t),o=re(t),s=ne(o),c=V(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=H(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=B(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ge(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ye&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=B(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=P(d[_],T),D=P(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=z(E,k,O),j=!c.arrow&&H(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Se=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=B(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=V(r),_=U(o),v=V(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=ie(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==U(t))||T.every(e=>U(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=U(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return N.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=B(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=V(n),s=H(n),c=U(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=B(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Oe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await De(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},ke=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=B(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=U(i),p=te(f),m=u[p],h=u[f],g=(e,t)=>z(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ae=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=B(e,t),u={x:n,y:r},d=U(i),f=te(d),p=u[f],m=u[d],h=B(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ee.has(V(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},je=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=B(e,t),c=await i.detectOverflow(t,s),l=V(n),u=H(n),d=U(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=P(p-c[m],g),y=P(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*F(c.left,c.right):S=p-2*F(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function W(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof W(e).Node:!1}function K(e){return Me()?e instanceof Element||e instanceof W(e).Element:!1}function q(e){return Me()?e instanceof HTMLElement||e instanceof W(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof W(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,J=e=>!!e&&e!==`none`,Ve;function He(e){let t=K(e)?Y(e):e;return J(t.transform)||J(t.translate)||J(t.scale)||J(t.rotate)||J(t.perspective)||!We()&&(J(t.backdropFilter)||J(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=qe(e);for(;q(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=qe(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function Y(e){return W(e).getComputedStyle(e)}function Ke(e){return K(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||G(e);return Fe(t)?t.host:t}function Je(e){let t=qe(e);return Ge(t)?(e.ownerDocument||e).body:q(t)&&Ie(t)?t:Je(t)}function Ye(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Je(e),i=r===e.ownerDocument?.body,a=W(r);if(i){let e=Xe(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Ye(e):[])}else return t.concat(r,Ye(r,[],n))}function Xe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ze(e){let t=Y(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=q(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=I(n)!==a||I(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Qe(e){return K(e)?e:e.contextElement}function $e(e){let t=Qe(e);if(!q(t))return R(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Ze(t),o=(a?I(n.width):n.width)/r,s=(a?I(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var et=R(0);function tt(e){let t=W(e);return!We()||!t.visualViewport?et:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===W(e)}function rt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Qe(e),o=R(1);t&&(r?K(r)&&(o=$e(r)):o=$e(e));let s=nt(a,n,r)?tt(a):R(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=W(a),t=K(r)?W(r):r,n=e,i=Xe(n);for(;i&&t!==n;){let e=$e(i),t=i.getBoundingClientRect(),r=Y(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=W(i),i=Xe(n)}}return ge({width:u,height:d,x:c,y:l})}function it(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:rt(G(e)).left+n}function at(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-it(e,n),y:n.top+t.scrollTop}}function ot(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=G(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=R(1),u=R(0),d=q(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=rt(r);l=$e(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?at(o,c):R(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function st(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ct(e){let t=Ke(e),n=e.ownerDocument.body,r=F(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=F(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+it(e),o=-t.scrollTop;return Y(n).direction===`rtl`&&(a+=F(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var lt=25;function ut(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=W(e),a=G(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!We()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(it(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=lt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function dt(e,t){let n=rt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=$e(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ft(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ut(e,n,t);else if(t===`document`)r=ct(G(e));else if(K(t))r=dt(t,n);else{let n=tt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function pt(e,t){let n=t.get(e);if(n)return n;let r=Ye(e,[],!1).filter(e=>K(e)&&Ne(e)!==`body`),i=null,a=Y(e).position===`fixed`,o=a?qe(e):e;for(;K(o)&&!Ge(o);){let e=Y(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=qe(o)}return t.set(e,r),r}function mt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:pt(t,this._c):[].concat(n),r],o=ft(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ft(t,a[e],i);s=F(n.top,s),c=P(n.right,c),l=P(n.bottom,l),u=F(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ht(e){let{width:t,height:n}=Ze(e);return{width:t,height:n}}function gt(e,t,n){let r=q(t),i=G(t),a=n===`fixed`,o=rt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=R(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=rt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=it(i));let l=i&&!r&&!a?at(i,s):R(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function _t(e){return Y(e).position===`static`}function vt(e,t){if(!q(e)||Y(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function yt(e,t){let n=W(e);if(Re(e))return n;if(!q(e)){let t=qe(e);for(;t&&!Ge(t);){if(K(t)&&!_t(t))return t;t=qe(t)}return n}let r=vt(e,t);for(;r&&Le(r)&&_t(r);)r=vt(r,t);return r&&Ge(r)&&_t(r)&&!He(r)?n:r||Ue(e)||n}var bt=async function(e){let t=this.getOffsetParent||yt,n=this.getDimensions,r=await n(e.floating);return{reference:gt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xt(e){return Y(e).direction===`rtl`}var St={convertOffsetParentRelativeRectToViewportRelativeRect:ot,getDocumentElement:G,getClippingRect:mt,getOffsetParent:yt,getElementRects:bt,getClientRects:st,getDimensions:ht,getScale:$e,isElement:K,isRTL:xt};function Ct(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function wt(e,t,n){let r=null,i,a=G(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=L(d),h=L(a.clientWidth-(u+f)),g=L(a.clientHeight-(d+p)),_=L(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:F(0,P(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ct(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=W(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Tt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Qe(e),u=i||a?[...l?Ye(l):[],...t?Ye(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?wt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?rt(e):null;c&&g();function g(){let t=rt(e);h&&!Ct(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Et=Oe,Dt=ke,Ot=Se,kt=je,At=Te,jt=xe,Mt=Ae,Nt=(e,t,n)=>{let r=new Map,i=n??{},a={...St,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Pt=typeof document<`u`?E.useLayoutEffect:function(){};function Ft(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Ft(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ft(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function It(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lt(e,t){let n=It(e);return Math.round(t*n)/n}function Rt(e){let t=E.useRef(e);return Pt(()=>{t.current=e}),t}function zt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=E.useState(r);Ft(f,r)||p(r);let[m,h]=E.useState(null),[g,_]=E.useState(null),v=E.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=E.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=E.useRef(null),C=E.useRef(null),w=E.useRef(u),T=c!=null,D=Rt(c),O=Rt(i),k=Rt(l),A=E.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Nt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};M.current&&!Ft(w.current,t)&&(w.current=t,j.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Pt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=E.useRef(!1);Pt(()=>(M.current=!0,()=>{M.current=!1}),[]),Pt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,A);A()}},[b,x,A,D,T]);let N=E.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=E.useMemo(()=>({reference:b,floating:x}),[b,x]),F=E.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Lt(P.floating,u.x),r=Lt(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...It(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:A,refs:N,elements:P,floatingStyles:F}),[u,A,N,P,F])}var Bt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:jt({element:r.current,padding:i}).fn(n):r?jt({element:r,padding:i}).fn(n):{}}}},Vt=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ht=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>({fn:Mt(e).fn,options:[e,t]}),Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=kt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=(e,t)=>{let n=At(e);return{name:n.name,fn:n.fn,options:[e,t]}},qt=(e,t)=>{let n=Bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jt=`Arrow`,Yt=E.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,D.jsx)(g.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,D.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Yt.displayName=Jt;var Xt=Yt,Zt=`Popper`,[Qt,$t]=y(Zt),[en,tn]=Qt(Zt),nn=e=>{let{__scopePopper:t,children:n}=e,[r,i]=E.useState(null),[a,o]=E.useState(void 0);return(0,D.jsx)(en,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};nn.displayName=Zt;var rn=`PopperAnchor`,an=E.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:i,...a}=e,o=tn(rn,n),s=E.useRef(null),c=o.onAnchorChange,l=r(t,E.useCallback(e=>{s.current=e,e&&c(e)},[c])),u=E.useRef(null);E.useEffect(()=>{if(!i)return;let e=u.current;u.current=i.current,e!==u.current&&c(u.current)});let d=o.placementState&&hn(o.placementState),f=d?.[0],p=d?.[1];return i?null:(0,D.jsx)(g.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...a,ref:l})});an.displayName=rn;var on=`PopperContent`,[sn,cn]=Qt(on),ln=E.forwardRef((e,t)=>{let{__scopePopper:n,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,arrowPadding:c=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:p=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:_=`optimized`,onPlaced:v,...y}=e,b=tn(on,n),[x,S]=E.useState(null),C=r(t,S),[w,T]=E.useState(null),O=M(w),k=O?.width??0,A=O?.height??0,j=i+(o===`center`?``:`-`+o),N=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],F=P.length>0,I={padding:N,boundary:P.filter(pn),altBoundary:F},{refs:L,floatingStyles:R,placement:ee,isPositioned:z,middlewareData:B}=zt({strategy:`fixed`,placement:j,whileElementsMounted:(...e)=>Tt(...e,{animationFrame:_===`always`}),elements:{reference:b.anchor},middleware:[Vt({mainAxis:a+A,alignmentAxis:s}),l&&Ht({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?Ut():void 0,...I}),l&&Wt({...I}),Gt({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),w&&qt({element:w,padding:c}),mn({arrowWidth:k,arrowHeight:A}),h&&Kt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),V=b.setPlacementState;m(()=>(V(ee),()=>{V(void 0)}),[ee,V]);let[H,te]=hn(ee),ne=f(v);m(()=>{z&&ne?.()},[z,ne]);let U=B.arrow?.x,re=B.arrow?.y,ie=B.arrow?.centerOffset!==0,[ae,oe]=E.useState();return m(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),(0,D.jsx)(`div`,{ref:L.setFloating,"data-radix-popper-content-wrapper":``,style:{...R,transform:z?R.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ae,"--radix-popper-transform-origin":[B.transformOrigin?.x,B.transformOrigin?.y].join(` `),...B.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,D.jsx)(sn,{scope:n,placedSide:H,placedAlign:te,onArrowChange:T,arrowX:U,arrowY:re,shouldHideArrow:ie,children:(0,D.jsx)(g.div,{"data-side":H,"data-align":te,...y,ref:C,style:{...y.style,animation:z?void 0:`none`}})})})});ln.displayName=on;var un=`PopperArrow`,dn={top:`bottom`,right:`left`,bottom:`top`,left:`right`},fn=E.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=cn(un,n),a=dn[i.placedSide];return(0,D.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,D.jsx)(Xt,{...r,ref:t,style:{...r.style,display:`block`}})})});fn.displayName=un;function pn(e){return e!==null}var mn=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=hn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function hn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var gn=nn,_n=an,vn=ln,yn=fn,bn=!1;function xn(){let[e,t]=E.useState(bn);return E.useEffect(()=>{bn||(bn=!0,t(!0))},[]),e}var Sn=E.useSyncExternalStore;function Cn(){return()=>{}}function wn(){return Sn(Cn,()=>!0,()=>!1)}var Tn=typeof Sn==`function`?wn:xn,En=`rovingFocusGroup.onEntryFocus`,Dn={bubbles:!1,cancelable:!0},On=`RovingFocusGroup`,[kn,An,jn]=O(On),[Mn,Nn]=y(On,[jn]),[Pn,Fn]=Mn(On),In=E.forwardRef((e,t)=>(0,D.jsx)(kn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(kn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Ln,{...e,ref:t})})}));In.displayName=On;var Ln=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...m}=e,h=E.useRef(null),_=r(t,h),v=A(o),[y,b]=p({prop:s,defaultProp:c??null,onChange:l,caller:On}),[x,C]=E.useState(!1),w=f(u),T=An(n),O=E.useRef(!1),[k,j]=E.useState(0);return E.useEffect(()=>{let e=h.current;if(e)return e.addEventListener(En,w),()=>e.removeEventListener(En,w)},[w]),(0,D.jsx)(Pn,{scope:n,orientation:i,dir:v,loop:a,currentTabStopId:y,onItemFocus:E.useCallback(e=>b(e),[b]),onItemShiftTab:E.useCallback(()=>C(!0),[]),onFocusableItemAdd:E.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:E.useCallback(()=>j(e=>e-1),[]),children:(0,D.jsx)(g.div,{tabIndex:x||k===0?-1:0,"data-orientation":i,...m,ref:_,style:{outline:`none`,...e.style},onMouseDown:S(e.onMouseDown,()=>{O.current=!0}),onFocus:S(e.onFocus,e=>{let t=!O.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(En,Dn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>e.focusable);Un([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),d)}}O.current=!1}),onBlur:S(e.onBlur,()=>C(!1))})})}),Rn=`RovingFocusGroupItem`,zn=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=v(),l=a||c,u=Fn(Rn,n),d=u.currentTabStopId===l,f=An(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:_}=u,y=Tn();return m(()=>{if(!(!y||!r))return p(),()=>h()},[y,r,p,h]),E.useEffect(()=>{if(!(y||!r))return p(),()=>h()},[y,r,p,h]),(0,D.jsx)(kn.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,D.jsx)(g.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:S(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:S(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:S(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Hn(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Wn(n,r+1):n.slice(r+1)}setTimeout(()=>Un(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:_!=null}):o})})});zn.displayName=Rn;var Bn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Vn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Hn(e,t,n){let r=Vn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Bn[r]}function Un(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Wn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Gn=In,Kn=zn,qn=[`Enter`,` `],Jn=[`ArrowDown`,`PageUp`,`Home`],Yn=[`ArrowUp`,`PageDown`,`End`],Xn=[...Jn,...Yn],Zn={ltr:[...qn,`ArrowRight`],rtl:[...qn,`ArrowLeft`]},Qn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},$n=`Menu`,[er,tr,nr]=O($n),[X,rr]=y($n,[nr,$t,Nn]),ir=$t(),ar=Nn(),[or,Z]=X($n),[sr,cr]=X($n),lr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ir(t),[c,l]=E.useState(null),u=E.useRef(!1),d=f(a),p=A(i);return E.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),E.useEffect(()=>{if(!n)return;let e=()=>d(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,D.jsx)(gn,{...s,children:(0,D.jsx)(or,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,D.jsx)(sr,{scope:t,onClose:E.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:o,children:r})})})};lr.displayName=$n;var ur=`MenuAnchor`,dr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ir(n);return(0,D.jsx)(_n,{...i,...r,ref:t})});dr.displayName=ur;var fr=`MenuPortal`,[pr,mr]=X(fr,{forceMount:void 0}),hr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Z(fr,t);return(0,D.jsx)(pr,{scope:t,forceMount:n,children:(0,D.jsx)(T,{present:n||a.open,children:(0,D.jsx)(_,{asChild:!0,container:i,children:r})})})};hr.displayName=fr;var Q=`MenuContent`,[gr,_r]=X(Q),vr=E.forwardRef((e,t)=>{let n=mr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=cr(Q,e.__scopeMenu);return(0,D.jsx)(er.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(T,{present:r||a.open,children:(0,D.jsx)(er.Slot,{scope:e.__scopeMenu,children:o.modal?(0,D.jsx)(yr,{...i,ref:t}):(0,D.jsx)(br,{...i,ref:t})})})})}),yr=E.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),i=E.useRef(null),a=r(t,i);return E.useEffect(()=>{let e=i.current;if(e)return w(e)},[]),(0,D.jsx)(Sr,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:S(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),br=E.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,D.jsx)(Sr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),xr=t(`MenuContent.ScrollLock`),Sr=E.forwardRef((e,t)=>{let{__scopeMenu:n,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:c,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=Z(Q,n),y=cr(Q,n),w=ir(n),T=ar(n),O=tr(n),[k,A]=E.useState(null),j=E.useRef(null),M=r(t,j,v.onContentChange),N=E.useRef(0),P=E.useRef(``),F=E.useRef(0),I=E.useRef(null),L=E.useRef(`right`),R=E.useRef(0),ee=g?b:E.Fragment,z=g?{as:xr,allowPinchZoom:!0}:void 0,B=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=oi(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};E.useEffect(()=>()=>window.clearTimeout(N.current),[]),C();let V=E.useCallback(e=>L.current===I.current?.side&&ci(e,I.current?.area),[]);return(0,D.jsx)(gr,{scope:n,searchRef:P,onItemEnter:E.useCallback(e=>{V(e)&&e.preventDefault()},[V]),onItemLeave:E.useCallback(e=>{V(e)||(j.current?.focus(),A(null))},[V]),onTriggerLeave:E.useCallback(e=>{V(e)&&e.preventDefault()},[V]),pointerGraceTimerRef:F,onPointerGraceIntentChange:E.useCallback(e=>{I.current=e},[]),children:(0,D.jsx)(ee,{...z,children:(0,D.jsx)(d,{asChild:!0,trapped:a,onMountAutoFocus:S(o,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:(0,D.jsx)(x,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,D.jsx)(Gn,{asChild:!0,...T,dir:y.dir,orientation:`vertical`,loop:i,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:S(l,e=>{y.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,D.jsx)(vn,{role:`menu`,"aria-orientation":`vertical`,"data-state":ti(v.open),"data-radix-menu-content":``,dir:y.dir,...w,..._,ref:M,style:{outline:`none`,..._.style},onKeyDown:S(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&B(e.key));let i=j.current;if(e.target!==i||!Xn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);Yn.includes(e.key)&&a.reverse(),ii(a)}),onBlur:S(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:S(e.onPointerMove,li(e=>{let t=e.target,n=R.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>R.current?`right`:`left`;L.current=t,R.current=e.clientX}}))})})})})})})});vr.displayName=Q;var Cr=`MenuGroup`,wr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(g.div,{role:`group`,...r,ref:t})});wr.displayName=Cr;var Tr=`MenuLabel`,Er=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(g.div,{...r,ref:t})});Er.displayName=Tr;var Dr=`MenuItem`,Or=`menu.itemSelect`,kr=E.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:i,...a}=e,o=E.useRef(null),s=cr(Dr,e.__scopeMenu),c=_r(Dr,e.__scopeMenu),l=r(t,o),u=E.useRef(!1),d=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(Or,{bubbles:!0,cancelable:!0});e.addEventListener(Or,e=>i?.(e),{once:!0}),h(e,t),t.defaultPrevented?u.current=!1:s.onClose()}};return(0,D.jsx)(Ar,{...a,ref:l,disabled:n,onClick:S(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),u.current=!0},onPointerUp:S(e.onPointerUp,e=>{u.current||e.currentTarget?.click()}),onKeyDown:S(e.onKeyDown,e=>{n||e.target!==e.currentTarget||c.searchRef.current!==``&&e.key===` `||qn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});kr.displayName=Dr;var Ar=E.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:i=!1,textValue:a,...o}=e,s=_r(Dr,n),c=ar(n),l=E.useRef(null),u=r(t,l),[d,f]=E.useState(!1),[p,m]=E.useState(``);return E.useEffect(()=>{let e=l.current;e&&m((e.textContent??``).trim())},[o.children]),(0,D.jsx)(er.ItemSlot,{scope:n,disabled:i,textValue:a??p,children:(0,D.jsx)(Kn,{asChild:!0,...c,focusable:!i,children:(0,D.jsx)(g.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:u,onPointerMove:S(e.onPointerMove,li(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:S(e.onPointerLeave,li(e=>s.onItemLeave(e))),onFocus:S(e.onFocus,()=>f(!0)),onBlur:S(e.onBlur,()=>f(!1))})})})}),jr=`MenuCheckboxItem`,Mr=E.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,D.jsx)(Br,{scope:e.__scopeMenu,checked:n,children:(0,D.jsx)(kr,{role:`menuitemcheckbox`,"aria-checked":ni(n)?`mixed`:n,...i,ref:t,"data-state":ri(n),onSelect:S(i.onSelect,()=>r?.(ni(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Mr.displayName=jr;var Nr=`MenuRadioGroup`,[Pr,Fr]=X(Nr,{value:void 0,onValueChange:()=>{}}),Ir=E.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=f(r);return(0,D.jsx)(Pr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,D.jsx)(wr,{...i,ref:t})})});Ir.displayName=Nr;var Lr=`MenuRadioItem`,Rr=E.forwardRef((e,t)=>{let{value:n,...r}=e,i=Fr(Lr,e.__scopeMenu),a=n===i.value;return(0,D.jsx)(Br,{scope:e.__scopeMenu,checked:a,children:(0,D.jsx)(kr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ri(a),onSelect:S(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Rr.displayName=Lr;var zr=`MenuItemIndicator`,[Br,Vr]=X(zr,{checked:!1}),Hr=E.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Vr(zr,n);return(0,D.jsx)(T,{present:r||ni(a.checked)||a.checked===!0,children:(0,D.jsx)(g.span,{...i,ref:t,"data-state":ri(a.checked)})})});Hr.displayName=zr;var Ur=`MenuSeparator`,Wr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,D.jsx)(g.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuArrow`,Kr=E.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ir(n);return(0,D.jsx)(yn,{...i,...r,ref:t})});Kr.displayName=Gr;var qr=`MenuSub`,[Jr,Yr]=X(qr),Xr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(qr,t),o=ir(t),[s,c]=E.useState(null),[l,u]=E.useState(null),d=f(i);return E.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,D.jsx)(gn,{...o,children:(0,D.jsx)(or,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,D.jsx)(Jr,{scope:t,contentId:v(),triggerId:v(),trigger:s,onTriggerChange:c,children:n})})})};Xr.displayName=qr;var Zr=`MenuSubTrigger`,Qr=E.forwardRef((e,t)=>{let n=Z(Zr,e.__scopeMenu),i=cr(Zr,e.__scopeMenu),a=Yr(Zr,e.__scopeMenu),o=_r(Zr,e.__scopeMenu),s=E.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=E.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);E.useEffect(()=>d,[d]),E.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=r(t,a.onTriggerChange);return(0,D.jsx)(dr,{asChild:!0,...u,children:(0,D.jsx)(Ar,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":ti(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:S(e.onPointerMove,li(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:S(e.onPointerLeave,li(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:S(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||Zn[i.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Qr.displayName=Zr;var $r=`MenuSubContent`,ei=E.forwardRef((e,t)=>{let n=mr(Q,e.__scopeMenu),{forceMount:i=n.forceMount,align:a=`start`,...o}=e,s=Z(Q,e.__scopeMenu),c=cr(Q,e.__scopeMenu),l=Yr($r,e.__scopeMenu),u=E.useRef(null),d=r(t,u);return(0,D.jsx)(er.Provider,{scope:e.__scopeMenu,children:(0,D.jsx)(T,{present:i||s.open,children:(0,D.jsx)(er.Slot,{scope:e.__scopeMenu,children:(0,D.jsx)(Sr,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:a,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:S(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:S(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:S(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Qn[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});ei.displayName=$r;function ti(e){return e?`open`:`closed`}function ni(e){return e===`indeterminate`}function ri(e){return ni(e)?`indeterminate`:e?`checked`:`unchecked`}function ii(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ai(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function oi(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ai(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function si(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function ci(e,t){return t?si({x:e.clientX,y:e.clientY},t):!1}function li(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ui=lr,di=dr,fi=hr,pi=vr,mi=wr,hi=Er,gi=kr,_i=Mr,vi=Ir,yi=Rr,bi=Hr,xi=Wr,Si=Kr,Ci=Xr,wi=Qr,Ti=ei,Ei=`DropdownMenu`,[Di,Oi]=y(Ei,[rr]),$=rr(),[ki,Ai]=Di(Ei),ji=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=$(t),l=E.useRef(null),[u,d]=p({prop:i,defaultProp:a??!1,onChange:o,caller:Ei});return(0,D.jsx)(ki,{scope:t,triggerId:v(),triggerRef:l,contentId:v(),open:u,onOpenChange:d,onOpenToggle:E.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,D.jsx)(ui,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};ji.displayName=Ei;var Mi=`DropdownMenuTrigger`,Ni=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:i=!1,...a}=e,o=Ai(Mi,n),s=$(n),c=r(t,o.triggerRef);return(0,D.jsx)(di,{asChild:!0,...s,children:(0,D.jsx)(g.button,{type:`button`,id:o.triggerId,"aria-haspopup":`menu`,"aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?`open`:`closed`,"data-disabled":i?``:void 0,disabled:i,...a,ref:c,onPointerDown:S(e.onPointerDown,e=>{!i&&e.button===0&&e.ctrlKey===!1&&(o.onOpenToggle(),o.open||e.preventDefault())}),onKeyDown:S(e.onKeyDown,e=>{i||([`Enter`,` `].includes(e.key)&&o.onOpenToggle(),e.key===`ArrowDown`&&o.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ni.displayName=Mi;var Pi=`DropdownMenuPortal`,Fi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,D.jsx)(fi,{...r,...n})};Fi.displayName=Pi;var Ii=`DropdownMenuContent`,Li=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ai(Ii,n),a=$(n),o=E.useRef(!1);return(0,D.jsx)(pi,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:S(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:S(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Li.displayName=Ii;var Ri=`DropdownMenuGroup`,zi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(mi,{...i,...r,ref:t})});zi.displayName=Ri;var Bi=`DropdownMenuLabel`,Vi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(hi,{...i,...r,ref:t})});Vi.displayName=Bi;var Hi=`DropdownMenuItem`,Ui=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(gi,{...i,...r,ref:t})});Ui.displayName=Hi;var Wi=`DropdownMenuCheckboxItem`,Gi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(_i,{...i,...r,ref:t})});Gi.displayName=Wi;var Ki=`DropdownMenuRadioGroup`,qi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(vi,{...i,...r,ref:t})});qi.displayName=Ki;var Ji=`DropdownMenuRadioItem`,Yi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(yi,{...i,...r,ref:t})});Yi.displayName=Ji;var Xi=`DropdownMenuItemIndicator`,Zi=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(bi,{...i,...r,ref:t})});Zi.displayName=Xi;var Qi=`DropdownMenuSeparator`,$i=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(xi,{...i,...r,ref:t})});$i.displayName=Qi;var ea=`DropdownMenuArrow`,ta=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(Si,{...i,...r,ref:t})});ta.displayName=ea;var na=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=$(t),[s,c]=p({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,D.jsx)(Ci,{...o,open:s,onOpenChange:c,children:n})},ra=`DropdownMenuSubTrigger`,ia=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(wi,{...i,...r,ref:t})});ia.displayName=ra;var aa=`DropdownMenuSubContent`,oa=E.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,D.jsx)(Ti,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});oa.displayName=aa;var sa=ji,ca=Ni,la=Fi,ua=Li,da=Vi,fa=Ui,pa=Gi,ma=qi,ha=Yi,ga=Zi,_a=$i,va=na,ya=ia,ba=oa;function xa({...e}){return(0,D.jsx)(sa,{"data-slot":`dropdown-menu`,...e})}function Sa({...e}){return(0,D.jsx)(la,{"data-slot":`dropdown-menu-portal`,...e})}function Ca({...e}){return(0,D.jsx)(ca,{"data-slot":`dropdown-menu-trigger`,...e})}function wa({className:e,sideOffset:t=4,...n}){return(0,D.jsx)(la,{children:(0,D.jsx)(ua,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:i(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...n})})}function Ta({className:e,inset:t,variant:n=`default`,...r}){return(0,D.jsx)(fa,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:i(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Ea({className:e,children:t,checked:r,...a}){return(0,D.jsxs)(pa,{"data-slot":`dropdown-menu-checkbox-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n({checked:r}),...a,children:[(0,D.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(ga,{children:(0,D.jsx)(c,{className:`size-4`})})}),t]})}function Da({...e}){return(0,D.jsx)(ma,{"data-slot":`dropdown-menu-radio-group`,...e})}function Oa({className:e,children:t,...n}){return(0,D.jsxs)(ha,{"data-slot":`dropdown-menu-radio-item`,className:i(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pe-2 ps-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,D.jsx)(`span`,{className:`pointer-events-none absolute start-2 flex size-3.5 items-center justify-center`,children:(0,D.jsx)(ga,{children:(0,D.jsx)(l,{className:`size-2 fill-current`})})}),t]})}function ka({className:e,inset:t,...n}){return(0,D.jsx)(da,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:i(`px-2 py-1.5 text-sm font-medium data-[inset]:ps-8`,e),...n})}function Aa({className:e,...t}){return(0,D.jsx)(_a,{"data-slot":`dropdown-menu-separator`,className:i(`-mx-1 my-1 h-px bg-border`,e),...t})}function ja({...e}){return(0,D.jsx)(va,{"data-slot":`dropdown-menu-sub`,...e})}function Ma({className:e,inset:t,children:n,...r}){return(0,D.jsxs)(ya,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:i(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:ps-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,D.jsx)(u,{className:`ms-auto size-4`})]})}function Na({className:e,...t}){return(0,D.jsx)(ba,{"data-slot":`dropdown-menu-sub-content`,className:i(`z-50 min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md motion-safe:data-[side=bottom]:slide-in-from-top-2 motion-safe:data-[side=left]:slide-in-from-right-2 motion-safe:data-[side=right]:slide-in-from-left-2 motion-safe:data-[side=top]:slide-in-from-bottom-2 motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 motion-safe:data-[state=closed]:zoom-out-95 motion-safe:data-[state=open]:animate-in data-[state=open]:fade-in-0 motion-safe:data-[state=open]:zoom-in-95`,e),...t})}export{A as C,M as S,_n as _,ka as a,gn as b,Oa as c,Na as d,Ma as f,Nn as g,Gn as h,Ta as i,Aa as l,Kn as m,Ea as n,Sa as o,Ca as p,wa as r,Da as s,xa as t,ja as u,yn as v,O as w,$t as x,vn as y};
@@ -1,41 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,s as n}from"./button-DGwhwRuD.js";import{i as r,r as i,t as a}from"./react-runtime-CCIEwYL0.js";var o=e(r(),1),s=e(i(),1),c=a(),l=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,n)=>{let r=t(`Primitive.${n}`),i=o.forwardRef((e,t)=>{let{asChild:i,...a}=e,o=i?r:n;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:t})});return i.displayName=`Primitive.${n}`,{...e,[n]:i}},{});function u(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}function d(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,l=n?.[e]?.[a]||i,u=o.useMemo(()=>s,Object.values(s));return(0,c.jsx)(l.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function l(n,s,c={}){let{optional:l=!1}=c,u=s?.[e]?.[a]||i,d=o.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,l]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,f(i,...t)]}function f(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function p(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}var m=globalThis?.document?o.useLayoutEffect:()=>{},h=o.useInsertionEffect||m;function g({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=_({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=v(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function _({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return h(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function v(e){return typeof e==`function`}function y(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var b=e=>{let{present:t,children:n}=e,r=x(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),a=C(r.ref,ee(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:a}):null};b.displayName=`Presence`;function x(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),s=o.useRef(void 0),[c,l]=y(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{c===`mounted`?(a.current=s.current??w(r.current),s.current=void 0):a.current=`none`},[c]),m(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=w(t);e?(s.current=o,l(`MOUNT`)):o===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),m(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=w(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=w(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:o.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,s.current=w(t)}else r.current=null;n(e)},[])}}function S(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function C(...e){let t=o.useRef(e);return t.current=e,o.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=S(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():S(n[e],null)}}},[])}function w(e){return e?.animationName||`none`}function ee(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var T=o.useId||(()=>void 0),E=0;function te(e){let[t,n]=o.useState(T());return m(()=>{e||n(e=>e??String(E++))},[e]),e||(t?`radix-${t}`:``)}function D(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>((...e)=>t.current?.(...e)),[])}var ne=`DismissableLayer`,O=`dismissableLayer.update`,k=`dismissableLayer.pointerDownOutside`,A=`dismissableLayer.focusOutside`,re,j=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ie=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...m}=e,h=o.useContext(j),[g,_]=o.useState(null),v=g?.ownerDocument??globalThis?.document,[,y]=o.useState({}),b=n(t,_),x=Array.from(h.layers),[S]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),C=S?x.indexOf(S):-1,w=g?x.indexOf(g):-1,ee=h.layersWithOutsidePointerEventsDisabled.size>0,T=w>=C,E=o.useRef(!1),te=le(e=>{s?.(e),d?.(e),e.defaultPrevented||f?.()},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:E,dismissableSurfaces:h.dismissableSurfaces,shouldHandlePointerDownOutside:o.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...h.branches].some(t=>t.contains(e));return T&&!t},[h.branches,T])}),ne=ue(e=>{if(i&&E.current)return;let t=e.target;[...h.branches].some(e=>e.contains(t))||(u?.(e),d?.(e),e.defaultPrevented||f?.())},v),k=g?w===x.length-1:!1,A=D(e=>{e.key===`Escape`&&(a?.(e),!e.defaultPrevented&&f&&(e.preventDefault(),f()))});return o.useEffect(()=>{if(k)return v.addEventListener(`keydown`,A,{capture:!0}),()=>v.removeEventListener(`keydown`,A,{capture:!0})},[v,k,A]),o.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(re=v.body.style.pointerEvents,v.body.style.pointerEvents=`none`),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),de(),()=>{r&&(h.layersWithOutsidePointerEventsDisabled.delete(g),h.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=re))}},[g,v,r,h]),o.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),de())},[g,h]),o.useEffect(()=>{let e=()=>y({});return document.addEventListener(O,e),()=>document.removeEventListener(O,e)},[]),(0,c.jsx)(l.div,{...m,ref:b,style:{pointerEvents:ee?T?`auto`:`none`:void 0,...e.style},onFocusCapture:p(e.onFocusCapture,ne.onFocusCapture),onBlurCapture:p(e.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:p(e.onPointerDownCapture,te.onPointerDownCapture)})});ie.displayName=ne;var ae=`DismissableLayerBranch`,oe=o.forwardRef((e,t)=>{let r=o.useContext(j),i=o.useRef(null),a=n(t,i);return o.useEffect(()=>{let e=i.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,c.jsx)(l.div,{...e,ref:a})});oe.displayName=ae;function se(){let e=o.useContext(j),[t,n]=o.useState(null);return o.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var ce=()=>!0;function le(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:s=ce}=t,c=D(e),l=o.useRef(!1),u=o.useRef(!1),d=o.useRef(new Map),f=o.useRef(()=>{});return o.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function o(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let o=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||fe(k,c,p,{discrete:!0})};if(!s(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?o():(n.removeEventListener(`click`,f.current),f.current=o,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,o,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,o,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,s]),{onPointerDownCapture:()=>l.current=!0}}function ue(e,t=globalThis?.document){let n=D(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&fe(A,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){let e=new CustomEvent(O);document.dispatchEvent(e)}function fe(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?u(i,a):i.dispatchEvent(a)}var M=`focusScope.autoFocusOnMount`,N=`focusScope.autoFocusOnUnmount`,pe={bubbles:!1,cancelable:!0},me=`FocusScope`,he=o.forwardRef((e,t)=>{let{loop:r=!1,trapped:i=!1,onMountAutoFocus:a,onUnmountAutoFocus:s,...u}=e,[d,f]=o.useState(null),p=D(a),m=D(s),h=o.useRef(null),g=n(t,f),_=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(i){let e=function(e){if(_.paused||!d)return;let t=e.target;d.contains(t)?h.current=t:P(h.current,{select:!0})},t=function(e){if(_.paused||!d)return;let t=e.relatedTarget;t!==null&&(d.contains(t)||P(h.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&P(d)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return d&&r.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[i,d,_.paused]),o.useEffect(()=>{if(d){Se.add(_);let e=document.activeElement;if(!d.contains(e)){let t=new CustomEvent(M,pe);d.addEventListener(M,p),d.dispatchEvent(t),t.defaultPrevented||(ge(Te(ve(d)),{select:!0}),document.activeElement===e&&P(d))}return()=>{d.removeEventListener(M,p),setTimeout(()=>{let t=new CustomEvent(N,pe);d.addEventListener(N,m),d.dispatchEvent(t),t.defaultPrevented||P(e??document.body,{select:!0}),d.removeEventListener(N,m),Se.remove(_)},0)}}},[d,p,m,_]);let v=o.useCallback(e=>{if(!r&&!i||_.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){let t=e.currentTarget,[i,a]=_e(t);i&&a?!e.shiftKey&&n===a?(e.preventDefault(),r&&P(i,{select:!0})):e.shiftKey&&n===i&&(e.preventDefault(),r&&P(a,{select:!0})):n===t&&e.preventDefault()}},[r,i,_.paused]);return(0,c.jsx)(l.div,{tabIndex:-1,...u,ref:g,onKeyDown:v})});he.displayName=me;function ge(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(P(r,{select:t}),document.activeElement!==n)return}function _e(e){let t=ve(e);return[ye(t,e),ye(t.reverse(),e)]}function ve(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ye(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):be(r,{upTo:t})))return r}function be(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function xe(e){return e instanceof HTMLInputElement&&`select`in e}function P(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xe(e)&&t&&e.select()}}var Se=Ce();function Ce(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=we(e,t),e.unshift(t)},remove(t){e=we(e,t),e[0]?.resume()}}}function we(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Te(e){return e.filter(e=>e.tagName!==`A`)}var Ee=`Portal`,De=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);m(()=>a(!0),[]);let u=n||i&&globalThis?.document?.body;return u?s.createPortal((0,c.jsx)(l.div,{...r,ref:t}),u):null});De.displayName=Ee;var F=0,I=null;function Oe(){o.useEffect(()=>{I||={start:ke(),end:ke()};let{start:e,end:t}=I;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),F++,()=>{F===1&&(I?.start.remove(),I?.end.remove(),I=null),F=Math.max(0,F-1)}},[])}function ke(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var L=function(){return L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function Ae(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function je(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var R=`right-scroll-bar-position`,z=`width-before-scroll-bar`,Me=`with-scroll-bars-hidden`,Ne=`--removed-body-scroll-bar-size`;function B(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Pe(e,t){var n=(0,o.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Fe=typeof window<`u`?o.useLayoutEffect:o.useEffect,Ie=new WeakMap;function Le(e,t){var n=Pe(t||null,function(t){return e.forEach(function(e){return B(e,t)})});return Fe(function(){var t=Ie.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||B(e,null)}),i.forEach(function(e){r.has(e)||B(e,a)})}Ie.set(n,e)},[e]),n}function Re(e){return e}function ze(e,t){t===void 0&&(t=Re);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Be(e){e===void 0&&(e={});var t=ze(null);return t.options=L({async:!0,ssr:!1},e),t}var Ve=function(e){var t=e.sideCar,n=Ae(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return o.createElement(r,L({},n))};Ve.isSideCarExport=!0;function He(e,t){return e.useMedium(t),Ve}var Ue=Be(),V=function(){},H=o.forwardRef(function(e,t){var n=o.useRef(null),r=o.useState({onScrollCapture:V,onWheelCapture:V,onTouchMoveCapture:V}),i=r[0],a=r[1],s=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Ae(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Le([n,t]),w=L(L({},x),i);return o.createElement(o.Fragment,null,d&&o.createElement(S,{sideCar:Ue,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),s?o.cloneElement(o.Children.only(c),L(L({},w),{ref:C})):o.createElement(y,L({},w,{className:l,ref:C}),c))});H.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},H.classNames={fullWidth:z,zeroRight:R};var We,Ge=function(){if(We)return We;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ke(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Ge();return t&&e.setAttribute(`nonce`,t),e}function qe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Je(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Ye=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ke())&&(qe(t,n),Je(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Xe=function(){var e=Ye();return function(t,n){o.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ze=function(){var e=Xe();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Qe={left:0,top:0,right:0,gap:0},U=function(e){return parseInt(e||``,10)||0},$e=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[U(n),U(r),U(i)]},et=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Qe;var t=$e(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tt=Ze(),W=`data-scroll-locked`,nt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
- .${Me} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${W}] {
7
- overflow: hidden ${r};
8
- overscroll-behavior: contain;
9
- ${[t&&`position: relative ${r};`,n===`margin`&&`
10
- padding-left: ${i}px;
11
- padding-top: ${a}px;
12
- padding-right: ${o}px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: ${s}px ${r};
16
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
- }
18
-
19
- .${R} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${z} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${R} .${R} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${z} .${z} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${W}] {
36
- ${Ne}: ${s}px;
37
- }
38
- `},rt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},it=function(){o.useEffect(function(){return document.body.setAttribute(W,(rt()+1).toString()),function(){var e=rt()-1;e<=0?document.body.removeAttribute(W):document.body.setAttribute(W,e.toString())}},[])},at=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;it();var a=o.useMemo(function(){return et(i)},[i]);return o.createElement(tt,{styles:nt(a,!t,i,n?``:`!important`)})},G=!1;if(typeof window<`u`)try{var K=Object.defineProperty({},"passive",{get:function(){return G=!0,!0}});window.addEventListener(`test`,K,K),window.removeEventListener(`test`,K,K)}catch{G=!1}var q=G?{passive:!1}:!1,ot=function(e){return e.tagName===`TEXTAREA`},st=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!ot(e)&&n[t]===`visible`)},ct=function(e){return st(e,`overflowY`)},lt=function(e){return st(e,`overflowX`)},ut=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),pt(e,r)){var i=mt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},dt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ft=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},pt=function(e,t){return e===`v`?ct(t):lt(t)},mt=function(e,t){return e===`v`?dt(t):ft(t)},ht=function(e,t){return e===`h`&&t===`rtl`?-1:1},gt=function(e,t,n,r,i){var a=ht(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=mt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&pt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},J=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_t=function(e){return[e.deltaX,e.deltaY]},vt=function(e){return e&&`current`in e?e.current:e},yt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bt=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},xt=0,Y=[];function St(e){var t=o.useRef([]),n=o.useRef([0,0]),r=o.useRef(),i=o.useState(xt++)[0],a=o.useState(Ze)[0],s=o.useRef(e);o.useEffect(function(){s.current=e},[e]),o.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=je([e.lockRef.current],(e.shards||[]).map(vt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=o.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!s.current.allowPinchZoom;var i=J(e),a=n.current,o=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(o)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=ut(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=ut(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(o||c)&&(r.current=l),!l)return!0;var h=r.current||l;return gt(h,t,e,h===`h`?o:c,!0)},[]),l=o.useCallback(function(e){var n=e;if(!(!Y.length||Y[Y.length-1]!==a)){var r=`deltaY`in n?_t(n):J(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&yt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var o=(s.current.shards||[]).map(vt).filter(Boolean).filter(function(e){return e.contains(n.target)});(o.length>0?c(n,o[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=o.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ct(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=o.useCallback(function(e){n.current=J(e),r.current=void 0},[]),f=o.useCallback(function(t){u(t.type,_t(t),t.target,c(t,e.lockRef.current))},[]),p=o.useCallback(function(t){u(t.type,J(t),t.target,c(t,e.lockRef.current))},[]);o.useEffect(function(){return Y.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,q),document.addEventListener(`touchmove`,l,q),document.addEventListener(`touchstart`,d,q),function(){Y=Y.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,q),document.removeEventListener(`touchmove`,l,q),document.removeEventListener(`touchstart`,d,q)}},[]);var m=e.removeScrollBar,h=e.inert;return o.createElement(o.Fragment,null,h?o.createElement(a,{styles:bt(i)}):null,m?o.createElement(at,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ct(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var wt=He(Ue,St),Tt=o.forwardRef(function(e,t){return o.createElement(H,L({},e,{ref:t,sideCar:wt}))});Tt.classNames=H.classNames;var Et=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},X=new WeakMap,Z=new WeakMap,Q={},$=0,Dt=function(e){return e&&(e.host||Dt(e.parentNode))},Ot=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Dt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},kt=function(e,t,n,r){var i=Ot(t,Array.isArray(e)?e:[e]);Q[n]||(Q[n]=new WeakMap);var a=Q[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(X.get(e)||0)+1,l=(a.get(e)||0)+1;X.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Z.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),$++,function(){o.forEach(function(e){var t=X.get(e)-1,i=a.get(e)-1;X.set(e,t),a.set(e,i),t||(Z.has(e)||e.removeAttribute(r),Z.delete(e)),i||e.removeAttribute(n)}),$--,$||(X=new WeakMap,X=new WeakMap,Z=new WeakMap,Q={})}},At=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Et(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),kt(r,i,n,`aria-hidden`)):function(){return null}};export{he as a,D as c,g as d,m as f,u as g,l as h,De as i,te as l,d as m,Tt as n,ie as o,p,Oe as r,se as s,At as t,b as u};