onepipeline-ui 0.83.4 → 0.83.6

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.
@@ -0,0 +1,105 @@
1
+ import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as T,Z as E,_ as D,a as O,at as k,b as A,c as j,ct as M,d as N,dt as P,et as F,f as I,ft as L,g as R,i as ee,it as te,j as ne,k as re,l as ie,lt as ae,m as oe,n as se,nt as ce,o as le,ot as ue,p as de,q as fe,r as pe,rt as me,s as he,st as ge,t as _e,tt as ve,u as ye,ut as be,v as xe,w as Se,x as Ce,y as we,z as Te}from"./index-BRPgV32N.js";var Ee=E(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),De=E(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Oe=E(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),ke=E(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Ae=E(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),je=E(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Me=E(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Ne=E(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Pe=E(`circle-dashed`,[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]),Fe=E(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),Ie=E(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),Le=E(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Re=E(`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`}]]),ze=E(`circle-slash`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`9`,x2:`15`,y1:`15`,y2:`9`,key:`1dfufj`}]]),Be=E(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Ve=E(`clock-3`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6h4`,key:`135r8i`}]]),He=E(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Ue=E(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),We=E(`hand`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),Ge=E(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Ke=E(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),qe=E(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Je=E(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),Ye=E(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Xe=E(`message-square-off`,[[`path`,{d:`M19 19H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.7.7 0 0 1 2 21.286V5a2 2 0 0 1 1.184-1.826`,key:`1wyg69`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.656 3H20a2 2 0 0 1 2 2v11.344`,key:`mhl4k6`}]]),Ze=E(`message-square-reply`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`m10 8-3 3 3 3`,key:`fp6dz7`}],[`path`,{d:`M17 14v-1a2 2 0 0 0-2-2H7`,key:`1tkjnz`}]]),Qe=E(`octagon-minus`,[[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),$e=E(`octagon-pause`,[[`path`,{d:`M10 15V9`,key:`1lckn7`}],[`path`,{d:`M14 15V9`,key:`1muqhk`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}]]),et=E(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),tt=E(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),nt=E(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),rt=E(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),it=E(`satellite`,[[`path`,{d:`m13.5 6.5-3.148-3.148a1.205 1.205 0 0 0-1.704 0L6.352 5.648a1.205 1.205 0 0 0 0 1.704L9.5 10.5`,key:`dzhfyz`}],[`path`,{d:`M16.5 7.5 19 5`,key:`1ltcjm`}],[`path`,{d:`m17.5 10.5 3.148 3.148a1.205 1.205 0 0 1 0 1.704l-2.296 2.296a1.205 1.205 0 0 1-1.704 0L13.5 14.5`,key:`nfoymv`}],[`path`,{d:`M9 21a6 6 0 0 0-6-6`,key:`1iajcf`}],[`path`,{d:`M9.352 10.648a1.205 1.205 0 0 0 0 1.704l2.296 2.296a1.205 1.205 0 0 0 1.704 0l4.296-4.296a1.205 1.205 0 0 0 0-1.704l-2.296-2.296a1.205 1.205 0 0 0-1.704 0z`,key:`nv9zqy`}]]),at=E(`shapes`,[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]),ot=E(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),st=E(`square-terminal`,[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]]),ct=E(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),lt=E(`unplug`,[[`path`,{d:`m19 5 3-3`,key:`yk6iyv`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z`,key:`1snsnr`}]]),ut=E(`user-round`,[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]]),dt=E(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),ft=E(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),z=L(ge(),1),B=s(),pt=[`bg-spectrum-blue`,`bg-spectrum-green`,`bg-spectrum-orange`,`bg-spectrum-violet`,`bg-spectrum-red`,`bg-spectrum-indigo`,`bg-spectrum-yellow`],mt=`__timeline_implicit_lane__`;function ht(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return pt[(t>>>0)%pt.length]??pt[0]}function gt(e){return e.laneId??mt}function _t(e){return typeof e.end==`number`&&Number.isFinite(e.end)?e.end:typeof e.duration==`number`&&Number.isFinite(e.duration)?e.start+e.duration:e.start}function vt(e){return e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function yt(e){return`+${vt(e)}`}function bt(e){let t=new Date(e);return Number.isNaN(t.valueOf())?String(e):t.toISOString()}function xt(e,t){let n=new Date(e);return`${Number.isNaN(n.valueOf())?String(e):n.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})} ${yt(e-t)}`}function St(e,t){let n=_t(e),r=[e.label,`Lane: ${gt(e)}`,`Status: ${e.status??`unknown`}`,`Start: ${bt(e.start)}`];return n>e.start?r.push(`End: ${bt(n)}`,`Duration: ${vt(n-e.start)}`):r.push(`Duration: not recorded`),e.status===`failed`&&t?.trim()&&r.push(`Failure: ${t.trim().slice(0,160)}`),r.join(` · `)}function Ct(e,t,n){let[r,i]=(0,z.useState)(null),[a,o]=(0,z.useState)(null),s=(0,z.useRef)(null),c=(t&&t[1]>t[0]?{end:t[1],start:t[0]}:null)??r??e,l=Math.max(1,c.end-c.start),u=e=>{n?.([e.start,e.end]),t||i(e)},d=e=>{let t=s.current?.getBoundingClientRect(),n=t?.width||1e3;return c.start+Math.min(1,Math.max(0,(e-(t?.left??0))/n))*l};return{axis:s,brushStart:e=>o(d(e)),finishBrush:e=>{if(a===null)return;let t=d(e);Math.abs(t-a)>=l*.02&&u({end:Math.max(t,a),start:Math.min(t,a)}),o(null)},range:c,reset:()=>{n?.([e.start,e.end]),t||i(null)},viewChanged:c.start!==e.start||c.end!==e.end,zoom:(t,n)=>{let r=d(t),i=n<0?.75:1.25,a=Math.max(1,e.end-e.start),o=Math.min(a,Math.max(a/100,l*i)),s=r-o*((r-c.start)/l);s=Math.max(e.start,Math.min(s,e.end-o)),u({end:s+o,start:s})}}}function wt({axis:e,cursor:t,crosshair:n=!0,ticks:r,expanded:i=!1,getFailureExcerpt:a,items:o,label:s=`Timeline`,lanes:c,markers:l=[],onExpandedChange:d,onRangeChange:f,onSelect:p,range:m,selectedId:h}){let g=(0,z.useId)(),[_,v]=(0,z.useState)(1e3),[y,b]=(0,z.useState)(null),[S,C]=(0,z.useState)(null),T=(0,z.useMemo)(()=>o.filter(e=>Number.isFinite(e.start)),[o]),E=(0,z.useMemo)(()=>l.filter(e=>Number.isFinite(e.at)),[l]),D=(0,z.useMemo)(()=>c?[...c]:[...new Set(T.map(gt))].map(e=>({id:e,label:e===mt?`Events`:e})),[c,T]),O=(0,z.useMemo)(()=>{let e=[...T.flatMap(e=>[e.start,_t(e)]),...E.map(e=>e.at)];if(e.length===0)return{end:1,start:0};let t=Math.min(...e),n=Math.max(...e);return{end:n>t?n:t+1,start:t}},[T,E]),k=Ct(O,m,f),{axis:A,range:j}=k,M=T.length>0||E.length>0;(0,z.useEffect)(()=>{if(!M)return;let e=A.current;if(!e)return;let t=()=>v(e.getBoundingClientRect().width||1e3);if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[A,M]),(0,z.useEffect)(()=>{h&&A.current?.querySelector(`[data-selected="true"]`)?.scrollIntoView?.({block:`nearest`})},[A,h]);let N=Math.max(1,j.end-j.start),P=e=>(e-j.start)/N*100,F=i?D:[{id:`overlay`,label:`All events`}],I=e?.origin??O.start,L=r?.minSpacingPx,R=N*(L!==void 0&&Number.isFinite(L)&&L>0?L:80)/_,ee=[1e3,2e3,5e3,1e4,15e3,3e4,6e4,12e4,3e5,6e5,9e5,18e5,36e5].find(e=>e>=R)??Math.ceil(R/36e5)*36e5,te=[];for(let e=Math.ceil(j.start/ee)*ee;e<=j.end;e+=ee)te.push(e);let ne=y===null?null:j.start+y*N,re=e=>{let t=_t(e);if(t<j.start||e.start>j.end)return null;let n=Math.max(0,P(Math.max(e.start,j.start))),r=Math.max(.8,P(Math.min(t,j.end))-n),i=t<=e.start,o=`timeline-detail-${g}-${e.id.replace(/[^a-zA-Z0-9_-]/g,`-`)}`,s=ht(gt(e));return(0,B.jsxs)(`div`,{className:`absolute inset-y-0`,style:{left:`${n}%`},children:[(0,B.jsx)(`button`,{"aria-describedby":o,"aria-label":`${e.label}, ${i?`point event`:`span`}`,"aria-pressed":h===e.id,"aria-current":h===e.id?`true`:void 0,"data-turn-id":e.turnId,"data-tool-call-id":e.toolCallId,"data-event-index":e.eventIndex,className:x(`absolute top-0 h-5 border-2 border-card shadow-sm hover:opacity-80 focus-visible:z-20`,i?`w-5 -translate-x-1/2 rounded-full`:`min-w-1 rounded-md`,h===e.id&&`ring-2 ring-foreground ring-offset-1`,s),"data-lane-color":s,"data-selected":h===e.id?`true`:`false`,"data-timeline-shape":i?`point`:`span`,onBlur:()=>C(null),onClick:t=>{t.stopPropagation(),C(e.id),p?.(e)},onFocus:()=>C(e.id),onMouseEnter:()=>C(e.id),onMouseLeave:()=>C(null),style:{width:i?void 0:`${r}cqw`},type:`button`,children:i?(0,B.jsx)(w,{"aria-hidden":`true`,className:`m-auto size-2 fill-current text-white`}):null}),(0,B.jsx)(`span`,{className:x(`pointer-events-none absolute z-30 w-80 rounded-md bg-popover px-2.5 py-2 text-[10px] text-popover-foreground shadow-lg`,S===e.id?`block`:`sr-only`),id:o,role:S===e.id?`tooltip`:void 0,style:{top:`1.4rem`},children:St(e,a?.(e))})]},e.id)};return(0,B.jsxs)(`section`,{"aria-label":s,className:`timeline rounded-xl border bg-card p-4`,children:[(0,B.jsxs)(`div`,{className:`mb-3 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`div`,{"aria-label":`Timeline legend`,className:`flex flex-wrap gap-3`,role:`list`,children:D.map(e=>(0,B.jsxs)(`span`,{className:`flex items-center gap-1.5 text-[10px] text-muted-foreground`,role:`listitem`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:x(`size-2 rounded-full`,ht(e.id))}),e.label]},e.id))}),(0,B.jsxs)(`div`,{className:`flex gap-1`,children:[(0,B.jsxs)(`button`,{"aria-label":i?`Collapse timeline`:`Expand timeline`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,onClick:()=>d?.(!i),type:`button`,children:[i?(0,B.jsx)(Me,{"aria-hidden":`true`,className:`size-3`}):(0,B.jsx)(Ae,{"aria-hidden":`true`,className:`size-3`}),i?`Collapse`:`Expand`]}),(0,B.jsxs)(`button`,{"aria-label":`Reset timeline zoom`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted disabled:opacity-40`,disabled:!k.viewChanged,onClick:k.reset,type:`button`,children:[(0,B.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),` Reset zoom`]})]})]}),T.length===0&&E.length===0?(0,B.jsx)(`p`,{className:`m-0 text-xs text-muted-foreground`,children:`No timeline events recorded.`}):(0,B.jsxs)(`div`,{"aria-label":`Timeline plot. Scroll to zoom or drag to select a range.`,className:`relative touch-none select-none overflow-hidden rounded-lg border bg-muted/40 pb-3 pt-7`,onPointerMove:e=>{let t=e.currentTarget.getBoundingClientRect();b(Math.min(1,Math.max(0,(e.clientX-t.left)/(t.width||1e3))))},onPointerLeave:()=>b(null),onPointerDown:e=>k.brushStart(e.clientX),onPointerUp:e=>k.finishBrush(e.clientX),onWheel:e=>{e.preventDefault(),k.zoom(e.clientX,e.deltaY)},ref:A,children:[n&&ne!==null?(0,B.jsx)(`div`,{"aria-label":`Timeline crosshair`,className:`pointer-events-none absolute inset-y-0 z-30 border-l border-foreground`,style:{left:`${(y??0)*100}%`},children:(0,B.jsxs)(`span`,{className:`absolute top-0 whitespace-nowrap bg-popover text-[10px] text-popover-foreground`,style:{transform:(y??0)>.5?`translateX(-100%)`:void 0},children:[bt(ne),` `,yt(ne-I)]})}):null,(0,B.jsxs)(`div`,{className:`relative grid gap-2`,style:{containerType:`inline-size`},children:[F.map(e=>(0,B.jsxs)(`div`,{className:`relative h-6 border-b border-border/60`,"data-lane-id":e.id,"data-testid":`timeline-lane`,children:[i?(0,B.jsx)(`span`,{className:`sr-only`,children:e.label}):null,(i?T.filter(t=>gt(t)===e.id):T).map(re)]},e.id)),E.map(e=>e.at<j.start||e.at>j.end?null:(0,B.jsxs)(`div`,{className:`pointer-events-none absolute inset-y-0 z-20`,style:{left:`${P(e.at)}%`},children:[(0,B.jsx)(`span`,{className:`absolute inset-y-0 w-px bg-foreground/60`,"data-testid":`timeline-marker-line`}),(0,B.jsx)(`button`,{"aria-label":`${e.label}, marker`,"aria-pressed":h===e.id,className:x(`pointer-events-auto absolute bottom-full left-1/2 mb-1 flex size-5 -translate-x-1/2 items-center justify-center rounded-full bg-card text-foreground shadow`,h===e.id&&`ring-2 ring-foreground`),"data-selected":h===e.id?`true`:`false`,onClick:t=>{t.stopPropagation(),p?.(e)},type:`button`,children:e.icon??(0,B.jsx)(Je,{"aria-hidden":`true`,className:`size-3`})})]},e.id)),typeof t==`number`&&Number.isFinite(t)&&t>=j.start&&t<=j.end?(0,B.jsx)(`span`,{"aria-label":`Timeline cursor`,className:`pointer-events-none absolute inset-y-0 z-10 w-px bg-primary`,"data-testid":`timeline-cursor`,style:{left:`${P(t)}%`}}):null]}),(0,B.jsx)(`div`,{className:`relative mt-2 h-4 font-mono text-[9px] text-subtle`,"data-testid":`timeline-axis`,"data-timeline-axis":!0,children:te.map(e=>(0,B.jsx)(`span`,{"data-tick-time":e,className:`absolute`,style:{left:`${P(e)}%`,transform:e===j.end?`translateX(-100%)`:void 0},children:xt(e,I)},e))})]})]})}var Tt=Object.defineProperty,Et=(e,t)=>Tt(e,`name`,{value:t,configurable:!0});function Dt(e,t){let n=z.createContext(t);n.displayName=e+`Context`;let r=Et(e=>{let{children:t,...r}=e,i=z.useMemo(()=>r,Object.values(r));return(0,B.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=z.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Et(i,`useContext`),[r,i]}Et(Dt,`createContext`);function Ot(e,t=[]){let n=[];function r(t,r){let i=z.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Et(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=z.useMemo(()=>o,Object.values(o));return(0,B.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=z.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Et(s,`useContext`),[o,s]}Et(r,`createContext`);let i=Et(()=>{let t=n.map(e=>z.createContext(e));return Et(function(n){let r=n?.[e]||t;return z.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,kt(i,...t)]}Et(Ot,`createContextScope`);function kt(...e){let t=e[0];if(e.length===1)return t;let n=Et(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Et(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return z.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Et(kt,`composeContextScopes`);var At=Object.defineProperty,jt=(e,t)=>At(e,`name`,{value:t,configurable:!0});function Mt(e){let t=e+`CollectionProvider`,[r,i]=Ot(t),[a,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=jt(e=>{let{scope:t,children:n}=e,r=z.useRef(null),i=z.useRef(new Map).current;return(0,B.jsx)(a,{scope:t,itemMap:i,collectionRef:r,children:n})},`CollectionProvider`);s.displayName=t;let l=e+`CollectionSlot`,u=n(l),d=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(t,o(l,n).collectionRef);return(0,B.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=n(f),h=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=z.useRef(null),s=c(t,a),l=o(f,n);return z.useEffect(()=>(l.itemMap.set(a,{ref:a,...i}),()=>void l.itemMap.delete(a))),(0,B.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=o(e+`CollectionConsumer`,t);return z.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 jt(g,`useCollection`),[{Provider:s,Slot:d,ItemSlot:h},g,i]}jt(Mt,`createCollection`);var Nt=new WeakMap,Pt=class e extends Map{static{jt(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Nt.set(this,!0)}set(e,t){return Nt.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Lt(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Ft(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Ft(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Ft(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Ft(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=It(e,t);return n===-1?void 0:e[n]}jt(Ft,`at`);function It(e,t){let n=e.length,r=Lt(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}jt(It,`toSafeIndex`);function Lt(e){return e!==e||e===0?0:Math.trunc(e)}jt(Lt,`toSafeInteger`);function Rt(e){let t=e+`CollectionProvider`,[r,i]=Ot(t),[a,o]=r(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Pt,setItemMap:jt(()=>void 0,`setItemMap`)}),s=jt(({state:e,...t})=>e?(0,B.jsx)(u,{...t,state:e}):(0,B.jsx)(l,{...t}),`CollectionProvider`);s.displayName=t;let l=jt(e=>{let t=_();return(0,B.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=t+`Init`;let u=jt(e=>{let{scope:t,children:n,state:r}=e,i=z.useRef(null),[o,s]=z.useState(null),l=c(i,s),[u,d]=r;return z.useEffect(()=>{if(!o)return;let e=Ht(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,B.jsx)(a,{scope:t,itemMap:u,setItemMap:d,collectionRef:l,collectionRefObject:i,collectionElement:o,children:n})},`CollectionProviderImpl`);u.displayName=t+`Impl`;let d=e+`CollectionSlot`,f=n(d),p=z.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=c(t,o(d,n).collectionRef);return(0,B.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=n(m),g=z.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=z.useRef(null),[s,l]=z.useState(null),u=c(t,a,l),{setItemMap:d}=o(m,n),f=z.useRef(i);zt(f.current,i)||(f.current=i);let p=f.current;return z.useEffect(()=>{let e=p;return d(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Vt):(t.set(s,{...e,element:s}),t.toSorted(Vt)):t),()=>{d(e=>!s||!e.has(s)?e:(e.delete(s),new Pt(e)))}},[s,p,d]),(0,B.jsx)(h,{"data-radix-collection-item":``,ref:u,children:r})});g.displayName=m;function _(){return z.useState(new Pt)}jt(_,`useInitCollection`);function v(t){let{itemMap:n}=o(e+`CollectionConsumer`,t);return n}return jt(v,`useCollection`),[{Provider:s,Slot:p,ItemSlot:g},{createCollectionScope:i,useCollection:v,useInitCollection:_}]}jt(Rt,`createCollection`);function zt(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}jt(zt,`shallowEqual`);function Bt(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}jt(Bt,`isElementPreceding`);function Vt(e,t){return!e[1].element||!t[1].element?0:Bt(e[1].element,t[1].element)?-1:1}jt(Vt,`sortByDocumentPosition`);function Ht(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}jt(Ht,`getChildListObserver`);var Ut=Object.defineProperty,Wt=(e,t)=>Ut(e,`name`,{value:t,configurable:!0}),Gt=!!(typeof window<`u`&&window.document&&window.document.createElement);function Kt(e,t,{checkForDefaultPrevented:n=!0}={}){return Wt(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}Wt(Kt,`composeEventHandlers`);function qt(e){if(!Gt)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}Wt(qt,`getOwnerWindow`);function Jt(e){if(!Gt)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}Wt(Jt,`getOwnerDocument`);function Yt(e,t=!1){let{activeElement:n}=Jt(e);if(!n?.nodeName)return null;if(Xt(n)&&n.contentDocument)return Yt(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Jt(n).getElementById(e);if(t)return t}}return n}Wt(Yt,`getActiveElement`);function Xt(e){return e.tagName===`IFRAME`}Wt(Xt,`isFrame`);var Zt=globalThis?.document?z.useLayoutEffect:()=>{},Qt=Object.defineProperty,$t=(e,t)=>Qt(e,`name`,{value:t,configurable:!0}),en=z.useEffectEvent,tn=z.useInsertionEffect;function nn(e){if(typeof en==`function`)return en(e);let t=z.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof tn==`function`?tn(()=>{t.current=e}):Zt(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}$t(nn,`useEffectEvent`);var rn=Object.defineProperty,an=(e,t)=>rn(e,`name`,{value:t,configurable:!0}),on=z.useInsertionEffect||Zt;function sn({prop:e,defaultProp:t,onChange:n=an(()=>{},`onChange`),caller:r}){let[i,a,o]=cn({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,z.useCallback(t=>{if(s){let n=ln(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}an(sn,`useControllableState`);function cn({defaultProp:e,onChange:t}){let[n,r]=z.useState(e),i=z.useRef(n),a=z.useRef(t);return on(()=>{a.current=t},[t]),z.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}an(cn,`useUncontrolledState`);function ln(e){return typeof e==`function`}an(ln,`isFunction`);var un=Symbol(`RADIX:SYNC_STATE`);function dn(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=nn(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=z.useReducer((t,n)=>{if(n.type===un)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=z.useRef(p);z.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=z.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return z.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:un,state:i})},[i,d.state,c]),[h,f]}an(dn,`useControllableStateReducer`);var fn=L(ue(),1),pn=Object.defineProperty,mn=(e,t)=>pn(e,`name`,{value:t,configurable:!0}),hn=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let r=n(`Primitive.${t}`),i=z.forwardRef((e,n)=>{let{asChild:i,...a}=e,o=i?r:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,B.jsx)(o,{...a,ref:n})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{});function gn(e,t){e&&fn.flushSync(()=>e.dispatchEvent(t))}mn(gn,`dispatchDiscreteCustomEvent`);var _n=Object.defineProperty,vn=(e,t)=>_n(e,`name`,{value:t,configurable:!0});function yn(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}vn(yn,`useStateMachine`);var bn=vn(e=>{let{present:t,children:n}=e,r=xn(t),i=typeof n==`function`?n({present:r.isPresent}):z.Children.only(n),a=Cn(r.ref,Tn(i));return typeof n==`function`||r.isPresent?z.cloneElement(i,{ref:a}):null},`Presence`);function xn(e){let[t,n]=z.useState(),r=z.useRef(null),i=z.useRef(e),a=z.useRef(`none`),o=z.useRef(void 0),[s,c]=yn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return z.useEffect(()=>{s===`mounted`?(a.current=o.current??wn(r.current),o.current=void 0):a.current=`none`},[s]),Zt(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=wn(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Zt(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=vn(a=>{let o=wn(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=vn(e=>{e.target===t&&(a.current=wn(r.current))},`handleAnimationStart`);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 c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:z.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=wn(t)}else r.current=null;n(e)},[])}}vn(xn,`usePresence`);function Sn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}vn(Sn,`setRef`);function Cn(...e){let t=z.useRef(e);return t.current=e,z.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Sn(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():Sn(n[e],null)}}},[])}vn(Cn,`useStableComposedRefs`);function wn(e){return e?.animationName||`none`}vn(wn,`getAnimationName`);function Tn(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)}vn(Tn,`getElementRef`);var En=Object.defineProperty,Dn=(e,t)=>En(e,`name`,{value:t,configurable:!0}),On=z.useId||(()=>void 0),kn=0;function An(e){let[t,n]=z.useState(On());return Zt(()=>{e||n(e=>e??String(kn++))},[e]),e||(t?`radix-${t}`:``)}Dn(An,`useId`);var jn=Object.defineProperty,Mn=(e,t)=>jn(e,`name`,{value:t,configurable:!0}),Nn=`Collapsible`,[Pn,Fn]=Ot(Nn),[In,Ln]=Pn(Nn),Rn=z.forwardRef(Mn(function(e,t){let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=sn({prop:r,defaultProp:i??!1,onChange:o,caller:Nn});return(0,B.jsx)(In,{scope:n,disabled:a,contentId:An(),open:c,onOpenToggle:z.useCallback(()=>l(e=>!e),[l]),children:(0,B.jsx)(hn.div,{"data-state":Wn(c),"data-disabled":a?``:void 0,...s,ref:t})})},`Collapsible`)),zn=`CollapsibleTrigger`,Bn=z.forwardRef(Mn(function(e,t){let{__scopeCollapsible:n,...r}=e,i=Ln(zn,n);return(0,B.jsx)(hn.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":Wn(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:Kt(e.onClick,i.onOpenToggle)})},`CollapsibleTrigger`)),Vn=`CollapsibleContent`,Hn=z.forwardRef(Mn(function(e,t){let{forceMount:n,...r}=e,i=Ln(Vn,e.__scopeCollapsible);return(0,B.jsx)(bn,{present:n||i.open,children:({present:e})=>(0,B.jsx)(Un,{...r,ref:t,present:e})})},`CollapsibleContent`)),Un=z.forwardRef(Mn(function(e,t){let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Ln(Vn,n),[s,l]=z.useState(r),u=z.useRef(null),d=c(t,u),f=z.useRef(0),p=f.current,m=z.useRef(0),h=m.current,g=o.open||s,_=z.useRef(g),v=z.useRef(void 0);return z.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),Zt(()=>{let e=u.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),l(r)}},[o.open,r]),(0,B.jsx)(hn.div,{"data-state":Wn(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})},`CollapsibleContentImpl`));function Wn(e){return e?`open`:`closed`}Mn(Wn,`getState`);var Gn=Rn,Kn=Bn,qn=Hn,Jn=Object.defineProperty,Yn=(e,t)=>Jn(e,`name`,{value:t,configurable:!0}),Xn=z.createContext(void 0);function Zn(e){let t=z.useContext(Xn);return e||t||`ltr`}Yn(Zn,`useDirection`);var Qn=Object.defineProperty,$n=(e,t)=>Qn(e,`name`,{value:t,configurable:!0}),er=`Accordion`,tr=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[nr,rr,ir]=Mt(er),[ar,or]=Ot(er,[ir,Fn]),sr=Fn(),cr=z.forwardRef($n(function(e,t){let{type:n,...r}=e,i=r,a=r;return(0,B.jsx)(nr.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,B.jsx)(mr,{...a,ref:t}):(0,B.jsx)(pr,{...i,ref:t})})},`Accordion`)),[lr,ur]=ar(er),[dr,fr]=ar(er,{collapsible:!1}),pr=z.forwardRef($n(function(e,t){let{value:n,defaultValue:r,onValueChange:i=$n(()=>{},`onValueChange`),collapsible:a=!1,...o}=e,[s,c]=sn({prop:n,defaultProp:r??``,onChange:i,caller:er});return(0,B.jsx)(lr,{scope:e.__scopeAccordion,value:z.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:z.useCallback(()=>a&&c(``),[a,c]),children:(0,B.jsx)(dr,{scope:e.__scopeAccordion,collapsible:a,children:(0,B.jsx)(_r,{...o,ref:t})})})},`AccordionImplSingle`)),mr=z.forwardRef($n(function(e,t){let{value:n,defaultValue:r,onValueChange:i=$n(()=>{},`onValueChange`),...a}=e,[o,s]=sn({prop:n,defaultProp:r??[],onChange:i,caller:er}),c=z.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=z.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,B.jsx)(lr,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,B.jsx)(dr,{scope:e.__scopeAccordion,collapsible:!0,children:(0,B.jsx)(_r,{...a,ref:t})})})},`AccordionImplMultiple`)),[hr,gr]=ar(er),_r=z.forwardRef($n(function(e,t){let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=c(z.useRef(null),t),l=rr(n),u=Zn(i)===`ltr`,d=Kt(e.onKeyDown,e=>{if(!tr.includes(e.key))return;let t=e.target,n=l().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,c=$n(()=>{o=r+1,o>s&&(o=0)},`moveNext`),d=$n(()=>{o=r-1,o<0&&(o=s)},`movePrev`);switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(u?c():d());break;case`ArrowDown`:a===`vertical`&&c();break;case`ArrowLeft`:a===`horizontal`&&(u?d():c());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,B.jsx)(hr,{scope:n,disabled:r,direction:i,orientation:a,children:(0,B.jsx)(nr.Slot,{scope:n,children:(0,B.jsx)(hn.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:d})})})},`AccordionImpl`)),vr=`AccordionItem`,[yr,br]=ar(vr),xr=z.forwardRef($n(function(e,t){let{__scopeAccordion:n,value:r,...i}=e,a=gr(vr,n),o=ur(vr,n),s=sr(n),c=An(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,B.jsx)(yr,{scope:n,open:l,disabled:u,triggerId:c,children:(0,B.jsx)(Gn,{"data-orientation":a.orientation,"data-state":Or(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})},`AccordionItem`)),Sr=`AccordionHeader`,Cr=z.forwardRef($n(function(e,t){let{__scopeAccordion:n,...r}=e,i=gr(er,n),a=br(Sr,n);return(0,B.jsx)(hn.h3,{"data-orientation":i.orientation,"data-state":Or(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})},`AccordionHeader`)),wr=`AccordionTrigger`,Tr=z.forwardRef($n(function(e,t){let{__scopeAccordion:n,...r}=e,i=gr(er,n),a=br(wr,n),o=fr(wr,n),s=sr(n);return(0,B.jsx)(nr.ItemSlot,{scope:n,children:(0,B.jsx)(Kn,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})},`AccordionTrigger`)),Er=`AccordionContent`,Dr=z.forwardRef($n(function(e,t){let{__scopeAccordion:n,...r}=e,i=gr(er,n),a=br(Er,n),o=sr(n);return(0,B.jsx)(qn,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":`var(--radix-collapsible-content-height)`,"--radix-accordion-content-width":`var(--radix-collapsible-content-width)`,...e.style}})},`AccordionContent`));function Or(e){return e?`open`:`closed`}$n(Or,`getState`);var kr=cr,Ar=xr,jr=Cr,Mr=Tr,Nr=Dr;function Pr({...e}){return(0,B.jsx)(kr,{"data-slot":`accordion`,...e})}function Fr({className:e,...t}){return(0,B.jsx)(Ar,{"data-slot":`accordion-item`,className:x(`border-b last:border-b-0`,e),...t})}function Ir({className:e,children:t,...n}){return(0,B.jsx)(jr,{className:`flex`,children:(0,B.jsxs)(Mr,{"data-slot":`accordion-trigger`,className:x(`flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180`,e),...n,children:[t,(0,B.jsx)(Ae,{className:`pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200`})]})})}function Lr({className:e,children:t,...n}){return(0,B.jsx)(Nr,{"data-slot":`accordion-content`,className:`overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,B.jsx)(`div`,{className:x(`pt-0 pb-4`,e),children:t})})}var Rr=v(`relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive bg-destructive-surface text-destructive *:data-[slot=alert-description]:text-destructive [&>svg]:text-current`}},defaultVariants:{variant:`default`}});function zr({className:e,variant:t,...n}){return(0,B.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:x(Rr({variant:t}),e),...n})}function Br({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-title`,className:x(`col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight`,e),...t})}function Vr({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`alert-description`,className:x(`col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed`,e),...t})}var Hr=Object.defineProperty,Ur=(e,t)=>Hr(e,`name`,{value:t,configurable:!0});function Wr(e){let t=z.useRef(e);return z.useEffect(()=>{t.current=e}),z.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ur(Wr,`useCallbackRef`);var Gr=Object.defineProperty,Kr=(e,t)=>Gr(e,`name`,{value:t,configurable:!0}),qr=`Avatar`,[Jr,Yr]=Ot(qr),Xr=[0,()=>void 0],[Zr,Qr]=Jr(qr),$r=z.forwardRef(Kr(function(e,t){let{__scopeAvatar:n,...r}=e,[i,a]=z.useState(`idle`),[o,s]=ii();return(0,B.jsx)(Zr,{scope:n,imageLoadingStatus:i,setImageLoadingStatus:a,imageCount:o,setImageCount:s,children:(0,B.jsx)(hn.span,{...r,ref:t})})},`Avatar`)),ei=`AvatarFallback`,ti=z.forwardRef(Kr(function(e,t){let{__scopeAvatar:n,delayMs:r,...i}=e,a=Qr(ei,n),[o,s]=z.useState(r===void 0);return z.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,B.jsx)(hn.span,{...i,ref:t}):null},`AvatarFallback`));function ni(e,{loadingStatus:t,setLoadingStatus:n,referrerPolicy:r,crossOrigin:i}){return Zt(()=>{if(!e){n(`error`);return}let t=new window.Image,a=Kr(e=>{let t=e.currentTarget;n(ri(t))},`handleLoad`),o=Kr(()=>n(`error`),`handleError`);return t.addEventListener(`load`,a),t.addEventListener(`error`,o),r&&(t.referrerPolicy=r),t.crossOrigin=i??null,t.src=e,n(ri(t)),()=>{t.removeEventListener(`load`,a),t.removeEventListener(`error`,o),n(`idle`)}},[e,i,r,n]),t}Kr(ni,`useImageLoadingStatus`);function ri(e){return e.complete?e.naturalWidth>0?`loaded`:`error`:`loading`}Kr(ri,`getImageLoadingStatus`);function ii(){return Xr}Kr(ii,`useImageCount`);function ai(e){}Kr(ai,`useUpdateImageCount`);function oi({className:e,size:t=`default`,...n}){return(0,B.jsx)($r,{"data-slot":`avatar`,"data-size":t,className:x(`group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6`,e),...n})}function si({className:e,...t}){return(0,B.jsx)(ti,{"data-slot":`avatar-fallback`,className:x(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,e),...t})}function ci({className:e,...t}){return(0,B.jsx)(`img`,{className:x(`aspect-square size-full object-cover`,e),"data-slot":`avatar-image`,...t})}var li=v(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`border border-destructive bg-destructive-surface text-destructive hover:bg-destructive-surface/80 focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function ui({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,B.jsx)(r?Te:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:x(li({variant:t,size:n,className:e})),...i})}function di({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card`,className:x(`flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm`,e),...t})}function fi({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`card-content`,className:x(`px-6`,e),...t})}var pi=Object.defineProperty,mi=(e,t)=>pi(e,`name`,{value:t,configurable:!0}),hi=`dismissableLayer.update`,gi=`dismissableLayer.pointerDownOutside`,_i=`dismissableLayer.focusOutside`,vi,yi=z.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),bi=z.forwardRef(mi(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:l,...u}=e,d=z.useContext(yi),[f,p]=z.useState(null),m=f?.ownerDocument??globalThis?.document,[,h]=z.useState({}),g=c(t,p),_=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=f?_.indexOf(f):-1,x=d.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=z.useRef(!1),w=Ci(e=>{a?.(e),s?.(e),e.defaultPrevented||l?.()},{ownerDocument:m,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:z.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...d.branches].some(t=>t.contains(e));return S&&!t},[d.branches,S])}),T=wi(e=>{if(r&&C.current)return;let t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||l?.())},m),E=f?b===_.length-1:!1,D=Wr(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))});return z.useEffect(()=>{if(E)return m.addEventListener(`keydown`,D,{capture:!0}),()=>m.removeEventListener(`keydown`,D,{capture:!0})},[m,E,D]),z.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(vi=m.body.style.pointerEvents,m.body.style.pointerEvents=`none`),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Ti(),()=>{n&&(d.layersWithOutsidePointerEventsDisabled.delete(f),d.layersWithOutsidePointerEventsDisabled.size===0&&(m.body.style.pointerEvents=vi))}},[f,m,n,d]),z.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Ti())},[f,d]),z.useEffect(()=>{let e=mi(()=>h({}),`handleUpdate`);return document.addEventListener(hi,e),()=>document.removeEventListener(hi,e)},[]),(0,B.jsx)(hn.div,{...u,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Kt(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Kt(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Kt(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function xi(){let e=z.useContext(yi),[t,n]=z.useState(null);return z.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}mi(xi,`useDismissableLayerSurface`);var Si=mi(()=>!0,`IS_TRUE`);function Ci(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Si}=t,s=Wr(e),c=z.useRef(!1),l=z.useRef(!1),u=z.useRef(new Map),d=z.useRef(()=>{});return z.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}mi(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}mi(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}mi(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}mi(p,`handleInteractionBubble`);let m=mi(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Ei(gi,s,p,{discrete:!0})};if(mi(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!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`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:mi(()=>c.current=!0,`onPointerDownCapture`)}}mi(Ci,`usePointerDownOutside`);function wi(e,t=globalThis?.document){let n=Wr(e),r=z.useRef(!1);return z.useEffect(()=>{let e=mi(e=>{e.target&&!r.current&&Ei(_i,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:mi(()=>r.current=!0,`onFocusCapture`),onBlurCapture:mi(()=>r.current=!1,`onBlurCapture`)}}mi(wi,`useFocusOutside`);function Ti(){let e=new CustomEvent(hi);document.dispatchEvent(e)}mi(Ti,`dispatchUpdate`);function Ei(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?gn(i,a):i.dispatchEvent(a)}mi(Ei,`handleAndDispatchCustomEvent`);var Di=Object.defineProperty,Oi=(e,t)=>Di(e,`name`,{value:t,configurable:!0}),ki=`focusScope.autoFocusOnMount`,Ai=`focusScope.autoFocusOnUnmount`,ji={bubbles:!1,cancelable:!0},Mi=z.forwardRef(Oi(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=z.useState(null),u=Wr(i),d=Wr(a),f=z.useRef(null),p=c(t,l),m=z.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;z.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:zi(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||zi(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&zi(s)};Oi(e,`handleFocusIn`),Oi(t,`handleFocusOut`),Oi(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),z.useEffect(()=>{if(s){Bi.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ki,ji);s.addEventListener(ki,u),s.dispatchEvent(t),t.defaultPrevented||(Ni(Ui(Fi(s)),{select:!0}),document.activeElement===e&&zi(s))}return()=>{s.removeEventListener(ki,u),setTimeout(()=>{let t=new CustomEvent(Ai,ji);s.addEventListener(Ai,d),s.dispatchEvent(t),t.defaultPrevented||zi(e??document.body,{select:!0}),s.removeEventListener(Ai,d),Bi.remove(m)},0)}}},[s,u,d,m]);let h=z.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Pi(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&zi(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&zi(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,B.jsx)(hn.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})},`FocusScope`));function Ni(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(zi(r,{select:t}),document.activeElement!==n)return}Oi(Ni,`focusFirst`);function Pi(e){let t=Fi(e);return[Ii(t,e),Ii(t.reverse(),e)]}Oi(Pi,`getTabbableEdges`);function Fi(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Oi(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},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Oi(Fi,`getTabbableCandidates`);function Ii(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Li(r,{upTo:t})))return r}Oi(Ii,`findVisible`);function Li(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}Oi(Li,`isHidden`);function Ri(e){return e instanceof HTMLInputElement&&`select`in e}Oi(Ri,`isSelectableInput`);function zi(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ri(e)&&t&&e.select()}}Oi(zi,`focus`);var Bi=Vi();function Vi(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Hi(e,t),e.unshift(t)},remove(t){e=Hi(e,t),e[0]?.resume()}}}Oi(Vi,`createFocusScopesStack`);function Hi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Oi(Hi,`arrayRemove`);function Ui(e){return e.filter(e=>e.tagName!==`A`)}Oi(Ui,`removeLinks`);var Wi=Object.defineProperty,Gi=z.forwardRef(((e,t)=>Wi(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=z.useState(!1);Zt(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?fn.createPortal((0,B.jsx)(hn.div,{...r,ref:t}),o):null},`Portal`)),Ki=Object.defineProperty,qi=(e,t)=>Ki(e,`name`,{value:t,configurable:!0}),Ji=0,Yi=null;function Xi(e){return Zi(),e.children}qi(Xi,`FocusGuards`);function Zi(){z.useEffect(()=>{Yi||={start:Qi(),end:Qi()};let{start:e,end:t}=Yi;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ji++,()=>{Ji===1&&(Yi?.start.remove(),Yi?.end.remove(),Yi=null),Ji=Math.max(0,Ji-1)}},[])}qi(Zi,`useFocusGuards`);function Qi(){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}qi(Qi,`createFocusGuard`);var $i=function(){return $i=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},$i.apply(this,arguments)};function ea(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 ta(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 na=`right-scroll-bar-position`,ra=`width-before-scroll-bar`,ia=`with-scroll-bars-hidden`,aa=`--removed-body-scroll-bar-size`;function oa(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function sa(e,t){var n=(0,z.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 ca=typeof window<`u`?z.useLayoutEffect:z.useEffect,la=new WeakMap;function ua(e,t){var n=sa(t||null,function(t){return e.forEach(function(e){return oa(e,t)})});return ca(function(){var t=la.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||oa(e,null)}),i.forEach(function(e){r.has(e)||oa(e,a)})}la.set(n,e)},[e]),n}function da(e){return e}function fa(e,t){t===void 0&&(t=da);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 pa(e){e===void 0&&(e={});var t=fa(null);return t.options=$i({async:!0,ssr:!1},e),t}var ma=function(e){var t=e.sideCar,n=ea(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 z.createElement(r,$i({},n))};ma.isSideCarExport=!0;function ha(e,t){return e.useMedium(t),ma}var ga=pa(),_a=function(){},va=z.forwardRef(function(e,t){var n=z.useRef(null),r=z.useState({onScrollCapture:_a,onWheelCapture:_a,onTouchMoveCapture:_a}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=ea(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=ua([n,t]),C=$i($i({},b),i);return z.createElement(z.Fragment,null,u&&z.createElement(x,{sideCar:ga,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?z.cloneElement(z.Children.only(s),$i($i({},C),{ref:S})):z.createElement(v,$i({},C,{className:c,ref:S}),s))});va.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},va.classNames={fullWidth:ra,zeroRight:na};var ya,ba=function(){if(ya)return ya;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function xa(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ba();return t&&e.setAttribute(`nonce`,t),e}function Sa(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ca(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var wa=function(){var e=0,t=null;return{add:function(n){e==0&&(t=xa())&&(Sa(t,n),Ca(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ta=function(){var e=wa();return function(t,n){z.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ea=function(){var e=Ta();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Da={left:0,top:0,right:0,gap:0},Oa=function(e){return parseInt(e||``,10)||0},ka=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[Oa(n),Oa(r),Oa(i)]},Aa=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Da;var t=ka(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])}},ja=Ea(),Ma=`data-scroll-locked`,Na=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
+ .${ia} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${Ma}] {
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
+ .${na} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${ra} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${na} .${na} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${ra} .${ra} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${Ma}] {
36
+ ${aa}: ${s}px;
37
+ }
38
+ `},Pa=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Fa=function(){z.useEffect(function(){return document.body.setAttribute(Ma,(Pa()+1).toString()),function(){var e=Pa()-1;e<=0?document.body.removeAttribute(Ma):document.body.setAttribute(Ma,e.toString())}},[])},Ia=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Fa();var a=z.useMemo(function(){return Aa(i)},[i]);return z.createElement(ja,{styles:Na(a,!t,i,n?``:`!important`)})},La=!1;if(typeof window<`u`)try{var Ra=Object.defineProperty({},"passive",{get:function(){return La=!0,!0}});window.addEventListener(`test`,Ra,Ra),window.removeEventListener(`test`,Ra,Ra)}catch{La=!1}var za=La?{passive:!1}:!1,Ba=function(e){return e.tagName===`TEXTAREA`},Va=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ba(e)&&n[t]===`visible`)},Ha=function(e){return Va(e,`overflowY`)},Ua=function(e){return Va(e,`overflowX`)},Wa=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),qa(e,r)){var i=Ja(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ga=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Ka=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},qa=function(e,t){return e===`v`?Ha(t):Ua(t)},Ja=function(e,t){return e===`v`?Ga(t):Ka(t)},Ya=function(e,t){return e===`h`&&t===`rtl`?-1:1},Xa=function(e,t,n,r,i){var a=Ya(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=Ja(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&qa(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},Za=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qa=function(e){return[e.deltaX,e.deltaY]},$a=function(e){return e&&`current`in e?e.current:e},eo=function(e,t){return e[0]===t[0]&&e[1]===t[1]},to=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},no=0,ro=[];function io(e){var t=z.useRef([]),n=z.useRef([0,0]),r=z.useRef(),i=z.useState(no++)[0],a=z.useState(Ea)[0],o=z.useRef(e);z.useEffect(function(){o.current=e},[e]),z.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ta([e.lockRef.current],(e.shards||[]).map($a),!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 s=z.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Za(e),a=n.current,s=`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(s)>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=Wa(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Wa(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Xa(h,t,e,h===`h`?s:c,!0)},[]),c=z.useCallback(function(e){var n=e;if(!(!ro.length||ro[ro.length-1]!==a)){var r=`deltaY`in n?Qa(n):Za(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&eo(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map($a).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=z.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ao(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=z.useCallback(function(e){n.current=Za(e),r.current=void 0},[]),d=z.useCallback(function(t){l(t.type,Qa(t),t.target,s(t,e.lockRef.current))},[]),f=z.useCallback(function(t){l(t.type,Za(t),t.target,s(t,e.lockRef.current))},[]);z.useEffect(function(){return ro.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,za),document.addEventListener(`touchmove`,c,za),document.addEventListener(`touchstart`,u,za),function(){ro=ro.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,za),document.removeEventListener(`touchmove`,c,za),document.removeEventListener(`touchstart`,u,za)}},[]);var p=e.removeScrollBar,m=e.inert;return z.createElement(z.Fragment,null,m?z.createElement(a,{styles:to(i)}):null,p?z.createElement(Ia,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ao(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var oo=ha(ga,io),so=z.forwardRef(function(e,t){return z.createElement(va,$i({},e,{ref:t,sideCar:oo}))});so.classNames=va.classNames;var co=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},lo=new WeakMap,uo=new WeakMap,fo={},po=0,mo=function(e){return e&&(e.host||mo(e.parentNode))},ho=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mo(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})},go=function(e,t,n,r){var i=ho(t,Array.isArray(e)?e:[e]);fo[n]||(fo[n]=new WeakMap);var a=fo[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=(lo.get(e)||0)+1,l=(a.get(e)||0)+1;lo.set(e,c),a.set(e,l),o.push(e),c===1&&i&&uo.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(),po++,function(){o.forEach(function(e){var t=lo.get(e)-1,i=a.get(e)-1;lo.set(e,t),a.set(e,i),t||(uo.has(e)||e.removeAttribute(r),uo.delete(e)),i||e.removeAttribute(n)}),po--,po||(lo=new WeakMap,lo=new WeakMap,uo=new WeakMap,fo={})}},_o=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||co(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),go(r,i,n,`aria-hidden`)):function(){return null}},vo=Object.defineProperty,yo=(e,t)=>vo(e,`name`,{value:t,configurable:!0}),bo=`Dialog`,[xo,So]=Ot(bo),[Co,wo]=xo(bo),To=yo(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=z.useRef(null),c=z.useRef(null),[l,u]=sn({prop:r,defaultProp:i??!1,onChange:a,caller:bo}),[d,f]=z.useState(0),[p,m]=z.useState(0);return(0,B.jsx)(Co,{scope:t,triggerRef:s,contentRef:c,contentId:An(),titleId:An(),descriptionId:An(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:z.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),Eo=`DialogPortal`,[Do,Oo]=xo(Eo,{forceMount:void 0}),ko=yo(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=wo(Eo,t);return(0,B.jsx)(Do,{scope:t,forceMount:n,children:z.Children.map(r,e=>(0,B.jsx)(bn,{present:n||a.open,children:(0,B.jsx)(Gi,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Ao=`DialogOverlay`,jo=z.forwardRef(yo(function(e,t){let n=Oo(Ao,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=wo(Ao,e.__scopeDialog);return a.modal?(0,B.jsx)(bn,{present:r||a.open,children:(0,B.jsx)(No,{...i,ref:t})}):null},`DialogOverlay`)),Mo=n(`DialogOverlay.RemoveScroll`),No=z.forwardRef(yo(function(e,t){let{__scopeDialog:n,...r}=e,i=wo(Ao,n),a=c(t,xi());return(0,B.jsx)(so,{as:Mo,allowPinchZoom:!0,shards:[i.contentRef],children:(0,B.jsx)(hn.div,{"data-state":Go(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Po=`DialogContent`,Fo=z.forwardRef(yo(function(e,t){let n=Oo(Po,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=wo(Po,e.__scopeDialog);return(0,B.jsx)(bn,{present:r||a.open,children:a.modal?(0,B.jsx)(Io,{...i,ref:t}):(0,B.jsx)(Lo,{...i,ref:t})})},`DialogContent`)),Io=z.forwardRef(yo(function(e,t){let n=wo(Po,e.__scopeDialog),r=z.useRef(null),i=c(t,n.contentRef,r);return z.useEffect(()=>{let e=r.current;if(e)return _o(e)},[]),(0,B.jsx)(Ro,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Kt(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Kt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Kt(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Lo=z.forwardRef(yo(function(e,t){let n=wo(Po,e.__scopeDialog),r=z.useRef(!1),i=z.useRef(!1);return(0,B.jsx)(Ro,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ro=z.forwardRef(yo(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=wo(Po,n);return Zi(),(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(Mi,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,B.jsx)(bi,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Go(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),zo=`DialogTitle`,Bo=z.forwardRef(yo(function(e,t){let{__scopeDialog:n,...r}=e,i=wo(zo,n),{setTitleCount:a}=i;return Zt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,B.jsx)(hn.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Vo=`DialogDescription`,Ho=z.forwardRef(yo(function(e,t){let{__scopeDialog:n,...r}=e,i=wo(Vo,n),{setDescriptionCount:a}=i;return Zt(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,B.jsx)(hn.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Uo=`DialogClose`,Wo=z.forwardRef(yo(function(e,t){let{__scopeDialog:n,...r}=e,i=wo(Uo,n);return(0,B.jsx)(hn.button,{type:`button`,...r,ref:t,onClick:Kt(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Go(e){return e?`open`:`closed`}yo(Go,`getState`);function Ko({...e}){return(0,B.jsx)(To,{"data-slot":`dialog`,...e})}function qo({...e}){return(0,B.jsx)(ko,{"data-slot":`dialog-portal`,...e})}function Jo({...e}){return(0,B.jsx)(Wo,{"data-slot":`dialog-close`,...e})}function Yo({className:e,...t}){return(0,B.jsx)(jo,{"data-slot":`dialog-overlay`,className:x(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function Xo({className:e,children:t,showCloseButton:n=!0,...r}){return(0,B.jsxs)(qo,{"data-slot":`dialog-portal`,children:[(0,B.jsx)(Yo,{}),(0,B.jsxs)(Fo,{"data-slot":`dialog-content`,className:x(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,B.jsxs)(Wo,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity 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,B.jsx)(ft,{}),(0,B.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function Zo({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`dialog-header`,className:x(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Qo({className:e,showCloseButton:t=!1,children:n,...r}){return(0,B.jsxs)(`div`,{"data-slot":`dialog-footer`,className:x(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,B.jsx)(Wo,{asChild:!0,children:(0,B.jsx)(ui,{variant:`outline`,children:`Close`})})]})}function $o({className:e,...t}){return(0,B.jsx)(Bo,{"data-slot":`dialog-title`,className:x(`text-lg leading-none font-semibold`,e),...t})}function es({className:e,...t}){return(0,B.jsx)(Ho,{"data-slot":`dialog-description`,className:x(`text-sm text-muted-foreground`,e),...t})}function ts({className:e,type:t,...n}){return(0,B.jsx)(`input`,{type:t,"data-slot":`input`,className:x(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}var ns=Object.defineProperty,rs=z.forwardRef(((e,t)=>ns(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,B.jsx)(hn.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));function is({className:e,...t}){return(0,B.jsx)(rs,{"data-slot":`label`,className:x(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var as=[`top`,`right`,`bottom`,`left`],os=Math.min,ss=Math.max,cs=Math.round,ls=Math.floor,us=e=>({x:e,y:e}),ds={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function fs(e,t,n){return ss(e,os(t,n))}function ps(e,t){return typeof e==`function`?e(t):e}function ms(e){return e.split(`-`)[0]}function hs(e){return e.split(`-`)[1]}function gs(e){return e===`x`?`y`:`x`}function _s(e){return e===`y`?`height`:`width`}function vs(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ys(e){return gs(vs(e))}function bs(e,t,n){n===void 0&&(n=!1);let r=hs(e),i=ys(e),a=_s(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ks(o)),[o,ks(o)]}function xs(e){let t=ks(e);return[Ss(e),t,Ss(t)]}function Ss(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Cs=[`left`,`right`],ws=[`right`,`left`],Ts=[`top`,`bottom`],Es=[`bottom`,`top`];function Ds(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ws:Cs:t?Cs:ws;case`left`:case`right`:return t?Ts:Es;default:return[]}}function Os(e,t,n,r){let i=hs(e),a=Ds(ms(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ss)))),a}function ks(e){let t=ms(e);return ds[t]+e.slice(t.length)}function As(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function js(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:As(e)}function Ms(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 Ns(e,t,n){let{reference:r,floating:i}=e,a=vs(t),o=ys(t),s=_s(o),c=ms(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=hs(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ps(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}=ps(t,e),p=js(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ms(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=Ms(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 Fs=50,Is=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ps},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ns(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<Fs&&(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}=Ns(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ls=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}=ps(e,t)||{};if(l==null)return{};let d=js(u),f={x:n,y:r},p=ys(i),m=_s(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=os(d[_],T),D=os(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=fs(E,k,O),j=!c.arrow&&hs(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}}}),Rs=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}=ps(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ms(r),_=vs(o),v=ms(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ks(o)]:xs(o)),x=p!==`none`;!d&&x&&b.push(...Os(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=bs(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`&&_!==vs(t))||T.every(e=>vs(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=vs(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 zs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bs(e){return as.some(t=>e[t]>=0)}var Vs=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ps(e,t);switch(i){case`referenceHidden`:{let e=zs(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Bs(e)}}}case`escaped`:{let e=zs(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Bs(e)}}}default:return{}}}}},Hs=new Set([`left`,`top`]);async function Us(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ms(n),s=hs(n),c=vs(n)===`y`,l=Hs.has(o)?-1:1,u=a&&c?-1:1,d=ps(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 Ws=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 Us(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}}}}},Gs=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}=ps(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=vs(i),p=gs(f),m=u[p],h=u[f],g=(e,t)=>fs(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}}}}}},Ks=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}=ps(e,t),u={x:n,y:r},d=vs(i),f=gs(d),p=u[f],m=u[d],h=ps(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=Hs.has(ms(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}}}},qs=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}=ps(e,t),c=await i.detectOverflow(t,s),l=ms(n),u=hs(n),d=vs(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=os(p-c[m],g),y=os(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*ss(c.left,c.right):S=p-2*ss(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 Js(){return typeof window<`u`}function Ys(e){return Qs(e)?(e.nodeName||``).toLowerCase():`#document`}function Xs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zs(e){return((Qs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Qs(e){return Js()?e instanceof Node||e instanceof Xs(e).Node:!1}function $s(e){return Js()?e instanceof Element||e instanceof Xs(e).Element:!1}function ec(e){return Js()?e instanceof HTMLElement||e instanceof Xs(e).HTMLElement:!1}function tc(e){return!Js()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Xs(e).ShadowRoot}function nc(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=pc(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function rc(e){return/^(table|td|th)$/.test(Ys(e))}function ic(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ac=/transform|translate|scale|rotate|perspective|filter/,oc=/paint|layout|strict|content/,sc=e=>!!e&&e!==`none`,cc;function lc(e){let t=$s(e)?pc(e):e;return sc(t.transform)||sc(t.translate)||sc(t.scale)||sc(t.rotate)||sc(t.perspective)||!dc()&&(sc(t.backdropFilter)||sc(t.filter))||ac.test(t.willChange||``)||oc.test(t.contain||``)}function uc(e){let t=hc(e);for(;ec(t)&&!fc(t);){if(lc(t))return t;if(ic(t))return null;t=hc(t)}return null}function dc(){return cc??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),cc}function fc(e){return/^(html|body|#document)$/.test(Ys(e))}function pc(e){return Xs(e).getComputedStyle(e)}function mc(e){return $s(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hc(e){if(Ys(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||tc(e)&&e.host||Zs(e);return tc(t)?t.host:t}function gc(e){let t=hc(e);return fc(t)?(e.ownerDocument||e).body:ec(t)&&nc(t)?t:gc(t)}function _c(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=gc(e),i=r===e.ownerDocument?.body,a=Xs(r);if(i){let e=vc(a);return t.concat(a,a.visualViewport||[],nc(r)?r:[],e&&n?_c(e):[])}else return t.concat(r,_c(r,[],n))}function vc(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function yc(e){let t=pc(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ec(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=cs(n)!==a||cs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function bc(e){return $s(e)?e:e.contextElement}function xc(e){let t=bc(e);if(!ec(t))return us(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=yc(t),o=(a?cs(n.width):n.width)/r,s=(a?cs(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Sc=us(0);function Cc(e){let t=Xs(e);return!dc()||!t.visualViewport?Sc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function wc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Xs(e)}function Tc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=bc(e),o=us(1);t&&(r?$s(r)&&(o=xc(r)):o=xc(e));let s=wc(a,n,r)?Cc(a):us(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=Xs(a),t=$s(r)?Xs(r):r,n=e,i=vc(n);for(;i&&t!==n;){let e=xc(i),t=i.getBoundingClientRect(),r=pc(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=Xs(i),i=vc(n)}}return Ms({width:u,height:d,x:c,y:l})}function Ec(e,t){let n=mc(e).scrollLeft;return t?t.left+n:Tc(Zs(e)).left+n}function Dc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ec(e,n),y:n.top+t.scrollTop}}function Oc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Zs(r),s=t?ic(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=us(1),u=us(0),d=ec(r);if((d||!a)&&((Ys(r)!==`body`||nc(o))&&(c=mc(r)),d)){let e=Tc(r);l=xc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Dc(o,c):us(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 kc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ac(e){let t=mc(e),n=e.ownerDocument.body,r=ss(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ss(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ec(e),o=-t.scrollTop;return pc(n).direction===`rtl`&&(a+=ss(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var jc=25;function Mc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Xs(e),a=Zs(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!dc()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ec(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<=jc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Nc(e,t){let n=Tc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=xc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Pc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Mc(e,n,t);else if(t===`document`)r=Ac(Zs(e));else if($s(t))r=Nc(t,n);else{let n=Cc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ms(r)}function Fc(e,t){let n=t.get(e);if(n)return n;let r=_c(e,[],!1).filter(e=>$s(e)&&Ys(e)!==`body`),i=null,a=pc(e).position===`fixed`,o=a?hc(e):e;for(;$s(o)&&!fc(o);){let e=pc(o),t=lc(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=hc(o)}return t.set(e,r),r}function Ic(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ic(t)?[]:Fc(t,this._c):[].concat(n),r],o=Pc(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=Pc(t,a[e],i);s=ss(n.top,s),c=os(n.right,c),l=os(n.bottom,l),u=ss(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Lc(e){let{width:t,height:n}=yc(e);return{width:t,height:n}}function Rc(e,t,n){let r=ec(t),i=Zs(t),a=n===`fixed`,o=Tc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=us(0);if((r||!a)&&((Ys(t)!==`body`||nc(i))&&(s=mc(t)),r)){let e=Tc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ec(i));let l=i&&!r&&!a?Dc(i,s):us(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 zc(e){return pc(e).position===`static`}function Bc(e,t){if(!ec(e)||pc(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Zs(e)===n&&(n=n.ownerDocument.body),n}function Vc(e,t){let n=Xs(e);if(ic(e))return n;if(!ec(e)){let t=hc(e);for(;t&&!fc(t);){if($s(t)&&!zc(t))return t;t=hc(t)}return n}let r=Bc(e,t);for(;r&&rc(r)&&zc(r);)r=Bc(r,t);return r&&fc(r)&&zc(r)&&!lc(r)?n:r||uc(e)||n}var Hc=async function(e){let t=this.getOffsetParent||Vc,n=this.getDimensions,r=await n(e.floating);return{reference:Rc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Uc(e){return pc(e).direction===`rtl`}var Wc={convertOffsetParentRelativeRectToViewportRelativeRect:Oc,getDocumentElement:Zs,getClippingRect:Ic,getOffsetParent:Vc,getElementRects:Hc,getClientRects:kc,getDimensions:Lc,getScale:xc,isElement:$s,isRTL:Uc};function Gc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kc(e,t,n){let r=null,i,a=Zs(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=ls(d),h=ls(a.clientWidth-(u+f)),g=ls(a.clientHeight-(d+p)),_=ls(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ss(0,os(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Gc(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=Xs(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function qc(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=bc(e),u=i||a?[...l?_c(l):[],...t?_c(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Kc(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?Tc(e):null;c&&g();function g(){let t=Tc(e);h&&!Gc(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 Jc=Ws,Yc=Gs,Xc=Rs,Zc=qs,Qc=Vs,$c=Ls,el=Ks,tl=(e,t,n)=>{let r=new Map,i=n??{},a={...Wc,...i.platform,_c:r};return Is(e,t,{...i,platform:a})},nl=typeof document<`u`?z.useLayoutEffect:function(){};function rl(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(!rl(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)&&!rl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function il(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function al(e,t){let n=il(e);return Math.round(t*n)/n}function ol(e){let t=z.useRef(e);return nl(()=>{t.current=e}),t}function sl(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]=z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=z.useState(r);rl(f,r)||p(r);let[m,h]=z.useState(null),[g,_]=z.useState(null),v=z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=z.useRef(null),C=z.useRef(null),w=z.useRef(u),T=c!=null,E=ol(c),D=ol(i),O=ol(l),k=z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),tl(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!rl(w.current,t)&&(w.current=t,fn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);nl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=z.useRef(!1);nl(()=>(A.current=!0,()=>{A.current=!1}),[]),nl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=al(M.floating,u.x),r=al(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...il(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var cl=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?{}:$c({element:r.current,padding:i}).fn(n):r?$c({element:r,padding:i}).fn(n):{}}}},ll=(e,t)=>{let n=Jc(e);return{name:n.name,fn:n.fn,options:[e,t]}},ul=(e,t)=>{let n=Yc(e);return{name:n.name,fn:n.fn,options:[e,t]}},dl=(e,t)=>({fn:el(e).fn,options:[e,t]}),fl=(e,t)=>{let n=Xc(e);return{name:n.name,fn:n.fn,options:[e,t]}},pl=(e,t)=>{let n=Zc(e);return{name:n.name,fn:n.fn,options:[e,t]}},ml=(e,t)=>{let n=Qc(e);return{name:n.name,fn:n.fn,options:[e,t]}},hl=(e,t)=>{let n=cl(e);return{name:n.name,fn:n.fn,options:[e,t]}},gl=Object.defineProperty,_l=z.forwardRef(((e,t)=>gl(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,B.jsx)(hn.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,B.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),vl=Object.defineProperty,yl=(e,t)=>vl(e,`name`,{value:t,configurable:!0});function bl(e){let[t,n]=z.useState(void 0);return Zt(()=>{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}yl(bl,`useSize`);var xl=Object.defineProperty,Sl=(e,t)=>xl(e,`name`,{value:t,configurable:!0}),Cl=`Popper`,[wl,Tl]=Ot(Cl),[El,Dl]=wl(Cl),Ol=Sl(e=>{let{__scopePopper:t,children:n}=e,[r,i]=z.useState(null),[a,o]=z.useState(void 0);return(0,B.jsx)(El,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),kl=`PopperAnchor`,Al=z.forwardRef(Sl(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Dl(kl,n),o=z.useRef(null),s=a.onAnchorChange,l=c(t,z.useCallback(e=>{o.current=e,e&&s(e)},[s])),u=z.useRef(null);z.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=a.placementState&&Bl(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,B.jsx)(hn.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),jl=`PopperContent`,[Ml,Nl]=wl(jl),Pl=z.forwardRef(Sl(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=Dl(jl,n),[v,y]=z.useState(null),b=c(t,y),[x,S]=z.useState(null),C=bl(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],k=O.length>0,A={padding:D,boundary:O.filter(Rl),altBoundary:k},{refs:j,floatingStyles:M,placement:N,isPositioned:P,middlewareData:F}=sl({strategy:`fixed`,placement:E,whileElementsMounted:Sl((...e)=>qc(...e,{animationFrame:m===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[ll({mainAxis:i+T,alignmentAxis:o}),l&&ul({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?dl():void 0,...A}),l&&fl({...A}),pl({...A,apply:Sl(({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`)},`apply`)}),x&&hl({element:x,padding:s}),zl({arrowWidth:w,arrowHeight:T}),p&&ml({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),I=_.setPlacementState;Zt(()=>(I(N),()=>{I(void 0)}),[N,I]);let[L,R]=Bl(N),ee=Wr(h);Zt(()=>{P&&ee?.()},[P,ee]);let te=F.arrow?.x,ne=F.arrow?.y,re=F.arrow?.centerOffset!==0,[ie,ae]=z.useState();return Zt(()=>{v&&ae(window.getComputedStyle(v).zIndex)},[v]),(0,B.jsx)(`div`,{ref:j.setFloating,"data-radix-popper-content-wrapper":``,style:{...M,transform:P?M.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,B.jsx)(Ml,{scope:n,placedSide:L,placedAlign:R,onArrowChange:S,arrowX:te,arrowY:ne,shouldHideArrow:re,children:(0,B.jsx)(hn.div,{"data-side":L,"data-align":R,...g,ref:b,style:{...g.style,animation:P?g.style?.animation:`none`}})})})},`PopperContent`)),Fl=`PopperArrow`,Il={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ll=z.forwardRef(Sl(function(e,t){let{__scopePopper:n,...r}=e,i=Nl(Fl,n),a=Il[i.placedSide];return(0,B.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,B.jsx)(_l,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Rl(e){return e!==null}Sl(Rl,`isNotNull`);var zl=Sl(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]=Bl(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}}}}),`transformOrigin`);function Bl(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Sl(Bl,`getSideAndAlignFromPlacement`);var Vl=Ol,Hl=Al,Ul=Pl,Wl=Ll,Gl=Object.defineProperty,Kl=(e,t)=>Gl(e,`name`,{value:t,configurable:!0});function ql(e,[t,n]){return Math.min(n,Math.max(t,e))}Kl(ql,`clamp`);var Jl=Object.defineProperty,Yl=(e,t)=>Jl(e,`name`,{value:t,configurable:!0});function Xl(e,t){return z.useReducer((e,n)=>t[e][n]??e,e)}Yl(Xl,`useStateMachine`);var Zl=`ScrollArea`,[Ql,$l]=Ot(Zl),[eu,tu]=Ql(Zl),nu=z.forwardRef(Yl(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,l]=z.useState(null),[u,d]=z.useState(null),[f,p]=z.useState(null),[m,h]=z.useState(null),[g,_]=z.useState(null),[v,y]=z.useState(0),[b,x]=z.useState(0),[S,C]=z.useState(!1),[w,T]=z.useState(!1),E=c(t,l),D=Zn(i);return(0,B.jsx)(eu,{scope:n,type:r,dir:D,scrollHideDelay:a,scrollArea:s,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:m,onScrollbarXChange:h,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:_,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,B.jsx)(hn.div,{dir:D,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),ru=`ScrollAreaViewport`,iu=z.forwardRef(Yl(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=tu(ru,n),s=c(t,z.useRef(null),o.onViewportChange);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(au,{nonce:i}),(0,B.jsx)(hn.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,B.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),au=z.memo(Yl(function({nonce:e}){return(0,B.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),ou=`ScrollAreaScrollbar`,su=z.forwardRef(Yl(function(e,t){let{forceMount:n,...r}=e,i=tu(ou,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return z.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,B.jsx)(cu,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,B.jsx)(lu,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,B.jsx)(uu,{...r,ref:t,forceMount:n}):i.type===`always`?(0,B.jsx)(du,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),cu=z.forwardRef(Yl(function(e,t){let{forceMount:n,...r}=e,i=tu(ou,e.__scopeScrollArea),[a,o]=z.useState(!1);return z.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=Yl(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=Yl(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,B.jsx)(bn,{present:n||a,children:(0,B.jsx)(uu,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),lu=z.forwardRef(Yl(function(e,t){let{forceMount:n,...r}=e,i=tu(ou,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=ju(()=>c(`SCROLL_END`),100),[s,c]=Xl(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return z.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),z.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=Yl(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,B.jsx)(bn,{present:n||s!==`hidden`,children:(0,B.jsx)(du,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Kt(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Kt(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),uu=z.forwardRef(Yl(function(e,t){let n=tu(ou,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=z.useState(!1),s=e.orientation===`horizontal`,c=ju(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Mu(n.viewport,c),Mu(n.content,c),(0,B.jsx)(bn,{present:r||a,children:(0,B.jsx)(du,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),du=z.forwardRef(Yl(function(e,t){let{orientation:n=`vertical`,...r}=e,i=tu(ou,e.__scopeScrollArea),a=z.useRef(null),o=z.useRef(0),[s,c]=z.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=wu(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:Yl(e=>a.current=e,`onThumbChange`),onThumbPointerUp:Yl(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:Yl(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return Eu(e,o.current,s,t)}return Yl(d,`getScrollPosition`),n===`horizontal`?(0,B.jsx)(fu,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Du(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,B.jsx)(pu,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Du(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),fu=z.forwardRef(Yl(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=tu(ou,e.__scopeScrollArea),[o,s]=z.useState(),l=z.useRef(null),u=c(t,l,a.onScrollbarXChange);return z.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,B.jsx)(gu,{"data-orientation":`horizontal`,...i,ref:u,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":Tu(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),ku(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Cu(o.paddingLeft),paddingEnd:Cu(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),pu=z.forwardRef(Yl(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=tu(ou,e.__scopeScrollArea),[o,s]=z.useState(),l=z.useRef(null),u=c(t,l,a.onScrollbarYChange);return z.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),(0,B.jsx)(gu,{"data-orientation":`vertical`,...i,ref:u,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":Tu(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),ku(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Cu(o.paddingTop),paddingEnd:Cu(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[mu,hu]=Ql(ou),gu=z.forwardRef(Yl(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,m=tu(ou,n),[h,g]=z.useState(null),_=c(t,g),v=z.useRef(null),y=z.useRef(``),b=m.viewport,x=r.content-r.viewport,S=Wr(d),C=Wr(l),w=ju(f,10);function T(e){if(v.current){let t=e.clientX-v.current.left,n=e.clientY-v.current.top;u({x:t,y:n})}}return Yl(T,`handleDragScroll`),z.useEffect(()=>{let e=Yl(e=>{let t=e.target;h?.contains(t)&&S(e,x)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,h,x,S]),z.useEffect(C,[r,C]),Mu(h,w),Mu(m.content,w),(0,B.jsx)(mu,{scope:n,scrollbar:h,hasThumb:i,onThumbChange:Wr(a),onThumbPointerUp:Wr(o),onThumbPositionChange:C,onThumbPointerDown:Wr(s),children:(0,B.jsx)(hn.div,{...p,ref:_,style:{position:`absolute`,...p.style},onPointerDown:Kt(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),v.current=h.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,m.viewport&&(m.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:Kt(e.onPointerMove,T),onPointerUp:Kt(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=``),v.current=null})})})},`ScrollAreaScrollbarImpl`)),_u=`ScrollAreaThumb`,vu=z.forwardRef(Yl(function(e,t){let{forceMount:n,...r}=e,i=hu(_u,e.__scopeScrollArea);return(0,B.jsx)(bn,{present:n||i.hasThumb,children:(0,B.jsx)(yu,{ref:t,...r})})},`ScrollAreaThumb`)),yu=z.forwardRef(Yl(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=tu(_u,n),o=hu(_u,n),{onThumbPositionChange:s}=o,l=c(t,o.onThumbChange),u=z.useRef(void 0),d=ju(()=>{u.current&&=(u.current(),void 0)},100);return z.useEffect(()=>{let e=a.viewport;if(e){let t=Yl(()=>{if(d(),!u.current){let t=Au(e,s);u.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,d,s]),(0,B.jsx)(hn.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:l,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Kt(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Kt(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),bu=`ScrollAreaCorner`,xu=z.forwardRef(Yl(function(e,t){let n=tu(bu,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,B.jsx)(Su,{...e,ref:t}):null},`ScrollAreaCorner`)),Su=z.forwardRef(Yl(function(e,t){let{__scopeScrollArea:n,...r}=e,i=tu(bu,n),[a,o]=z.useState(0),[s,c]=z.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return Mu(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Mu(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),z.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,B.jsx)(hn.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function Cu(e){return e?parseInt(e,10):0}Yl(Cu,`toInt`);function wu(e,t){let n=e/t;return isNaN(n)?0:n}Yl(wu,`getThumbRatio`);function Tu(e){let t=wu(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}Yl(Tu,`getThumbSize`);function Eu(e,t,n,r=`ltr`){let i=Tu(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Ou([c,l],d)(e)}Yl(Eu,`getScrollPositionFromPointer`);function Du(e,t,n=`ltr`){let r=Tu(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=ql(e,n===`ltr`?[0,o]:[o*-1,0]);return Ou([0,o],[0,s])(c)}Yl(Du,`getThumbOffsetFromScroll`);function Ou(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Yl(Ou,`linearScale`);function ku(e,t){return e>0&&e<t}Yl(ku,`isScrollingWithinScrollbarBounds`);var Au=Yl((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return Yl((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function ju(e,t){let n=Wr(e),r=z.useRef(0);return z.useEffect(()=>()=>window.clearTimeout(r.current),[]),z.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}Yl(ju,`useDebounceCallback`);function Mu(e,t){let n=Wr(t);Zt(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}Yl(Mu,`useResizeObserver`);var Nu=nu,Pu=iu,Fu=xu;function Iu({className:e,children:t,...n}){return(0,B.jsxs)(Nu,{"data-slot":`scroll-area`,className:x(`relative`,e),...n,children:[(0,B.jsx)(Pu,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1`,children:t}),(0,B.jsx)(Lu,{}),(0,B.jsx)(Fu,{})]})}function Lu({className:e,orientation:t=`vertical`,...n}){return(0,B.jsx)(su,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:x(`flex touch-none p-px transition-colors select-none`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent`,e),...n,children:(0,B.jsx)(vu,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}var Ru=Object.defineProperty,zu=(e,t)=>Ru(e,`name`,{value:t,configurable:!0}),Bu=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Vu=z.forwardRef(zu(function(e,t){return(0,B.jsx)(hn.span,{...e,ref:t,style:{...Bu,...e.style}})},`VisuallyHidden`)),Hu=Object.defineProperty,Uu=(e,t)=>Hu(e,`name`,{value:t,configurable:!0}),Wu=`horizontal`,Gu=[`horizontal`,`vertical`],Ku=z.forwardRef(Uu(function(e,t){let{decorative:n,orientation:r=Wu,...i}=e,a=qu(r)?r:Wu,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,B.jsx)(hn.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function qu(e){return Gu.includes(e)}Uu(qu,`isValidOrientation`);var Ju=Ku;function Yu({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,B.jsx)(Ju,{"data-slot":`separator`,decorative:n,orientation:t,className:x(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function Xu({className:e,...t}){return(0,B.jsx)(`div`,{"data-slot":`skeleton`,className:x(`animate-pulse rounded-md bg-accent`,e),...t})}var Zu=Object.defineProperty,Qu=(e,t)=>Zu(e,`name`,{value:t,configurable:!0}),$u=!1;function ed(){let[e,t]=z.useState($u);return z.useEffect(()=>{$u||($u=!0,t(!0))},[]),e}Qu(ed,`useIsHydrated`);var td=z.useSyncExternalStore;function nd(){return()=>{}}Qu(nd,`subscribe`);function rd(){return td(nd,()=>!0,()=>!1)}Qu(rd,`useIsHydratedModern`);var id=typeof td==`function`?rd:ed,ad=Object.defineProperty,od=(e,t)=>ad(e,`name`,{value:t,configurable:!0}),sd=`rovingFocusGroup.onEntryFocus`,cd={bubbles:!1,cancelable:!0},ld=`RovingFocusGroup`,[ud,dd,fd]=Mt(ld),[pd,md]=Ot(ld,[fd]),[hd,gd]=pd(ld),_d=z.forwardRef(od(function(e,t){return(0,B.jsx)(ud.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(ud.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,B.jsx)(vd,{...e,ref:t})})})},`RovingFocusGroup`)),vd=z.forwardRef(od(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,p=z.useRef(null),m=c(t,p),h=Zn(a),[g,_]=sn({prop:o,defaultProp:s??null,onChange:l,caller:ld}),[v,y]=z.useState(!1),b=Wr(u),x=dd(n),S=z.useRef(!1),[C,w]=z.useState(0);return z.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(sd,b),()=>e.removeEventListener(sd,b)},[b]),(0,B.jsx)(hd,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:z.useCallback(e=>_(e),[_]),onItemShiftTab:z.useCallback(()=>y(!0),[]),onFocusableItemAdd:z.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:z.useCallback(()=>w(e=>e-1),[]),children:(0,B.jsx)(hn.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:Kt(e.onMouseDown,()=>{S.current=!0}),onFocus:Kt(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(sd,cd);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);wd([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}S.current=!1}),onBlur:Kt(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),yd=`RovingFocusGroupItem`,bd=z.forwardRef(od(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=An(),l=a||c,u=gd(yd,n),d=u.currentTabStopId===l,f=dd(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=id();return Zt(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),z.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,B.jsx)(ud.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,B.jsx)(hn.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Kt(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Kt(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Kt(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Cd(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?Td(n,r+1):n.slice(r+1)}setTimeout(()=>wd(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),xd={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Sd(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}od(Sd,`getDirectionAwareKey`);function Cd(e,t,n){let r=Sd(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return xd[r]}od(Cd,`getFocusIntent`);function wd(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}od(wd,`focusFirst`);function Td(e,t){return e.map((n,r)=>e[(t+r)%e.length])}od(Td,`wrapArray`);var Ed=_d,Dd=bd,Od=Object.defineProperty,kd=(e,t)=>Od(e,`name`,{value:t,configurable:!0}),Ad=`Tabs`,[jd,Md]=Ot(Ad,[md]),Nd=md(),[Pd,Fd]=jd(Ad),Id=z.forwardRef(kd(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Zn(s),[d,f]=sn({prop:r,onChange:i,defaultProp:a??``,caller:Ad});return(0,B.jsx)(Pd,{scope:n,baseId:An(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,B.jsx)(hn.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),Ld=`TabsList`,Rd=z.forwardRef(kd(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Fd(Ld,n),o=Nd(n);return(0,B.jsx)(Ed,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,B.jsx)(hn.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),zd=`TabsTrigger`,Bd=z.forwardRef(kd(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Fd(zd,n),s=Nd(n),c=Ud(o.baseId,r),l=Wd(o.baseId,r),u=r===o.value;return(0,B.jsx)(Dd,{asChild:!0,...s,focusable:!i,active:u,children:(0,B.jsx)(hn.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Kt(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Kt(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Kt(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Vd=`TabsContent`,Hd=z.forwardRef(kd(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Fd(Vd,n),c=Ud(s.baseId,r),l=Wd(s.baseId,r),u=r===s.value,d=z.useRef(u);return z.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,B.jsx)(bn,{present:i||u,children:({present:n})=>(0,B.jsx)(hn.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Ud(e,t){return`${e}-trigger-${t}`}kd(Ud,`makeTriggerId`);function Wd(e,t){return`${e}-content-${t}`}kd(Wd,`makeContentId`);var Gd=Id,Kd=Rd,qd=Bd,Jd=Hd;function Yd({className:e,orientation:t=`horizontal`,...n}){return(0,B.jsx)(Gd,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:x(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Xd=v(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function Zd({className:e,variant:t=`default`,...n}){return(0,B.jsx)(Kd,{"data-slot":`tabs-list`,"data-variant":t,className:x(Xd({variant:t}),e),...n})}function Qd({className:e,...t}){return(0,B.jsx)(qd,{"data-slot":`tabs-trigger`,className:x(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function $d({className:e,...t}){return(0,B.jsx)(Jd,{"data-slot":`tabs-content`,className:x(`flex-1 outline-none`,e),...t})}var ef=Object.defineProperty,tf=(e,t)=>ef(e,`name`,{value:t,configurable:!0}),[nf,rf]=Ot(`Tooltip`,[Tl]),af=Tl(),of=`TooltipProvider`,sf=700,cf=`tooltip.open`,[lf,uf]=nf(of),df=tf(e=>{let{__scopeTooltip:t,delayDuration:n=sf,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=z.useRef(!0),s=z.useRef(!1),c=z.useRef(0);return z.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,B.jsx)(lf,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:z.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:z.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:z.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),ff=`Tooltip`,[pf,mf]=nf(ff),hf=tf(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=uf(ff,e.__scopeTooltip),l=af(t),[u,d]=z.useState(null),[f,p]=z.useState(void 0),m=An(),h=z.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=z.useRef(!1),[y,b]=sn({prop:r,defaultProp:i??!1,onChange:tf(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(cf))):c.onClose(),a?.(e)},`onChange`),caller:ff}),x=z.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=z.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=z.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=z.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);z.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let T=f??m;return(0,B.jsx)(Vl,{...l,children:(0,B.jsx)(pf,{scope:t,contentId:T,setContentId:p,open:y,stateAttribute:x,trigger:u,onTriggerChange:d,onTriggerEnter:z.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:z.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})},`Tooltip`),gf=`TooltipTrigger`,_f=z.forwardRef(tf(function(e,t){let{__scopeTooltip:n,...r}=e,i=mf(gf,n),a=uf(gf,n),o=af(n),s=c(t,z.useRef(null),i.onTriggerChange),l=z.useRef(!1),u=z.useRef(!1),d=z.useCallback(()=>l.current=!1,[]);return z.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,B.jsx)(Hl,{asChild:!0,...o,children:(0,B.jsx)(hn.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Kt(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Kt(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Kt(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:Kt(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Kt(e.onBlur,i.onClose),onClick:Kt(e.onClick,i.onClose)})})},`TooltipTrigger`)),vf=`TooltipPortal`,[yf,bf]=nf(vf,{forceMount:void 0}),xf=tf(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=mf(vf,t);return(0,B.jsx)(yf,{scope:t,forceMount:n,children:(0,B.jsx)(bn,{present:n||a.open,children:(0,B.jsx)(Gi,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Sf=`TooltipContent`,Cf=z.forwardRef(tf(function(e,t){let n=bf(Sf,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=mf(Sf,e.__scopeTooltip);return(0,B.jsx)(bn,{present:r||o.open,children:o.disableHoverableContent?(0,B.jsx)(Ef,{side:i,...a,ref:t}):(0,B.jsx)(wf,{side:i,...a,ref:t})})},`TooltipContent`)),wf=z.forwardRef(tf(function(e,t){let n=mf(Sf,e.__scopeTooltip),r=uf(Sf,e.__scopeTooltip),i=z.useRef(null),a=c(t,i),[o,s]=z.useState(null),{trigger:l,onClose:u}=n,d=i.current,{onPointerInTransitChange:f}=r,p=z.useCallback(()=>{s(null),f(!1)},[f]),m=z.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=kf(r,Of(r,n.getBoundingClientRect())),a=Af(t.getBoundingClientRect()),o=Mf([...i,...a]);s(o),f(!0)},[f]);return z.useEffect(()=>()=>p(),[p]),z.useEffect(()=>{if(l&&d){let e=tf(e=>m(e,d),`handleTriggerLeave`),t=tf(e=>m(e,l),`handleContentLeave`);return l.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{l.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[l,d,m,p]),z.useEffect(()=>{if(o){let e=tf(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=l?.contains(t)||d?.contains(t),i=!jf(n,o);r?p():i&&(p(),u())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[l,d,o,u,p]),(0,B.jsx)(Ef,{...e,ref:a})},`TooltipContentHoverable`)),Tf=S(`TooltipContent`),Ef=z.forwardRef(tf(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=mf(Sf,n),u=af(n),{onClose:d}=l;z.useEffect(()=>(document.addEventListener(cf,d),()=>document.removeEventListener(cf,d)),[d]),z.useEffect(()=>{if(l.trigger){let e=tf(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Zt(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,B.jsx)(bi,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,B.jsxs)(Ul,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,B.jsx)(Tf,{children:r}),i?(0,B.jsx)(Vu,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Df=z.forwardRef(tf(function(e,t){let{__scopeTooltip:n,...r}=e,i=af(n);return(0,B.jsx)(Wl,{...i,...r,ref:t})},`TooltipArrow`));function Of(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}tf(Of,`getExitSideFromRect`);function kf(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}tf(kf,`getPaddedExitPoints`);function Af(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}tf(Af,`getPointsFromRect`);function jf(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}tf(jf,`isPointInPolygon`);function Mf(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Nf(t)}tf(Mf,`getHull`);function Nf(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}tf(Nf,`getHullPresorted`);var Pf=df,Ff=hf,If=_f,Lf=xf,Rf=Cf,zf=Df;function Bf({delayDuration:e=0,...t}){return(0,B.jsx)(Pf,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Vf({...e}){return(0,B.jsx)(Ff,{"data-slot":`tooltip`,...e})}function Hf({...e}){return(0,B.jsx)(If,{"data-slot":`tooltip-trigger`,...e})}function Uf({className:e,sideOffset:t=0,children:n,...r}){return(0,B.jsx)(Lf,{children:(0,B.jsxs)(Rf,{"data-slot":`tooltip-content`,sideOffset:t,className:x(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,B.jsx)(zf,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var Wf={completed:`Completed`,failed:`Failed`,running:`Running`,stopped:`Stopped`};function Gf({state:e}){let t=Object.hasOwn(Wf,e)?e:`unknown`;return(0,B.jsxs)(f,{className:x(`gap-1.5 uppercase tracking-[.03em]`,{"border-destructive bg-destructive-surface text-destructive":t===`failed`,"border-info bg-info-surface text-info":t===`running`,"border-success bg-success-surface text-success":t===`completed`,"border-warning bg-warning-surface text-warning":t===`stopped`}),variant:`outline`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:x(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),Wf[e]??e]})}var Kf=`tool_result`;function qf(...e){for(let t of e)if(t!=null)return t;return null}function Jf(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n?.call&&!n.result)return n}}function Yf({call:e,result:t}){let n=e??t,r=n?.kind??Kf;return{eventIndices:[e?.index,t?.index].filter(e=>e!==void 0),durationMs:qf(e?.durationMs,t?.durationMs),finishedAt:qf(e?.finishedAt,t?.finishedAt),id:`tool-${n?.index??0}`,input:e?.input??t?.input,kind:r,name:qf(e?.name,t?.name)??r,output:qf(t?.output,e?.output),startedAt:qf(e?.startedAt,t?.startedAt),status:qf(e?.status,t?.status),timingSource:qf(e?.timingSource,t?.timingSource),toolCallId:qf(e?.toolCallId,t?.toolCallId)}}function Xf(e){let t=[],n=new Map;for(let r of e){if(r.kind===Kf){let e=r.toolCallId?n.get(r.toolCallId):Jf(t);if(e&&!e.result){e.result=r,e.call?.toolCallId&&n.delete(e.call.toolCallId);continue}t.push({call:null,result:r});continue}let e={call:r,result:null};t.push(e),r.toolCallId&&n.set(r.toolCallId,e)}return t.map(Yf)}var Zf=[{id:`turns`,label:`Turns`},{id:`phases`,label:`Phases`},{id:`tools`,label:`Tools`}];function Qf(e){if(!e)return null;let t=Date.parse(e);return Number.isFinite(t)?t:null}function $f(e){return typeof e==`number`&&Number.isFinite(e)&&e>=0?e:void 0}function ep(e){let t=[],n=[];for(let r of e.turns){let e=Qf(r.startedAt)??Qf(r.timestamp);if(e===null)continue;let i=$f(r.durationMs),a=Qf(r.finishedAt);t.push({...i===void 0?a===null?{}:{end:a}:{duration:i},turnId:r.id,id:r.id,kind:`turn`,label:`${r.harness} turn`,laneId:`turns`,payload:{turn:r,type:`turn`},start:e,status:r.status});let o=[[`model`,r.modelMs],[`tools`,r.toolMs]],s=e;for(let[e,n]of o){let i=$f(n);i!==void 0&&(t.push({duration:i,id:`${r.id}-phase-${e}`,kind:`${e} phase`,label:`${e===`model`?`Model`:`Tool`} time`,laneId:`phases`,parent:r.id,payload:{turn:r,type:`phase`},start:s,status:r.status}),s+=i)}let c=$f(r.timeToFirstTokenMs);c!==void 0&&n.push({at:e+c,id:`${r.id}-first-token`,label:`First token`,payload:{turn:r,type:`milestone`},status:r.status});for(let n of Xf(r.tools)){let i=Qf(n.startedAt)??e,a=$f(n.durationMs),o=Qf(n.finishedAt);t.push({...a===void 0?o===null?{}:{end:o}:{duration:a},turnId:r.id,...n.toolCallId===null?{}:{toolCallId:n.toolCallId},eventIndex:Number(n.id.slice(5)),id:`${r.id}-${n.id}`,kind:n.kind,label:n.name,laneId:`tools`,parent:r.id,payload:{turn:r,type:`tool`},start:i,status:n.status})}}let r=Qf(e.startedAt);return{items:t,lanes:Zf.filter(e=>t.some(t=>t.laneId===e.id)),markers:n,...r===null?{}:{origin:r}}}function tp({cursor:e,focus:t,expanded:n,onExpandedChange:r,onSelectTurn:i,selectedTurnId:a,turns:o}){let[s,c]=(0,z.useState)(!1),l=n??s,u=ep({turns:o}),d=o.find(e=>e.id===t?.turnId),f=d&&t?Xf(d.tools).find(e=>t.toolCallId===void 0?t.eventIndex!==void 0&&e.eventIndices.includes(t.eventIndex):e.toolCallId===t.toolCallId):void 0,p=t?u.items.find(e=>e.turnId===t.turnId&&e.id===(f?`${t.turnId}-${f.id}`:t.turnId)):void 0;return(0,B.jsx)(wt,{...e===void 0?{}:{cursor:e},expanded:t?!0:l,onExpandedChange:e=>{n===void 0&&c(e),r?.(e)},getFailureExcerpt:e=>e.payload.turn.failureKind,items:u.items,label:`Conversation timeline`,lanes:u.lanes,markers:u.markers,onSelect:e=>i(e.payload.turn.id),...p?{selectedId:p.id}:a?{selectedId:a}:{}})}function np(e){let t=(0,z.useRef)(null),n=(0,z.useRef)(new Map),[r,i]=(0,z.useState)(),a=(0,z.useRef)(new Map);a.current=new Map(e.map(e=>[e.id,e.time]));let o=(0,z.useCallback)(()=>{let r=t.current;if(!r)return;let a=r.getBoundingClientRect().top+Math.min(r.clientHeight*.25,160),o=e.map(e=>({element:n.current.get(e.id),...e})).filter(e=>!!e.element);if(o.length===0)return;let s=o[0];if(!s)return;let c=s;for(let e of o)if(e.element.getBoundingClientRect().top<=a)c=e;else break;i(c.time)},[e]),s=(0,z.useCallback)(e=>{t.current?.removeEventListener(`scroll`,o),t.current=e,e?.addEventListener(`scroll`,o,{passive:!0}),o()},[o]);return(0,z.useEffect)(()=>{o();let e=t.current;return()=>e?.removeEventListener(`scroll`,o)},[o]),{containerRef:s,cursor:r,register:(0,z.useCallback)((e,t)=>{t?n.current.set(e,t):n.current.delete(e)},[]),scrollTo:(0,z.useCallback)(e=>{n.current.get(e)?.scrollIntoView({behavior:`smooth`,block:`start`});let t=a.current.get(e);t!==void 0&&i(t)},[])}}function rp({className:e,from:t,...n}){return(0,B.jsx)(`div`,{className:x(t===`user`?`flex justify-end`:`grid grid-cols-[2rem_minmax(0,1fr)] items-start gap-3.5`,e),"data-message-author":t,...n})}function ip({className:e,...t}){return(0,B.jsx)(`div`,{className:x(`min-w-0`,e),...t})}function ap({children:e,src:t}){return(0,B.jsxs)(oi,{"aria-hidden":`true`,className:`size-8 rounded-[9px]`,children:[t?(0,B.jsx)(ci,{alt:``,src:t}):null,(0,B.jsx)(si,{className:`bg-primary text-[9px] font-extrabold text-primary-foreground`,children:e})]})}var op=/"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/g;function sp(e){try{return JSON.parse(e)}catch{return}}function cp(e,t=2){try{return JSON.stringify(e,null,t)??String(e)}catch{return String(e)}}function lp(e){return cp(e,0)}function up(e,t){return e.startsWith(`"`)?t?`hljs-attr`:`hljs-string`:e===`true`||e===`false`||e===`null`?`hljs-literal`:`hljs-number`}function dp(e){let t=[],n=0;for(let r of e.matchAll(op)){let i=r[0],a=r.index;a>n&&t.push(e.slice(n,a)),n=a+i.length;let o=/^\s*:/.test(e.slice(n));t.push((0,B.jsx)(`span`,{className:up(i,o),children:i},`${a}-${i.length}`))}return n<e.length&&t.push(e.slice(n)),t}function fp({className:e,label:t,value:n}){return(0,B.jsx)(`pre`,{"aria-label":t,className:x(`message-json`,e),children:(0,B.jsx)(`code`,{children:dp(cp(n))})})}function pp(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var mp=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,hp=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gp={};function _p(e,t){return((t||gp).jsx?hp:mp).test(e)}var vp=/[ \t\n\f\r]/g;function yp(e){return typeof e==`object`?e.type===`text`&&bp(e.value):bp(e)}function bp(e){return e.replace(vp,``)===``}var xp=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};xp.prototype.normal={},xp.prototype.property={},xp.prototype.space=void 0;function Sp(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new xp(n,r,t)}function Cp(e){return e.toLowerCase()}var wp=class{constructor(e,t){this.attribute=t,this.property=e}};wp.prototype.attribute=``,wp.prototype.booleanish=!1,wp.prototype.boolean=!1,wp.prototype.commaOrSpaceSeparated=!1,wp.prototype.commaSeparated=!1,wp.prototype.defined=!1,wp.prototype.mustUseProperty=!1,wp.prototype.number=!1,wp.prototype.overloadedBoolean=!1,wp.prototype.property=``,wp.prototype.spaceSeparated=!1,wp.prototype.space=void 0;var Tp=P({boolean:()=>V,booleanish:()=>Dp,commaOrSpaceSeparated:()=>jp,commaSeparated:()=>Ap,number:()=>H,overloadedBoolean:()=>Op,spaceSeparated:()=>kp}),Ep=0,V=Mp(),Dp=Mp(),Op=Mp(),H=Mp(),kp=Mp(),Ap=Mp(),jp=Mp();function Mp(){return 2**++Ep}var Np=Object.keys(Tp),Pp=class extends wp{constructor(e,t,n,r){let i=-1;if(super(e,t),Fp(this,`space`,r),typeof n==`number`)for(;++i<Np.length;){let e=Np[i];Fp(this,Np[i],(n&Tp[e])===Tp[e])}}};Pp.prototype.defined=!0;function Fp(e,t,n){n&&(e[t]=n)}function Ip(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Pp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Cp(r)]=r,n[Cp(a.attribute)]=r}return new xp(t,n,e.space)}var Lp=Ip({properties:{ariaActiveDescendant:null,ariaAtomic:Dp,ariaAutoComplete:null,ariaBusy:Dp,ariaChecked:Dp,ariaColCount:H,ariaColIndex:H,ariaColSpan:H,ariaControls:kp,ariaCurrent:null,ariaDescribedBy:kp,ariaDetails:null,ariaDisabled:Dp,ariaDropEffect:kp,ariaErrorMessage:null,ariaExpanded:Dp,ariaFlowTo:kp,ariaGrabbed:Dp,ariaHasPopup:null,ariaHidden:Dp,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kp,ariaLevel:H,ariaLive:null,ariaModal:Dp,ariaMultiLine:Dp,ariaMultiSelectable:Dp,ariaOrientation:null,ariaOwns:kp,ariaPlaceholder:null,ariaPosInSet:H,ariaPressed:Dp,ariaReadOnly:Dp,ariaRelevant:null,ariaRequired:Dp,ariaRoleDescription:kp,ariaRowCount:H,ariaRowIndex:H,ariaRowSpan:H,ariaSelected:Dp,ariaSetSize:H,ariaSort:null,ariaValueMax:H,ariaValueMin:H,ariaValueNow:H,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Rp(e,t){return t in e?e[t]:t}function zp(e,t){return Rp(e,t.toLowerCase())}var Bp=Ip({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Ap,acceptCharset:kp,accessKey:kp,action:null,allow:null,allowFullScreen:V,allowPaymentRequest:V,allowUserMedia:V,alpha:V,alt:null,as:null,async:V,autoCapitalize:null,autoComplete:kp,autoFocus:V,autoPlay:V,blocking:kp,capture:null,charSet:null,checked:V,cite:null,className:kp,closedBy:null,colorSpace:null,cols:H,colSpan:H,command:null,commandFor:null,content:null,contentEditable:Dp,controls:V,controlsList:kp,coords:H|Ap,crossOrigin:null,data:null,dateTime:null,decoding:null,default:V,defer:V,dir:null,dirName:null,disabled:V,download:Op,draggable:Dp,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:V,formTarget:null,headers:kp,height:H,hidden:Op,high:H,href:null,hrefLang:null,htmlFor:kp,httpEquiv:kp,id:null,imageSizes:null,imageSrcSet:null,inert:V,inputMode:null,integrity:null,is:null,isMap:V,itemId:null,itemProp:kp,itemRef:kp,itemScope:V,itemType:kp,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:V,low:H,manifest:null,max:null,maxLength:H,media:null,method:null,min:null,minLength:H,multiple:V,muted:V,name:null,nonce:null,noModule:V,noValidate:V,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:V,optimum:H,pattern:null,ping:kp,placeholder:null,playsInline:V,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:V,referrerPolicy:null,rel:kp,required:V,reversed:V,rows:H,rowSpan:H,sandbox:kp,scope:null,scoped:V,seamless:V,selected:V,shadowRootClonable:V,shadowRootCustomElementRegistry:V,shadowRootDelegatesFocus:V,shadowRootMode:null,shadowRootSerializable:V,shape:null,size:H,sizes:null,slot:null,span:H,spellCheck:Dp,src:null,srcDoc:null,srcLang:null,srcSet:null,start:H,step:null,style:null,tabIndex:H,target:null,title:null,translate:null,type:null,typeMustMatch:V,useMap:null,value:Dp,width:H,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kp,axis:null,background:null,bgColor:null,border:H,borderColor:null,bottomMargin:H,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:V,declare:V,event:null,face:null,frame:null,frameBorder:null,hSpace:H,leftMargin:H,link:null,longDesc:null,lowSrc:null,marginHeight:H,marginWidth:H,noResize:V,noHref:V,noShade:V,noWrap:V,object:null,profile:null,prompt:null,rev:null,rightMargin:H,rules:null,scheme:null,scrolling:Dp,standby:null,summary:null,text:null,topMargin:H,valueType:null,version:null,vAlign:null,vLink:null,vSpace:H,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:V,disablePictureInPicture:V,disableRemotePlayback:V,exportParts:Ap,part:kp,prefix:null,property:null,results:H,security:null,unselectable:null},space:`html`,transform:zp}),Vp=Ip({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:jp,accentHeight:H,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:H,amplitude:H,arabicForm:null,ascent:H,attributeName:null,attributeType:null,azimuth:H,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:H,by:null,calcMode:null,capHeight:H,className:kp,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:H,diffuseConstant:H,direction:null,display:null,dur:null,divisor:H,dominantBaseline:null,download:V,dx:null,dy:null,edgeMode:null,editable:null,elevation:H,enableBackground:null,end:null,event:null,exponent:H,externalResourcesRequired:null,fill:null,fillOpacity:H,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ap,g2:Ap,glyphName:Ap,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:H,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:H,horizOriginX:H,horizOriginY:H,id:null,ideographic:H,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:H,k:H,k1:H,k2:H,k3:H,k4:H,kernelMatrix:jp,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:H,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:H,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:H,overlineThickness:H,paintOrder:null,panose1:null,path:null,pathLength:H,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kp,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:H,pointsAtY:H,pointsAtZ:H,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:jp,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:jp,rev:jp,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:jp,requiredFeatures:jp,requiredFonts:jp,requiredFormats:jp,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:H,specularExponent:H,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:H,strikethroughThickness:H,string:null,stroke:null,strokeDashArray:jp,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:H,strokeOpacity:H,strokeWidth:null,style:null,surfaceScale:H,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:jp,tabIndex:H,tableValues:null,target:null,targetX:H,targetY:H,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:jp,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:H,underlineThickness:H,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:H,values:null,vAlphabetic:H,vMathematical:H,vectorEffect:null,vHanging:H,vIdeographic:H,version:null,vertAdvY:H,vertOriginX:H,vertOriginY:H,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:H,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Rp}),Hp=Ip({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),Up=Ip({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:zp}),Wp=Ip({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Gp={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Kp=/[A-Z]/g,qp=/-[a-z]/g,Jp=/^data[-\w.:]+$/i;function Yp(e,t){let n=Cp(t),r=t,i=wp;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Jp.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(qp,Zp);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!qp.test(e)){let n=e.replace(Kp,Xp);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Pp}return new i(r,t)}function Xp(e){return`-`+e.toLowerCase()}function Zp(e){return e.charAt(1).toUpperCase()}var Qp=Sp([Lp,Bp,Hp,Up,Wp],`html`),$p=Sp([Lp,Vp,Hp,Up,Wp],`svg`);function em(e){return e.join(` `).trim()}var tm=be(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
42
+ `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(!(e.charAt(0)!=`/`||e.charAt(1)!=`*`)){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),nm=be((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(tm());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),rm=be((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),im=be(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(nm()),r=rm();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),am=sm(`end`),om=sm(`start`);function sm(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function cm(e){let t=om(e),n=am(e);if(t&&n)return{start:t,end:n}}function lm(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?dm(e.position):`start`in e||`end`in e?dm(e):`line`in e||`column`in e?um(e):``}function um(e){return fm(e&&e.line)+`:`+fm(e&&e.column)}function dm(e){return um(e&&e.start)+`-`+um(e&&e.end)}function fm(e){return e&&typeof e==`number`?e:1}var pm=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=lm(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};pm.prototype.file=``,pm.prototype.name=``,pm.prototype.reason=``,pm.prototype.message=``,pm.prototype.stack=``,pm.prototype.column=void 0,pm.prototype.line=void 0,pm.prototype.ancestors=void 0,pm.prototype.cause=void 0,pm.prototype.fatal=void 0,pm.prototype.place=void 0,pm.prototype.ruleId=void 0,pm.prototype.source=void 0;var mm=L(im(),1),hm={}.hasOwnProperty,gm=new Map,_m=/[A-Z]/g,vm=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),ym=new Set([`td`,`th`]);function bm(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=jm(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Am(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?$p:Qp,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=xm(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function xm(e,t,n){if(t.type===`element`)return Sm(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Cm(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Tm(e,t,n);if(t.type===`mdxjsEsm`)return wm(e,t);if(t.type===`root`)return Em(e,t,n);if(t.type===`text`)return Dm(e,t)}function Sm(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=$p,e.schema=i),e.ancestors.push(t);let a=Lm(e,t.tagName,!1),o=Mm(e,t),s=Pm(e,t);return vm.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!yp(e)})),Om(e,o,a,t),km(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Cm(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Rm(e,t.position)}function wm(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rm(e,t.position)}function Tm(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=$p,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Lm(e,t.name,!0),o=Nm(e,t),s=Pm(e,t);return Om(e,o,a,t),km(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Em(e,t,n){let r={};return km(r,Pm(e,t)),e.create(t,e.Fragment,r,n)}function Dm(e,t){return t.value}function Om(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function km(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Am(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function jm(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=om(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Mm(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&hm.call(t.properties,i)){let a=Fm(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&ym.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Nm(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Rm(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Rm(e,t.position);else a=r.value===null||r.value;n[i]=a}return n}function Pm(e,t){let n=[],r=-1,i=e.passKeys?new Map:gm;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=xm(e,a,o);s!==void 0&&n.push(s)}return n}function Fm(e,t,n){let r=Yp(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pp(n):em(n)),r.property===`style`){let t=typeof n==`object`?n:Im(e,String(n));return e.stylePropertyNameCase===`css`&&(t=zm(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Gp[r.property]||r.property:r.attribute,n]}}function Im(e,t){try{return(0,mm.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new pm("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-parse-style-attribute`,r}}function Lm(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=_p(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=_p(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return hm.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rm(e)}function Rm(e,t){let n=new pm("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=`https://github.com/syntax-tree/hast-util-to-jsx-runtime#cannot-handle-mdx-estrees-without-createevaluater`,n}function zm(e){let t={},n;for(n in e)hm.call(e,n)&&(t[Bm(n)]=e[n]);return t}function Bm(e){let t=e.replace(_m,Vm);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Vm(e){return`-`+e.toLowerCase()}var Hm={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},Um={};function Wm(e,t){let n=t||Um;return Gm(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function Gm(e,t,n){if(qm(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Km(e.children,t,n)}return Array.isArray(e)?Km(e,t,n):``}function Km(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Gm(e[i],t,n);return r.join(``)}function qm(e){return!!(e&&typeof e==`object`)}var Jm=document.createElement(`i`);function Ym(e){let t=`&`+e+`;`;Jm.innerHTML=t;let n=Jm.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Xm(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Zm(e,t){return e.length>0?(Xm(e,e.length,0,t),e):t}var Qm={}.hasOwnProperty;function $m(e){let t={},n=-1;for(;++n<e.length;)eh(t,e[n]);return t}function eh(e,t){let n;for(n in t){let r=(Qm.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Qm.call(r,a)||(r[a]=[]);let e=i[a];th(r[a],Array.isArray(e)?e:e?[e]:[])}}}function th(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Xm(e,0,0,r)}function nh(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function rh(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var ih=hh(/[A-Za-z]/),ah=hh(/[\dA-Za-z]/),oh=hh(/[#-'*+\--9=?A-Z^-~]/);function sh(e){return e!==null&&(e<32||e===127)}var ch=hh(/\d/),lh=hh(/[\dA-Fa-f]/),uh=hh(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function dh(e){return e!==null&&(e<0||e===32)}function fh(e){return e===-2||e===-1||e===32}var ph=hh(/\p{P}|\p{S}/u),mh=hh(/\s/);function hh(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function gh(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&ah(e.charCodeAt(n+1))&&ah(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function _h(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return fh(r)?(e.enter(n),s(r)):t(r)}function s(r){return fh(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var vh={tokenize:yh};function yh(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),_h(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return U(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var bh={tokenize:Sh},xh={tokenize:Ch};function Sh(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return Xm(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(xh,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(xh,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return U(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;Xm(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ch(e,t,n){return _h(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function wh(e){if(e===null||dh(e)||mh(e))return 1;if(ph(e))return 2}function Th(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Eh={name:`attention`,resolveAll:Dh,tokenize:Oh};function Dh(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};kh(d,-c),kh(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Zm(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=Zm(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=Zm(l,Th(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Zm(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=Zm(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,Xm(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Oh(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wh(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=wh(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function kh(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Ah={name:`autolink`,tokenize:jh};function jh(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return ih(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||ah(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||ah(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||sh(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):oh(t)?(e.consume(t),l):n(t)}function u(e){return ah(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||ah(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Mh={partial:!0,tokenize:Nh};function Nh(e,t,n){return r;function r(t){return fh(t)?_h(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||U(e)?t(e):n(e)}}var Ph={continuation:{tokenize:Ih},exit:Lh,name:`blockQuote`,tokenize:Fh};function Fh(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return fh(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Ih(e,t,n){let r=this;return i;function i(t){return fh(t)?_h(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ph,t,n)(r)}}function Lh(e){e.exit(`blockQuote`)}var Rh={name:`characterEscape`,tokenize:zh};function zh(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return uh(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Bh={name:`characterReference`,tokenize:Vh};function Vh(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=ah,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=lh,u):(e.enter(`characterReferenceValue`),a=7,o=ch,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===ah&&!Ym(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Hh={partial:!0,tokenize:Gh},Uh={concrete:!0,name:`codeFenced`,tokenize:Wh};function Wh(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),fh(t)?_h(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||U(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Hh,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):fh(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),_h(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||U(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&fh(t)?_h(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||U(t)?e.check(Hh,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||U(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),fh(t)?_h(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),fh(t)?_h(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||U(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Gh(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Kh={name:`codeIndented`,tokenize:Jh},qh={partial:!0,tokenize:Yh};function Jh(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),_h(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):U(t)?e.attempt(qh,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||U(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Yh(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):_h(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):U(e)?i(e):n(e)}}var Xh={name:`codeText`,previous:Qh,resolve:Zh,tokenize:$h};function Zh(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Qh(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function $h(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||U(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var eg=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&tg(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),tg(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),tg(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);tg(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);tg(this.left,t.reverse())}}};function tg(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ng(e){let t={},n=-1,r,i,a,o,s,c,l,u=new eg(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,rg(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Xm(e,0,1/0,u.slice(0)),!l}function rg(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var ig={resolve:og,tokenize:sg},ag={partial:!0,tokenize:cg};function og(e){return ng(e),e}function sg(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):U(t)?e.check(ag,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function cg(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_h(e,a,`linePrefix`)}function a(i){if(i===null||U(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function lg(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||sh(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||U(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||dh(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||sh(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function ug(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):U(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||U(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!fh(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function dg(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_h(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||U(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function fg(e,t){let n;return r;function r(i){return U(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):fh(i)?_h(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var pg={name:`definition`,tokenize:hg},mg={partial:!0,tokenize:gg};function hg(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return ug.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=rh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return dh(t)?fg(e,l)(t):l(t)}function l(t){return lg(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(mg,d,d)(t)}function d(t){return fh(t)?_h(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||U(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function gg(e,t,n){return r;function r(t){return dh(t)?fg(e,i)(t):n(t)}function i(t){return dg(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return fh(t)?_h(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||U(e)?t(e):n(e)}}var _g={name:`hardBreakEscape`,tokenize:vg};function vg(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return U(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var yg={name:`headingAtx`,resolve:bg,tokenize:xg};function bg(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},Xm(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function xg(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||dh(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||U(n)?(e.exit(`atxHeading`),t(n)):fh(n)?_h(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||dh(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Sg=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Cg=[`pre`,`script`,`style`,`textarea`],wg={concrete:!0,name:`htmlFlow`,resolveTo:Dg,tokenize:Og},Tg={partial:!0,tokenize:Ag},Eg={partial:!0,tokenize:kg};function Dg(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Og(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:I):ih(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):ih(a)?(e.consume(a),i=4,r.interrupt?t:I):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:I):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return ih(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||dh(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Cg.includes(l)?(i=1,r.interrupt?t(s):O(s)):Sg.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||ah(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return fh(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||ih(t)?(e.consume(t),b):fh(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||ah(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):fh(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):fh(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||U(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||dh(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||fh(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||U(t)?O(t):fh(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),L):t===63&&i===3?(e.consume(t),I):t===93&&i===5?(e.consume(t),F):U(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Tg,R,k)(t)):t===null||U(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Eg,A,R)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||U(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),I):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return Cg.includes(n)?(e.consume(t),L):O(t)}return ih(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),I):O(t)}function I(t){return t===62?(e.consume(t),L):t===45&&i===2?(e.consume(t),I):O(t)}function L(t){return t===null||U(t)?(e.exit(`htmlFlowData`),R(t)):(e.consume(t),L)}function R(n){return e.exit(`htmlFlow`),t(n)}}function kg(e,t,n){let r=this;return i;function i(t){return U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Ag(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Mh,t,n)}}var jg={name:`htmlText`,tokenize:Mg};function Mg(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):ih(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):ih(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):U(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):U(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):U(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):U(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return ih(t)?(e.consume(t),S):n(t)}function S(t){return t===45||ah(t)?(e.consume(t),S):C(t)}function C(t){return U(t)?(o=C,N(t)):fh(t)?(e.consume(t),C):M(t)}function w(t){return t===45||ah(t)?(e.consume(t),w):t===47||t===62||dh(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||ih(t)?(e.consume(t),E):U(t)?(o=T,N(t)):fh(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||ah(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):U(t)?(o=D,N(t)):fh(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):U(t)?(o=O,N(t)):fh(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):U(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||dh(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||dh(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return fh(t)?_h(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var Ng={name:`labelEnd`,resolveAll:Lg,resolveTo:Rg,tokenize:zg},Pg={tokenize:Bg},Fg={tokenize:Vg},Ig={tokenize:Hg};function Lg(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Xm(e,0,e.length,n),e}function Rg(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=Zm(s,e.slice(a+1,a+r+3)),s=Zm(s,[[`enter`,u,t]]),s=Zm(s,Th(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=Zm(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=Zm(s,e.slice(o+1)),s=Zm(s,[[`exit`,c,t]]),Xm(e,a,e.length,s),e}function zg(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(rh(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Pg,u,o?u:d)(t):t===91?e.attempt(Fg,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Ig,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Bg(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return dh(t)?fg(e,a)(t):a(t)}function a(t){return t===41?u(t):lg(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return dh(t)?fg(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?dg(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return dh(t)?fg(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Vg(e,t,n){let r=this;return i;function i(t){return ug.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(rh(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Hg(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Ug={name:`labelStartImage`,resolveAll:Ng.resolveAll,tokenize:Wg};function Wg(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var Gg={name:`labelStartLink`,resolveAll:Ng.resolveAll,tokenize:Kg};function Kg(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var qg={name:`lineEnding`,tokenize:Jg};function Jg(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),_h(e,t,`linePrefix`)}}var Yg={name:`thematicBreak`,tokenize:Xg};function Xg(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||U(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),fh(t)?_h(e,s,`whitespace`)(t):s(t))}}var Zg={continuation:{tokenize:t_},exit:r_,name:`list`,tokenize:e_},Qg={partial:!0,tokenize:i_},$g={partial:!0,tokenize:n_};function e_(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:ch(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Yg,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return ch(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Mh,r.interrupt?n:u,e.attempt(Qg,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return fh(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function t_(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Mh,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_h(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!fh(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt($g,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,_h(e,e.attempt(Zg,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function n_(e,t,n){let r=this;return _h(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function r_(e){e.exit(this.containerState.type)}function i_(e,t,n){let r=this;return _h(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!fh(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var a_={name:`setextUnderline`,resolveTo:o_,tokenize:s_};function o_(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function s_(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),fh(t)?_h(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||U(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var c_={tokenize:l_};function l_(e){let t=this,n=e.attempt(Mh,r,e.attempt(this.parser.constructs.flowInitial,i,_h(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ig,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var u_={resolveAll:m_()},d_=p_(`string`),f_=p_(`text`);function p_(e){return{resolveAll:m_(e===`text`?h_:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function m_(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function h_(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var g_=P({attentionMarkers:()=>w_,contentInitial:()=>v_,disable:()=>T_,document:()=>__,flow:()=>b_,flowInitial:()=>y_,insideSpan:()=>C_,string:()=>x_,text:()=>S_}),__={42:Zg,43:Zg,45:Zg,48:Zg,49:Zg,50:Zg,51:Zg,52:Zg,53:Zg,54:Zg,55:Zg,56:Zg,57:Zg,62:Ph},v_={91:pg},y_={[-2]:Kh,[-1]:Kh,32:Kh},b_={35:yg,42:Yg,45:[a_,Yg],60:wg,61:a_,95:Yg,96:Uh,126:Uh},x_={38:Bh,92:Rh},S_={[-5]:qg,[-4]:qg,[-3]:qg,33:Ug,38:Bh,42:Eh,60:[Ah,jg],91:Gg,92:[_g,Rh],93:Ng,95:Eh,96:Xh},C_={null:[Eh,u_]},w_={null:[42,95]},T_={null:[]};function E_(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Zm(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Th(a,l.events,l),l.events):[]}function f(e,t){return O_(p(e),t)}function p(e){return D_(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){U(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Xm(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function D_(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function O_(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
43
+ `;break;case-3:o=`\r
44
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function k_(e){let t={constructs:$m([g_,...(e||{}).extensions||[]]),content:n(vh),defined:[],document:n(bh),flow:n(c_),lazy:{},string:n(d_),text:n(f_)};return t;function n(e){return n;function n(n){return E_(t,e,n)}}}function A_(e){for(;!ng(e););return e}var j_=/[\0\t\n\r]/g;function M_(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(j_.lastIndex=u,c=j_.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var N_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function P_(e){return e.replace(N_,F_)}function F_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return nh(n.slice(t?2:1),t?16:10)}return Ym(n)||e}var I_={}.hasOwnProperty;function L_(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),R_(n)(A_(k_(n).document().write(M_()(e,t,!0))))}function R_(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ge),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(fe),blockQuote:a(se),characterEscape:T,characterReference:T,codeFenced:a(ce),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ce,o),codeText:a(le,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ue),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(de),hardBreakEscape:a(pe),hardBreakTrailing:a(pe),htmlFlow:a(me,o),htmlFlowData:T,htmlText:a(me,o),htmlTextData:T,image:a(he),label:o,link:a(ge),listItem:a(ve),listItemValue:f,listOrdered:a(_e,d),listUnordered:a(_e),paragraph:a(ye),reference:ee,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(fe),strong:a(be),thematicBreak:a(Se)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:oe,autolinkProtocol:ae,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:re,characterReference:ie,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:I,resourceTitleString:L,resource:R,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};B_(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];I_.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||H_).call(a,void 0,e[0])}for(r.position={start:z_(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:z_(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:z_(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||H_).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+lm({start:e.start,end:e.end})+`): it’s not open`);n.position.end=z_(e.end)}function u(){return Wm(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rh(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=xe(),n.position={start:z_(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=z_(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=z_(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=P_(t),n.identifier=rh(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function L(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function R(){this.data.inReference=void 0}function ee(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=rh(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ne(e){this.data.characterReferenceType=e.type}function re(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=nh(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Ym(t);let i=this.stack[this.stack.length-1];i.value+=r}function ie(e){let t=this.stack.pop();t.position.end=z_(e.end)}function ae(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function oe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function se(){return{type:`blockquote`,children:[]}}function ce(){return{type:`code`,lang:null,meta:null,value:``}}function le(){return{type:`inlineCode`,value:``}}function ue(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function de(){return{type:`emphasis`,children:[]}}function fe(){return{type:`heading`,depth:0,children:[]}}function pe(){return{type:`break`}}function me(){return{type:`html`,value:``}}function he(){return{type:`image`,title:null,url:``,alt:null}}function ge(){return{type:`link`,title:null,url:``,children:[]}}function _e(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ve(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ye(){return{type:`paragraph`,children:[]}}function be(){return{type:`strong`,children:[]}}function xe(){return{type:`text`,value:``}}function Se(){return{type:`thematicBreak`}}}function z_(e){return{line:e.line,column:e.column,offset:e.offset}}function B_(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?B_(e,r):V_(e,r)}}function V_(e,t){let n;for(n in t)if(I_.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function H_(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+lm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lm({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+lm({start:t.start,end:t.end})+`) is still open`)}function U_(e){let t=this;t.parser=n;function n(n){return L_(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function W_(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function G_(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
45
+ `}]}function K_(e,t){let n=t.value?t.value+`
46
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function q_(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function J_(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y_(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=gh(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function X_(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z_(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Q_(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function $_(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Q_(e,t);let i={src:gh(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function ev(e,t){let n={src:gh(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function tv(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function nv(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Q_(e,t);let i={href:gh(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function rv(e,t){let n={href:gh(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function iv(e,t,n){let r=e.all(t),i=n?av(n):ov(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
47
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
48
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function av(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=ov(n[r])}return t}function ov(e){return e.spread??e.children.length>1}function sv(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function cv(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lv(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function uv(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dv(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=om(t.children[1]),o=am(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function fv(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function pv(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var mv=9,hv=32;function gv(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(_v(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(_v(t.slice(i),i>0,!1)),a.join(``)}function _v(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===mv||t===hv;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===mv||t===hv;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function vv(e,t){let n={type:`text`,value:gv(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yv(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var bv={blockquote:W_,break:G_,code:K_,delete:q_,emphasis:J_,footnoteReference:Y_,heading:X_,html:Z_,imageReference:$_,image:ev,inlineCode:tv,linkReference:nv,link:rv,listItem:iv,list:sv,paragraph:cv,root:lv,strong:uv,table:dv,tableCell:pv,tableRow:fv,text:vv,thematicBreak:yv,toml:xv,yaml:xv,definition:xv,footnoteDefinition:xv};function xv(){}var Sv=typeof self==`object`?self:globalThis,Cv=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Sv[e](t)},wv=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof Sv[e]==`function`?Cv(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(Cv(a,o),i)};return r},Tv=e=>wv(new Map,e)(0),Ev=``,{toString:Dv}={},{keys:Ov}=Object,kv=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Dv.call(e).slice(8,-1);switch(n){case`Array`:return[1,Ev];case`Object`:return[2,Ev];case`Date`:return[3,Ev];case`RegExp`:return[4,Ev];case`Map`:return[5,Ev];case`Set`:return[6,Ev];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},Av=([e,t])=>e===0&&(t===`function`||t===`symbol`),jv=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=kv(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Ov(r))(e||!Av(kv(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?Ev:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(Av(kv(n))||Av(kv(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!Av(kv(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},Mv=(e,{json:t,lossy:n}={})=>{let r=[];return jv(!(t||n),!!t,new Map,r)(e),r},Nv=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Tv(Mv(e,t)):structuredClone(e):(e,t)=>Tv(Mv(e,t));function Pv(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Fv(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function Iv(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Pv,r=e.options.footnoteBackLabel||Fv,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=gh(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...Nv(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
49
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
50
+ `}]}}var Lv=(function(e){if(e==null)return Hv;if(typeof e==`function`)return Vv(e);if(typeof e==`object`)return Array.isArray(e)?Rv(e):zv(e);if(typeof e==`string`)return Bv(e);throw Error(`Expected function, string, or object as test`)});function Rv(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Lv(e[n]);return Vv(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function zv(e){let t=e;return Vv(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Bv(e){return Vv(t);function t(t){return t&&t.type===e}}function Vv(e){return t;function t(t,n,r){return!!(Uv(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Hv(){return!0}function Uv(e){return typeof e==`object`&&!!e&&`type`in e}function Wv(e){return e}var Gv=[];function Kv(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Lv(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Wv(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Gv,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=qv(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function qv(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Gv:[e]}function Jv(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Kv(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Yv={}.hasOwnProperty,Xv={};function Zv(e,t){let n=t||Xv,r=new Map,i=new Map,a={all:s,applyData:$v,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...bv,...n.handlers},one:o,options:n,patch:Qv,wrap:ty};return Jv(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Yv.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=Nv(n);return r.children=a.all(e),r}return Nv(e)}return(a.options.unknownHandler||ey)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=ny(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=ny(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Qv(e,t){e.position&&(t.position=cm(e))}function $v(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,Nv(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function ey(e,t){let n=t.data||{},r=`value`in t&&!(Yv.call(n,`hProperties`)||Yv.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ty(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
51
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
52
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
53
+ `}),n}function ny(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ry(e,t){let n=Zv(e,t),r=n.one(e,void 0),i=Iv(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
54
+ `},i)),a}function iy(e,t){return e&&`run`in e?async function(n,r){let i=ry(n,{file:r,...t});await e.run(i,r)}:function(n,r){return ry(n,{file:r,...e||t})}}function ay(e){if(e)throw e}var oy=be(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function sy(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function cy(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?ly(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function ly(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var uy={basename:dy,dirname:fy,extname:py,join:my,sep:`/`};function dy(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);_y(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function fy(e){if(_y(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function py(e){_y(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function my(...e){let t=-1,n;for(;++t<e.length;)_y(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:hy(n)}function hy(e){_y(e);let t=e.codePointAt(0)===47,n=gy(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function gy(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function _y(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var vy={cwd:yy};function yy(){return`/`}function by(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function xy(e){if(typeof e==`string`)e=new URL(e);else if(!by(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return Sy(e)}function Sy(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var Cy=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],wy=class{constructor(e){let t;t=e?by(e)?{path:e}:typeof e==`string`||Oy(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:vy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Cy.length;){let e=Cy[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)Cy.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?uy.basename(this.path):void 0}set basename(e){Ey(e,`basename`),Ty(e,`basename`),this.path=uy.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?uy.dirname(this.path):void 0}set dirname(e){Dy(this.basename,`dirname`),this.path=uy.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?uy.extname(this.path):void 0}set extname(e){if(Ty(e,`extname`),Dy(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=uy.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){by(e)&&(e=xy(e)),Ey(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?uy.basename(this.path,this.extname):void 0}set stem(e){Ey(e,`stem`),Ty(e,`stem`),this.path=uy.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new pm(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Ty(e,t){if(e&&e.includes(uy.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+uy.sep+"`")}function Ey(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Dy(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Oy(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ky=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),Ay=L(oy(),1),jy={}.hasOwnProperty,My=new class e extends ky{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=cy()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,Ay.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Fy(`data`,this.frozen),this.namespace[e]=t,this):jy.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Fy(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Ry(e),n=this.parser||this.Parser;return Ny(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Ny(`process`,this.parser||this.Parser),Py(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Ry(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);By(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Ny(`processSync`,this.parser||this.Parser),Py(`processSync`,this.compiler||this.Compiler),this.process(e,r),Ly(`processSync`,`process`,t),n;function r(e,r){t=!0,ay(e),n=r}}run(e,t,n){Iy(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Ry(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Ly(`runSync`,`run`,n),r;function i(e,t){ay(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Ry(t),r=this.compiler||this.Compiler;return Py(`stringify`,r),Iy(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Fy(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,Ay.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];sy(o)&&sy(r)&&(r=(0,Ay.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Ny(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Py(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Fy(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Iy(e){if(!sy(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Ly(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ry(e){return zy(e)?e:new wy(e)}function zy(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function By(e){return typeof e==`string`||Vy(e)}function Vy(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Hy=[],Uy={allowDangerousHtml:!0},Wy=/^(https?|ircs?|mailto|xmpp)$/i,Gy=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Ky(e){let t=qy(e),n=Jy(e);return Yy(t.runSync(t.parse(n),n),e)}function qy(e){let t=e.rehypePlugins||Hy,n=e.remarkPlugins||Hy,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Uy}:Uy;return My().use(U_).use(n).use(iy,r).use(t)}function Jy(e){let t=e.children||``,n=new wy;return typeof t==`string`?n.value=t:``+t,n}function Yy(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Xy;for(let e of Gy)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Jv(e,l),bm(e,{Fragment:B.Fragment,components:i,ignoreInvalidStyle:!0,jsx:B.jsx,jsxs:B.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Hm)if(Object.hasOwn(Hm,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Hm[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function Xy(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Wy.test(e.slice(0,t))?e:``}var Zy=(function(e,t,n){let r=Lv(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),Qy=(function(e){if(e==null)return nb;if(typeof e==`string`)return eb(e);if(typeof e==`object`)return $y(e);if(typeof e==`function`)return tb(e);throw Error("Expected function, string, or array as `test`")});function $y(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Qy(e[n]);return tb(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function eb(e){return tb(t);function t(t){return t.tagName===e}}function tb(e){return t;function t(t,n,r){return!!(rb(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function nb(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function rb(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var ib=/\n/g,ab=/[\t ]+/g,ob=Qy(`br`),sb=Qy(bb),cb=Qy(`p`),lb=Qy(`tr`),ub=Qy([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,yb,xb]),db=Qy(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function fb(e,t){let n=t||{},r=`children`in e?e.children:[],i=db(e),a=vb(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...hb(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...pb(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?ob(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
55
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function pb(e,t,n){return e.type===`element`?mb(e,t,n):e.type===`text`?n.whitespace===`normal`?hb(e,n):gb(e):[]}function mb(e,t,n){let r=vb(e,n),i=e.children||[],a=-1,o=[];if(ub(e))return o;let s,c;for(ob(e)||lb(e)&&Zy(t,e,lb)?c=`
56
+ `:cb(e)?(s=2,c=2):db(e)&&(s=1,c=1);++a<i.length;)o=o.concat(pb(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?ob(i[a+1]):c}));return sb(e)&&Zy(t,e,sb)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function hb(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){ib.lastIndex=a;let e=ib.exec(n),i=e&&`index`in e?e.index:n.length;r.push(_b(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a!==0||t.breakBefore,i!==n.length||t.breakAfter)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function gb(e){return[String(e.value)]}function _b(e,t,n){let r=[],i=0,a;for(;i<e.length;){ab.lastIndex=i;let n=ab.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function vb(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function yb(e){return!!(e.properties||{}).hidden}function bb(e){return e.tagName===`td`||e.tagName===`th`}function xb(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function Sb(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(v,y,g,_,[c,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function Cb(e){let t={type:[`boolean`,`byte`,`word`,`String`],built_in:`KeyboardController.MouseController.SoftwareSerial.EthernetServer.EthernetClient.LiquidCrystal.RobotControl.GSMVoiceCall.EthernetUDP.EsploraTFT.HttpClient.RobotMotor.WiFiClient.GSMScanner.FileSystem.Scheduler.GSMServer.YunClient.YunServer.IPAddress.GSMClient.GSMModem.Keyboard.Ethernet.Console.GSMBand.Esplora.Stepper.Process.WiFiUDP.GSM_SMS.Mailbox.USBHost.Firmata.PImage.Client.Server.GSMPIN.FileIO.Bridge.Serial.EEPROM.Stream.Mouse.Audio.Servo.File.Task.GPRS.WiFi.Wire.TFT.GSM.SPI.SD`.split(`.`),_hints:`setup.loop.runShellCommandAsynchronously.analogWriteResolution.retrieveCallingNumber.printFirmwareVersion.analogReadResolution.sendDigitalPortPair.noListenOnLocalhost.readJoystickButton.setFirmwareVersion.readJoystickSwitch.scrollDisplayRight.getVoiceCallStatus.scrollDisplayLeft.writeMicroseconds.delayMicroseconds.beginTransmission.getSignalStrength.runAsynchronously.getAsynchronously.listenOnLocalhost.getCurrentCarrier.readAccelerometer.messageAvailable.sendDigitalPorts.lineFollowConfig.countryNameWrite.runShellCommand.readStringUntil.rewindDirectory.readTemperature.setClockDivider.readLightSensor.endTransmission.analogReference.detachInterrupt.countryNameRead.attachInterrupt.encryptionType.readBytesUntil.robotNameWrite.readMicrophone.robotNameRead.cityNameWrite.userNameWrite.readJoystickY.readJoystickX.mouseReleased.openNextFile.scanNetworks.noInterrupts.digitalWrite.beginSpeaker.mousePressed.isActionDone.mouseDragged.displayLogos.noAutoscroll.addParameter.remoteNumber.getModifiers.keyboardRead.userNameRead.waitContinue.processInput.parseCommand.printVersion.readNetworks.writeMessage.blinkVersion.cityNameRead.readMessage.setDataMode.parsePacket.isListening.setBitOrder.beginPacket.isDirectory.motorsWrite.drawCompass.digitalRead.clearScreen.serialEvent.rightToLeft.setTextSize.leftToRight.requestFrom.keyReleased.compassRead.analogWrite.interrupts.WiFiServer.disconnect.playMelody.parseFloat.autoscroll.getPINUsed.setPINUsed.setTimeout.sendAnalog.readSlider.analogRead.beginWrite.createChar.motorsStop.keyPressed.tempoWrite.readButton.subnetMask.debugPrint.macAddress.writeGreen.randomSeed.attachGPRS.readString.sendString.remotePort.releaseAll.mouseMoved.background.getXChange.getYChange.answerCall.getResult.voiceCall.endPacket.constrain.getSocket.writeJSON.getButton.available.connected.findUntil.readBytes.exitValue.readGreen.writeBlue.startLoop.IPAddress.isPressed.sendSysex.pauseMode.gatewayIP.setCursor.getOemKey.tuneWrite.noDisplay.loadImage.switchPIN.onRequest.onReceive.changePIN.playFile.noBuffer.parseInt.overflow.checkPIN.knobRead.beginTFT.bitClear.updateIR.bitWrite.position.writeRGB.highByte.writeRed.setSpeed.readBlue.noStroke.remoteIP.transfer.shutdown.hangCall.beginSMS.endWrite.attached.maintain.noCursor.checkReg.checkPUK.shiftOut.isValid.shiftIn.pulseIn.connect.println.localIP.pinMode.getIMEI.display.noBlink.process.getBand.running.beginSD.drawBMP.lowByte.setBand.release.bitRead.prepare.pointTo.readRed.setMode.noFill.remove.listen.stroke.detach.attach.noTone.exists.buffer.height.bitSet.circle.config.cursor.random.IRread.setDNS.endSMS.getKey.micros.millis.begin.print.write.ready.flush.width.isPIN.blink.clear.press.mkdir.rmdir.close.point.yield.image.BSSID.click.delay.read.text.move.peek.beep.rect.line.open.seek.fill.size.turn.stop.home.find.step.tone.sqrt.RSSI.SSID.end.bit.tan.cos.sin.pow.map.abs.max.min.get.run.put`.split(`.`),literal:[`DIGITAL_MESSAGE`,`FIRMATA_STRING`,`ANALOG_MESSAGE`,`REPORT_DIGITAL`,`REPORT_ANALOG`,`INPUT_PULLUP`,`SET_PIN_MODE`,`INTERNAL2V56`,`SYSTEM_RESET`,`LED_BUILTIN`,`INTERNAL1V1`,`SYSEX_START`,`INTERNAL`,`EXTERNAL`,`DEFAULT`,`OUTPUT`,`INPUT`,`HIGH`,`LOW`]},n=Sb(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name=`Arduino`,n.aliases=[`ino`],n.supersetOf=`cpp`,n}function wb(e){let t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:[`self`,{begin:/:-/,contains:[n]}]};Object.assign(n,{className:`variable`,variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,`(?![\\w\\d])(?![$])`)},r]});let i={className:`subst`,begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:`comment`}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:`string`})]}},s={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);let c={match:/\\"/},l={className:`string`,begin:/'/,end:/'/},u={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:`number`},e.NUMBER_MODE,n]},f=e.SHEBANG({binary:`(${[`fish`,`bash`,`zsh`,`sh`,`csh`,`ksh`,`tcsh`,`dash`,`scsh`].join(`|`)})`,relevance:10}),p={className:`function`,begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=[`if`,`then`,`else`,`elif`,`fi`,`time`,`for`,`while`,`until`,`in`,`do`,`done`,`case`,`esac`,`coproc`,`function`,`select`],h=[`true`,`false`],g={match:/(\/[a-z._-]+)+/},_=[`break`,`cd`,`continue`,`eval`,`exec`,`exit`,`export`,`getopts`,`hash`,`pwd`,`readonly`,`return`,`shift`,`test`,`times`,`trap`,`umask`,`unset`],v=[`alias`,`bind`,`builtin`,`caller`,`command`,`declare`,`echo`,`enable`,`help`,`let`,`local`,`logout`,`mapfile`,`printf`,`read`,`readarray`,`source`,`sudo`,`type`,`typeset`,`ulimit`,`unalias`],y=`autoload.bg.bindkey.bye.cap.chdir.clone.comparguments.compcall.compctl.compdescribe.compfiles.compgroups.compquote.comptags.comptry.compvalues.dirs.disable.disown.echotc.echoti.emulate.fc.fg.float.functions.getcap.getln.history.integer.jobs.kill.limit.log.noglob.popd.print.pushd.pushln.rehash.sched.setcap.setopt.stat.suspend.ttyctl.unfunction.unhash.unlimit.unsetopt.vared.wait.whence.where.which.zcompile.zformat.zftp.zle.zmodload.zparseopts.zprof.zpty.zregexparse.zsocket.zstyle.ztcp`.split(`.`),b=`chcon.chgrp.chown.chmod.cp.dd.df.dir.dircolors.ln.ls.mkdir.mkfifo.mknod.mktemp.mv.realpath.rm.rmdir.shred.sync.touch.truncate.vdir.b2sum.base32.base64.cat.cksum.comm.csplit.cut.expand.fmt.fold.head.join.md5sum.nl.numfmt.od.paste.ptx.pr.sha1sum.sha224sum.sha256sum.sha384sum.sha512sum.shuf.sort.split.sum.tac.tail.tr.tsort.unexpand.uniq.wc.arch.basename.chroot.date.dirname.du.echo.env.expr.factor.groups.hostid.id.link.logname.nice.nohup.nproc.pathchk.pinky.printenv.printf.pwd.readlink.runcon.seq.sleep.stat.stdbuf.stty.tee.test.timeout.tty.uname.unlink.uptime.users.who.whoami.yes`.split(`.`);return{name:`Bash`,aliases:[`sh`,`zsh`],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[..._,...v,`set`,`shopt`,...y,...b]},contains:[f,e.SHEBANG(),p,d,a,o,g,s,c,l,u,n]}}function Tb(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,variants:[{begin:`\\b[a-z\\d_]*_t\\b`},{match:/\batomic_[a-z]{3,6}\b/}]},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d={keyword:`asm.auto.break.case.continue.default.do.else.enum.extern.for.fortran.goto.if.inline.register.restrict.return.sizeof.typeof.typeof_unqual.struct.switch.typedef.union.volatile.while._Alignas._Alignof._Atomic._Generic._Noreturn._Static_assert._Thread_local.alignas.alignof.noreturn.static_assert.thread_local._Pragma`.split(`.`),type:`float.double.signed.unsigned.int.short.long.char.void._Bool._BitInt._Complex._Imaginary._Decimal32._Decimal64._Decimal96._Decimal128._Decimal64x._Decimal128x._Float16._Float32._Float64._Float128._Float32x._Float64x._Float128x.const.static.constexpr.complex.bool.imaginary`.split(`.`),literal:`true false NULL`,built_in:`std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr`},f=[c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],p={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:d,contains:f.concat([{begin:/\(/,end:/\)/,keywords:d,contains:f.concat([`self`]),relevance:0}]),relevance:0},m={begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:d,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:d,relevance:0},{begin:u,returnBegin:!0,contains:[e.inherit(l,{className:`title.function`})],relevance:0},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:d,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C`,aliases:[`h`],keywords:d,disableAutodetect:!0,illegal:`</`,contains:[].concat(p,m,f,[c,{begin:e.IDENT_RE+`::`,keywords:d},{className:`class`,beginKeywords:`enum class struct union`,end:/[{;:<>=]/,contains:[{beginKeywords:`final class struct`},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:o,keywords:d}}}function Eb(e){let t=e.regex,n=e.COMMENT(`//`,`$`,{contains:[{begin:/\\\n/}]}),r=`[a-zA-Z_]\\w*::`,i=`(?!struct)(decltype\\(auto\\)|`+t.optional(r)+`[a-zA-Z_]\\w*`+t.optional(`<[^<>]+>`)+`)`,a={className:`type`,begin:`\\b[a-z\\d_]*_t\\b`},o={className:`string`,variants:[{begin:`(u8?|U|L)?"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]},{begin:`(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)`,end:`'`,illegal:`.`},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},s={className:`number`,variants:[{begin:`[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)`},{begin:`[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)`}],relevance:0},c={className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:`string`}),{className:`string`,begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},l={className:`title`,begin:t.optional(r)+e.IDENT_RE,relevance:0},u=t.optional(r)+e.IDENT_RE+`\\s*\\(`,d=`alignas.alignof.and.and_eq.asm.atomic_cancel.atomic_commit.atomic_noexcept.auto.bitand.bitor.break.case.catch.class.co_await.co_return.co_yield.compl.concept.const_cast|10.consteval.constexpr.constinit.continue.decltype.default.delete.do.dynamic_cast|10.else.enum.explicit.export.extern.false.final.for.friend.goto.if.import.inline.module.mutable.namespace.new.noexcept.not.not_eq.nullptr.operator.or.or_eq.override.private.protected.public.reflexpr.register.reinterpret_cast|10.requires.return.sizeof.static_assert.static_cast|10.struct.switch.synchronized.template.this.thread_local.throw.transaction_safe.transaction_safe_dynamic.true.try.typedef.typeid.typename.union.using.virtual.volatile.while.xor.xor_eq`.split(`.`),f=[`bool`,`char`,`char16_t`,`char32_t`,`char8_t`,`double`,`float`,`int`,`long`,`short`,`void`,`wchar_t`,`unsigned`,`signed`,`const`,`static`],p=`any.auto_ptr.barrier.binary_semaphore.bitset.complex.condition_variable.condition_variable_any.counting_semaphore.deque.false_type.flat_map.flat_set.future.imaginary.initializer_list.istringstream.jthread.latch.lock_guard.multimap.multiset.mutex.optional.ostringstream.packaged_task.pair.promise.priority_queue.queue.recursive_mutex.recursive_timed_mutex.scoped_lock.set.shared_future.shared_lock.shared_mutex.shared_timed_mutex.shared_ptr.stack.string_view.stringstream.timed_mutex.thread.true_type.tuple.unique_lock.unique_ptr.unordered_map.unordered_multimap.unordered_multiset.unordered_set.variant.vector.weak_ptr.wstring.wstring_view`.split(`.`),m=`abort.abs.acos.apply.as_const.asin.atan.atan2.calloc.ceil.cerr.cin.clog.cos.cosh.cout.declval.endl.exchange.exit.exp.fabs.floor.fmod.forward.fprintf.fputs.free.frexp.fscanf.future.invoke.isalnum.isalpha.iscntrl.isdigit.isgraph.islower.isprint.ispunct.isspace.isupper.isxdigit.labs.launder.ldexp.log.log10.make_pair.make_shared.make_shared_for_overwrite.make_tuple.make_unique.malloc.memchr.memcmp.memcpy.memset.modf.move.pow.printf.putchar.puts.realloc.scanf.sin.sinh.snprintf.sprintf.sqrt.sscanf.std.stderr.stdin.stdout.strcat.strchr.strcmp.strcpy.strcspn.strlen.strncat.strncmp.strncpy.strpbrk.strrchr.strspn.strstr.swap.tan.tanh.terminate.to_underlying.tolower.toupper.vfprintf.visit.vprintf.vsprintf`.split(`.`),h={type:f,keyword:d,literal:[`NULL`,`false`,`nullopt`,`nullptr`,`true`],built_in:[`_Pragma`],_type_hints:p},g={className:`function.dispatch`,relevance:0,keywords:{_hint:m},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[g,c,a,n,e.C_BLOCK_COMMENT_MODE,s,o],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:`new throw return else`,end:/;/}],keywords:h,contains:_.concat([{begin:/\(/,end:/\)/,keywords:h,contains:_.concat([`self`]),relevance:0}]),relevance:0},y={className:`function`,begin:`(`+i+`[\\*&\\s]+)+`+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:`decltype\\(auto\\)`,keywords:h,relevance:0},{begin:u,returnBegin:!0,contains:[l],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,s]},{relevance:0,match:/,/},{className:`params`,begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,o,s,a,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[`self`,n,e.C_BLOCK_COMMENT_MODE,o,s,a]}]},a,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:`C++`,aliases:[`cc`,`c++`,`h++`,`hpp`,`hh`,`hxx`,`cxx`],keywords:h,illegal:`</`,classNameAliases:{"function.dispatch":`built_in`},contains:[].concat(v,y,g,_,[c,{begin:`\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)`,end:`>`,keywords:h,contains:[`self`,a]},{begin:e.IDENT_RE+`::`,keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:`keyword`,3:`title.class`}}])}}function Db(e){let t=[`bool`,`byte`,`char`,`decimal`,`delegate`,`double`,`dynamic`,`enum`,`float`,`int`,`long`,`nint`,`nuint`,`object`,`sbyte`,`short`,`string`,`ulong`,`uint`,`ushort`],n=[`public`,`private`,`protected`,`static`,`internal`,`protected`,`abstract`,`async`,`extern`,`override`,`unsafe`,`virtual`,`new`,`sealed`,`partial`],r={keyword:`abstract.as.base.break.case.catch.class.const.continue.do.else.event.explicit.extern.finally.fixed.for.foreach.goto.if.implicit.in.interface.internal.is.lock.namespace.new.operator.out.override.params.private.protected.public.readonly.record.ref.return.scoped.sealed.sizeof.stackalloc.static.struct.switch.this.throw.try.typeof.unchecked.unsafe.using.virtual.void.volatile.while`.split(`.`).concat(`add.alias.and.ascending.args.async.await.by.descending.dynamic.equals.file.from.get.global.group.init.into.join.let.nameof.not.notnull.on.or.orderby.partial.record.remove.required.scoped.select.set.unmanaged.value|0.var.when.where.with.yield`.split(`.`)),built_in:t,literal:[`default`,`false`,`null`,`true`]},i=e.inherit(e.TITLE_MODE,{begin:`[a-zA-Z](\\.?\\w)*`}),a={className:`number`,variants:[{begin:`\\b(0b[01']+)`},{begin:`(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)`},{begin:`(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)`}],relevance:0},o={className:`string`,begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},s={className:`string`,begin:`@"`,end:`"`,contains:[{begin:`""`}]},c=e.inherit(s,{illegal:/\n/}),l={className:`subst`,begin:/\{/,end:/\}/,keywords:r},u=e.inherit(l,{illegal:/\n/}),d={className:`string`,begin:/\$"/,end:`"`,illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,u]},f={className:`string`,begin:/\$@"/,end:`"`,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},l]},p=e.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:`""`},u]});l.contains=[f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],u.contains=[p,d,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[o,f,d,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},h={begin:`<`,end:`>`,contains:[{beginKeywords:`in out`},i]},g=e.IDENT_RE+`(<`+e.IDENT_RE+`(\\s*,\\s*`+e.IDENT_RE+`)*>)?(\\[\\])?`,_={begin:`@`+e.IDENT_RE,relevance:0};return{name:`C#`,aliases:[`cs`,`c#`],keywords:r,illegal:/::/,contains:[e.COMMENT(`///`,`$`,{returnBegin:!0,contains:[{className:`doctag`,variants:[{begin:`///`,relevance:0},{begin:`<!--|-->`},{begin:`</?`,end:`>`}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`meta`,begin:`#`,end:`$`,keywords:{keyword:`if else elif endif define undef warning error line region endregion pragma checksum`}},m,a,{beginKeywords:`class interface`,relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:`where class`},i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`namespace`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`record`,relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,h,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`meta`,begin:`^\\s*\\[(?=[\\w])`,excludeBegin:!0,end:`\\]`,excludeEnd:!0,contains:[{className:`string`,begin:/"/,end:/"/}]},{beginKeywords:`new return throw await else`,relevance:0},{className:`function`,begin:`(`+g+`\\s+)+`+e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:r,contains:[{beginKeywords:n.join(` `),relevance:0},{begin:e.IDENT_RE+`\\s*(<[^=]+>\\s*)?\\(`,returnBegin:!0,contains:[e.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:`params`,begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,relevance:0,contains:[m,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}var Ob=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),kb=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Ab=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),jb=[...kb,...Ab],Mb=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Nb=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Pb=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Fb=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function Ib(e){let t=e.regex,n=Ob(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i=/@-?\w[\w]*(-\w+)*/,a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:`CSS`,case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:`from to`},classNameAliases:{keyframePosition:`selector-tag`},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:`selector-id`,begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:`selector-class`,begin:`\\.[a-zA-Z-][a-zA-Z0-9_-]*`,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,variants:[{begin:`:(`+Nb.join(`|`)+`)`},{begin:`:(:)?(`+Pb.join(`|`)+`)`}]},n.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Fb.join(`|`)+`)\\b`},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:`url data-uri`},contains:[...a,{className:`string`,begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:`[{;]`,relevance:0,illegal:/:/,contains:[{className:`keyword`,begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Mb.join(` `)},contains:[{begin:/[a-z-]+(?=:)/,className:`attribute`},...a,n.CSS_NUMBER_MODE]}]},{className:`selector-tag`,begin:`\\b(`+jb.join(`|`)+`)\\b`}]}}function Lb(e){let t=e.regex;return{name:`Diff`,aliases:[`patch`],contains:[{className:`meta`,relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:`comment`,variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:`addition`,begin:/^\+/,end:/$/},{className:`deletion`,begin:/^-/,end:/$/},{className:`addition`,begin:/^!/,end:/$/}]}}function Rb(e){let t={keyword:[`break`,`case`,`chan`,`const`,`continue`,`default`,`defer`,`else`,`fallthrough`,`for`,`func`,`go`,`goto`,`if`,`import`,`interface`,`map`,`package`,`range`,`return`,`select`,`struct`,`switch`,`type`,`var`],type:[`bool`,`byte`,`complex64`,`complex128`,`error`,`float32`,`float64`,`int8`,`int16`,`int32`,`int64`,`string`,`uint8`,`uint16`,`uint32`,`uint64`,`int`,`uint`,`uintptr`,`rune`],literal:[`true`,`false`,`iota`,`nil`],built_in:[`append`,`cap`,`close`,`complex`,`copy`,`imag`,`len`,`make`,`new`,`panic`,`print`,`println`,`real`,`recover`,`delete`]};return{name:`Go`,aliases:[`golang`],keywords:t,illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:`string`,variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:`number`,variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:`function`,beginKeywords:`func`,end:`\\s*(\\{|$)`,excludeEnd:!0,contains:[e.TITLE_MODE,{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}function zb(e){let t=e.regex;return{name:`GraphQL`,aliases:[`gql`],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:[`query`,`mutation`,`subscription`,`type`,`input`,`schema`,`directive`,`interface`,`union`,`scalar`,`fragment`,`enum`,`on`],literal:[`true`,`false`,`null`]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:`punctuation`,match:/[.]{3}/,relevance:0},{scope:`punctuation`,begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:`variable`,begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:`meta`,match:/@\w+/,excludeEnd:!0},{scope:`symbol`,begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Bb(e){let t=e.regex,n={className:`number`,relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:`variable`,variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},a={className:`literal`,begin:/\bon|off|true|false|yes|no\b/},o={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:`'''`,end:`'''`,relevance:10},{begin:`"""`,end:`"""`,relevance:10},{begin:`"`,end:`"`},{begin:`'`,end:`'`}]},s={begin:/\[/,end:/\]/,contains:[r,a,i,o,n,`self`],relevance:0},c=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:`TOML, also INI`,aliases:[`toml`],case_insensitive:!0,illegal:/\S/,contains:[r,{className:`section`,begin:/\[+/,end:/\]+/},{begin:t.concat(c,`(\\s*\\.\\s*`,c,`)*`,t.lookahead(/\s*=\s*[^#\s]/)),className:`attr`,starts:{end:/$/,contains:[r,s,a,i,o,n]}}]}}var Vb=`[0-9](_*[0-9])*`,Hb=`\\.(${Vb})`,Ub=`[0-9a-fA-F](_*[0-9a-fA-F])*`,Wb={className:`number`,variants:[{begin:`(\\b(${Vb})((${Hb})|\\.)?|(${Hb}))[eE][+-]?(${Vb})[fFdD]?\\b`},{begin:`\\b(${Vb})((${Hb})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Hb})[fFdD]?\\b`},{begin:`\\b(${Vb})[fFdD]\\b`},{begin:`\\b0[xX]((${Ub})\\.?|(${Ub})?\\.(${Ub}))[pP][+-]?(${Vb})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${Ub})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function Gb(e,t,n){return n===-1?``:e.replace(t,r=>Gb(e,t,n-1))}function Kb(e){let t=e.regex,n=`[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,r=n+Gb(`(?:<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~(?:\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*~~~)*>)?`,/~~~/g,2),i={keyword:`synchronized.abstract.private.var.static.if.const .for.while.strictfp.finally.protected.import.native.final.void.enum.else.break.transient.catch.instanceof.volatile.case.assert.package.default.public.try.switch.continue.throws.protected.public.private.module.requires.exports.do.sealed.yield.permits.goto.when`.split(`.`),literal:[`false`,`true`,`null`],type:[`char`,`boolean`,`long`,`float`,`int`,`byte`,`short`,`double`],built_in:[`super`,`this`]},a={className:`meta`,begin:`@[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*`,contains:[{begin:/\(/,end:/\)/,contains:[`self`]}]},o={className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:`Java`,aliases:[`jsp`],keywords:i,illegal:/<\/|#/,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:`doctag`,begin:`@[A-Za-z]+`}]}),{begin:/import java\.[a-z]+\./,keywords:`import`,relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:`string`,contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:`keyword`,3:`title.class`}},{match:/non-sealed/,scope:`keyword`},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:`type`,3:`variable`,5:`operator`}},{begin:[/record/,/\s+/,n],className:{1:`keyword`,3:`title.class`},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:`new throw return else`,relevance:0},{begin:[`(?:`+r+`\\s+)`,e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:`title.function`},keywords:i,contains:[{className:`params`,begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Wb,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Wb,a]}}var qb=`[A-Za-z$_][0-9A-Za-z$_]*`,Jb=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),Yb=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],Xb=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),Zb=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],Qb=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],$b=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],ex=[].concat(Qb,Xb,Zb);function tx(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=qb,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:qb,keyword:Jb,literal:Yb,built_in:ex,"variable.language":$b},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...Xb,...Zb]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([...Qb,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function nx(e){let t={className:`attr`,begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:`punctuation`,relevance:0},r=[`true`,`false`,`null`],i={scope:`literal`,beginKeywords:r.join(` `)};return{name:`JSON`,aliases:[`jsonc`],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:`\\S`}}var rx=`[0-9](_*[0-9])*`,ix=`\\.(${rx})`,ax=`[0-9a-fA-F](_*[0-9a-fA-F])*`,ox={className:`number`,variants:[{begin:`(\\b(${rx})((${ix})|\\.)?|(${ix}))[eE][+-]?(${rx})[fFdD]?\\b`},{begin:`\\b(${rx})((${ix})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ix})[fFdD]?\\b`},{begin:`\\b(${rx})[fFdD]\\b`},{begin:`\\b0[xX]((${ax})\\.?|(${ax})?\\.(${ax}))[pP][+-]?(${rx})[fFdD]?\\b`},{begin:`\\b(0|[1-9](_*[0-9])*)[lL]?\\b`},{begin:`\\b0[xX](${ax})[lL]?\\b`},{begin:`\\b0(_*[0-7])*[lL]?\\b`},{begin:`\\b0[bB][01](_*[01])*[lL]?\\b`}],relevance:0};function sx(e){let t={keyword:`abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual`,built_in:`Byte Short Char Int Long Boolean Float Double Void Unit Nothing`,literal:`true false null`},n={className:`keyword`,begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:`symbol`,begin:/@\w+/}]}},r={className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`@`},i={className:`subst`,begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:`variable`,begin:`\\$`+e.UNDERSCORE_IDENT_RE},o={className:`string`,variants:[{begin:`"""`,end:`"""(?=[^"])`,contains:[a,i]},{begin:`'`,end:`'`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`,illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,i]}]};i.contains.push(o);let s={className:`meta`,begin:`@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*`+e.UNDERSCORE_IDENT_RE+`)?`},c={className:`meta`,begin:`@`+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:`string`}),`self`]}]},l=ox,u=e.COMMENT(`/\\*`,`\\*/`,{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:`type`,begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},f=d;return f.variants[1].contains=[d],d.variants[1].contains=[f],{name:`Kotlin`,aliases:[`kt`,`kts`],keywords:t,contains:[e.COMMENT(`/\\*\\*`,`\\*/`,{relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`}]}),e.C_LINE_COMMENT_MODE,u,n,r,s,c,{className:`function`,beginKeywords:`fun`,end:`[(]|$`,returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+`\\s*\\(`,returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:`type`,begin:/</,end:/>/,keywords:`reified`,relevance:0},{className:`params`,begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,u],relevance:0},e.C_LINE_COMMENT_MODE,u,s,c,o,e.C_NUMBER_MODE]},u]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:`title.class`},keywords:`class interface trait`,end:/[:\{(]|$/,excludeEnd:!0,illegal:`extends implements`,contains:[{beginKeywords:`public protected internal private constructor`},e.UNDERSCORE_TITLE_MODE,{className:`type`,begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,c]},o,{className:`meta`,begin:`^#!/usr/bin/env`,end:`$`,illegal:`
57
+ `},l]}}var cx=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),lx=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),ux=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),dx=[...lx,...ux],fx=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),px=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),mx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),hx=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse(),gx=px.concat(mx).sort().reverse();function _x(e){let t=cx(e),n=gx,r=`([\\w-]+|@\\{[\\w-]+\\})`,i=[],a=[],o=function(e){return{className:`string`,begin:`~?`+e+`.*?`+e}},s=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:fx.join(` `)},l={begin:`\\(`,end:`\\)`,contains:a,keywords:c,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o(`'`),o(`"`),t.CSS_NUMBER_MODE,{begin:`(url|data-uri)\\(`,starts:{className:`string`,end:`[\\)\\n]`,excludeEnd:!0}},t.HEXCOLOR,l,s(`variable`,`@@?[\\w-]+`,10),s(`variable`,`@\\{[\\w-]+\\}`),s(`built_in`,"~?`[^`]*?`"),{className:`attribute`,begin:`[\\w-]+\\s*:`,end:`:`,returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:`and not`},t.FUNCTION_DISPATCH);let u=a.concat({begin:/\{/,end:/\}/,contains:i}),d={beginKeywords:`when`,endsWithParent:!0,contains:[{beginKeywords:`and not`}].concat(a)},f={begin:`([\\w-]+|@\\{[\\w-]+\\})\\s*:`,returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+hx.join(`|`)+`)\\b`,end:/(?=:)/,starts:{endsWithParent:!0,illegal:`[<=$]`,relevance:0,contains:a}}]},p={className:`keyword`,begin:`@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b`,starts:{end:`[;{}]`,keywords:c,returnEnd:!0,contains:a,relevance:0}},m={className:`variable`,variants:[{begin:`@[\\w-]+\\s*:`,relevance:15},{begin:`@[\\w-]+`}],starts:{end:`[;}]`,returnEnd:!0,contains:u}},h={variants:[{begin:`[\\.#:&\\[>]`,end:`[;{}]`},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,s(`keyword`,`all\\b`),s(`variable`,`@\\{[\\w-]+\\}`),{begin:`\\b(`+dx.join(`|`)+`)\\b`,className:`selector-tag`},t.CSS_NUMBER_MODE,s(`selector-tag`,r,0),s(`selector-id`,`#([\\w-]+|@\\{[\\w-]+\\})`),s(`selector-class`,`\\.([\\w-]+|@\\{[\\w-]+\\})`,0),s(`selector-tag`,`&`,0),t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-pseudo`,begin:`:(`+px.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+mx.join(`|`)+`)`},{begin:/\(/,end:/\)/,relevance:0,contains:u},{begin:`!important`},t.FUNCTION_DISPATCH]},g={begin:`[\\w-]+:(:)?(${n.join(`|`)})`,returnBegin:!0,contains:[h]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p,m,g,f,h,d,t.FUNCTION_DISPATCH),{name:`Less`,case_insensitive:!0,illegal:`[=>'/<($"]`,contains:i}}function vx(e){let t=`\\[=*\\[`,n=`\\]=*\\]`,r={begin:t,end:n,contains:[`self`]},i=[e.COMMENT(`--(?!\\[=*\\[)`,`$`),e.COMMENT(`--\\[=*\\[`,n,{contains:[r],relevance:10})];return{name:`Lua`,aliases:[`pluto`],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:`true false nil`,keyword:`and break do else elseif end for goto if in local not or repeat return then until while`,built_in:`_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove`},contains:i.concat([{className:`function`,beginKeywords:`function`,end:`\\)`,contains:[e.inherit(e.TITLE_MODE,{begin:`([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*`}),{className:`params`,begin:`\\(`,endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:`string`,begin:t,end:n,contains:[r],relevance:5}])}}function yx(e){let t={className:`variable`,variants:[{begin:`\\$\\(`+e.UNDERSCORE_IDENT_RE+`\\)`,contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:`variable`,begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:`subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value`},contains:[t,n]},i={begin:`^`+e.UNDERSCORE_IDENT_RE+`\\s*(?=[:+?]?=)`},a={className:`meta`,begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:`.PHONY`}},o={className:`section`,begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:`Makefile`,aliases:[`mk`,`mak`,`make`],keywords:{$pattern:/[\w-]+/,keyword:`define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath`},contains:[e.HASH_COMMENT_MODE,t,n,r,i,a,o]}}function bx(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:`>`,subLanguage:`xml`,relevance:0},r={begin:`^[-\\*]{3,}`,end:`$`},i={className:`code`,variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:`(~{3,})[^~](.|\\n)*?\\1~*[ ]*`},{begin:"```",end:"```+[ ]*$"},{begin:`~~~`,end:`~~~+[ ]*$`},{begin:"`.+?`"},{begin:`(?=^( {4}|\\t))`,contains:[{begin:`^( {4}|\\t)`,end:`(\\n)$`}],relevance:0}]},a={className:`bullet`,begin:`^[ ]*([*+-]|(\\d+\\.))(?=\\s+)`,end:`\\s+`,excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:`symbol`,begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:`link`,begin:/:\s*/,end:/$/,excludeBegin:!0}]},s={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:`string`,relevance:0,begin:`\\[`,end:`\\]`,excludeBegin:!0,returnEnd:!0},{className:`link`,relevance:0,begin:`\\]\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0},{className:`symbol`,relevance:0,begin:`\\]\\[`,end:`\\]`,excludeBegin:!0,excludeEnd:!0}]},c={className:`strong`,contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},l={className:`emphasis`,contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},u=e.inherit(c,{contains:[]}),d=e.inherit(l,{contains:[]});c.contains.push(d),l.contains.push(u);let f=[n,s];return[c,l,u,d].forEach(e=>{e.contains=e.contains.concat(f)}),f=f.concat(c,l),{name:`Markdown`,aliases:[`md`,`mkdown`,`mkd`],contains:[{className:`section`,variants:[{begin:`^#{1,6}`,end:`$`,contains:f},{begin:`(?=^.+?\\n[=-]{2,}$)`,contains:[{begin:`^[=-]*$`},{begin:`^`,end:`\\n`,contains:f}]}]},n,a,c,l,{className:`quote`,begin:`^>\\s+`,contains:f,end:`$`},i,r,s,o,{scope:`literal`,match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function xx(e){let t={className:`built_in`,begin:`\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+`},n=/[a-zA-Z@][a-zA-Z0-9_]*/,r={"variable.language":[`this`,`super`],$pattern:n,keyword:`while.export.sizeof.typedef.const.struct.for.union.volatile.static.mutable.if.do.return.goto.enum.else.break.extern.asm.case.default.register.explicit.typename.switch.continue.inline.readonly.assign.readwrite.self.@synchronized.id.typeof.nonatomic.IBOutlet.IBAction.strong.weak.copy.in.out.inout.bycopy.byref.oneway.__strong.__weak.__block.__autoreleasing.@private.@protected.@public.@try.@property.@end.@throw.@catch.@finally.@autoreleasepool.@synthesize.@dynamic.@selector.@optional.@required.@encode.@package.@import.@defs.@compatibility_alias.__bridge.__bridge_transfer.__bridge_retained.__bridge_retain.__covariant.__contravariant.__kindof._Nonnull._Nullable._Null_unspecified.__FUNCTION__.__PRETTY_FUNCTION__.__attribute__.getter.setter.retain.unsafe_unretained.nonnull.nullable.null_unspecified.null_resettable.class.instancetype.NS_DESIGNATED_INITIALIZER.NS_UNAVAILABLE.NS_REQUIRES_SUPER.NS_RETURNS_INNER_POINTER.NS_INLINE.NS_AVAILABLE.NS_DEPRECATED.NS_ENUM.NS_OPTIONS.NS_SWIFT_UNAVAILABLE.NS_ASSUME_NONNULL_BEGIN.NS_ASSUME_NONNULL_END.NS_REFINED_FOR_SWIFT.NS_SWIFT_NAME.NS_SWIFT_NOTHROW.NS_DURING.NS_HANDLER.NS_ENDHANDLER.NS_VALUERETURN.NS_VOIDRETURN`.split(`.`),literal:[`false`,`true`,`FALSE`,`TRUE`,`nil`,`YES`,`NO`,`NULL`],built_in:[`dispatch_once_t`,`dispatch_queue_t`,`dispatch_sync`,`dispatch_async`,`dispatch_once`],type:[`int`,`float`,`char`,`unsigned`,`signed`,`short`,`long`,`double`,`wchar_t`,`unichar`,`void`,`bool`,`BOOL`,`id|0`,`_Bool`]},i={$pattern:n,keyword:[`@interface`,`@class`,`@protocol`,`@implementation`]};return{name:`Objective-C`,aliases:[`mm`,`objc`,`obj-c`,`obj-c++`,`objective-c++`],keywords:r,illegal:`</`,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:`string`,variants:[{begin:`@"`,end:`"`,illegal:`\\n`,contains:[e.BACKSLASH_ESCAPE]}]},{className:`meta`,begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:`if else elif endif define undef warning error line pragma ifdef ifndef include`},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),{className:`string`,begin:/<.*?>/,end:/$/,illegal:`\\n`},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:`class`,begin:`(`+i.keyword.join(`|`)+`)\\b`,end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:`\\.`+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function Sx(e){let t=e.regex,n=`abs.accept.alarm.and.atan2.bind.binmode.bless.break.caller.chdir.chmod.chomp.chop.chown.chr.chroot.class.close.closedir.connect.continue.cos.crypt.dbmclose.dbmopen.defined.delete.die.do.dump.each.else.elsif.endgrent.endhostent.endnetent.endprotoent.endpwent.endservent.eof.eval.exec.exists.exit.exp.fcntl.field.fileno.flock.for.foreach.fork.format.formline.getc.getgrent.getgrgid.getgrnam.gethostbyaddr.gethostbyname.gethostent.getlogin.getnetbyaddr.getnetbyname.getnetent.getpeername.getpgrp.getpriority.getprotobyname.getprotobynumber.getprotoent.getpwent.getpwnam.getpwuid.getservbyname.getservbyport.getservent.getsockname.getsockopt.given.glob.gmtime.goto.grep.gt.hex.if.index.int.ioctl.join.keys.kill.last.lc.lcfirst.length.link.listen.local.localtime.log.lstat.lt.ma.map.method.mkdir.msgctl.msgget.msgrcv.msgsnd.my.ne.next.no.not.oct.open.opendir.or.ord.our.pack.package.pipe.pop.pos.print.printf.prototype.push.q|0.qq.quotemeta.qw.qx.rand.read.readdir.readline.readlink.readpipe.recv.redo.ref.rename.require.reset.return.reverse.rewinddir.rindex.rmdir.say.scalar.seek.seekdir.select.semctl.semget.semop.send.setgrent.sethostent.setnetent.setpgrp.setpriority.setprotoent.setpwent.setservent.setsockopt.shift.shmctl.shmget.shmread.shmwrite.shutdown.sin.sleep.socket.socketpair.sort.splice.split.sprintf.sqrt.srand.stat.state.study.sub.substr.symlink.syscall.sysopen.sysread.sysseek.system.syswrite.tell.telldir.tie.tied.time.times.tr.truncate.uc.ucfirst.umask.undef.unless.unlink.unpack.unshift.untie.until.use.utime.values.vec.wait.waitpid.wantarray.warn.when.while.write.x|0.xor.y|0`.split(`.`),r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(` `)},a={className:`subst`,begin:`[$@]\\{`,end:`\\}`,keywords:i},o={begin:/->\{/,end:/\}/},s={scope:`attr`,match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:`variable`,variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,`(?![A-Za-z])(?![@$%])`)},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[s]},l={className:`number`,variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},u=[e.BACKSLASH_ESCAPE,a,c],d=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],f=(e,n,i=`\\1`)=>{let a=i===`\\1`?i:t.concat(i,n);return t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,a,/(?:\\.|[^\\\/])*?/,i,r)},p=(e,n,i)=>t.concat(t.concat(`(?:`,e,`)`),n,/(?:\\.|[^\\\/])*?/,i,r),m=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:`string`,contains:u,variants:[{begin:`q[qwxr]?\\s*\\(`,end:`\\)`,relevance:5},{begin:`q[qwxr]?\\s*\\[`,end:`\\]`,relevance:5},{begin:`q[qwxr]?\\s*\\{`,end:`\\}`,relevance:5},{begin:`q[qwxr]?\\s*\\|`,end:`\\|`,relevance:5},{begin:`q[qwxr]?\\s*<`,end:`>`,relevance:5},{begin:`qw\\s+q`,end:`q`,relevance:5},{begin:`'`,end:`'`,contains:[e.BACKSLASH_ESCAPE]},{begin:`"`,end:`"`},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:`-?\\w+\\s*=>`,relevance:0}]},l,{begin:`(\\/\\/|`+e.RE_STARTERS_RE+`|\\b(split|return|print|reverse|grep)\\b)\\s*`,keywords:`split return print reverse grep`,relevance:0,contains:[e.HASH_COMMENT_MODE,{className:`regexp`,variants:[{begin:f(`s|tr|y`,t.either(...d,{capture:!0}))},{begin:f(`s|tr|y`,`\\(`,`\\)`)},{begin:f(`s|tr|y`,`\\[`,`\\]`)},{begin:f(`s|tr|y`,`\\{`,`\\}`)}],relevance:2},{className:`regexp`,variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p(`(?:m|qr)?`,/\//,/\//)},{begin:p(`m|qr`,t.either(...d,{capture:!0}),/\1/)},{begin:p(`m|qr`,/\(/,/\)/)},{begin:p(`m|qr`,/\[/,/\]/)},{begin:p(`m|qr`,/\{/,/\}/)}]}]},{className:`function`,beginKeywords:`sub method`,end:`(\\s*\\(.*?\\))?[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s]},{className:`class`,beginKeywords:`class`,end:`[;{]`,excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,s,l]},{begin:`-\\w\\b`,relevance:0},{begin:`^__DATA__$`,end:`^__END__$`,subLanguage:`mojolicious`,contains:[{begin:`^@@.*`,end:`$`,className:`comment`}]}];return a.contains=m,o.contains=m,{name:`Perl`,aliases:[`pl`,`pm`],keywords:i,contains:m}}function Cx(e){let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:`variable`,match:`\\$+`+r},s={scope:`meta`,variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:`subst`,variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),d={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},f=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),p=`[
58
+ ]`,m={scope:`string`,variants:[u,l,d,f]},h={scope:`number`,variants:[{begin:`\\b0[bB][01]+(?:_[01]+)*\\b`},{begin:`\\b0[oO][0-7]+(?:_[0-7]+)*\\b`},{begin:`\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b`},{begin:`(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?`}],relevance:0},g=[`false`,`null`,`true`],_=`__CLASS__.__DIR__.__FILE__.__FUNCTION__.__COMPILER_HALT_OFFSET__.__LINE__.__METHOD__.__NAMESPACE__.__TRAIT__.die.echo.exit.include.include_once.print.require.require_once.array.abstract.and.as.binary.bool.boolean.break.callable.case.catch.class.clone.const.continue.declare.default.do.double.else.elseif.empty.enddeclare.endfor.endforeach.endif.endswitch.endwhile.enum.eval.extends.final.finally.float.for.foreach.from.global.goto.if.implements.instanceof.insteadof.int.integer.interface.isset.iterable.list.match|0.mixed.new.never.object.or.private.protected.public.readonly.real.return.string.switch.throw.trait.try.unset.use.var.void.while.xor.yield`.split(`.`),v=`Error|0.AppendIterator.ArgumentCountError.ArithmeticError.ArrayIterator.ArrayObject.AssertionError.BadFunctionCallException.BadMethodCallException.CachingIterator.CallbackFilterIterator.CompileError.Countable.DirectoryIterator.DivisionByZeroError.DomainException.EmptyIterator.ErrorException.Exception.FilesystemIterator.FilterIterator.GlobIterator.InfiniteIterator.InvalidArgumentException.IteratorIterator.LengthException.LimitIterator.LogicException.MultipleIterator.NoRewindIterator.OutOfBoundsException.OutOfRangeException.OuterIterator.OverflowException.ParentIterator.ParseError.RangeException.RecursiveArrayIterator.RecursiveCachingIterator.RecursiveCallbackFilterIterator.RecursiveDirectoryIterator.RecursiveFilterIterator.RecursiveIterator.RecursiveIteratorIterator.RecursiveRegexIterator.RecursiveTreeIterator.RegexIterator.RuntimeException.SeekableIterator.SplDoublyLinkedList.SplFileInfo.SplFileObject.SplFixedArray.SplHeap.SplMaxHeap.SplMinHeap.SplObjectStorage.SplObserver.SplPriorityQueue.SplQueue.SplStack.SplSubject.SplTempFileObject.TypeError.UnderflowException.UnexpectedValueException.UnhandledMatchError.ArrayAccess.BackedEnum.Closure.Fiber.Generator.Iterator.IteratorAggregate.Serializable.Stringable.Throwable.Traversable.UnitEnum.WeakReference.WeakMap.Directory.__PHP_Incomplete_Class.parent.php_user_filter.self.static.stdClass`.split(`.`),y={keyword:_,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(g),built_in:v},b=e=>e.map(e=>e.replace(/\|\d+$/,``)),x={variants:[{match:[/new/,t.concat(p,`+`),t.concat(`(?!`,b(v).join(`\\b|`),`\\b)`),i],scope:{1:`keyword`,4:`title.class`}}]},S=t.concat(r,`\\b(?!\\()`),C={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{2:`variable.constant`}},{match:[/::/,/class/],scope:{2:`variable.language`}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),S],scope:{1:`title.class`,3:`variable.constant`}},{match:[i,t.concat(`::`,t.lookahead(/(?!class\b)/))],scope:{1:`title.class`}},{match:[i,/::/,/class/],scope:{1:`title.class`,3:`variable.language`}}]},w={scope:`attr`,match:t.concat(r,t.lookahead(`:`),t.lookahead(/(?!::)/))},T={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[w,o,C,e.C_BLOCK_COMMENT_MODE,m,h,x]},E={relevance:0,match:[/\b/,t.concat(`(?!fn\\b|function\\b|`,b(_).join(`\\b|`),`|`,b(v).join(`\\b|`),`\\b)`),r,t.concat(p,`*`),t.lookahead(/(?=\()/)],scope:{3:`title.function.invoke`},contains:[T]};T.contains.push(E);let D=[w,C,e.C_BLOCK_COMMENT_MODE,m,h,x],O={begin:t.concat(/#\[\s*\\?/,t.either(i,a)),beginScope:`meta`,end:/]/,endScope:`meta`,keywords:{literal:g,keyword:[`new`,`array`]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:[`new`,`array`]},contains:[`self`,...D]},...D,{scope:`meta`,variants:[{match:i},{match:a}]}]};return{case_insensitive:!1,keywords:y,contains:[O,e.HASH_COMMENT_MODE,e.COMMENT(`//`,`$`),e.COMMENT(`/\\*`,`\\*/`,{contains:[{scope:`doctag`,match:`@[A-Za-z]+`}]}),{match:/__halt_compiler\(\);/,keywords:`__halt_compiler`,starts:{scope:`comment`,end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:`meta`,endsParent:!0}]}},s,{scope:`variable.language`,match:/\$this\b/},o,E,C,{match:[/const/,/\s/,r],scope:{1:`keyword`,3:`variable.constant`}},x,{scope:`function`,relevance:0,beginKeywords:`fn function`,end:/[;{]/,excludeEnd:!0,illegal:`[$%\\[]`,contains:[{beginKeywords:`use`},e.UNDERSCORE_TITLE_MODE,{begin:`=>`,endsParent:!0},{scope:`params`,begin:`\\(`,end:`\\)`,excludeBegin:!0,excludeEnd:!0,keywords:y,contains:[`self`,O,o,C,e.C_BLOCK_COMMENT_MODE,m,h]}]},{scope:`class`,variants:[{beginKeywords:`enum`,illegal:/[($"]/},{beginKeywords:`class interface trait`,illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:`extends implements`},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:`namespace`,relevance:0,end:`;`,illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:`title.class`})]},{beginKeywords:`use`,relevance:0,end:`;`,contains:[{match:/\b(as|const|function)\b/,scope:`keyword`},e.UNDERSCORE_TITLE_MODE]},m,h]}}function wx(e){return{name:`PHP template`,subLanguage:`xml`,contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:`php`,contains:[{begin:`/\\*`,end:`\\*/`,skip:!0},{begin:`b"`,end:`"`,skip:!0},{begin:`b'`,end:`'`,skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Tx(e){return{name:`Plain text`,aliases:[`text`,`txt`],disableAutodetect:!0}}function Ex(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=`and.as.assert.async.await.break.case.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.match.nonlocal|10.not.or.pass.raise.return.try.while.with.yield`.split(`.`),i={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:`__import__.abs.all.any.ascii.bin.bool.breakpoint.bytearray.bytes.callable.chr.classmethod.compile.complex.delattr.dict.dir.divmod.enumerate.eval.exec.filter.float.format.frozenset.getattr.globals.hasattr.hash.help.hex.id.input.int.isinstance.issubclass.iter.len.list.locals.map.max.memoryview.min.next.object.oct.open.ord.pow.print.property.range.repr.reversed.round.set.setattr.slice.sorted.staticmethod.str.sum.super.tuple.type.vars.zip`.split(`.`),literal:[`__debug__`,`Ellipsis`,`False`,`None`,`NotImplemented`,`True`],type:[`Any`,`Callable`,`Coroutine`,`Dict`,`List`,`Literal`,`Generic`,`Optional`,`Sequence`,`Set`,`Tuple`,`Type`,`Union`]},a={className:`meta`,begin:/^(>>>|\.\.\.) /},o={className:`subst`,begin:/\{/,end:/\}/,keywords:i,illegal:/#/},s={begin:/\{\{/,relevance:0},c={className:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l=`[0-9](_?[0-9])*`,u=`(\\b(${l}))?\\.(${l})|\\b(${l})\\.`,d=`\\b|${r.join(`|`)}`,f={className:`number`,relevance:0,variants:[{begin:`(\\b(${l})|(${u}))[eE][+-]?(${l})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${l})[jJ](?=${d})`}]},p={className:`comment`,begin:t.lookahead(/# type:/),end:/$/,keywords:i,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:`params`,variants:[{className:``,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:i,contains:[`self`,a,f,c,e.HASH_COMMENT_MODE]}]};return o.contains=[c,f,a],{name:`Python`,aliases:[`py`,`gyp`,`ipython`],unicodeRegex:!0,keywords:i,illegal:/(<\/|\?)|=>/,contains:[a,f,{scope:`variable.language`,match:/\bself\b/},{beginKeywords:`if`,relevance:0},{match:/\bor\b/,scope:`keyword`},c,p,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:`keyword`,3:`title.class`,6:`title.class.inherited`}},{className:`meta`,begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[f,m,c]}]}}function Dx(e){return{aliases:[`pycon`],contains:[{className:`meta.prompt`,starts:{end:/ |$/,starts:{end:`$`,subLanguage:`python`}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Ox(e){let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:`R`,keywords:{$pattern:n,keyword:`function if in break next repeat else for while`,literal:`NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10`,built_in:`LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm`},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:`doctag`,match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:`doctag`,begin:`@param`,end:/$/,contains:[{scope:`variable`,variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:`doctag`,match:/@[a-zA-Z]+/},{scope:`keyword`,match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:`string`,contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:`"`,end:`"`,relevance:0},{begin:`'`,end:`'`,relevance:0}]},{relevance:0,variants:[{scope:{1:`operator`,2:`number`},match:[i,r]},{scope:{1:`operator`,2:`number`},match:[/%[^%]*%/,r]},{scope:{1:`punctuation`,2:`number`},match:[a,r]},{scope:{2:`number`},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:`operator`},match:[n,/\s+/,/<-/,/\s+/]},{scope:`operator`,relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:`punctuation`,relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function kx(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),a={"variable.constant":[`__FILE__`,`__LINE__`,`__ENCODING__`],"variable.language":[`self`,`super`],keyword:`alias.and.begin.BEGIN.break.case.class.defined.do.else.elsif.end.END.ensure.for.if.in.module.next.not.or.redo.require.rescue.retry.return.then.undef.unless.until.when.while.yield.include.extend.prepend.public.private.protected.raise.throw`.split(`.`),built_in:[`proc`,`lambda`,`attr_accessor`,`attr_reader`,`attr_writer`,`define_method`,`private_constant`,`module_function`],literal:[`true`,`false`,`nil`]},o={className:`doctag`,begin:`@[A-Za-z]+`},s={begin:`#<`,end:`>`},c=[e.COMMENT(`#`,`$`,{contains:[o]}),e.COMMENT(`^=begin`,`^=end`,{contains:[o],relevance:10}),e.COMMENT(`^__END__`,e.MATCH_NOTHING_RE)],l={className:`subst`,begin:/#\{/,end:/\}/,keywords:a},u={className:`string`,contains:[e.BACKSLASH_ESCAPE,l],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,l]})]}]},d=`[0-9](_?[0-9])*`,f={className:`number`,relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|r)?i?\\b`},{begin:`\\b0[dD][0-9](_?[0-9])*r?i?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*r?i?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*r?i?\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b`},{begin:`\\b0(_?[0-7])+r?i?\\b`}]},p={variants:[{match:/\(\)/},{className:`params`,begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:a}]},m=[u,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:`title.class`,4:`title.class.inherited`},keywords:a},{match:[/(include|extend)\s+/,i],scope:{2:`title.class`},keywords:a},{relevance:0,match:[i,/\.new[. (]/],scope:{1:`title.class`}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`},{relevance:0,match:r,scope:`title.class`},{match:[/def/,/\s+/,n],scope:{1:`keyword`,3:`title.function`},contains:[p]},{begin:e.IDENT_RE+`::`},{className:`symbol`,begin:e.UNDERSCORE_IDENT_RE+`(!|\\?)?:`,relevance:0},{className:`symbol`,begin:`:(?!\\s)`,contains:[u,{begin:n}],relevance:0},f,{className:`variable`,begin:`(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])`},{className:`params`,begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:a},{begin:`(`+e.RE_STARTERS_RE+`|unless)\\s*`,keywords:`unless`,contains:[{className:`regexp`,contains:[e.BACKSLASH_ESCAPE,l],illegal:/\n/,variants:[{begin:`/`,end:`/[a-z]*`},{begin:/%r\{/,end:/\}[a-z]*/},{begin:`%r\\(`,end:`\\)[a-z]*`},{begin:`%r!`,end:`![a-z]*`},{begin:`%r\\[`,end:`\\][a-z]*`}]}].concat(s,c),relevance:0}].concat(s,c);l.contains=m,p.contains=m;let h=[{begin:/^\s*=>/,starts:{end:`$`,contains:m}},{className:`meta.prompt`,begin:`^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])`,starts:{end:`$`,keywords:a,contains:m}}];return c.unshift(s),{name:`Ruby`,aliases:[`rb`,`gemspec`,`podspec`,`thor`,`irb`],keywords:a,illegal:/\/\*/,contains:[e.SHEBANG({binary:`ruby`})].concat(h,c,m)}}function Ax(e){let t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),a={className:`title.function.invoke`,relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o=`abstract.as.async.await.become.box.break.const.continue.crate.do.dyn.else.enum.extern.false.final.fn.for.if.impl.in.let.loop.macro.match.mod.move.mut.override.priv.pub.ref.return.self.Self.static.struct.super.trait.true.try.type.typeof.union.unsafe.unsized.use.virtual.where.while.yield`.split(`.`),s=[`true`,`false`,`Some`,`None`,`Ok`,`Err`],c=`drop .Copy.Send.Sized.Sync.Drop.Fn.FnMut.FnOnce.ToOwned.Clone.Debug.PartialEq.PartialOrd.Eq.Ord.AsRef.AsMut.Into.From.Default.Iterator.Extend.IntoIterator.DoubleEndedIterator.ExactSizeIterator.SliceConcatExt.ToString.assert!.assert_eq!.bitflags!.bytes!.cfg!.col!.concat!.concat_idents!.debug_assert!.debug_assert_eq!.env!.eprintln!.panic!.file!.format!.format_args!.include_bytes!.include_str!.line!.local_data_key!.module_path!.option_env!.print!.println!.select!.stringify!.try!.unimplemented!.unreachable!.vec!.write!.writeln!.macro_rules!.assert_ne!.debug_assert_ne!`.split(`.`),l=[`i8`,`i16`,`i32`,`i64`,`i128`,`isize`,`u8`,`u16`,`u32`,`u64`,`u128`,`usize`,`f32`,`f64`,`str`,`char`,`bool`,`Box`,`Option`,`Result`,`String`,`Vec`];return{name:`Rust`,aliases:[`rs`],keywords:{$pattern:e.IDENT_RE+`!?`,type:l,keyword:o,literal:s,built_in:c},illegal:`</`,contains:[e.C_LINE_COMMENT_MODE,e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:`symbol`,begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:`string`,variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:`char.escape`,match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:`number`,variants:[{begin:`\\b0b([01_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0o([0-7_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b0x([A-Fa-f0-9_]+)([ui](8|16|32|64|128|size)|f(32|64))?`},{begin:`\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)([ui](8|16|32|64|128|size)|f(32|64))?`}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:`keyword`,3:`title.function`}},{className:`meta`,begin:`#!?\\[`,end:`\\]`,contains:[{className:`string`,begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:`keyword`,3:`keyword`,4:`variable`}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:`keyword`,3:`variable`,5:`keyword`}},{begin:[/type/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:`keyword`,3:`title.class`}},{begin:e.IDENT_RE+`::`,keywords:{keyword:`Self`,built_in:c,type:l}},{className:`punctuation`,begin:`->`},a]}}var jx=e=>({IMPORTANT:{scope:`meta`,begin:`!important`},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:`number`,begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:`built_in`,begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:`selector-attr`,begin:/\[/,end:/\]/,illegal:`$`,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:`number`,begin:e.NUMBER_RE+`(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?`,relevance:0},CSS_VARIABLE:{className:`attr`,begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Mx=`a.abbr.address.article.aside.audio.b.blockquote.body.button.canvas.caption.cite.code.dd.del.details.dfn.div.dl.dt.em.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.html.i.iframe.img.input.ins.kbd.label.legend.li.main.mark.menu.nav.object.ol.optgroup.option.p.picture.q.quote.samp.section.select.source.span.strong.summary.sup.table.tbody.td.textarea.tfoot.th.thead.time.tr.ul.var.video`.split(`.`),Nx=`defs.g.marker.mask.pattern.svg.switch.symbol.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feFlood.feGaussianBlur.feImage.feMerge.feMorphology.feOffset.feSpecularLighting.feTile.feTurbulence.linearGradient.radialGradient.stop.circle.ellipse.image.line.path.polygon.polyline.rect.text.use.textPath.tspan.foreignObject.clipPath`.split(`.`),Px=[...Mx,...Nx],Fx=`any-hover.any-pointer.aspect-ratio.color.color-gamut.color-index.device-aspect-ratio.device-height.device-width.display-mode.forced-colors.grid.height.hover.inverted-colors.monochrome.orientation.overflow-block.overflow-inline.pointer.prefers-color-scheme.prefers-contrast.prefers-reduced-motion.prefers-reduced-transparency.resolution.scan.scripting.update.width.min-width.max-width.min-height.max-height`.split(`.`).sort().reverse(),Ix=`active.any-link.blank.checked.current.default.defined.dir.disabled.drop.empty.enabled.first.first-child.first-of-type.fullscreen.future.focus.focus-visible.focus-within.has.host.host-context.hover.indeterminate.in-range.invalid.is.lang.last-child.last-of-type.left.link.local-link.not.nth-child.nth-col.nth-last-child.nth-last-col.nth-last-of-type.nth-of-type.only-child.only-of-type.optional.out-of-range.past.placeholder-shown.read-only.read-write.required.right.root.scope.target.target-within.user-invalid.valid.visited.where`.split(`.`).sort().reverse(),Lx=[`after`,`backdrop`,`before`,`cue`,`cue-region`,`first-letter`,`first-line`,`grammar-error`,`marker`,`part`,`placeholder`,`selection`,`slotted`,`spelling-error`].sort().reverse(),Rx=`accent-color.align-content.align-items.align-self.alignment-baseline.all.anchor-name.animation.animation-composition.animation-delay.animation-direction.animation-duration.animation-fill-mode.animation-iteration-count.animation-name.animation-play-state.animation-range.animation-range-end.animation-range-start.animation-timeline.animation-timing-function.appearance.aspect-ratio.backdrop-filter.backface-visibility.background.background-attachment.background-blend-mode.background-clip.background-color.background-image.background-origin.background-position.background-position-x.background-position-y.background-repeat.background-size.baseline-shift.block-size.border.border-block.border-block-color.border-block-end.border-block-end-color.border-block-end-style.border-block-end-width.border-block-start.border-block-start-color.border-block-start-style.border-block-start-width.border-block-style.border-block-width.border-bottom.border-bottom-color.border-bottom-left-radius.border-bottom-right-radius.border-bottom-style.border-bottom-width.border-collapse.border-color.border-end-end-radius.border-end-start-radius.border-image.border-image-outset.border-image-repeat.border-image-slice.border-image-source.border-image-width.border-inline.border-inline-color.border-inline-end.border-inline-end-color.border-inline-end-style.border-inline-end-width.border-inline-start.border-inline-start-color.border-inline-start-style.border-inline-start-width.border-inline-style.border-inline-width.border-left.border-left-color.border-left-style.border-left-width.border-radius.border-right.border-right-color.border-right-style.border-right-width.border-spacing.border-start-end-radius.border-start-start-radius.border-style.border-top.border-top-color.border-top-left-radius.border-top-right-radius.border-top-style.border-top-width.border-width.bottom.box-align.box-decoration-break.box-direction.box-flex.box-flex-group.box-lines.box-ordinal-group.box-orient.box-pack.box-shadow.box-sizing.break-after.break-before.break-inside.caption-side.caret-color.clear.clip.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.color-scheme.column-count.column-fill.column-gap.column-rule.column-rule-color.column-rule-style.column-rule-width.column-span.column-width.columns.contain.contain-intrinsic-block-size.contain-intrinsic-height.contain-intrinsic-inline-size.contain-intrinsic-size.contain-intrinsic-width.container.container-name.container-type.content.content-visibility.counter-increment.counter-reset.counter-set.cue.cue-after.cue-before.cursor.cx.cy.direction.display.dominant-baseline.empty-cells.enable-background.field-sizing.fill.fill-opacity.fill-rule.filter.flex.flex-basis.flex-direction.flex-flow.flex-grow.flex-shrink.flex-wrap.float.flood-color.flood-opacity.flow.font.font-display.font-family.font-feature-settings.font-kerning.font-language-override.font-optical-sizing.font-palette.font-size.font-size-adjust.font-smooth.font-smoothing.font-stretch.font-style.font-synthesis.font-synthesis-position.font-synthesis-small-caps.font-synthesis-style.font-synthesis-weight.font-variant.font-variant-alternates.font-variant-caps.font-variant-east-asian.font-variant-emoji.font-variant-ligatures.font-variant-numeric.font-variant-position.font-variation-settings.font-weight.forced-color-adjust.gap.glyph-orientation-horizontal.glyph-orientation-vertical.grid.grid-area.grid-auto-columns.grid-auto-flow.grid-auto-rows.grid-column.grid-column-end.grid-column-start.grid-gap.grid-row.grid-row-end.grid-row-start.grid-template.grid-template-areas.grid-template-columns.grid-template-rows.hanging-punctuation.height.hyphenate-character.hyphenate-limit-chars.hyphens.icon.image-orientation.image-rendering.image-resolution.ime-mode.initial-letter.initial-letter-align.inline-size.inset.inset-area.inset-block.inset-block-end.inset-block-start.inset-inline.inset-inline-end.inset-inline-start.isolation.justify-content.justify-items.justify-self.kerning.left.letter-spacing.lighting-color.line-break.line-height.line-height-step.list-style.list-style-image.list-style-position.list-style-type.margin.margin-block.margin-block-end.margin-block-start.margin-bottom.margin-inline.margin-inline-end.margin-inline-start.margin-left.margin-right.margin-top.margin-trim.marker.marker-end.marker-mid.marker-start.marks.mask.mask-border.mask-border-mode.mask-border-outset.mask-border-repeat.mask-border-slice.mask-border-source.mask-border-width.mask-clip.mask-composite.mask-image.mask-mode.mask-origin.mask-position.mask-repeat.mask-size.mask-type.masonry-auto-flow.math-depth.math-shift.math-style.max-block-size.max-height.max-inline-size.max-width.min-block-size.min-height.min-inline-size.min-width.mix-blend-mode.nav-down.nav-index.nav-left.nav-right.nav-up.none.normal.object-fit.object-position.offset.offset-anchor.offset-distance.offset-path.offset-position.offset-rotate.opacity.order.orphans.outline.outline-color.outline-offset.outline-style.outline-width.overflow.overflow-anchor.overflow-block.overflow-clip-margin.overflow-inline.overflow-wrap.overflow-x.overflow-y.overlay.overscroll-behavior.overscroll-behavior-block.overscroll-behavior-inline.overscroll-behavior-x.overscroll-behavior-y.padding.padding-block.padding-block-end.padding-block-start.padding-bottom.padding-inline.padding-inline-end.padding-inline-start.padding-left.padding-right.padding-top.page.page-break-after.page-break-before.page-break-inside.paint-order.pause.pause-after.pause-before.perspective.perspective-origin.place-content.place-items.place-self.pointer-events.position.position-anchor.position-visibility.print-color-adjust.quotes.r.resize.rest.rest-after.rest-before.right.rotate.row-gap.ruby-align.ruby-position.scale.scroll-behavior.scroll-margin.scroll-margin-block.scroll-margin-block-end.scroll-margin-block-start.scroll-margin-bottom.scroll-margin-inline.scroll-margin-inline-end.scroll-margin-inline-start.scroll-margin-left.scroll-margin-right.scroll-margin-top.scroll-padding.scroll-padding-block.scroll-padding-block-end.scroll-padding-block-start.scroll-padding-bottom.scroll-padding-inline.scroll-padding-inline-end.scroll-padding-inline-start.scroll-padding-left.scroll-padding-right.scroll-padding-top.scroll-snap-align.scroll-snap-stop.scroll-snap-type.scroll-timeline.scroll-timeline-axis.scroll-timeline-name.scrollbar-color.scrollbar-gutter.scrollbar-width.shape-image-threshold.shape-margin.shape-outside.shape-rendering.speak.speak-as.src.stop-color.stop-opacity.stroke.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.table-layout.text-align.text-align-all.text-align-last.text-anchor.text-combine-upright.text-decoration.text-decoration-color.text-decoration-line.text-decoration-skip.text-decoration-skip-ink.text-decoration-style.text-decoration-thickness.text-emphasis.text-emphasis-color.text-emphasis-position.text-emphasis-style.text-indent.text-justify.text-orientation.text-overflow.text-rendering.text-shadow.text-size-adjust.text-transform.text-underline-offset.text-underline-position.text-wrap.text-wrap-mode.text-wrap-style.timeline-scope.top.touch-action.transform.transform-box.transform-origin.transform-style.transition.transition-behavior.transition-delay.transition-duration.transition-property.transition-timing-function.translate.unicode-bidi.user-modify.user-select.vector-effect.vertical-align.view-timeline.view-timeline-axis.view-timeline-inset.view-timeline-name.view-transition-name.visibility.voice-balance.voice-duration.voice-family.voice-pitch.voice-range.voice-rate.voice-stress.voice-volume.white-space.white-space-collapse.widows.width.will-change.word-break.word-spacing.word-wrap.writing-mode.x.y.z-index.zoom`.split(`.`).sort().reverse();function zx(e){let t=jx(e),n=Lx,r=Ix,i=`@[a-z-]+`,a={className:`variable`,begin:`(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b`,relevance:0};return{name:`SCSS`,case_insensitive:!0,illegal:`[=/|']`,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:`selector-id`,begin:`#[A-Za-z0-9_-]+`,relevance:0},{className:`selector-class`,begin:`\\.[A-Za-z0-9_-]+`,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:`selector-tag`,begin:`\\b(`+Px.join(`|`)+`)\\b`,relevance:0},{className:`selector-pseudo`,begin:`:(`+r.join(`|`)+`)`},{className:`selector-pseudo`,begin:`:(:)?(`+n.join(`|`)+`)`},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:`attribute`,begin:`\\b(`+Rx.join(`|`)+`)\\b`},{begin:`\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b`},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:`@(page|font-face)`,keywords:{$pattern:i,keyword:`@page @font-face`}},{begin:`@`,end:`[{;]`,returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:`and or not only`,attribute:Fx.join(` `)},contains:[{begin:i,className:`keyword`},{begin:/[a-z-]+(?=:)/,className:`attribute`},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Bx(e){return{name:`Shell Session`,aliases:[`console`,`shellsession`],contains:[{className:`meta.prompt`,begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:`bash`}}]}}function Vx(e){let t=e.regex,n=e.COMMENT(`--`,`$`),r={scope:`string`,variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},a=[`true`,`false`,`unknown`],o=[`double precision`,`large object`,`with timezone`,`without timezone`],s=`bigint.binary.blob.boolean.char.character.clob.date.dec.decfloat.decimal.float.int.integer.interval.nchar.nclob.national.numeric.real.row.smallint.time.timestamp.varchar.varying.varbinary`.split(`.`),c=[`add`,`asc`,`collation`,`desc`,`final`,`first`,`last`,`view`],l=`abs.acos.all.allocate.alter.and.any.are.array.array_agg.array_max_cardinality.as.asensitive.asin.asymmetric.at.atan.atomic.authorization.avg.begin.begin_frame.begin_partition.between.bigint.binary.blob.boolean.both.by.call.called.cardinality.cascaded.case.cast.ceil.ceiling.char.char_length.character.character_length.check.classifier.clob.close.coalesce.collate.collect.column.commit.condition.connect.constraint.contains.convert.copy.corr.corresponding.cos.cosh.count.covar_pop.covar_samp.create.cross.cube.cume_dist.current.current_catalog.current_date.current_default_transform_group.current_path.current_role.current_row.current_schema.current_time.current_timestamp.current_path.current_role.current_transform_group_for_type.current_user.cursor.cycle.date.day.deallocate.dec.decimal.decfloat.declare.default.define.delete.dense_rank.deref.describe.deterministic.disconnect.distinct.double.drop.dynamic.each.element.else.empty.end.end_frame.end_partition.end-exec.equals.escape.every.except.exec.execute.exists.exp.external.extract.false.fetch.filter.first_value.float.floor.for.foreign.frame_row.free.from.full.function.fusion.get.global.grant.group.grouping.groups.having.hold.hour.identity.in.indicator.initial.inner.inout.insensitive.insert.int.integer.intersect.intersection.interval.into.is.join.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.language.large.last_value.lateral.lead.leading.left.like.like_regex.listagg.ln.local.localtime.localtimestamp.log.log10.lower.match.match_number.match_recognize.matches.max.member.merge.method.min.minute.mod.modifies.module.month.multiset.national.natural.nchar.nclob.new.no.none.normalize.not.nth_value.ntile.null.nullif.numeric.octet_length.occurrences_regex.of.offset.old.omit.on.one.only.open.or.order.out.outer.over.overlaps.overlay.parameter.partition.pattern.per.percent.percent_rank.percentile_cont.percentile_disc.period.portion.position.position_regex.power.precedes.precision.prepare.primary.procedure.ptf.range.rank.reads.real.recursive.ref.references.referencing.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.release.result.return.returns.revoke.right.rollback.rollup.row.row_number.rows.running.savepoint.scope.scroll.search.second.seek.select.sensitive.session_user.set.show.similar.sin.sinh.skip.smallint.some.specific.specifictype.sql.sqlexception.sqlstate.sqlwarning.sqrt.start.static.stddev_pop.stddev_samp.submultiset.subset.substring.substring_regex.succeeds.sum.symmetric.system.system_time.system_user.table.tablesample.tan.tanh.then.time.timestamp.timezone_hour.timezone_minute.to.trailing.translate.translate_regex.translation.treat.trigger.trim.trim_array.true.truncate.uescape.union.unique.unknown.unnest.update.upper.user.using.value.values.value_of.var_pop.var_samp.varbinary.varchar.varying.versioning.when.whenever.where.width_bucket.window.with.within.without.year`.split(`.`),u=`abs.acos.array_agg.asin.atan.avg.cast.ceil.ceiling.coalesce.corr.cos.cosh.count.covar_pop.covar_samp.cume_dist.dense_rank.deref.element.exp.extract.first_value.floor.json_array.json_arrayagg.json_exists.json_object.json_objectagg.json_query.json_table.json_table_primitive.json_value.lag.last_value.lead.listagg.ln.log.log10.lower.max.min.mod.nth_value.ntile.nullif.percent_rank.percentile_cont.percentile_disc.position.position_regex.power.rank.regr_avgx.regr_avgy.regr_count.regr_intercept.regr_r2.regr_slope.regr_sxx.regr_sxy.regr_syy.row_number.sin.sinh.sqrt.stddev_pop.stddev_samp.substring.substring_regex.sum.tan.tanh.translate.translate_regex.treat.trim.trim_array.unnest.upper.value_of.var_pop.var_samp.width_bucket`.split(`.`),d=[`current_catalog`,`current_date`,`current_default_transform_group`,`current_path`,`current_role`,`current_schema`,`current_transform_group_for_type`,`current_user`,`session_user`,`system_time`,`system_user`,`current_time`,`localtime`,`current_timestamp`,`localtimestamp`],f=[`create table`,`insert into`,`primary key`,`foreign key`,`not null`,`alter table`,`add constraint`,`grouping sets`,`on overflow`,`character set`,`respect nulls`,`ignore nulls`,`nulls first`,`nulls last`,`depth first`,`breadth first`],p=u,m=[...l,...c].filter(e=>!u.includes(e)),h={scope:`variable`,match:/@[a-z0-9][a-z0-9_]*/},g={scope:`operator`,match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},_={match:t.concat(/\b/,t.either(...p),/\s*\(/),relevance:0,keywords:{built_in:p}};function v(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,`\\s+`))),/\b/)}let y={scope:`keyword`,match:v(f),relevance:0};function b(e,{exceptions:t,when:n}={}){let r=n;return t||=[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}return{name:`SQL`,case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(m,{when:e=>e.length<3}),literal:a,type:s,built_in:d},contains:[{scope:`type`,match:v(o)},y,_,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}function Hx(e){return e?typeof e==`string`?e:e.source:null}function Ux(e){return Wx(`(?=`,e,`)`)}function Wx(...e){return e.map(e=>Hx(e)).join(``)}function Gx(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Kx(...e){return`(`+(Gx(e).capture?``:`?:`)+e.map(e=>Hx(e)).join(`|`)+`)`}var qx=e=>Wx(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Jx=[`Protocol`,`Type`].map(qx),Yx=[`init`,`self`].map(qx),Xx=[`Any`,`Self`],Zx=[`actor`,`any`,`associatedtype`,`async`,`await`,/as\?/,/as!/,`as`,`borrowing`,`break`,`case`,`catch`,`class`,`consume`,`consuming`,`continue`,`convenience`,`copy`,`default`,`defer`,`deinit`,`didSet`,`distributed`,`do`,`dynamic`,`each`,`else`,`enum`,`extension`,`fallthrough`,/fileprivate\(set\)/,`fileprivate`,`final`,`for`,`func`,`get`,`guard`,`if`,`import`,`indirect`,`infix`,/init\?/,/init!/,`inout`,/internal\(set\)/,`internal`,`in`,`is`,`isolated`,`nonisolated`,`lazy`,`let`,`macro`,`mutating`,`nonmutating`,/open\(set\)/,`open`,`operator`,`optional`,`override`,`package`,`postfix`,`precedencegroup`,`prefix`,/private\(set\)/,`private`,`protocol`,/public\(set\)/,`public`,`repeat`,`required`,`rethrows`,`return`,`set`,`some`,`static`,`struct`,`subscript`,`super`,`switch`,`throws`,`throw`,/try\?/,/try!/,`try`,`typealias`,/unowned\(safe\)/,/unowned\(unsafe\)/,`unowned`,`var`,`weak`,`where`,`while`,`willSet`],Qx=[`false`,`nil`,`true`],$x=[`assignment`,`associativity`,`higherThan`,`left`,`lowerThan`,`none`,`right`],eS=[`#colorLiteral`,`#column`,`#dsohandle`,`#else`,`#elseif`,`#endif`,`#error`,`#file`,`#fileID`,`#fileLiteral`,`#filePath`,`#function`,`#if`,`#imageLiteral`,`#keyPath`,`#line`,`#selector`,`#sourceLocation`,`#warning`],tS=`abs.all.any.assert.assertionFailure.debugPrint.dump.fatalError.getVaList.isKnownUniquelyReferenced.max.min.numericCast.pointwiseMax.pointwiseMin.precondition.preconditionFailure.print.readLine.repeatElement.sequence.stride.swap.swift_unboxFromSwiftValueWithType.transcode.type.unsafeBitCast.unsafeDowncast.withExtendedLifetime.withUnsafeMutablePointer.withUnsafePointer.withVaList.withoutActuallyEscaping.zip`.split(`.`),nS=Kx(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),rS=Kx(nS,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),iS=Wx(nS,rS,`*`),aS=Kx(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),oS=Kx(aS,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),sS=Wx(aS,oS,`*`),cS=Wx(/[A-Z]/,oS,`*`),lS=[`attached`,`autoclosure`,Wx(/convention\(/,Kx(`swift`,`block`,`c`),/\)/),`discardableResult`,`dynamicCallable`,`dynamicMemberLookup`,`escaping`,`freestanding`,`frozen`,`GKInspectable`,`IBAction`,`IBDesignable`,`IBInspectable`,`IBOutlet`,`IBSegueAction`,`inlinable`,`main`,`nonobjc`,`NSApplicationMain`,`NSCopying`,`NSManaged`,Wx(/objc\(/,sS,/\)/),`objc`,`objcMembers`,`propertyWrapper`,`requires_stored_property_inits`,`resultBuilder`,`Sendable`,`testable`,`UIApplicationMain`,`unchecked`,`unknown`,`usableFromInline`,`warn_unqualified_access`],uS=[`iOS`,`iOSApplicationExtension`,`macOS`,`macOSApplicationExtension`,`macCatalyst`,`macCatalystApplicationExtension`,`watchOS`,`watchOSApplicationExtension`,`tvOS`,`tvOSApplicationExtension`,`swift`];function dS(e){let t={match:/\s+/,relevance:0},n=e.COMMENT(`/\\*`,`\\*/`,{contains:[`self`]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,Kx(...Jx,...Yx)],className:{2:`keyword`}},a={match:Wx(/\./,Kx(...Zx)),relevance:0},o=Zx.filter(e=>typeof e==`string`).concat([`_|0`]),s={variants:[{className:`keyword`,match:Kx(...Zx.filter(e=>typeof e!=`string`).concat(Xx).map(qx),...Yx)}]},c={$pattern:Kx(/\b\w+/,/#\w+/),keyword:o.concat(eS),literal:Qx},l=[i,a,s],u=[{match:Wx(/\./,Kx(...tS)),relevance:0},{className:`built_in`,match:Wx(/\b/,Kx(...tS),/(?=\()/)}],d={match:/->/,relevance:0},f=[d,{className:`operator`,relevance:0,variants:[{match:iS},{match:`\\.(\\.|${rS})+`}]}],p=`([0-9]_*)+`,m=`([0-9a-fA-F]_*)+`,h={className:`number`,relevance:0,variants:[{match:`\\b(${p})(\\.(${p}))?([eE][+-]?(${p}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${p}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e=``)=>({className:`subst`,variants:[{match:Wx(/\\/,e,/[0\\tnr"']/)},{match:Wx(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e=``)=>({className:`subst`,match:Wx(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),v=(e=``)=>({className:`subst`,label:`interpol`,begin:Wx(/\\/,e,/\(/),end:/\)/}),y=(e=``)=>({begin:Wx(e,/"""/),end:Wx(/"""/,e),contains:[g(e),_(e),v(e)]}),b=(e=``)=>({begin:Wx(e,/"/),end:Wx(/"/,e),contains:[g(e),v(e)]}),x={className:`string`,variants:[y(),y(`#`),y(`##`),y(`###`),b(),b(`#`),b(`##`),b(`###`)]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],C={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},w=e=>{let t=Wx(e,/\//),n=Wx(/\//,e);return{begin:t,end:n,contains:[...S,{scope:`comment`,begin:`#(?!.*${n})`,end:/$/}]}},T={scope:`regexp`,variants:[w(`###`),w(`##`),w(`#`),C]},E={match:Wx(/`/,sS,/`/)},D=[E,{className:`variable`,match:/\$\d+/},{className:`variable`,match:`\\$${oS}+`}],O=[{match:/(@|#(un)?)available/,scope:`keyword`,starts:{contains:[{begin:/\(/,end:/\)/,keywords:uS,contains:[...f,h,x]}]}},{scope:`keyword`,match:Wx(/@/,Kx(...lS),Ux(Kx(/\(/,/\s+/)))},{scope:`meta`,match:Wx(/@/,sS)}],k={match:Ux(/\b[A-Z]/),relevance:0,contains:[{className:`type`,match:Wx(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,oS,`+`)},{className:`type`,match:cS,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Wx(/\s+&\s+/,Ux(cS)),relevance:0}]},A={begin:/</,end:/>/,keywords:c,contains:[...r,...l,...O,d,k]};k.contains.push(A);let j={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:[`self`,{match:Wx(sS,/\s*:/),keywords:`_|0`,relevance:0},...r,T,...l,...u,...f,h,x,...D,...O,k]},M={begin:/</,end:/>/,keywords:`repeat each`,contains:[...r,k]},N={begin:/\(/,end:/\)/,keywords:c,contains:[{begin:Kx(Ux(Wx(sS,/\s*:/)),Ux(Wx(sS,/\s+/,sS,/\s*:/))),end:/:/,relevance:0,contains:[{className:`keyword`,match:/\b_\b/},{className:`params`,match:sS}]},...r,...l,...f,h,x,...O,k,j],endsParent:!0,illegal:/["']/},P={match:[/(func|macro)/,/\s+/,Kx(E.match,sS,iS)],className:{1:`keyword`,3:`title.function`},contains:[M,N,t],illegal:[/\[/,/%/]},F={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:`keyword`},contains:[M,N,t],illegal:/\[|%/},I={match:[/operator/,/\s+/,iS],className:{1:`keyword`,3:`title`}},L={begin:[/precedencegroup/,/\s+/,cS],className:{1:`keyword`,3:`title`},contains:[k],keywords:[...$x,...Qx],end:/}/},R={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:`keyword`,3:`keyword`,5:`title.function`}},ee={match:[/class\b/,/\s+/,/var\b/],scope:{1:`keyword`,3:`keyword`}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,sS,/\s*/],beginScope:{1:`keyword`,3:`title.class`},keywords:c,contains:[M,...l,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:`title.class.inherited`,match:cS},...l],relevance:0}]};for(let e of x.variants){let t=e.contains.find(e=>e.label===`interpol`);t.keywords=c;let n=[...l,...u,...f,h,x,...D];t.contains=[...n,{begin:/\(/,end:/\)/,contains:[`self`,...n]}]}return{name:`Swift`,keywords:c,contains:[...r,P,F,R,ee,te,I,L,{beginKeywords:`import`,end:/$/,contains:[...r],relevance:0},T,...l,...u,...f,h,x,...D,...O,k,j]}}var fS=`[A-Za-z$_][0-9A-Za-z$_]*`,pS=`as.in.of.if.for.while.finally.var.new.function.do.return.void.else.break.catch.instanceof.with.throw.case.default.try.switch.continue.typeof.delete.let.yield.const.class.debugger.async.await.static.import.from.export.extends.using`.split(`.`),mS=[`true`,`false`,`null`,`undefined`,`NaN`,`Infinity`],hS=`Object.Function.Boolean.Symbol.Math.Date.Number.BigInt.String.RegExp.Array.Float32Array.Float64Array.Int8Array.Uint8Array.Uint8ClampedArray.Int16Array.Int32Array.Uint16Array.Uint32Array.BigInt64Array.BigUint64Array.Set.Map.WeakSet.WeakMap.ArrayBuffer.SharedArrayBuffer.Atomics.DataView.JSON.Promise.Generator.GeneratorFunction.AsyncFunction.Reflect.Proxy.Intl.WebAssembly`.split(`.`),gS=[`Error`,`EvalError`,`InternalError`,`RangeError`,`ReferenceError`,`SyntaxError`,`TypeError`,`URIError`],_S=[`setInterval`,`setTimeout`,`clearInterval`,`clearTimeout`,`require`,`exports`,`eval`,`isFinite`,`isNaN`,`parseFloat`,`parseInt`,`decodeURI`,`decodeURIComponent`,`encodeURI`,`encodeURIComponent`,`escape`,`unescape`],vS=[`arguments`,`this`,`super`,`console`,`window`,`document`,`localStorage`,`sessionStorage`,`module`,`global`],yS=[].concat(_S,hS,gS);function bS(e){let t=e.regex,n=(e,{after:t})=>{let n=`</`+e[0].slice(1);return e.input.indexOf(n,t)!==-1},r=fS,i={begin:`<>`,end:`</>`},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{let r=e[0].length+e.index,i=e.input[r];if(i===`<`||i===`,`){t.ignoreMatch();return}i===`>`&&(n(e,{after:r})||t.ignoreMatch());let a,o=e.input.substring(r);if(a=o.match(/^\s*=/)){t.ignoreMatch();return}if((a=o.match(/^\s+extends\s+/))&&a.index===0){t.ignoreMatch();return}}},s={$pattern:fS,keyword:pS,literal:mS,built_in:yS,"variable.language":vS},c=`[0-9](_?[0-9])*`,l=`\\.(${c})`,u=`0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*`,d={className:`number`,variants:[{begin:`(\\b(${u})((${l})|\\.)?|(${l}))[eE][+-]?(${c})\\b`},{begin:`\\b(${u})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:`\\b(0|[1-9](_?[0-9])*)n\\b`},{begin:`\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b`},{begin:`\\b0[bB][0-1](_?[0-1])*n?\\b`},{begin:`\\b0[oO][0-7](_?[0-7])*n?\\b`},{begin:`\\b0[0-7]+n?\\b`}],relevance:0},f={className:`subst`,begin:`\\$\\{`,end:`\\}`,keywords:s,contains:[]},p={begin:".?html`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`xml`}},m={begin:".?css`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`css`}},h={begin:".?gql`",end:``,starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:`graphql`}},g={className:`string`,begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},_={className:`comment`,variants:[e.COMMENT(/\/\*\*(?!\/)/,`\\*/`,{relevance:0,contains:[{begin:`(?=@[A-Za-z]+)`,relevance:0,contains:[{className:`doctag`,begin:`@[A-Za-z]+`},{className:`type`,begin:`\\{`,end:`\\}`,excludeEnd:!0,excludeBegin:!0,relevance:0},{className:`variable`,begin:`[A-Za-z$_][0-9A-Za-z$_]*(?=\\s*(-)|$)`,endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,{match:/\$\d+/},d];f.contains=v.concat({begin:/\{/,end:/\}/,keywords:s,contains:[`self`].concat(v)});let y=[].concat(_,f.contains),b=y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:s,contains:[`self`].concat(y)}]),x={className:`params`,begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b},S={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,`(`,t.concat(/\./,r),`)*`)],scope:{1:`keyword`,3:`title.class`,5:`keyword`,7:`title.class.inherited`}},{match:[/class/,/\s+/,r],scope:{1:`keyword`,3:`title.class`}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:`title.class`,keywords:{_:[...hS,...gS]}},w={label:`use_strict`,className:`meta`,relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:`keyword`,3:`title.function`},label:`func.def`,contains:[x],illegal:/%/},E={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:`variable.constant`};function D(e){return t.concat(`(?!`,e.join(`|`),`)`)}let O={match:t.concat(/\b/,D([..._S,`super`,`import`].map(e=>`${e}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:`title.function`,relevance:0},k={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:`prototype`,className:`property`,relevance:0},A={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:`keyword`,3:`title.function`},contains:[{begin:/\(\)/},x]},j=`(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|`+e.UNDERSCORE_IDENT_RE+`)\\s*=>`,M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(j)],keywords:`async`,className:{1:`keyword`,3:`title.function`},contains:[x]};return{name:`JavaScript`,aliases:[`js`,`jsx`,`mjs`,`cjs`],keywords:s,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:`shebang`,binary:`node`,relevance:5}),w,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,m,h,g,_,{match:/\$\d+/},d,C,{scope:`attr`,match:r+t.lookahead(`:`),relevance:0},M,{begin:`(`+e.RE_STARTERS_RE+`|\\b(case|return|throw)\\b)\\s*`,keywords:`return throw case`,relevance:0,contains:[_,e.REGEXP_MODE,{className:`function`,begin:j,returnBegin:!0,end:`\\s*=>`,contains:[{className:`params`,variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:`xml`,contains:[{begin:o.begin,end:o.end,skip:!0,contains:[`self`]}]}]},T,{beginKeywords:`while if switch catch for`},{begin:`\\b(?!function)`+e.UNDERSCORE_IDENT_RE+`\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{`,returnBegin:!0,label:`func.def`,contains:[x,e.inherit(e.TITLE_MODE,{begin:r,className:`title.function`})]},{match:/\.\.\./,relevance:0},k,{match:`\\$[A-Za-z$_][0-9A-Za-z$_]*`,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:`title.function`},contains:[x]},O,E,S,A,{match:/\$[(.]/}]}}function xS(e){let t=e.regex,n=bS(e),r=fS,i=[`any`,`void`,`number`,`boolean`,`string`,`object`,`never`,`symbol`,`bigint`,`unknown`],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:`keyword`,3:`title.class`}},o={beginKeywords:`interface`,end:/\{/,excludeEnd:!0,keywords:{keyword:`interface extends`,built_in:i},contains:[n.exports.CLASS_REFERENCE]},s={className:`meta`,relevance:10,begin:/^\s*['"]use strict['"]/},c={$pattern:fS,keyword:pS.concat([`type`,`interface`,`public`,`private`,`protected`,`implements`,`declare`,`abstract`,`readonly`,`enum`,`override`,`satisfies`]),literal:mS,built_in:yS.concat(i),"variable.language":vS},l={className:`meta`,begin:`@[A-Za-z$_][0-9A-Za-z$_]*`},u=(e,t,n)=>{let r=e.contains.findIndex(e=>e.label===t);if(r===-1)throw Error(`can not find mode to replace`);e.contains.splice(r,1,n)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(l);let d=n.contains.find(e=>e.scope===`attr`),f=Object.assign({},d,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,d,f]),n.contains=n.contains.concat([l,a,o,f]),u(n,`shebang`,e.SHEBANG()),u(n,`use_strict`,s);let p=n.contains.find(e=>e.label===`func.def`);return p.relevance=0,Object.assign(n,{name:`TypeScript`,aliases:[`ts`,`tsx`,`mts`,`cts`]}),n}function SS(e){let t=e.regex,n={className:`string`,begin:/"(""|[^/n])"C\b/},r={className:`string`,begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,c={className:`literal`,variants:[{begin:t.concat(/# */,t.either(a,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,i),/ +/,t.either(o,s),/ *#/)}]},l={className:`number`,relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},u={className:`label`,begin:/^\w+:/},d=e.COMMENT(/'''/,/$/,{contains:[{className:`doctag`,begin:/<\/?/,end:/>/}]}),f=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:`Visual Basic .NET`,aliases:[`vb`],case_insensitive:!0,classNameAliases:{label:`symbol`},keywords:{keyword:`addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield`,built_in:`addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort`,type:`boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort`,literal:`true false nothing`},illegal:`//|\\{|\\}|endif|gosub|variant|wend|^\\$ `,contains:[n,r,c,l,u,d,f,{className:`meta`,begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:`const disable else elseif enable end externalsource if region then`},contains:[f]}]}}function CS(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push(`self`),{name:`WebAssembly`,keywords:{$pattern:/[\w.]+/,keyword:`anyfunc,block,br,br_if,br_table,call,call_indirect,data,drop,elem,else,end,export,func,global.get,global.set,local.get,local.set,local.tee,get_global,get_local,global,if,import,local,loop,memory,memory.grow,memory.size,module,mut,nop,offset,param,result,return,select,set_global,set_local,start,table,tee_local,then,type,unreachable`.split(`,`)},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:`keyword`,3:`operator`}},{className:`variable`,begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:`punctuation`,relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:`keyword`,3:`title.function`}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:`type`},{className:`keyword`,match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:`number`,relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}function wS(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:`symbol`,begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:`keyword`,begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:`string`}),c=e.inherit(e.QUOTE_STRING_MODE,{className:`string`}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:`attr`,begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:`string`,endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:`HTML, XML`,aliases:[`html`,`xhtml`,`rss`,`atom`,`xjb`,`xsd`,`xsl`,`plist`,`wsf`,`svg`],case_insensitive:!0,unicodeRegex:!0,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,relevance:10,contains:[a,c,s,o,{begin:/\[/,end:/\]/,contains:[{className:`meta`,begin:/<![a-z]/,end:/>/,contains:[a,o,c,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:`meta`,end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:`tag`,begin:/<style(?=\s|>)/,end:/>/,keywords:{name:`style`},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:[`css`,`xml`]}},{className:`tag`,begin:/<script(?=\s|>)/,end:/>/,keywords:{name:`script`},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:[`javascript`,`handlebars`,`xml`]}},{className:`tag`,begin:/<>|<\/>/},{className:`tag`,begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:`name`,begin:n,relevance:0,starts:l}]},{className:`tag`,begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:`name`,begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function TS(e){let t=`true false yes no null`,n={className:`attr`,variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:`template-variable`,variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:`string`,relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:`char.escape`,relevance:0}]},a={className:`string`,relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},o=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={className:`number`,begin:`\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b`},c={end:`,`,endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},l={begin:/\{/,end:/\}/,contains:[c],illegal:`\\n`,relevance:0},u={begin:`\\[`,end:`\\]`,contains:[c],illegal:`\\n`,relevance:0},d=[n,{className:`meta`,begin:`^---\\s*$`,relevance:10},{className:`string`,begin:`[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*`},{begin:`<%[%=-]?`,end:`[%-]?%>`,subLanguage:`ruby`,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:`type`,begin:`!\\w+![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!<[\\w#;/?:@&=+$,.~*'()[\\]]+>`},{className:`type`,begin:`![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`type`,begin:`!![\\w#;/?:@&=+$,.~*'()[\\]]+`},{className:`meta`,begin:`&`+e.UNDERSCORE_IDENT_RE+`$`},{className:`meta`,begin:`\\*`+e.UNDERSCORE_IDENT_RE+`$`},{className:`bullet`,begin:`-(?=[ ]|$)`,relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},s,{className:`number`,begin:e.C_NUMBER_RE+`\\b`,relevance:0},l,u,i,a],f=[...d];return f.pop(),f.push(o),c.contains=f,{name:`YAML`,case_insensitive:!0,aliases:[`yml`],contains:d}}var ES={arduino:Cb,bash:wb,c:Tb,cpp:Eb,csharp:Db,css:Ib,diff:Lb,go:Rb,graphql:zb,ini:Bb,java:Kb,javascript:tx,json:nx,kotlin:sx,less:_x,lua:vx,makefile:yx,markdown:bx,objectivec:xx,perl:Sx,php:Cx,"php-template":wx,plaintext:Tx,python:Ex,"python-repl":Dx,r:Ox,ruby:kx,rust:Ax,scss:zx,shell:Bx,sql:Vx,swift:dS,typescript:xS,vbnet:SS,wasm:CS,xml:wS,yaml:TS},DS=L(be(((e,t)=>{function n(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw Error(`map is read-only`)}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw Error(`set is read-only`)}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let r=e[t],i=typeof r;(i===`object`||i===`function`)&&!Object.isFrozen(r)&&n(r)}),e}var r=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function i(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#x27;`)}function a(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(function(e){for(let t in e)n[t]=e[t]}),n}var o=`</span>`,s=e=>!!e.scope,c=(e,{prefix:t})=>{if(e.startsWith(`language:`))return e.replace(`language:`,`language-`);if(e.includes(`.`)){let n=e.split(`.`);return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${`_`.repeat(t+1)}`)].join(` `)}return`${t}${e}`},l=class{constructor(e,t){this.buffer=``,this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=i(e)}openNode(e){if(!s(e))return;let t=c(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){s(e)&&(this.buffer+=o)}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}},u=(e={})=>{let t={children:[]};return Object.assign(t,e),t},d=class e{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=u({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t==`string`?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(t){typeof t!=`string`&&t.children&&(t.children.every(e=>typeof e==`string`)?t.children=[t.children.join(``)]:t.children.forEach(t=>{e._collapse(t)}))}},f=class extends d{constructor(e){super(),this.options=e}addText(e){e!==``&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function p(e){return e?typeof e==`string`?e:e.source:null}function m(e){return _(`(?=`,e,`)`)}function h(e){return _(`(?:`,e,`)*`)}function g(e){return _(`(?:`,e,`)?`)}function _(...e){return e.map(e=>p(e)).join(``)}function v(e){let t=e[e.length-1];return typeof t==`object`&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function y(...e){return`(`+(v(e).capture?``:`?:`)+e.map(e=>p(e)).join(`|`)+`)`}function b(e){return RegExp(e.toString()+`|`).exec(``).length-1}function x(e,t){let n=e&&e.exec(t);return n&&n.index===0}var S=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;let t=n,r=p(e),i=``;for(;r.length>0;){let e=S.exec(r);if(!e){i+=r;break}i+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),e[0][0]===`\\`&&e[1]?i+=`\\`+String(Number(e[1])+t):(i+=e[0],e[0]===`(`&&n++)}return i}).map(e=>`(${e})`).join(t)}var w=/\b\B/,T=`[a-zA-Z]\\w*`,E=`[a-zA-Z_]\\w*`,D=`\\b\\d+(\\.\\d+)?`,O=`(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)`,k=`\\b(0b[01]+)`,A=`!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~`,j=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=_(t,/.*\b/,e.binary,/\b.*/)),a({scope:`meta`,begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{e.index!==0&&t.ignoreMatch()}},e)},M={begin:`\\\\[\\s\\S]`,relevance:0},N={scope:`string`,begin:`'`,end:`'`,illegal:`\\n`,contains:[M]},P={scope:`string`,begin:`"`,end:`"`,illegal:`\\n`,contains:[M]},F={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},I=function(e,t,n={}){let r=a({scope:`comment`,begin:e,end:t,contains:[]},n);r.contains.push({scope:`doctag`,begin:`[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)`,end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=y(`I`,`a`,`is`,`so`,`us`,`to`,`at`,`if`,`in`,`it`,`on`,/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:_(/[ ]+/,`(`,i,/[.]?[:]?([.][ ]|[ ])/,`){3}`)}),r},L=I(`//`,`$`),R=I(`/\\*`,`\\*/`),ee=I(`#`,`$`),te=Object.freeze({__proto__:null,APOS_STRING_MODE:N,BACKSLASH_ESCAPE:M,BINARY_NUMBER_MODE:{scope:`number`,begin:k,relevance:0},BINARY_NUMBER_RE:k,COMMENT:I,C_BLOCK_COMMENT_MODE:R,C_LINE_COMMENT_MODE:L,C_NUMBER_MODE:{scope:`number`,begin:O,relevance:0},C_NUMBER_RE:O,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:ee,IDENT_RE:T,MATCH_NOTHING_RE:w,METHOD_GUARD:{begin:`\\.\\s*[a-zA-Z_]\\w*`,relevance:0},NUMBER_MODE:{scope:`number`,begin:D,relevance:0},NUMBER_RE:D,PHRASAL_WORDS_MODE:F,QUOTE_STRING_MODE:P,REGEXP_MODE:{scope:`regexp`,begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[M,{begin:/\[/,end:/\]/,relevance:0,contains:[M]}]},RE_STARTERS_RE:A,SHEBANG:j,TITLE_MODE:{scope:`title`,begin:T,relevance:0},UNDERSCORE_IDENT_RE:E,UNDERSCORE_TITLE_MODE:{scope:`title`,begin:E,relevance:0}});function ne(e,t){e.input[e.index-1]===`.`&&t.ignoreMatch()}function re(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function ie(e,t){t&&e.beginKeywords&&(e.begin=`\\b(`+e.beginKeywords.split(` `).join(`|`)+`)(?!\\.)(?=\\b|\\s)`,e.__beforeBegin=ne,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function ae(e,t){Array.isArray(e.illegal)&&(e.illegal=y(...e.illegal))}function oe(e,t){if(e.match){if(e.begin||e.end)throw Error(`begin & end are not supported with match`);e.begin=e.match,delete e.match}}function se(e,t){e.relevance===void 0&&(e.relevance=1)}var ce=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error(`beforeMatch cannot be used with starts`);let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=_(n.beforeMatch,m(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},le=[`of`,`and`,`for`,`in`,`not`,`or`,`if`,`then`,`parent`,`list`,`value`],ue=`keyword`;function de(e,t,n=ue){let r=Object.create(null);return typeof e==`string`?i(n,e.split(` `)):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,de(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){let n=t.split(`|`);r[n[0]]=[e,fe(n[0],n[1])]})}}function fe(e,t){return t?Number(t):+!pe(e)}function pe(e){return le.includes(e.toLowerCase())}var me={},he=e=>{console.error(e)},ge=(e,...t)=>{console.log(`WARN: ${e}`,...t)},_e=(e,t)=>{me[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),me[`${e}/${t}`]=!0)},ve=Error();function ye(e,t,{key:n}){let r=0,i=e[n],a={},o={};for(let e=1;e<=t.length;e++)o[e+r]=i[e],a[e+r]=!0,r+=b(t[e-1]);e[n]=o,e[n]._emit=a,e[n]._multi=!0}function be(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw he(`skip, excludeBegin, returnBegin not compatible with beginScope: {}`),ve;if(typeof e.beginScope!=`object`||e.beginScope===null)throw he(`beginScope must be object`),ve;ye(e,e.begin,{key:`beginScope`}),e.begin=C(e.begin,{joinWith:``})}}function xe(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw he(`skip, excludeEnd, returnEnd not compatible with endScope: {}`),ve;if(typeof e.endScope!=`object`||e.endScope===null)throw he(`endScope must be object`),ve;ye(e,e.end,{key:`endScope`}),e.end=C(e.end,{joinWith:``})}}function Se(e){e.scope&&typeof e.scope==`object`&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ce(e){Se(e),typeof e.beginScope==`string`&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope==`string`&&(e.endScope={_wrap:e.endScope}),be(e),xe(e)}function we(e){function t(t,n){return new RegExp(p(t),`m`+(e.case_insensitive?`i`:``)+(e.unicodeRegex?`u`:``)+(n?`g`:``))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=b(e)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(C(e,{joinWith:`|`}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&e!==void 0),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),t.type===`begin`&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()&&!(n&&n.index===this.lastIndex)){let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}function i(e){let t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:`begin`})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:`end`}),e.illegal&&t.addRule(e.illegal,{type:`illegal`}),t}function o(n,r){let a=n;if(n.isCompiled)return a;[re,oe,Ce,ce].forEach(e=>e(n,r)),e.compilerExtensions.forEach(e=>e(n,r)),n.__beforeBegin=null,[ie,ae,se].forEach(e=>e(n,r)),n.isCompiled=!0;let s=null;return typeof n.keywords==`object`&&n.keywords.$pattern&&(n.keywords=Object.assign({},n.keywords),s=n.keywords.$pattern,delete n.keywords.$pattern),s||=/\w+/,n.keywords&&=de(n.keywords,e.case_insensitive),a.keywordPatternRe=t(s,!0),r&&(n.begin||=/\B|\b/,a.beginRe=t(a.begin),!n.end&&!n.endsWithParent&&(n.end=/\B|\b/),n.end&&(a.endRe=t(a.end)),a.terminatorEnd=p(a.end)||``,n.endsWithParent&&r.terminatorEnd&&(a.terminatorEnd+=(n.end?`|`:``)+r.terminatorEnd)),n.illegal&&(a.illegalRe=t(n.illegal)),n.contains||=[],n.contains=[].concat(...n.contains.map(function(e){return Ee(e===`self`?n:e)})),n.contains.forEach(function(e){o(e,a)}),n.starts&&o(n.starts,r),a.matcher=i(a),a}if(e.compilerExtensions||=[],e.contains&&e.contains.includes(`self`))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=a(e.classNameAliases||{}),o(e)}function Te(e){return e?e.endsWithParent||Te(e.starts):!1}function Ee(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return a(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:Te(e)?a(e,{starts:e.starts?a(e.starts):null}):Object.isFrozen(e)?a(e):e}var De=`11.11.1`,Oe=class extends Error{constructor(e,t){super(e),this.name=`HTMLInjectionError`,this.html=t}},ke=i,Ae=a,je=Symbol(`nomatch`),Me=7,Ne=function(e){let t=Object.create(null),i=Object.create(null),a=[],o=!0,s=`Could not find the language '{}', did you forget to load/include a language module?`,c={disableAutodetect:!0,name:`Plain text`,contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:`hljs-`,cssSelector:`pre code`,languages:null,__emitter:f};function u(e){return l.noHighlightRe.test(e)}function d(e){let t=e.className+` `;t+=e.parentNode?e.parentNode.className:``;let n=l.languageDetectRe.exec(t);if(n){let t=N(n[1]);return t||(ge(s.replace(`{}`,n[1])),ge(`Falling back to no-highlight mode for this block.`,e)),t?n[1]:`no-highlight`}return t.split(/\s+/).find(e=>u(e)||N(e))}function p(e,t,n){let r=``,i=``;typeof t==`object`?(r=e,n=t.ignoreIllegals,i=t.language):(_e(`10.7.0`,`highlight(lang, code, ...args) has been deprecated.`),_e(`10.7.0`,`Please use highlight(code, options) instead.
59
+ https://github.com/highlightjs/highlight.js/issues/2277`),i=e,r=t),n===void 0&&(n=!0);let a={code:r,language:i};ee(`before:highlight`,a);let o=a.result?a.result:v(a.language,a.code,n);return o.code=a.code,ee(`after:highlight`,o),o}function v(e,n,i,a){let c=Object.create(null);function u(e,t){return e.keywords[t]}function d(){if(!A.keywords){M.addText(P);return}let e=0;A.keywordPatternRe.lastIndex=0;let t=A.keywordPatternRe.exec(P),n=``;for(;t;){n+=P.substring(e,t.index);let r=D.case_insensitive?t[0].toLowerCase():t[0],i=u(A,r);if(i){let[e,a]=i;if(M.addText(n),n=``,c[r]=(c[r]||0)+1,c[r]<=Me&&(F+=a),e.startsWith(`_`))n+=t[0];else{let n=D.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=A.keywordPatternRe.lastIndex,t=A.keywordPatternRe.exec(P)}n+=P.substring(e),M.addText(n)}function f(){if(P===``)return;let e=null;if(typeof A.subLanguage==`string`){if(!t[A.subLanguage]){M.addText(P);return}e=v(A.subLanguage,P,!0,j[A.subLanguage]),j[A.subLanguage]=e._top}else e=S(P,A.subLanguage.length?A.subLanguage:null);A.relevance>0&&(F+=e.relevance),M.__addSublanguage(e._emitter,e.language)}function p(){A.subLanguage==null?d():f(),P=``}function m(e,t){e!==``&&(M.startScope(t),M.addText(e),M.endScope())}function h(e,t){let n=1,r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}let r=D.classNameAliases[e[n]]||e[n],i=t[n];r?m(i,r):(P=i,d(),P=``),n++}}function g(e,t){return e.scope&&typeof e.scope==`string`&&M.openNode(D.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(P,D.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),P=``):e.beginScope._multi&&(h(e.beginScope,t),P=``)),A=Object.create(e,{parent:{value:A}}),A}function _(e,t,n){let i=x(e.endRe,n);if(i){if(e[`on:end`]){let n=new r(e);e[`on:end`](t,n),n.isMatchIgnored&&(i=!1)}if(i){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return _(e.parent,t,n)}function y(e){return A.matcher.regexIndex===0?(P+=e[0],1):(R=!0,0)}function b(e){let t=e[0],n=e.rule,i=new r(n),a=[n.__beforeBegin,n[`on:begin`]];for(let n of a)if(n&&(n(e,i),i.isMatchIgnored))return y(t);return n.skip?P+=t:(n.excludeBegin&&(P+=t),p(),!n.returnBegin&&!n.excludeBegin&&(P=t)),g(n,e),n.returnBegin?0:t.length}function C(e){let t=e[0],r=n.substring(e.index),i=_(A,e,r);if(!i)return je;let a=A;A.endScope&&A.endScope._wrap?(p(),m(t,A.endScope._wrap)):A.endScope&&A.endScope._multi?(p(),h(A.endScope,e)):a.skip?P+=t:(a.returnEnd||a.excludeEnd||(P+=t),p(),a.excludeEnd&&(P=t));do A.scope&&M.closeNode(),!A.skip&&!A.subLanguage&&(F+=A.relevance),A=A.parent;while(A!==i.parent);return i.starts&&g(i.starts,e),a.returnEnd?0:t.length}function w(){let e=[];for(let t=A;t!==D;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>M.openNode(e))}let T={};function E(t,r){let a=r&&r[0];if(P+=t,a==null)return p(),0;if(T.type===`begin`&&r.type===`end`&&T.index===r.index&&a===``){if(P+=n.slice(r.index,r.index+1),!o){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=T.rule,t}return 1}if(T=r,r.type===`begin`)return b(r);if(r.type===`illegal`&&!i){let e=Error(`Illegal lexeme "`+a+`" for mode "`+(A.scope||`<unnamed>`)+`"`);throw e.mode=A,e}else if(r.type===`end`){let e=C(r);if(e!==je)return e}if(r.type===`illegal`&&a===``)return P+=`
60
+ `,1;if(L>1e5&&L>r.index*3)throw Error(`potential infinite loop, way more iterations than matches`);return P+=a,a.length}let D=N(e);if(!D)throw he(s.replace(`{}`,e)),Error(`Unknown language: "`+e+`"`);let O=we(D),k=``,A=a||O,j={},M=new l.__emitter(l);w();let P=``,F=0,I=0,L=0,R=!1;try{if(D.__emitTokens)D.__emitTokens(n,M);else{for(A.matcher.considerAll();;){L++,R?R=!1:A.matcher.considerAll(),A.matcher.lastIndex=I;let e=A.matcher.exec(n);if(!e)break;let t=E(n.substring(I,e.index),e);I=e.index+t}E(n.substring(I))}return M.finalize(),k=M.toHTML(),{language:e,value:k,relevance:F,illegal:!1,_emitter:M,_top:A}}catch(t){if(t.message&&t.message.includes(`Illegal`))return{language:e,value:ke(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:k},_emitter:M};if(o)return{language:e,value:ke(n),illegal:!1,relevance:0,errorRaised:t,_emitter:M,_top:A};throw t}}function b(e){let t={value:ke(e),illegal:!1,relevance:0,_top:c,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}function S(e,n){n=n||l.languages||Object.keys(t);let r=b(e),i=n.filter(N).filter(F).map(t=>v(t,e,!1));i.unshift(r);let[a,o]=i.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(N(e.language).supersetOf===t.language)return 1;if(N(t.language).supersetOf===e.language)return-1}return 0}),s=a;return s.secondBest=o,s}function C(e,t,n){let r=t&&i[t]||n;e.classList.add(`hljs`),e.classList.add(`language-${r}`)}function w(e){let t=null,n=d(e);if(u(n))return;if(ee(`before:highlightElement`,{el:e,language:n}),e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);return}if(e.children.length>0&&(l.ignoreUnescapedHTML||(console.warn(`One of your code blocks includes unescaped HTML. This is a potentially serious security risk.`),console.warn(`https://github.com/highlightjs/highlight.js/wiki/security`),console.warn(`The element with unescaped HTML:`),console.warn(e)),l.throwUnescapedHTML))throw new Oe(`One of your code blocks includes unescaped HTML.`,e.innerHTML);t=e;let r=t.textContent,i=n?p(r,{language:n,ignoreIllegals:!0}):S(r);e.innerHTML=i.value,e.dataset.highlighted=`yes`,C(e,n,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),ee(`after:highlightElement`,{el:e,result:i,text:r})}function T(e){l=Ae(l,e)}let E=()=>{k(),_e(`10.6.0`,`initHighlighting() deprecated. Use highlightAll() now.`)};function D(){k(),_e(`10.6.0`,`initHighlightingOnLoad() deprecated. Use highlightAll() now.`)}let O=!1;function k(){function e(){k()}if(document.readyState===`loading`){O||window.addEventListener(`DOMContentLoaded`,e,!1),O=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function A(n,r){let i=null;try{i=r(e)}catch(e){if(he(`Language definition for '{}' could not be registered.`.replace(`{}`,n)),o)he(e);else throw e;i=c}i.name||=n,t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&P(i.aliases,{languageName:n})}function j(e){delete t[e];for(let t of Object.keys(i))i[t]===e&&delete i[t]}function M(){return Object.keys(t)}function N(e){return e=(e||``).toLowerCase(),t[e]||t[i[e]]}function P(e,{languageName:t}){typeof e==`string`&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function F(e){let t=N(e);return t&&!t.disableAutodetect}function I(e){e[`before:highlightBlock`]&&!e[`before:highlightElement`]&&(e[`before:highlightElement`]=t=>{e[`before:highlightBlock`](Object.assign({block:t.el},t))}),e[`after:highlightBlock`]&&!e[`after:highlightElement`]&&(e[`after:highlightElement`]=t=>{e[`after:highlightBlock`](Object.assign({block:t.el},t))})}function L(e){I(e),a.push(e)}function R(e){let t=a.indexOf(e);t!==-1&&a.splice(t,1)}function ee(e,t){let n=e;a.forEach(function(e){e[n]&&e[n](t)})}function ne(e){return _e(`10.7.0`,`highlightBlock will be removed entirely in v12.0`),_e(`10.7.0`,`Please use highlightElement now.`),w(e)}Object.assign(e,{highlight:p,highlightAuto:S,highlightAll:k,highlightElement:w,highlightBlock:ne,configure:T,initHighlighting:E,initHighlightingOnLoad:D,registerLanguage:A,unregisterLanguage:j,listLanguages:M,getLanguage:N,registerAliases:P,autoDetection:F,inherit:Ae,addPlugin:L,removePlugin:R}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString=De,e.regex={concat:_,lookahead:m,either:y,optional:g,anyNumberOfTimes:h};for(let e in te)typeof te[e]==`object`&&n(te[e]);return Object.assign(e,te),e},Pe=Ne({});Pe.newInstance=()=>Ne({}),t.exports=Pe,Pe.HighlightJS=Pe,Pe.default=Pe}))()).default,OS={},kS=`hljs-`;function AS(e){let t=DS.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:i,register:a,registerAlias:o,registered:s};function n(e,n,r){let i=r||OS,a=typeof i.prefix==`string`?i.prefix:kS;if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:jS,classPrefix:a});let o=t.highlight(n,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,c=s.data;return c.language=o.language,c.relevance=o.relevance,s}function r(e,r){let a=(r||OS).subset||i(),o=-1,s=0,c;for(;++o<a.length;){let i=a[o];if(!t.getLanguage(i))continue;let l=n(i,e,r);l.data&&l.data.relevance!==void 0&&l.data.relevance>s&&(s=l.data.relevance,c=l)}return c||{type:`root`,children:[],data:{language:void 0,relevance:s}}}function i(){return t.listLanguages()}function a(e,n){if(typeof e==`string`)t.registerLanguage(e,n);else{let n;for(n in e)Object.hasOwn(e,n)&&t.registerLanguage(n,e[n])}}function o(e,n){if(typeof e==`string`)t.registerAliases(typeof n==`string`?n:[...n],{languageName:e});else{let n;for(n in e)if(Object.hasOwn(e,n)){let r=e[n];t.registerAliases(typeof r==`string`?r:[...r],{languageName:n})}}}function s(e){return!!t.getLanguage(e)}}var jS=class{constructor(e){this.options=e,this.root={type:`root`,children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(e===``)return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type===`text`?n.value+=e:t.children.push({type:`text`,value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:`element`,tagName:`span`,properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){let t=this,n=e.split(`.`).map(function(e,n){return n?e+`_`.repeat(n):t.options.classPrefix+e}),r=this.stack[this.stack.length-1],i={type:`element`,tagName:`span`,properties:{className:n},children:[]};r.children.push(i),this.stack.push(i)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return``}},MS={};function NS(e){let t=e||MS,n=t.aliases,r=t.detect||!1,i=t.languages||ES,a=t.plainText,o=t.prefix,s=t.subset,c=`hljs`,l=AS(i);if(n&&l.registerAlias(n),o){let e=o.indexOf(`-`);c=e===-1?o:o.slice(0,e)}return function(e,t){Jv(e,`element`,function(e,n,i){if(e.tagName!==`code`||!i||i.type!==`element`||i.tagName!==`pre`)return;let u=PS(e);if(u===!1||!u&&!r||u&&a&&a.includes(u))return;Array.isArray(e.properties.className)||(e.properties.className=[]),e.properties.className.includes(c)||e.properties.className.unshift(c);let d=fb(e,{whitespace:`pre`}),f;try{f=u?l.highlight(u,d,{prefix:o}):l.highlightAuto(d,{prefix:o,subset:s})}catch(n){let r=n;if(u&&/Unknown language/.test(r.message)){t.message("Cannot highlight as `"+u+"`, it’s not registered",{ancestors:[i,e],cause:r,place:e.position,ruleId:`missing-language`,source:`rehype-highlight`});return}throw r}!u&&f.data&&f.data.language&&e.properties.className.push(`language-`+f.data.language),f.children.length>0&&(e.children=f.children)})}}function PS(e){let t=e.properties.className,n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){let e=String(t[n]);if(e===`no-highlight`||e===`nohighlight`)return!1;!r&&e.slice(0,5)===`lang-`&&(r=e.slice(5)),!r&&e.slice(0,9)===`language-`&&(r=e.slice(9))}return r}var FS=`a.blockquote.br.code.del.em.h1.h2.h3.h4.h5.h6.hr.li.ol.p.pre.span.strong.table.tbody.td.th.thead.tr.ul`.split(`.`);function IS({children:e,label:t}){let n=sp(e);return n===void 0?(0,B.jsx)(`div`,{className:`message-markdown`,children:(0,B.jsx)(Ky,{allowedElements:[...FS],rehypePlugins:[NS],skipHtml:!0,children:e})}):(0,B.jsx)(fp,{className:`whitespace-pre`,label:`${t} formatted JSON`,value:n})}var LS=200,RS=`mt-0 max-h-72 whitespace-pre-wrap rounded-none border-0 text-[11px]`,zS={completed:`text-success`,failed:`text-destructive`,interrupted:`text-warning`,timeout:`text-warning`};function BS({label:e,value:t}){return(0,B.jsx)(fp,{className:`mt-0 max-h-90 whitespace-pre-wrap rounded-none border-0 text-[11px]`,label:e,value:t})}function VS(e){return e===null||!Number.isFinite(e)?null:e<1e3?`${Math.round(e)} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}function HS(e){return e.input===void 0||e.input===null?e.output??``:typeof e.input==`string`?e.input:lp(e.input)}function US(e){return HS(e).split(`
61
+ `,1)[0]?.trim().slice(0,LS)??``}function WS({status:e}){return e?(0,B.jsxs)(`span`,{className:x(`flex shrink-0 items-center gap-1 text-[9px] uppercase tracking-[.08em]`,zS[e]??`text-subtle`),children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full bg-current`}),e]}):null}function GS({invocation:e}){let t=[[`Call ID`,e.toolCallId],[`Started`,e.startedAt],[`Finished`,e.finishedAt],[`Timing`,e.timingSource]].filter(([,e])=>e!==null);return t.length===0?null:(0,B.jsx)(`dl`,{"aria-label":`${e.name} tool timing`,className:`flex flex-wrap gap-2 px-3.5 py-2`,children:t.map(([e,t])=>(0,B.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,B.jsx)(`dt`,{className:`text-[9px] uppercase text-subtle`,children:e}),(0,B.jsx)(`dd`,{className:`m-0 font-mono text-[10px] text-muted-foreground`,children:t})]},e))})}function KS({children:e,title:t}){return(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h4`,{className:`m-0 px-3.5 pt-2 text-[9px] font-bold uppercase tracking-[.08em] text-subtle`,children:t}),e]})}function qS({invocation:e,current:t}){let n=VS(e.durationMs),r=US(e),i=e.input!==void 0&&e.input!==null,a=e.output===null?void 0:sp(e.output);return(0,B.jsxs)(Fr,{"aria-current":t?`true`:void 0,"data-tool-call-id":e.toolCallId??void 0,"data-event-index":e.id.slice(5),className:`rounded-[10px] border bg-card px-3`,value:e.id,children:[(0,B.jsxs)(Ir,{"aria-label":`${e.name} tool details`,className:`items-center gap-2 py-1.5 text-xs text-muted-foreground`,children:[(0,B.jsx)(ct,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}),(0,B.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:e.name}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[10px] font-normal text-subtle`,children:r}),n?(0,B.jsx)(`span`,{className:`shrink-0 text-[10px] tabular-nums text-subtle`,children:n}):null,(0,B.jsx)(WS,{status:e.status})]}),(0,B.jsxs)(Lr,{className:`-mx-3 border-t p-0`,children:[(0,B.jsx)(GS,{invocation:e}),i?(0,B.jsx)(KS,{title:`Input`,children:(0,B.jsx)(fp,{className:RS,label:`${e.name} tool input`,value:e.input})}):null,e.output===null?null:(0,B.jsx)(KS,{title:`Output`,children:a===void 0?(0,B.jsx)(`pre`,{"aria-label":`${e.name} tool output`,className:x(`message-json`,RS),children:e.output}):(0,B.jsx)(fp,{className:RS,label:`${e.name} tool output`,value:a})}),!i&&e.output===null?(0,B.jsxs)(`p`,{className:`m-0 px-3.5 py-2 text-[11px] italic text-muted-foreground`,children:[`This `,e.kind,` event carried no input or output.`]}):null]})]})}function JS({usage:e}){let t=[[`Input`,`inputTokens`,e.inputTokens],[`Output`,`outputTokens`,e.outputTokens],[`Cache read`,`cacheReadTokens`,e.cacheReadTokens],[`Cache write`,`cacheWriteTokens`,e.cacheWriteTokens],[`Cost`,`costUsd`,e.costUsd]].filter(([,t])=>Object.hasOwn(e,t));return t.length===0?null:(0,B.jsx)(`dl`,{"aria-label":`Usage`,className:`mt-4.5 flex flex-wrap gap-2`,children:t.map(([e,t,n])=>(0,B.jsxs)(`div`,{className:`flex gap-1.5 rounded-md bg-muted px-2 py-1`,children:[(0,B.jsx)(`dt`,{className:`text-[9px] uppercase text-subtle`,children:e}),(0,B.jsx)(`dd`,{className:`m-0 text-[10px] text-muted-foreground`,children:n===null?`Not reported`:t===`costUsd`&&typeof n==`number`?`$${n.toFixed(4)}`:n??`Not reported`})]},t))})}function YS({events:e}){return(0,B.jsx)(`section`,{"aria-label":`Agent activity`,className:`my-3 space-y-2`,children:[...e].sort((e,t)=>e.index-t.index).map(e=>e.kind===`reasoning`?(0,B.jsx)(Pr,{collapsible:!0,type:`single`,children:(0,B.jsxs)(Fr,{className:`rounded-[10px] border border-dashed bg-card px-3`,value:`reasoning-${e.index}`,children:[(0,B.jsx)(Ir,{className:`py-1.5 text-xs text-muted-foreground`,children:`Reasoning`}),(0,B.jsx)(Lr,{className:`whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground`,children:e.text})]})},`reasoning-${e.index}`):(0,B.jsx)(`div`,{"aria-label":`Agent message`,className:`border-l-2 border-primary pl-3`,role:`group`,children:(0,B.jsx)(IS,{label:`Agent message`,children:e.text})},`message-${e.index}`))})}function XS({author:e,focus:t,turn:n}){let r=(0,z.useRef)(null),[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)([]),c=t?.turnId===n.id,l=c?Xf(n.tools).find(e=>t.toolCallId===void 0?t.eventIndex!==void 0&&e.eventIndices.includes(t.eventIndex):e.toolCallId===t.toolCallId):void 0,u=l?.id,d=c?JSON.stringify(t):void 0;(0,z.useEffect)(()=>{d&&(a(!1),u&&s(e=>e.includes(u)?e:[...e,u]))},[d,u]),(0,z.useEffect)(()=>{!d||i||u&&!o.includes(u)||(r.current?.scrollIntoView?.({block:`nearest`}),r.current?.querySelector(`[aria-current="true"]`)?.scrollIntoView?.({block:`nearest`}))},[d,i,o,u]);let p=Object.keys(n.unknown).length>0,m=Xf(n.tools),h=n.status===`running`;return(0,B.jsxs)(`article`,{ref:r,"data-turn-id":n.id,"aria-current":c&&!l?`true`:void 0,"aria-label":`Turn ${n.id} from ${n.harness}`,className:`mx-auto mb-10.5 max-w-[850px]`,children:[(0,B.jsxs)(`button`,{className:`mb-2 text-[10px] text-muted-foreground hover:text-foreground`,type:`button`,"aria-expanded":!i,onClick:()=>a(!i),children:[i?`Expand`:`Collapse`,` turn `,n.id]}),(0,B.jsxs)(`div`,{hidden:i,children:[(0,B.jsx)(rp,{from:`user`,children:(0,B.jsxs)(ip,{className:`mb-8 ml-auto max-w-[min(680px,88%)] rounded-[22px_22px_5px_22px] border bg-popover px-5 py-4.5`,children:[(0,B.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[.08em] text-subtle`,children:`You`}),h&&!n.user?(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,children:`The prompt is recorded when this run finishes.`}):(0,B.jsx)(IS,{label:`User message`,children:n.user})]})}),(0,B.jsxs)(rp,{from:`assistant`,children:[(0,B.jsx)(ap,{...e?.avatar?{src:e.avatar}:{},children:e?e.label.slice(0,2).toUpperCase():`OH`}),(0,B.jsxs)(ip,{className:`pt-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] font-bold uppercase tracking-[.08em] text-subtle`,children:[(0,B.jsx)(`span`,{children:e?.label??n.harness}),n.model?(0,B.jsx)(f,{variant:`secondary`,className:`font-medium normal-case tracking-normal`,children:n.model}):null]}),n.reasoning?(0,B.jsx)(Pr,{className:`mt-2.5`,collapsible:!0,type:`single`,children:(0,B.jsxs)(Fr,{className:`rounded-[10px] border border-dashed bg-card px-3`,value:`reasoning`,children:[(0,B.jsx)(Ir,{className:`text-xs text-muted-foreground`,children:`Reasoning`}),(0,B.jsx)(Lr,{className:`whitespace-pre-wrap text-[13px] leading-relaxed text-muted-foreground`,children:n.reasoning})]})}):null,n.agentEvents?.length?(0,B.jsx)(YS,{events:n.agentEvents}):null,m.length>0?(0,B.jsx)(`section`,{"aria-label":`Tool calls`,className:`my-3`,children:(0,B.jsx)(Pr,{className:`space-y-1`,type:`multiple`,value:o,onValueChange:s,children:m.map(e=>(0,B.jsx)(qS,{current:l?.id===e.id,invocation:e},e.id))})}):null,n.assistant?(0,B.jsx)(IS,{label:`Assistant message`,children:n.assistant}):h?(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,role:`status`,children:`Still running. Its final answer appears when the run finishes.`}):(0,B.jsx)(`p`,{className:`text-[13px] italic text-muted-foreground`,children:`No assistant text was captured for this run.`}),n.failureKind?(0,B.jsxs)(`p`,{"aria-label":`Failure: ${n.failureKind}`,className:`border-l-2 border-destructive pl-2.5 text-xs text-destructive`,role:`note`,children:[`Failure: `,n.failureKind]}):null,(0,B.jsx)(JS,{usage:n.usage}),p?(0,B.jsx)(Pr,{className:`mt-2.5`,collapsible:!0,type:`single`,children:(0,B.jsxs)(Fr,{className:`rounded-[10px] border bg-card px-3`,value:`unknown`,children:[(0,B.jsx)(Ir,{className:`text-xs text-muted-foreground`,children:`Additional upstream data`}),(0,B.jsx)(Lr,{className:`-mx-3 border-t p-0`,children:(0,B.jsx)(BS,{label:`Additional upstream data detail`,value:n.unknown})})]})}):null]})]})]})]})}Object.freeze({status:`aborted`});function W(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var ZS=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},QS=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},$S={};function eC(e){return e&&Object.assign($S,e),$S}function tC(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function nC(e,t){return typeof t==`bigint`?t.toString():t}function rC(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function iC(e){return e==null}function aC(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function oC(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=t.toString(),i=(r.split(`.`)[1]||``).length;if(i===0&&/\d?e-\d?/.test(r)){let e=r.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let a=n>i?n:i;return Number.parseInt(e.toFixed(a).replace(`.`,``))%Number.parseInt(t.toFixed(a).replace(`.`,``))/10**a}var sC=Symbol(`evaluating`);function cC(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==sC)return r===void 0&&(r=sC,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function lC(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function uC(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function dC(e){return JSON.stringify(e)}var fC=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function pC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var mC=rC(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function hC(e){if(pC(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(pC(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function gC(e){return hC(e)?{...e}:Array.isArray(e)?[...e]:e}var _C=new Set([`string`,`number`,`symbol`]);function vC(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function yC(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function G(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function bC(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var xC={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function SC(e,t){let n=e._zod.def;return yC(e,uC(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return lC(this,`shape`,e),e},checks:[]}))}function CC(e,t){let n=e._zod.def;return yC(e,uC(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return lC(this,`shape`,r),r},checks:[]}))}function wC(e,t){if(!hC(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return yC(e,uC(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return lC(this,`shape`,n),n},checks:[]}))}function TC(e,t){if(!hC(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return yC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return lC(this,`shape`,n),n},checks:e._zod.def.checks})}function EC(e,t){return yC(e,uC(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return lC(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function DC(e,t,n){return yC(t,uC(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return lC(this,`shape`,i),i},checks:[]}))}function OC(e,t,n){return yC(t,uC(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return lC(this,`shape`,i),i},checks:[]}))}function kC(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function AC(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function jC(e){return typeof e==`string`?e:e?.message}function MC(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=jC(e.inst?._zod.def?.error?.(e))??jC(t?.error?.(e))??jC(n.customError?.(e))??jC(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function NC(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function PC(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var FC=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,nC,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},IC=W(`$ZodError`,FC),LC=W(`$ZodError`,FC,{Parent:Error});function RC(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function zC(e,t=e=>e.message){let n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`&&i.errors.length)i.errors.map(e=>r({issues:e}));else if(i.code===`invalid_key`)r({issues:i.issues});else if(i.code===`invalid_element`)r({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(e),n}var BC=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new ZS;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>MC(e,a,eC())));throw fC(t,i?.callee),t}return o.value},VC=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>MC(e,a,eC())));throw fC(t,i?.callee),t}return o.value},HC=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new ZS;return a.issues.length?{success:!1,error:new(e??IC)(a.issues.map(e=>MC(e,i,eC())))}:{success:!0,data:a.value}},UC=HC(LC),WC=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>MC(e,i,eC())))}:{success:!0,data:a.value}},GC=WC(LC),KC=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return BC(e)(t,n,i)},qC=e=>(t,n,r)=>BC(e)(t,n,r),JC=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return VC(e)(t,n,i)},YC=e=>async(t,n,r)=>VC(e)(t,n,r),XC=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return HC(e)(t,n,i)},ZC=e=>(t,n,r)=>HC(e)(t,n,r),QC=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return WC(e)(t,n,i)},$C=e=>async(t,n,r)=>WC(e)(t,n,r),ew=/^[cC][^\s-]{8,}$/,tw=/^[0-9a-z]+$/,nw=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rw=/^[0-9a-vA-V]{20}$/,iw=/^[A-Za-z0-9]{27}$/,aw=/^[a-zA-Z0-9_-]{21}$/,ow=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,sw=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cw=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,lw=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function dw(){return new RegExp(uw,`u`)}var fw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,pw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,mw=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,hw=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,gw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_w=/^[A-Za-z0-9_-]*$/,vw=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,yw=/^\+(?:[0-9]){6,14}[0-9]$/,bw=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,xw=RegExp(`^${bw}$`);function Sw(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Cw(e){return RegExp(`^${Sw(e)}$`)}function ww(e){let t=Sw({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${bw}T(?:${r})$`)}var Tw=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Ew=/^-?\d+$/,Dw=/^-?\d+(?:\.\d+)?/,Ow=/^(?:true|false)$/i,kw=/^null$/i,Aw=/^[^A-Z]*$/,jw=/^[^a-z]*$/,Mw=W(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Nw={number:`number`,bigint:`bigint`,object:`date`},Pw=W(`$ZodCheckLessThan`,(e,t)=>{Mw.init(e,t);let n=Nw[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Fw=W(`$ZodCheckGreaterThan`,(e,t)=>{Mw.init(e,t);let n=Nw[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Iw=W(`$ZodCheckMultipleOf`,(e,t)=>{Mw.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):oC(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Lw=W(`$ZodCheckNumberFormat`,(e,t)=>{Mw.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xC[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Ew)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),Rw=W(`$ZodCheckMaxLength`,(e,t)=>{var n;Mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=NC(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),zw=W(`$ZodCheckMinLength`,(e,t)=>{var n;Mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=NC(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Bw=W(`$ZodCheckLengthEquals`,(e,t)=>{var n;Mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!iC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=NC(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Vw=W(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Mw.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Hw=W(`$ZodCheckRegex`,(e,t)=>{Vw.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Uw=W(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Aw,Vw.init(e,t)}),Ww=W(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=jw,Vw.init(e,t)}),Gw=W(`$ZodCheckIncludes`,(e,t)=>{Mw.init(e,t);let n=vC(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Kw=W(`$ZodCheckStartsWith`,(e,t)=>{Mw.init(e,t);let n=RegExp(`^${vC(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),qw=W(`$ZodCheckEndsWith`,(e,t)=>{Mw.init(e,t);let n=RegExp(`.*${vC(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Jw=W(`$ZodCheckOverwrite`,(e,t)=>{Mw.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Yw=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
62
+ `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
63
+ `))}},Xw={major:4,minor:1,patch:12},Zw=W(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Xw;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=kC(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new ZS;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=kC(e,t))});else{if(e.issues.length===t)continue;r||=kC(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(kC(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new ZS;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new ZS;return o.then(e=>t(e,r,a))}return t(o,r,a)}}e[`~standard`]={validate:t=>{try{let n=UC(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return GC(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Qw=W(`$ZodString`,(e,t)=>{Zw.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Tw(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),$w=W(`$ZodStringFormat`,(e,t)=>{Vw.init(e,t),Qw.init(e,t)}),eT=W(`$ZodGUID`,(e,t)=>{t.pattern??=sw,$w.init(e,t)}),tT=W(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=cw(e)}else t.pattern??=cw();$w.init(e,t)}),nT=W(`$ZodEmail`,(e,t)=>{t.pattern??=lw,$w.init(e,t)}),rT=W(`$ZodURL`,(e,t)=>{$w.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:vw.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),iT=W(`$ZodEmoji`,(e,t)=>{t.pattern??=dw(),$w.init(e,t)}),aT=W(`$ZodNanoID`,(e,t)=>{t.pattern??=aw,$w.init(e,t)}),oT=W(`$ZodCUID`,(e,t)=>{t.pattern??=ew,$w.init(e,t)}),sT=W(`$ZodCUID2`,(e,t)=>{t.pattern??=tw,$w.init(e,t)}),cT=W(`$ZodULID`,(e,t)=>{t.pattern??=nw,$w.init(e,t)}),lT=W(`$ZodXID`,(e,t)=>{t.pattern??=rw,$w.init(e,t)}),uT=W(`$ZodKSUID`,(e,t)=>{t.pattern??=iw,$w.init(e,t)}),dT=W(`$ZodISODateTime`,(e,t)=>{t.pattern??=ww(t),$w.init(e,t)}),fT=W(`$ZodISODate`,(e,t)=>{t.pattern??=xw,$w.init(e,t)}),pT=W(`$ZodISOTime`,(e,t)=>{t.pattern??=Cw(t),$w.init(e,t)}),mT=W(`$ZodISODuration`,(e,t)=>{t.pattern??=ow,$w.init(e,t)}),hT=W(`$ZodIPv4`,(e,t)=>{t.pattern??=fw,$w.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),gT=W(`$ZodIPv6`,(e,t)=>{t.pattern??=pw,$w.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),_T=W(`$ZodCIDRv4`,(e,t)=>{t.pattern??=mw,$w.init(e,t)}),vT=W(`$ZodCIDRv6`,(e,t)=>{t.pattern??=hw,$w.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function yT(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var bT=W(`$ZodBase64`,(e,t)=>{t.pattern??=gw,$w.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{yT(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function xT(e){if(!_w.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return yT(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var ST=W(`$ZodBase64URL`,(e,t)=>{t.pattern??=_w,$w.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{xT(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),CT=W(`$ZodE164`,(e,t)=>{t.pattern??=yw,$w.init(e,t)});function wT(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var TT=W(`$ZodJWT`,(e,t)=>{$w.init(e,t),e._zod.check=n=>{wT(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ET=W(`$ZodNumber`,(e,t)=>{Zw.init(e,t),e._zod.pattern=e._zod.bag.pattern??Dw,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),DT=W(`$ZodNumber`,(e,t)=>{Lw.init(e,t),ET.init(e,t)}),OT=W(`$ZodBoolean`,(e,t)=>{Zw.init(e,t),e._zod.pattern=Ow,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),kT=W(`$ZodNull`,(e,t)=>{Zw.init(e,t),e._zod.pattern=kw,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),AT=W(`$ZodUnknown`,(e,t)=>{Zw.init(e,t),e._zod.parse=e=>e}),jT=W(`$ZodNever`,(e,t)=>{Zw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function MT(e,t,n){e.issues.length&&t.issues.push(...AC(n,e.issues)),t.value[n]=e.value}var NT=W(`$ZodArray`,(e,t)=>{Zw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>MT(t,n,e))):MT(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function PT(e,t,n,r){e.issues.length&&t.issues.push(...AC(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function FT(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=bC(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function IT(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i of Object.keys(t)){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>PT(e,n,i,t))):PT(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var LT=W(`$ZodObject`,(e,t)=>{if(Zw.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=rC(()=>FT(t));cC(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=pC,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>PT(n,t,e,s))):PT(n,t,e,s)}return i?IT(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),RT=W(`$ZodObjectJIT`,(e,t)=>{LT.init(e,t);let n=e._zod.parse,r=rC(()=>FT(t)),i=e=>{let t=new Yw([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=dC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=dC(e);t.write(`const ${n} = ${i(e)};`),t.write(`
64
+ if (${n}.issues.length) {
65
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
66
+ ...iss,
67
+ path: iss.path ? [${r}, ...iss.path] : [${r}]
68
+ })));
69
+ }
70
+
71
+
72
+ if (${n}.value === undefined) {
73
+ if (${r} in input) {
74
+ newResult[${r}] = undefined;
75
+ }
76
+ } else {
77
+ newResult[${r}] = ${n}.value;
78
+ }
79
+
80
+ `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=pC,s=!$S.jitless,c=s&&mC.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?IT([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function zT(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!kC(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>MC(e,r,eC())))}),t)}var BT=W(`$ZodUnion`,(e,t)=>{Zw.init(e,t),cC(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),cC(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),cC(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),cC(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>aC(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>zT(t,i,e,a)):zT(s,i,e,a)}}),VT=W(`$ZodDiscriminatedUnion`,(e,t)=>{BT.init(e,t);let n=e._zod.parse;cC(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=rC(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!pC(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),HT=W(`$ZodIntersection`,(e,t)=>{Zw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>WT(e,t,n)):WT(e,i,a)}});function UT(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(hC(e)&&hC(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=UT(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=UT(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function WT(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),kC(e))return e;let r=UT(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var GT=W(`$ZodRecord`,(e,t)=>{Zw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!hC(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...AC(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...AC(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>MC(e,r,eC())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...AC(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...AC(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),KT=W(`$ZodEnum`,(e,t)=>{Zw.init(e,t);let n=tC(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>_C.has(typeof e)).map(e=>typeof e==`string`?vC(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),qT=W(`$ZodLiteral`,(e,t)=>{if(Zw.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?vC(e):e?vC(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),JT=W(`$ZodTransform`,(e,t)=>{Zw.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new QS(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new ZS;return n.value=i,n}});function YT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var XT=W(`$ZodOptional`,(e,t)=>{Zw.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,cC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),cC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${aC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>YT(t,e.value)):YT(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),ZT=W(`$ZodNullable`,(e,t)=>{Zw.init(e,t),cC(e._zod,`optin`,()=>t.innerType._zod.optin),cC(e._zod,`optout`,()=>t.innerType._zod.optout),cC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${aC(e.source)}|null)$`):void 0}),cC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),QT=W(`$ZodDefault`,(e,t)=>{Zw.init(e,t),e._zod.optin=`optional`,cC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>$T(e,t)):$T(r,t)}});function $T(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var eE=W(`$ZodPrefault`,(e,t)=>{Zw.init(e,t),e._zod.optin=`optional`,cC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),tE=W(`$ZodNonOptional`,(e,t)=>{Zw.init(e,t),cC(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>nE(t,e)):nE(i,e)}});function nE(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var rE=W(`$ZodCatch`,(e,t)=>{Zw.init(e,t),cC(e._zod,`optin`,()=>t.innerType._zod.optin),cC(e._zod,`optout`,()=>t.innerType._zod.optout),cC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>MC(e,n,eC()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>MC(e,n,eC()))},input:e.value}),e.issues=[]),e)}}),iE=W(`$ZodPipe`,(e,t)=>{Zw.init(e,t),cC(e._zod,`values`,()=>t.in._zod.values),cC(e._zod,`optin`,()=>t.in._zod.optin),cC(e._zod,`optout`,()=>t.out._zod.optout),cC(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>aE(e,t.in,n)):aE(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>aE(e,t.out,n)):aE(r,t.out,n)}});function aE(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var oE=W(`$ZodReadonly`,(e,t)=>{Zw.init(e,t),cC(e._zod,`propValues`,()=>t.innerType._zod.propValues),cC(e._zod,`values`,()=>t.innerType._zod.values),cC(e._zod,`optin`,()=>t.innerType._zod.optin),cC(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(sE):sE(r)}});function sE(e){return e.value=Object.freeze(e.value),e}var cE=W(`$ZodLazy`,(e,t)=>{Zw.init(e,t),cC(e._zod,`innerType`,()=>t.getter()),cC(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),cC(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),cC(e._zod,`optin`,()=>e._zod.innerType._zod.optin??void 0),cC(e._zod,`optout`,()=>e._zod.innerType._zod.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),lE=W(`$ZodCustom`,(e,t)=>{Mw.init(e,t),Zw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>uE(t,n,r,e));uE(i,n,r,e)}});function uE(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(PC(e))}}var dE=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function fE(){return new dE}var pE=fE();function mE(e,t){return new e({type:`string`,...G(t)})}function hE(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...G(t)})}function gE(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...G(t)})}function _E(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...G(t)})}function vE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...G(t)})}function yE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...G(t)})}function bE(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...G(t)})}function xE(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...G(t)})}function SE(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...G(t)})}function CE(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...G(t)})}function wE(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...G(t)})}function TE(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...G(t)})}function EE(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...G(t)})}function DE(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...G(t)})}function OE(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...G(t)})}function kE(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...G(t)})}function AE(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...G(t)})}function jE(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...G(t)})}function ME(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...G(t)})}function NE(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...G(t)})}function PE(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...G(t)})}function FE(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...G(t)})}function IE(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...G(t)})}function LE(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...G(t)})}function RE(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...G(t)})}function zE(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...G(t)})}function BE(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...G(t)})}function VE(e,t){return new e({type:`number`,checks:[],...G(t)})}function HE(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...G(t)})}function UE(e,t){return new e({type:`boolean`,...G(t)})}function WE(e,t){return new e({type:`null`,...G(t)})}function GE(e){return new e({type:`unknown`})}function KE(e,t){return new e({type:`never`,...G(t)})}function qE(e,t){return new Pw({check:`less_than`,...G(t),value:e,inclusive:!1})}function JE(e,t){return new Pw({check:`less_than`,...G(t),value:e,inclusive:!0})}function YE(e,t){return new Fw({check:`greater_than`,...G(t),value:e,inclusive:!1})}function XE(e,t){return new Fw({check:`greater_than`,...G(t),value:e,inclusive:!0})}function ZE(e,t){return new Iw({check:`multiple_of`,...G(t),value:e})}function QE(e,t){return new Rw({check:`max_length`,...G(t),maximum:e})}function $E(e,t){return new zw({check:`min_length`,...G(t),minimum:e})}function eD(e,t){return new Bw({check:`length_equals`,...G(t),length:e})}function tD(e,t){return new Hw({check:`string_format`,format:`regex`,...G(t),pattern:e})}function nD(e){return new Uw({check:`string_format`,format:`lowercase`,...G(e)})}function rD(e){return new Ww({check:`string_format`,format:`uppercase`,...G(e)})}function iD(e,t){return new Gw({check:`string_format`,format:`includes`,...G(t),includes:e})}function aD(e,t){return new Kw({check:`string_format`,format:`starts_with`,...G(t),prefix:e})}function oD(e,t){return new qw({check:`string_format`,format:`ends_with`,...G(t),suffix:e})}function sD(e){return new Jw({check:`overwrite`,tx:e})}function cD(e){return sD(t=>t.normalize(e))}function lD(){return sD(e=>e.trim())}function uD(){return sD(e=>e.toLowerCase())}function dD(){return sD(e=>e.toUpperCase())}function fD(e,t,n){return new e({type:`array`,element:t,...G(n)})}function pD(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...G(n)})}function mD(e){let t=hD(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(PC(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(PC(r))}},e(n.value,n)));return t}function hD(e,t){let n=new Mw({check:`custom`,...G(t)});return n._zod.check=e,n}var gD=W(`ZodISODateTime`,(e,t)=>{dT.init(e,t),VD.init(e,t)});function _D(e){return LE(gD,e)}var vD=W(`ZodISODate`,(e,t)=>{fT.init(e,t),VD.init(e,t)});function yD(e){return RE(vD,e)}var bD=W(`ZodISOTime`,(e,t)=>{pT.init(e,t),VD.init(e,t)});function xD(e){return zE(bD,e)}var SD=W(`ZodISODuration`,(e,t)=>{mT.init(e,t),VD.init(e,t)});function CD(e){return BE(SD,e)}var wD=(e,t)=>{IC.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>zC(e,t)},flatten:{value:t=>RC(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,nC,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,nC,2)}},isEmpty:{get(){return e.issues.length===0}}})};W(`ZodError`,wD);var TD=W(`ZodError`,wD,{Parent:Error}),ED=BC(TD),DD=VC(TD),OD=HC(TD),kD=WC(TD),AD=KC(TD),jD=qC(TD),MD=JC(TD),ND=YC(TD),PD=XC(TD),FD=ZC(TD),ID=QC(TD),LD=$C(TD),RD=W(`ZodType`,(e,t)=>(Zw.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(uC(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>yC(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>ED(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>OD(e,t,n),e.parseAsync=async(t,n)=>DD(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>kD(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>AD(e,t,n),e.decode=(t,n)=>jD(e,t,n),e.encodeAsync=async(t,n)=>MD(e,t,n),e.decodeAsync=async(t,n)=>ND(e,t,n),e.safeEncode=(t,n)=>PD(e,t,n),e.safeDecode=(t,n)=>FD(e,t,n),e.safeEncodeAsync=async(t,n)=>ID(e,t,n),e.safeDecodeAsync=async(t,n)=>LD(e,t,n),e.refine=(t,n)=>e.check(ek(t,n)),e.superRefine=t=>e.check(tk(t)),e.overwrite=t=>e.check(sD(t)),e.optional=()=>IO(e),e.nullable=()=>RO(e),e.nullish=()=>IO(RO(e)),e.nonoptional=t=>WO(e,t),e.array=()=>q(e),e.or=t=>wO([e,t]),e.and=t=>OO(e,t),e.transform=t=>JO(e,PO(t)),e.default=t=>BO(e,t),e.prefault=t=>HO(e,t),e.catch=t=>KO(e,t),e.pipe=t=>JO(e,t),e.readonly=()=>XO(e),e.describe=t=>{let n=e.clone();return pE.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return pE.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return pE.get(e);let n=e.clone();return pE.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),zD=W(`_ZodString`,(e,t)=>{Qw.init(e,t),RD.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(tD(...t)),e.includes=(...t)=>e.check(iD(...t)),e.startsWith=(...t)=>e.check(aD(...t)),e.endsWith=(...t)=>e.check(oD(...t)),e.min=(...t)=>e.check($E(...t)),e.max=(...t)=>e.check(QE(...t)),e.length=(...t)=>e.check(eD(...t)),e.nonempty=(...t)=>e.check($E(1,...t)),e.lowercase=t=>e.check(nD(t)),e.uppercase=t=>e.check(rD(t)),e.trim=()=>e.check(lD()),e.normalize=(...t)=>e.check(cD(...t)),e.toLowerCase=()=>e.check(uD()),e.toUpperCase=()=>e.check(dD())}),BD=W(`ZodString`,(e,t)=>{Qw.init(e,t),zD.init(e,t),e.email=t=>e.check(hE(HD,t)),e.url=t=>e.check(xE(GD,t)),e.jwt=t=>e.check(IE(sO,t)),e.emoji=t=>e.check(SE(qD,t)),e.guid=t=>e.check(gE(UD,t)),e.uuid=t=>e.check(_E(WD,t)),e.uuidv4=t=>e.check(vE(WD,t)),e.uuidv6=t=>e.check(yE(WD,t)),e.uuidv7=t=>e.check(bE(WD,t)),e.nanoid=t=>e.check(CE(JD,t)),e.guid=t=>e.check(gE(UD,t)),e.cuid=t=>e.check(wE(YD,t)),e.cuid2=t=>e.check(TE(XD,t)),e.ulid=t=>e.check(EE(ZD,t)),e.base64=t=>e.check(NE(iO,t)),e.base64url=t=>e.check(PE(aO,t)),e.xid=t=>e.check(DE(QD,t)),e.ksuid=t=>e.check(OE($D,t)),e.ipv4=t=>e.check(kE(eO,t)),e.ipv6=t=>e.check(AE(tO,t)),e.cidrv4=t=>e.check(jE(nO,t)),e.cidrv6=t=>e.check(ME(rO,t)),e.e164=t=>e.check(FE(oO,t)),e.datetime=t=>e.check(_D(t)),e.date=t=>e.check(yD(t)),e.time=t=>e.check(xD(t)),e.duration=t=>e.check(CD(t))});function K(e){return mE(BD,e)}var VD=W(`ZodStringFormat`,(e,t)=>{$w.init(e,t),zD.init(e,t)}),HD=W(`ZodEmail`,(e,t)=>{nT.init(e,t),VD.init(e,t)}),UD=W(`ZodGUID`,(e,t)=>{eT.init(e,t),VD.init(e,t)}),WD=W(`ZodUUID`,(e,t)=>{tT.init(e,t),VD.init(e,t)}),GD=W(`ZodURL`,(e,t)=>{rT.init(e,t),VD.init(e,t)});function KD(e){return xE(GD,e)}var qD=W(`ZodEmoji`,(e,t)=>{iT.init(e,t),VD.init(e,t)}),JD=W(`ZodNanoID`,(e,t)=>{aT.init(e,t),VD.init(e,t)}),YD=W(`ZodCUID`,(e,t)=>{oT.init(e,t),VD.init(e,t)}),XD=W(`ZodCUID2`,(e,t)=>{sT.init(e,t),VD.init(e,t)}),ZD=W(`ZodULID`,(e,t)=>{cT.init(e,t),VD.init(e,t)}),QD=W(`ZodXID`,(e,t)=>{lT.init(e,t),VD.init(e,t)}),$D=W(`ZodKSUID`,(e,t)=>{uT.init(e,t),VD.init(e,t)}),eO=W(`ZodIPv4`,(e,t)=>{hT.init(e,t),VD.init(e,t)}),tO=W(`ZodIPv6`,(e,t)=>{gT.init(e,t),VD.init(e,t)}),nO=W(`ZodCIDRv4`,(e,t)=>{_T.init(e,t),VD.init(e,t)}),rO=W(`ZodCIDRv6`,(e,t)=>{vT.init(e,t),VD.init(e,t)}),iO=W(`ZodBase64`,(e,t)=>{bT.init(e,t),VD.init(e,t)}),aO=W(`ZodBase64URL`,(e,t)=>{ST.init(e,t),VD.init(e,t)}),oO=W(`ZodE164`,(e,t)=>{CT.init(e,t),VD.init(e,t)}),sO=W(`ZodJWT`,(e,t)=>{TT.init(e,t),VD.init(e,t)}),cO=W(`ZodNumber`,(e,t)=>{ET.init(e,t),RD.init(e,t),e.gt=(t,n)=>e.check(YE(t,n)),e.gte=(t,n)=>e.check(XE(t,n)),e.min=(t,n)=>e.check(XE(t,n)),e.lt=(t,n)=>e.check(qE(t,n)),e.lte=(t,n)=>e.check(JE(t,n)),e.max=(t,n)=>e.check(JE(t,n)),e.int=t=>e.check(dO(t)),e.safe=t=>e.check(dO(t)),e.positive=t=>e.check(YE(0,t)),e.nonnegative=t=>e.check(XE(0,t)),e.negative=t=>e.check(qE(0,t)),e.nonpositive=t=>e.check(JE(0,t)),e.multipleOf=(t,n)=>e.check(ZE(t,n)),e.step=(t,n)=>e.check(ZE(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function lO(e){return VE(cO,e)}var uO=W(`ZodNumberFormat`,(e,t)=>{DT.init(e,t),cO.init(e,t)});function dO(e){return HE(uO,e)}var fO=W(`ZodBoolean`,(e,t)=>{OT.init(e,t),RD.init(e,t)});function pO(e){return UE(fO,e)}var mO=W(`ZodNull`,(e,t)=>{kT.init(e,t),RD.init(e,t)});function hO(e){return WE(mO,e)}var gO=W(`ZodUnknown`,(e,t)=>{AT.init(e,t),RD.init(e,t)});function _O(){return GE(gO)}var vO=W(`ZodNever`,(e,t)=>{jT.init(e,t),RD.init(e,t)});function yO(e){return KE(vO,e)}var bO=W(`ZodArray`,(e,t)=>{NT.init(e,t),RD.init(e,t),e.element=t.element,e.min=(t,n)=>e.check($E(t,n)),e.nonempty=t=>e.check($E(1,t)),e.max=(t,n)=>e.check(QE(t,n)),e.length=(t,n)=>e.check(eD(t,n)),e.unwrap=()=>e.element});function q(e,t){return fD(bO,e,t)}var xO=W(`ZodObject`,(e,t)=>{RT.init(e,t),RD.init(e,t),cC(e,`shape`,()=>t.shape),e.keyof=()=>Y(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:_O()}),e.loose=()=>e.clone({...e._zod.def,catchall:_O()}),e.strict=()=>e.clone({...e._zod.def,catchall:yO()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>wC(e,t),e.safeExtend=t=>TC(e,t),e.merge=t=>EC(e,t),e.pick=t=>SC(e,t),e.omit=t=>CC(e,t),e.partial=(...t)=>DC(FO,e,t[0]),e.required=(...t)=>OC(UO,e,t[0])});function SO(e,t){return new xO({type:`object`,shape:e??{},...G(t)})}function J(e,t){return new xO({type:`object`,shape:e,catchall:yO(),...G(t)})}var CO=W(`ZodUnion`,(e,t)=>{BT.init(e,t),RD.init(e,t),e.options=t.options});function wO(e,t){return new CO({type:`union`,options:e,...G(t)})}var TO=W(`ZodDiscriminatedUnion`,(e,t)=>{CO.init(e,t),VT.init(e,t)});function EO(e,t,n){return new TO({type:`union`,options:t,discriminator:e,...G(n)})}var DO=W(`ZodIntersection`,(e,t)=>{HT.init(e,t),RD.init(e,t)});function OO(e,t){return new DO({type:`intersection`,left:e,right:t})}var kO=W(`ZodRecord`,(e,t)=>{GT.init(e,t),RD.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function AO(e,t,n){return new kO({type:`record`,keyType:e,valueType:t,...G(n)})}var jO=W(`ZodEnum`,(e,t)=>{KT.init(e,t),RD.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new jO({...t,checks:[],...G(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new jO({...t,checks:[],...G(r),entries:i})}});function Y(e,t){return new jO({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...G(t)})}var MO=W(`ZodLiteral`,(e,t)=>{qT.init(e,t),RD.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function X(e,t){return new MO({type:`literal`,values:Array.isArray(e)?e:[e],...G(t)})}var NO=W(`ZodTransform`,(e,t)=>{JT.init(e,t),RD.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new QS(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(PC(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(PC(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function PO(e){return new NO({type:`transform`,transform:e})}var FO=W(`ZodOptional`,(e,t)=>{XT.init(e,t),RD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function IO(e){return new FO({type:`optional`,innerType:e})}var LO=W(`ZodNullable`,(e,t)=>{ZT.init(e,t),RD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function RO(e){return new LO({type:`nullable`,innerType:e})}var zO=W(`ZodDefault`,(e,t)=>{QT.init(e,t),RD.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function BO(e,t){return new zO({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():gC(t)}})}var VO=W(`ZodPrefault`,(e,t)=>{eE.init(e,t),RD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function HO(e,t){return new VO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():gC(t)}})}var UO=W(`ZodNonOptional`,(e,t)=>{tE.init(e,t),RD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function WO(e,t){return new UO({type:`nonoptional`,innerType:e,...G(t)})}var GO=W(`ZodCatch`,(e,t)=>{rE.init(e,t),RD.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function KO(e,t){return new GO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var qO=W(`ZodPipe`,(e,t)=>{iE.init(e,t),RD.init(e,t),e.in=t.in,e.out=t.out});function JO(e,t){return new qO({type:`pipe`,in:e,out:t})}var YO=W(`ZodReadonly`,(e,t)=>{oE.init(e,t),RD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function XO(e){return new YO({type:`readonly`,innerType:e})}var ZO=W(`ZodLazy`,(e,t)=>{cE.init(e,t),RD.init(e,t),e.unwrap=()=>e._zod.def.getter()});function QO(e){return new ZO({type:`lazy`,getter:e})}var $O=W(`ZodCustom`,(e,t)=>{lE.init(e,t),RD.init(e,t)});function ek(e,t={}){return pD($O,e,t)}function tk(e){return mD(e)}function nk(e){let t=QO(()=>wO([K(e),lO(),pO(),hO(),q(t),AO(K(),t)]));return t}var rk=k(),ik=[`urgent`,`high`,`medium`,`low`],ak={urgent:`Critical`,high:`High`,medium:`Medium`,low:`Low`},ok={list:`/api/human-items`,item:e=>`/api/human-items/${encodeURIComponent(e)}`,answers:`/api/human-items/answers`,answer:e=>`/api/human-items/${encodeURIComponent(e)}/answer`,complete:e=>`/api/human-items/${encodeURIComponent(e)}/complete`,dismiss:e=>`/api/human-items/${encodeURIComponent(e)}/dismiss`,reopen:e=>`/api/human-items/${encodeURIComponent(e)}/reopen`,note:e=>`/api/human-items/${encodeURIComponent(e)}/note`},sk=K().nullable(),ck=K().regex(/\S/u),lk=J({session:K(),run:sk,plan:sk}),uk=EO(`scope`,[J({scope:X(`nothing`)}),J({scope:X(`work`),run:K(),node:K()}),J({scope:X(`plan`),plan:K()}),J({scope:X(`host`)})]),dk=Y([`manager`,`user`]),fk=J({actor:K(),on_behalf_of:sk,text:sk,choice:sk.optional(),reason:sk,provenance:dk.optional()}),pk=J({id:K().regex(/^[a-z0-9][a-z0-9-]{0,63}$/u),title:K().regex(/^[^\r\n]*\S[^\r\n]*$/u).refine(e=>[...e].length<=80),description:ck});function mk(e){let{kind:t,state:n,resolution:r}=e,i=e.choices??[];if(t===`task`&&i.length>0)return`choices are only valid on questions`;if(new Set(i.map(({id:e})=>e)).size!==i.length)return`a choice id is repeated`;let a=r?.choice??void 0;return a!==void 0&&(n!==`answered`||!i.some(({id:e})=>e===a))?`a resolution's choice is one this answered question offers`:t===`question`&&e.approval!==null?`approval is only valid on tasks`:n===`open`?r===null?void 0:`an open item has no resolution`:r===null?`a resolved item carries its resolution`:n===`answered`?t===`question`&&(r.text===null?a!==void 0:/\S/u.test(r.text))&&r.reason===null?void 0:`an answer is a question's, with a choice or text and no reason`:n===`completed`?t===`task`&&(r.text===null||/\S/u.test(r.text))&&r.reason===null?void 0:`a completion is a task's, with no reason and any comment not blank`:r.text===null?void 0:`a dismissal carries no text`}var hk=J({schema_version:X(1),id:K().min(1),dedup_key:K(),kind:Y([`task`,`question`]),title:ck,body:ck,choices:q(pk).max(6).optional(),priority:Y(ik),owner:lk,block:uk,approval:J({board_copy:K(),key:K()}).nullable(),state:Y([`open`,`answered`,`completed`,`dismissed`]),resolution:fk.nullable(),tracker:J({task:K(),url:KD()}).nullable(),created_at:K(),updated_at:K()}).superRefine((e,t)=>{let n=mk(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),gk=J({run:K(),node:K(),title:K()}),_k=J({plan:K(),count:lO().int().nonnegative(),preview:q(gk).max(3)}),vk=J({total:lO().int().nonnegative(),plans:q(_k)});function yk(e,t){return!(e.state===`open`&&e.block.scope!==`nothing`)&&(t.total!==0||t.plans.length>0)?`a non-blocking item reports nothing blocked`:new Set(t.plans.map(({plan:e})=>e)).size===t.plans.length?t.plans.some(({count:e,preview:t})=>t.length!==Math.min(e,3))?`a preview is the first three affected steps of its plan`:t.plans.reduce((e,{count:t})=>e+t,0)===t.total?void 0:`the blocked total is the plans' counts`:`a blocked plan appears twice`}var bk=J({available:pO(),reason:sk});function xk({dedup_key:e,block:t,owner:n}){return t.scope===`work`&&e===`run:${t.run}#${t.node}`&&n.run===t.run}function Sk(e,{available:t,reason:n}){return(t?n!==null:n===null||!/\S/u.test(n))?`a reopen states a reason exactly when it is unavailable`:e.state===`open`||e.state===`answered`||xk(e)||e.resolution?.actor===`engine`?t?`this item's state cannot be reopened`:void 0:t||e.state===`completed`&&e.approval!==null?void 0:`nothing about this item's state refuses a reopen`}var Ck=J({item:hk,blocked:vk,reopen:bk}).superRefine(({item:e,blocked:t,reopen:n},r)=>{let i=yk(e,t)??Sk(e,n);i!==void 0&&r.addIssue({code:`custom`,message:i})});function wk(e){let{blocked:t,nodes:n}=e;if(n.length!==t.total)return`the steps are the blocked total`;if(new Set(n.map(({run:e,node:t})=>`${e}\u0000${t}`)).size!==n.length)return`a blocked step appears twice`;let r=0;for(let{count:e,preview:i}of t.plans){let t=n.slice(r,r+e);if(i.some((e,n)=>t[n]?.run!==e.run||t[n]?.node!==e.node))return`a preview is the first steps of its plan's group`;r+=e}}var Tk=J({action:Y([`human-item-raised`,`human-item-answered`,`human-item-completed`,`human-item-dismissed`,`human-item-auto-resolved`,`human-item-reopened`,`human-item-noted`]),at:_D({offset:!0}),actor:ck,on_behalf_of:sk,provenance:dk}),Ek=J({item:hk,blocked:vk,nodes:q(gk),reopen:bk,history:q(Tk).optional()}).superRefine((e,t)=>{let n=yk(e.item,e.blocked)??Sk(e.item,e.reopen)??wk(e);n!==void 0&&t.addIssue({code:`custom`,message:n})}),Dk=J({item:Ck,event_id:K()}),Ok=EO(`kind`,[J({kind:X(`unavailable`)}),J({kind:X(`conflict`),reason:K()})]),kk=J({batch:sk.optional(),answered:q(Dk),refused:q(J({id:K(),refusal:Ok}))}),Ak=J({items:q(Ck)}),jk=J({kind:Y([`task`,`question`]).nullable().optional(),blocking:pO().nullable().optional(),priority:Y(ik).nullable().optional(),state:Y([`open`,`answered`,`completed`,`dismissed`]).nullable().optional(),session:K().nullable().optional(),run:K().nullable().optional(),plan:K().nullable().optional(),host:pO().nullable().optional()}),Mk=J({type:X(`human-items`),items:q(Ck),detail:Ek.nullable()}),Nk=lO().finite().nonnegative(),Z=lO().int().nonnegative(),Pk=_D({offset:!0}),Fk=K().min(1).nullable(),Q=e=>SO(e).catchall(_O()),Ik={runs:`/api/v2/runs`,run:e=>`/api/v2/runs/${encodeURIComponent(e)}`,timeline:e=>`/api/v2/runs/${encodeURIComponent(e)}/timeline`,conversation:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/conversations/${encodeURIComponent(t)}`,artifact:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/artifacts/${encodeURIComponent(t)}`,timelineEvents:e=>`/api/v2/runs/${encodeURIComponent(e)}/timeline/events`,events:`/api/v2/events`,projects:`/api/v2/projects`,project:e=>`/api/v2/projects/${encodeURIComponent(e)}`,channel:e=>`/api/v2/runs/${encodeURIComponent(e)}/channel`,channelNext:e=>`/api/v2/runs/${encodeURIComponent(e)}/channel/next`,channelReply:e=>`/api/v2/runs/${encodeURIComponent(e)}/channel/reply`,channelSurface:e=>`/api/v2/runs/${encodeURIComponent(e)}/channel/surface`,attest:e=>`/api/v2/runs/${encodeURIComponent(e)}/attest`,stop:e=>`/api/v2/runs/${encodeURIComponent(e)}/stop`,shutdown:`/api/v2/shutdown`,unwatched:`/api/v2/unwatched`,host:`/api/v2/host`,status:e=>`/api/v2/runs/${encodeURIComponent(e)}/status`,results:e=>`/api/v2/runs/${encodeURIComponent(e)}/results`,goals:`/api/v2/goals`,runGoals:e=>`/api/v2/runs/${encodeURIComponent(e)}/goals`,transcript:e=>`/api/v2/runs/${encodeURIComponent(e)}/transcript`,telemetry:e=>`/api/v2/runs/${encodeURIComponent(e)}/telemetry`,agents:e=>`/api/v2/runs/${encodeURIComponent(e)}/agents`,nodeAgents:(e,t)=>`/api/v2/runs/${encodeURIComponent(e)}/nodes/${encodeURIComponent(t)}/agents`,projectAgents:e=>`/api/v2/projects/${encodeURIComponent(e)}/agents`,subscriptions:`/api/v2/subscriptions`,subscription:e=>`/api/v2/subscriptions/${encodeURIComponent(e)}`},Lk={includeSettled:`include_settled`,includeConversations:`include_conversations`,runId:`run_id`,after:`after`,cursor:`cursor`,limit:`limit`,span:`span`,from:`from`,to:`to`,select:`select`,node:`node`,scope:`scope`,filter:`filter`,correlation:`correlation`,until:`until`,timeout:`timeout`,subscription:`subscription`,tick:`tick`},Rk={run:`run`,node:`node`},zk={planner:`planner`,detailed:`detailed`},Bk=Y([`complete`,`partial`,`legacy`]),Vk=Y([`native`,`labelled`,`inferred`]),Hk=Q({agent_model_ms:pO(),judge_model_ms:pO(),llmlint_model_ms:pO(),tool_ms:pO()}),Uk=Nk.nullable(),Wk=Z.nullable(),Gk=Q({agent_seconds:Uk,judge_seconds:Uk,llmlint_seconds:Uk,gate_seconds:Uk,publication_wait_seconds:Uk,lock_wait_seconds:Uk,setup_seconds:Uk,scheduling_seconds:Uk,wall_seconds:Uk,agent_model_ms:Wk,judge_model_ms:Wk,llmlint_model_ms:Wk,tool_ms:Wk,idle_orchestration_ms:Wk,unattributed_ms:Wk,wall_ms:Wk,fractions:Q({agent_model:Uk,judge_model:Uk,llmlint_model:Uk,tool:Uk,idle_orchestration:Uk,lock_wait:Uk,setup:Uk,scheduling:Uk})}),Kk=K().regex(/^[A-Za-z0-9_-]+$/,`a member name: letters, digits, hyphens and underscores`),qk=Y([`agent`,`judge`,`llmlint`]),Jk=Nk.nullable(),Yk=Q({input_tokens:Jk,output_tokens:Jk,cache_read_tokens:Jk,cache_write_tokens:Jk,cost_usd:Jk}),Xk=Q({agent:Yk,judge:Yk,llmlint:Yk,total:Yk}),Zk=Q({session_id:K().min(1),history_id:K().min(1).nullable().optional(),role:qk,agent_role:Kk.optional(),turn_index:Z.nullable().optional(),started_at:Pk.optional(),finished_at:Pk.nullable().optional()}),Qk=AO(K(),_O()),$k=Y([`agent`,`gate`,`checks`,`publication`,`timeout`,`provider`,`configuration`,`unknown`]),eA=Y([`agent`,`judge`,`llmlint`]),tA=Y([`quota_at_launch`,`quota_mid_conversation`,`stale_session_resume`,`rate_limit`,`harness_exit`]),nA=Q({side:eA.optional(),harness:K().optional(),variant:K().optional(),identity:K().optional(),cause:tA.optional(),raw_tail:K().optional(),reset_time:K().optional(),missing_session_id:K().optional(),wait_seconds:lO().nonnegative().optional(),failure_kind:K().optional(),structured_error:Qk.optional(),judge_unrecorded:pO().optional()}).extend({class:$k,detail:K().optional()}),rA=Q({node:K().min(1),status:K().min(1),outcome:K().min(1).optional(),branch:K().min(1).optional(),comparison_remote:K().min(1).optional(),comparison_base:K().min(1).optional(),checkpoint:K().min(1).optional(),commit:K().min(1).optional(),retry_lineage:Qk.optional(),gate_attestation:Qk.optional(),failure:nA.optional(),timing:Gk.optional(),usage:Xk.optional(),sessions:q(Zk),tool_commands:AO(K(),Z).optional(),turns:Z,lint:Z,timing_quality:Bk,linkage_quality:Vk,timing_presence:Hk}),iA=Q({run_id:K().min(1),state:K().min(1),phase:K().min(1),last_event:Fk,last_progress_at:Nk.optional(),timing:Gk,nodes:q(rA),providers:q(Qk).optional(),failure:nA.optional(),check_rollup:Qk.optional(),usage:Xk,timing_quality:Bk,linkage_quality:Vk,timing_presence:Hk,sources:q(K()),node_work_ms:Q({agent_model_ms:Wk,judge_model_ms:Wk,llmlint_model_ms:Wk,tool_ms:Wk,wall_ms:Wk}),turns:Z,lint:Z,agent_count:Z.optional()}),aA=Q({schema_version:wO([K(),lO()]).optional(),observed_at:K().optional(),identities:q(Qk)}),oA=Q({started_at:Pk.optional(),launch_id:K().min(1),launcher:Y([`claude-code`,`codex`,`unknown`]),session_key:K().min(1).optional(),launcher_session_id:K().min(1).optional()}),sA=K().min(1),cA=Q({labels:AO(K(),K()).optional(),group:K().min(1).optional(),run_id:K().min(1),state:K().min(1),phase:K().min(1),last_event:Fk,last_progress_at:Nk.optional(),timing_quality:Bk,linkage_quality:Vk,timing:Gk,node_counts:AO(K(),Z),launch:oA.optional(),project:K().min(1).optional(),project_name:K().min(1).optional(),liveness:sA.optional(),unread_surfaces:Z.optional()}),lA=Q({path:K().min(1),reason:K().min(1)}),uA=Q({api_version:X(2),telemetry_schema_version:X(29),observed_at:Pk,runs:q(cA),next_cursor:K().min(1).optional(),unreadable:q(lA).optional(),missing:q(K().min(1)).optional(),provider_health:aA.optional()}),dA=Y([`agent`,`human`,`command`]),fA=Q({id:K().min(1),kind:dA.optional(),persona:K().min(1).optional(),task:K().min(1),deps:q(K().min(1)).optional(),max_turns:Z.positive().optional(),expects_no_diff:pO().optional()}),pA=Q({branch:K().min(1),base_branch:K().min(1),pr_base:K().min(1),checkpoint:K().min(1),completed_steps:q(K()).optional(),pr:K().nullable().optional(),mode:Y([`pause`,`retry`,`continue`]).optional(),attempts:Z.optional()}),mA=Q({branch:K().min(1),repo:K().min(1).optional(),identity:K().min(1).optional(),base_branch:K().min(1).optional(),pr:K().min(1).optional(),pr_base:K().min(1).optional()}),hA=q(K()),gA=fA.extend({task:K().min(1).optional(),repo:K().min(1).optional(),steps:q(fA).min(1).optional(),session:K().min(1).optional(),project_dir:K().min(1).optional(),base_branch:K().min(1).optional(),branch:K().min(1).optional(),title:K().min(1).optional(),verify_cmd:K().min(1).optional(),skip_verify:pO().optional(),verify_via_ci:pO().optional(),merge_policy:Y([`auto`,`direct`,`none`]).optional(),workflow:Y([`local`,`remote`]).optional(),repo_type:Y([`single-owner`,`team`]).optional(),execution_checkout:K().min(1).optional(),stack_bases:q(mA).optional(),resume:pA.optional(),sets:hA.optional(),command:q(K()).min(1).optional(),timeout_seconds:Z.positive().optional()}),_A=gA.superRefine((e,t)=>{e.steps===void 0&&e.task===void 0&&t.addIssue({code:`custom`,path:[`task`],message:"a plan task without `steps` must carry its own `task` prose"})}),vA=Q({gate_log:K().optional(),worker_report:K().optional(),oneharness_session:K().optional()}),yA=Q({id:K().min(1),kind:K().min(1),persona:K().nullable(),status:K().min(1),telemetry:Qk.optional(),artifacts:vA.optional()}),bA=Q({ref:K().min(1),task:K(),unblocks:q(K()),unblocks_publication:pO()}),xA=Q({branch:K().min(1),base_branch:K().min(1),pr_base:K(),checkpoint:K().min(1),completed_steps:q(K()),pr:K().nullable(),mode:K().optional()}),SA=Q({identity:K().min(1),target:K().min(1),style:K().min(1).optional(),version:K().min(1)}),CA=Q({producer:K().min(1),target:K().min(1)}),wA=Q({path:K().min(1),content:K().optional(),truncated:pO().optional()}),TA=Q({kind:K().optional(),log:wA.optional(),status:K().optional(),task:K().optional(),unblocks:q(K()).optional(),blocked_by:q(K()).optional(),human_actions:q(bA).optional(),completed:pO().optional(),exit_code:lO().int().nullable().optional(),verdicts:q(_O()).optional(),usage:Qk.optional(),telemetry:Qk.optional(),repo:K().optional(),branch:K().optional(),commit:K().optional(),base_branch:K().optional(),pr_base:K().optional(),synthetic_stack_base:K().nullable().optional(),stack_bases:q(Qk).optional(),repository_type:Y([`single-owner`,`team`]).nullable().optional(),repo_type:Y([`single-owner`,`team`]).nullable().optional(),publication_workflow:Y([`local`,`remote`]).nullable().optional(),workflow:Y([`local`,`remote`]).nullable().optional(),merge_policy:Y([`auto`,`direct`,`none`]).nullable().optional(),outcome:K().optional(),ok:pO().optional(),pr:K().nullable().optional(),release:SA.nullable().optional(),awaiting:q(CA).min(1).optional(),detail:K().optional(),follow_ups:K().nullable().optional(),steps:q(yA).optional(),waiting_steps:q(K()).optional(),resume:xA.nullable().optional(),error:K().nullable().optional(),retry_lineage:Qk.optional(),deferred_cleanup:q(K()).optional(),artifacts:vA.optional()}),EA=Q({ok:pO().optional(),state:K().optional(),started_order:q(K()).optional(),results:AO(K(),TA).optional(),schema_version:Z.optional()}),DA=Y([`running`,`done`,`failed`,`waiting`,`parked`,`cancelled`,`complete-but-draft`,`complete-but-held`]),OA=Y([`pending`,`ready`,`running`,`waiting`,`blocked`,`skipped`,`done`,`not-completed`,`failed`,`parked`,`cancelled`,`complete-but-draft`,`complete-but-held`,`unknown`]),kA=Q({addressable:pO(),member:K().min(1).optional(),reason:K().min(1).optional()}).superRefine((e,t)=>{e.addressable===(e.reason!==void 0)&&t.addIssue({code:`custom`,path:[`reason`],message:`a reason is carried exactly when there is no turn to address`})}),AA=Q({id:K().min(1),kind:K(),unblocks:q(K().min(1))}),jA=Q({at:K().min(1),author:K().min(1),command:Qk,reason:K(),envelope:Z.optional(),index:Z.optional(),refusal:Qk.optional()}),MA=Q({run_id:K().min(1),plan:Q({tasks:q(_A),schema_version:Z.optional(),concurrency:Z.positive().optional(),name:K().min(1).optional(),goal:Q({id:K().min(1),text:K().min(1)}).optional()}),node_states:AO(K(),DA),node_status:AO(K(),OA),node_gated_by:AO(K(),q(K().min(1))),node_control:AO(K(),kA),node_results:AO(K(),TA),decisions:q(AA),attestations:q(K()),result:EA.nullable(),last_seq:Z,run_node_sets:hA.optional(),rejected_edits:q(jA).min(1).optional()}),NA=MA.superRefine(PA);function PA(e,t){let n=new Set(e.plan.tasks.map(e=>e.id)),r=new Set(Object.keys(e.node_status));(n.size!==e.plan.tasks.length||n.size!==r.size||[...n].some(e=>!r.has(e)))&&t.addIssue({code:`custom`,path:[`node_status`],message:`must contain exactly one entry for every plan task`}),Object.entries(e.node_gated_by).find(([e,t])=>!n.has(e)||t.some(e=>!n.has(e)))&&t.addIssue({code:`custom`,path:[`node_gated_by`],message:`must name only nodes in this graph's plan`}),Object.keys(e.node_control).find(t=>e.node_status[t]!==`running`)!==void 0&&t.addIssue({code:`custom`,path:[`node_control`],message:`must name only nodes the run has in flight`})}var FA=Q({cacheReadTokens:Jk.optional(),cacheWriteTokens:Jk.optional(),costUsd:Jk.optional(),inputTokens:Jk.optional(),outputTokens:Jk.optional()}),IA=Q({index:Z,input:_O().optional(),kind:K(),name:K().nullable().optional(),output:K().nullable().optional(),toolCallId:K().min(1).optional(),output_truncated:X(!0).optional(),input_truncated:X(!0).optional()}),LA=Q({judge:K(),kind:K(),decision:K(),reason:K()}),RA=Q({assistant:K().nullable(),durationMs:Jk.optional(),failureKind:K().nullable(),finishedAt:Pk.nullable().optional(),harness:K(),id:K(),judges:q(LA).optional(),model:K().nullable(),modelMs:Jk.optional(),reasoning:K().nullable(),startedAt:Pk.nullable().optional(),status:K(),timestamp:Pk,toolMs:Jk.optional(),tools:q(IA),unknown:Qk,usage:FA,user:K()}),zA=Q({conversation:Q({canContinue:pO(),harnesses:q(K()),id:K().min(1),name:K(),project:K(),startedAt:Pk,state:K(),turns:q(RA)}),attribution:Q({runId:K().optional(),nodeId:K().optional(),stepId:K().optional(),launchId:K().optional(),launcher:Y([`claude-code`,`codex`,`unknown`]).optional(),transportRole:qk,agentRole:Kk.optional(),parentConversationId:K().optional(),persona:K().optional(),finishedAt:Pk.nullable().optional(),inferred:X(!0).optional(),timing:Gk.optional()})}),BA=Q({node:K().optional(),conversations:q(zA)}),VA=wO([q(zA),q(BA).transform(e=>e.flatMap(e=>e.conversations))]),HA=Q({name:K(),state:K(),status:K().optional(),conclusion:K().optional(),started_at:Pk.optional(),completed_at:Pk.optional(),required:pO(),requirement:K().optional(),url:K().url().nullable().optional()}),UA=Q({ok:pO(),output_tail:K(),artifact_id:K().min(1).optional()}),WA=Q({verification:Q({pre_push_hook:pO().optional(),required_checks:q(K()).optional(),required_checks_status:K().optional(),expected_gate:q(K()).optional(),checks:q(HA).optional(),records:q(UA)}),publication:Q({pr_url:K().url().optional(),branch:K().optional(),branch_url:K().url().optional(),merged:pO(),base_branch:K().optional(),commit:K().optional(),commit_url:K().url().optional()}).optional()}),GA=q(SO({event_id:K().min(1),node:K().min(1),step:K().min(1).optional(),at:lO().finite(),kind:K(),name:K(),detail:K(),description:K(),events:lO().int().nonnegative()})),KA=Q({telemetry:Q({schema_version:Z,as_of:Pk.optional()}).optional(),api_version:X(2),telemetry_schema_version:X(29),observed_at:Pk,run:iA.extend({live_activity:GA.optional()}),graph:NA.nullable(),conversations:VA,node_details:AO(K(),WA).optional().default({}),launch:oA.optional(),provider_health:aA.optional()}),qA=J({complete:pO(),loading:q(K()),failed:K().optional()}),JA=J({loading:X(!0)}),YA=rA.partial({sessions:!0,turns:!0,lint:!0,timing_quality:!0,linkage_quality:!0,timing_presence:!0}),XA=Gk.partial().extend({wall_seconds:Uk}),ZA=iA.partial({usage:!0,timing_quality:!0,linkage_quality:!0,timing_presence:!0,sources:!0,node_work_ms:!0,lint:!0}).extend({timing:XA,nodes:q(YA),turns:wO([Z,JA]),live_activity:GA.optional()}),QA=MA.partial({node_states:!0,decisions:!0,attestations:!0}).extend({plan:Q({tasks:q(gA),schema_version:Z.optional(),concurrency:Z.positive().optional(),name:K().min(1).optional(),goal:Q({id:K().min(1),text:K().min(1)}).optional()})}).superRefine(PA),$A=KA.extend({run:ZA,graph:QA.nullable(),conversations:VA.optional(),progress:qA.optional()}),ej=Y([`conversation`,`gate_log`,`worker_report`,`oneharness_session`,`pr`]),tj=Y([`run`,`node`,`step`,`dispatch`,`verification`,`publication`,`pr-drafting`,`conflict-resolution`,`human-wait`,`rollup`,`queued`]),nj=Y([`starting`,`dispatching`,`deciding`,`surfacing`,`waiting`,`settled`,`finished`]),rj=Q({kind:ej,value:K().min(1)}),ij=Q({delivered:pO(),delivery:Y([`live`,`deferred`]).optional(),reached:Y([`queued`,`worker`,`supervisor`,`judged-with`,`carried`]).optional(),turn:Y([`interrupted`,`turn-end`]).optional(),member:K().min(1).optional(),input_bytes:Z.optional(),reason:K().min(1).optional(),node_id:K().min(1).optional()}).superRefine((e,t)=>{e.delivered&&e.reason!==void 0&&t.addIssue({code:`custom`,path:[`reason`],message:`a delivered redirection carries no reason it did not land`}),e.delivery!==void 0&&e.delivered!==(e.delivery===`live`)&&t.addIssue({code:`custom`,path:[`delivery`],message:"`delivery` is `live` exactly when the running turn took the note"})}),aj=Q({dep:K().min(1),identity:K().min(1).optional(),target:K().min(1).optional(),style:K().min(1).optional(),action:K().min(1).optional(),since:Pk.optional(),waited_seconds:Z.optional(),last_answer:K().min(1).optional()}),oj=Q({kind:K().min(1).optional(),message:K().min(1).optional(),source:K().min(1).optional(),blocking:pO().optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a surface record carries at least one recorded fact`})}),sj=Q({name:K().min(1).optional(),required:pO().optional(),requirement:K().optional(),url:K().nullable().optional(),state:K().min(1).optional(),kind:K().min(1).optional(),base:K().min(1).optional(),awaited:q(K().min(1)).optional(),grace_seconds:lO().nonnegative().optional(),warned:pO().optional(),head:K().min(1).optional(),verdict:K().min(1).optional(),skipped:q(K().min(1)).optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a review record carries at least one recorded fact`})}),cj=Q({identity:K().min(1).optional(),target:K().min(1).optional(),style:K().min(1).optional(),version:K().min(1).optional(),landing_commit:K().min(1).optional(),actor:K().min(1).optional(),superseded:pO().optional(),form:K().min(1).optional(),outcome:K().min(1).optional(),elapsed_ms:Z.optional(),dep:K().min(1).optional(),delivery:K().min(1).optional(),awaiting:q(aj).min(1).optional(),versions:q(Q({identity:K().min(1),target:K().min(1),version:K().min(1)})).min(1).optional()}).superRefine((e,t)=>{Object.values(e).every(e=>e===void 0)&&t.addIssue({code:`custom`,message:`a release record carries at least one recorded fact`})}),lj=Q({id:K().min(1),label:K().min(1),order:Z,started_at:Pk}),uj=Q({id:K().min(1),stream:K().min(1).optional(),seq:Z.optional(),journal_order:Z.optional(),record_id:K().min(1).optional(),persona:K().min(1).optional(),dispatch_id:K().min(1).optional(),dispatch_group:lj.optional(),fields:AO(K().min(1),nk()).optional(),kind:K().min(1),at:Pk,node_id:K().min(1).optional(),step_id:K().min(1).optional(),status:K().min(1).optional(),author:K().min(1).optional(),redirection:ij.optional(),release:cj.optional(),surface:oj.optional(),review:sj.optional(),reference:rj.optional(),description:K().optional(),tool:Q({index:Z,tool_call_id:K().min(1).optional(),turn:K().min(1).optional()}).optional()}),dj=Q({started_at:Pk,ended_at:Pk}),fj=Q({kind:K().min(1),blocking:q(K().min(1)).min(1).optional(),ahead:q(K().min(1)).min(1).optional(),limit:Z.optional(),reference:K().min(1).optional(),awaiting:q(K().min(1)).min(1).optional()}),pj=Q({id:K().min(1),kind:tj,label:K(),started_at:Pk,ended_at:Pk.nullable(),events:q(uj),events_total:Z.optional(),parent_id:K().min(1).optional(),node_id:K().min(1).optional(),step_id:K().min(1).optional(),status:K().min(1).optional(),count:Z.optional(),total_duration_ms:Z.optional(),intervals:q(dj).optional(),harness_scope:K().min(1).optional(),dispatch_attempt:K().min(1).optional(),agent_role:Kk.optional(),transport_role:qk.optional(),dispatch_id:K().min(1).optional(),dispatch_group:lj.optional(),reference:rj.optional(),detail:Q({ok:pO().optional(),output_tail:K().optional(),artifact_id:K().optional()}).optional(),phase:nj.optional(),reasons:q(fj).min(1).optional()}).superRefine((e,t)=>{e.reasons!==void 0&&e.kind!==`queued`&&t.addIssue({code:`custom`,path:[`reasons`],message:`only a queued span carries the reasons a node was held`})}),mj=Q({id:K().min(1),kind:ej,content:K(),truncated:pO(),turns:q(RA).optional(),unavailable:K().optional()}),hj=Q({api_version:X(2),timeline_schema_version:X(15),observed_at:Pk,run_id:K().min(1),spans:q(pj),progress:qA.optional()}),gj=Q({rows:q(uj.extend({span_id:K().min(1)})),next_cursor:K().min(1).nullable(),total:Z,span:Q({id:K().min(1)}).optional(),observed_at:Pk}),_j=Q({error:Q({code:K(),message:K()})});Q({schema_version:X(1),launch_id:K().min(1),launcher:Y([`claude-code`,`codex`]),launcher_session_id:K().min(1),started_at:Pk,repository_identity:K().min(1)});var vj=Y([`snapshot`,`run.changed`,`conversation.changed`,`activity.changed`,`run.removed`]),yj=Qk;function bj(e){let t=e.indexOf(`:`);if(t===-1)return!1;let n=e.slice(0,t),r=e.slice(t+1);return/^[a-z0-9][a-z0-9-]*$/u.test(n)&&r.length>0&&r.length<=128&&!r.startsWith(`.`)&&/^[A-Za-z0-9._-]+$/u.test(r)}var xj=Q({project:K().min(1).nullable(),name:K().min(1).nullable(),last_write_at:Nk.nullable(),runs:q(cA),agent_count:Z.optional()}),Sj=Q({api_version:X(2),telemetry_schema_version:X(29),observed_at:Pk,projects:q(xj),unreadable:q(lA).optional()}),Cj=xj.extend({api_version:X(2),telemetry_schema_version:X(29),observed_at:Pk}),wj={api_version:X(2),telemetry_schema_version:X(29),observed_at:Pk},Tj=Y([`manager`,`user`]),Ej=Y([`note`,`amendment`,`answer`]),Dj=J({node:K(),ruling:K(),provenance:Tj,kind:Ej,reply:Z,text:K(),reason:K()}),Oj=Q({id:Z,correlation:K().min(1).optional(),kind:K().min(1),message:K(),source:K().min(1),blocking:pO(),queued_at:Nk,workstream:K().min(1).optional(),abandoned:pO().optional(),declined_ruling:Dj.optional()}).superRefine((e,t)=>{e.kind===`declined-ruling`!=(e.declined_ruling!==void 0)&&t.addIssue({code:`custom`,path:[`declined_ruling`],message:`a declined-ruling surface, and only one, carries its declined ruling`})}),kj=Y([`worker`,`supervisor`,`both`]),Aj=Y([`live`,`next`]),jj=Y([`detach`,`drop`]),Mj=Y([`done`,`failed`]),Nj=Q({sets:hA.optional()}),Pj=EO(`op`,[SO({op:X(`add`),node:_A}).strict(),SO({op:X(`drop`),id:K().min(1),dependents:jj,reason:K().min(1).optional()}).strict(),SO({op:X(`reparent`),id:K().min(1),deps:q(K().min(1))}).strict(),SO({op:X(`retry`),id:K().min(1),node:_A}).strict(),SO({op:X(`cancel`),id:K().min(1),reason:K().min(1).optional()}).strict(),SO({op:X(`requeue`),id:K().min(1),amend:Nj.optional()}).strict(),SO({op:X(`set-node-sets`),id:K().min(1),sets:hA}).strict(),SO({op:X(`set-run-node-sets`),sets:hA}).strict(),SO({op:X(`attest`),ref:K().min(1)}).strict(),SO({op:X(`complete`),reason:K().min(1)}).strict(),SO({op:X(`amend`),id:K().min(1),text:K().min(1)}).strict(),SO({op:X(`note`),id:K().min(1),addressee:kj,text:K().min(1),criterion:K().min(1).optional(),deliver:Aj.optional(),persist:pO().optional(),delivery_timeout_seconds:lO().int().positive().optional()}).strict(),SO({op:X(`withdraw-note`),envelope:K().min(1),index:lO().int().nonnegative(),reason:K().min(1)}).strict(),SO({op:X(`finding`),message:K().min(1),blocking:pO().optional(),id:K().min(1).optional()}).strict(),SO({op:X(`settle`),id:K().min(1),outcome:Mj,evidence:K().min(1),landing:K().min(1).optional(),release:SO({target:K().min(1),version:K().min(1)}).strict().optional()}).strict(),SO({op:X(`rework`),id:K().min(1),reason:K().min(1),instruction:K().min(1),comments:q(SO({id:K(),url:K()}).strict()).optional(),title:K().optional(),replacement:K().optional()}).strict(),SO({op:X(`retitle`),id:K().min(1),title:K().min(1),reason:K().min(1)}).strict(),SO({op:X(`review`)}).strict(),SO({op:X(`readjust`)}).strict(),SO({op:X(`decline`),id:K().min(1),comments:q(SO({id:K(),url:K()}).strict()),reason:K().min(1)}).strict()]);Pj.options.map(e=>e.shape.op.value),SO({version:Z.optional(),author:K().min(1).optional(),completion:pO().optional(),message:K().optional(),reason:K().optional(),commands:q(Pj).optional(),provenance:Tj.optional()}).strict().superRefine((e,t)=>{e.commands!==void 0&&e.commands.length>0&&e.version!==4&&t.addIssue({code:`custom`,path:[`version`],message:`an edit envelope requires version 4`})});var Fj=Q({id:Z,reply:Qk,at:Nk,correlation:K().min(1).optional()}),Ij=Q({id:Z,author:K().min(1).optional(),commands:q(Qk),provenance:Tj.optional()}),Lj=Q({op:K().min(1).optional(),outcome:K().min(1).optional(),reason:K().optional()}),Rj=Q({id:Z,applied:pO(),reason:K().optional(),results:q(Lj).optional()}),zj=Q({...wj,run_id:K().min(1),surfaces:q(Oj),waiting:q(Oj),held:Oj.nullable(),replies:q(Fj),commands:q(Ij),outcomes:q(Rj)}),Bj=Y([`surface`,`running`,`finished`]),Vj=Q({...wj,run_id:K().min(1),status:Bj,surface:Oj.nullable(),events:q(Qk)}),Hj=Q({...wj,run_id:K().min(1),receipt:Q({reply:Z,state:K().min(1),verdict:K().min(1).optional(),commands:K().min(1).optional()}),advice:q(K())}),Uj=Q({...wj,run_id:K().min(1),surface:Z,state:K().min(1)}),Wj=Q({...wj,run_id:K().min(1),stopped:pO(),owner:K().min(1),forced:pO(),teardown:K().min(1)}),Gj=Y([`host`]);Y([`host`]);var Kj=Y([`delivered`,`no-turn`,`failed`,`not-asked`]),qj=Y([`graceful`,`killed`,`still-running`]),Jj=Y([`pushed`,`already-on-origin`,`no-remote`,`refused`]),Yj=Q({...wj,scope:Gj,root:K(),grace_seconds:Z,forced:pO(),complete:pO(),runs:q(Q({run_id:K().min(1),owner:K().min(1),forced_over_owner:pO(),dispatches:q(Q({node:K().min(1),pid:Z,interrupt:Kj,detail:K(),ended:qj,waited_ms:Z})),teardown:K().min(1),branches:q(Q({identity:K(),branch:K(),result:Jj,remote:K().nullable(),commit:K().nullable(),detail:K()}))})),not_pushed:q(Q({identity:K(),branch:K()})),not_pushed_unread:K().nullable(),rendered:K()}),Xj=Q({...wj,session_key:K().min(1).optional(),reported:q(Q({run:K().min(1),standing:K().min(1),why_not_watched:K()})),unresolved:q(K())}),Zj=Q({schema_version:X(1),host:K(),root:K(),root_error:K().nullable(),free_space:q(Q({roots:q(Q({role:K(),path:K().nullable(),measured_at:K().nullable()})),free_bytes:Z.nullable(),total_bytes:Z.nullable(),error:K().nullable()})),dispatches:q(Q({run:K(),node:K(),launcher:K(),age_ms:Nk.nullable(),proof:Y([`held`,`unproven`]),unproven:K().nullable()})),gone:q(Q({run:K(),node:K(),reason:K()})),skipped:q(Q({path:K(),reason:K()}))}),Qj=Q({...wj,reading:Zj.optional(),rendered:K(),unreadable:q(lA).optional()});Q({...wj,run_id:K().min(1),rendered:K()});var $j=Q({...wj,run_id:K().min(1),liveness:sA,unread_surfaces:Q({count:Z,oldest_seconds:Nk.nullable()}),node_status:AO(K(),K().min(1)),summary:K(),rendered:K()});Q({...wj,run_id:K().min(1),node:K().min(1).nullable().optional(),rendered:K()}),Q({...wj,run_id:K().min(1),telemetry:Q({schema_version:Z})});var eM=Q({history_id:K().min(1),harness:K().min(1),variant:K().min(1).optional(),harness_id:K().min(1),started:Pk}),tM=Q({history_session:K().min(1),name:K().min(1),history_dir:K().min(1),history_project:K().min(1),history_file:K().min(1),project:K().min(1),started:Pk,labels:AO(K(),K()),runs:q(eM),run_id:K().min(1).optional()}),nM={...wj,sessions:q(tM),skipped:Z},rM=Q({...nM,run_id:K().min(1),node:K().min(1).optional()}),iM=Q({...nM,project:K().min(1)}),aM=K().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/u),oM=K().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(0|[1-9][0-9]*)$/u),sM=wO([J({type:X(`sidebar`)}),J({type:X(`detail`),run_id:K().min(1),filter:K().min(1).optional()}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`run`),filter:K().min(1).optional()}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`node`),node:K().min(1),filter:K().min(1).optional()}),J({type:X(`channel`),run_id:K().min(1)}),J({type:X(`human-items`),filter:jk.optional(),item:K().min(1).optional()})]),cM=J({id:K().min(1),name:K(),group:J({project:K(),name:K()}).nullable(),kind:K().nullable(),state:K().min(1),nodes:J({total:Z,done:Z,failed:Z,running:Z}),updated_at:Pk,started_at:Pk.optional()});Object.keys(cM.shape);var lM=wO([J({type:X(`sidebar`)}),J({type:X(`detail`),run_id:K().min(1),detail:$A}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`run`),detail:$A,timeline:hj}),J({type:X(`timeline`),run_id:K().min(1),scope:X(`node`),node:K().min(1),detail:$A,timeline:hj}),J({type:X(`channel`),run_id:K().min(1),detail:$A,channel:zj}),Mk]),uM=J({id:oM,sidebar:q(cM).nullable(),visible:lM}),dM=q(wO([K(),Z])),fM=wO([J({p:dM,v:_O()}),J({p:dM,a:q(_O())}),J({p:dM,d:X(!0)})]),pM={id:oM,base:oM,subscription:aM},mM=Y([`unknown-cursor`,`stale-cursor`,`server-restarted`]),hM=J({...pM,type:X(`reset`),reason:mM,snapshot:uM}),gM=wO([hM,J({...pM,type:X(`sidebar.snapshot`),rows:q(cM)}),J({...pM,type:X(`run.changed`),row:cM}),J({...pM,type:X(`run.removed`),run_id:K().min(1)}),J({...pM,type:X(`detail.patch`),run_id:K().min(1),ops:q(fM)}),J({...pM,type:X(`timeline.patch`),run_id:K().min(1),scope:X(`run`),ops:q(fM)}),J({...pM,type:X(`timeline.patch`),run_id:K().min(1),scope:X(`node`),node:K().min(1),ops:q(fM)}),J({...pM,type:X(`channel.patch`),run_id:K().min(1),ops:q(fM)}),J({...pM,type:X(`human-items.patch`),ops:q(fM)})]),_M=[`reset`,`sidebar.snapshot`,`run.changed`,`run.removed`,`detail.patch`,`timeline.patch`,`channel.patch`,`human-items.patch`],vM=J({subscription:aM,view:sM,initial:wO([J({type:X(`snapshot`),snapshot:uM}),hM])}),yM=`api_version,telemetry_schema_version,observed_at,progress,run.run_id,run.state,run.phase,run.last_event,run.timing.wall_seconds,run.nodes.*.node,run.nodes.*.status,run.nodes.*.outcome,run.nodes.*.failure,run.turns,graph.last_seq,graph.run_id,graph.plan.goal,graph.plan.tasks.*.id,graph.plan.tasks.*.kind,graph.plan.tasks.*.name,graph.plan.tasks.*.deps,graph.plan.tasks.*.repo,graph.plan.tasks.*.steps,graph.node_status,graph.node_gated_by,graph.node_control,graph.result,graph.node_results.*.blocked_by,graph.node_results.*.awaiting,graph.node_results.*.outcome,graph.node_results.*.error,graph.node_results.*.detail,node_details`.split(`,`);function bM(e){let t=new Map;for(let n of e){let e=t;for(let t of n.split(`.`)){let n=e.get(t);n===void 0&&(n=new Map,e.set(t,n)),e=n}}return t}bM(yM),J({code:X(`subscription-unavailable`),reason:Y([`expired`,`server-restarted`,`unknown`])});var xM=class extends Error{constructor(e){super(e),this.name=`PatchError`}};function SM(e,t){let n=e;for(let e of t)n=CM(n,e);return n}function CM(e,t){let n=t.p;if(`a`in t)return TM(e,n,e=>{if(!Array.isArray(e))throw new xM(`an append's path names an array`);return[...e,...t.a]});let r=n.at(-1);if(r===void 0)throw new xM(`the root is never replaced or deleted`);return TM(e,n.slice(0,-1),e=>{if(`v`in t){if(Array.isArray(e)&&typeof r==`number`){if(r>=e.length)throw new xM(`a set replaces an existing element`);let n=[...e];return n[r]=t.v,n}if(wM(e)&&typeof r==`string`)return{...e,[r]:t.v};throw new xM(`a set's path does not match its parent`)}if(wM(e)&&typeof r==`string`){if(!Object.hasOwn(e,r))throw new xM(`a deletion names an existing member`);let t={...e};return delete t[r],t}throw new xM(`a deletion names an object member`)})}function wM(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function TM(e,t,n){let[r,...i]=t;if(r===void 0)return n(e);if(Array.isArray(e)&&typeof r==`number`){if(r>=e.length)throw new xM(`an index on the path does not exist`);let t=[...e];return t[r]=TM(e[r],i,n),t}if(wM(e)&&typeof r==`string`){if(!Object.hasOwn(e,r))throw new xM(`a parent on the path does not exist`);return{...e,[r]:TM(e[r],i,n)}}throw new xM(`a path step does not match its parent`)}var EM=1e3;function DM(e){let t=e.lastIndexOf(`:`);return{epoch:e.slice(0,t),seq:BigInt(e.slice(t+1))}}var OM=class{#e;#t;#n;#r;#i;#a;#o;#s;#c=!1;#l=!1;#u=0;#d;#f=()=>{this.#x(),this.#t.onDisconnected?.()};#p=()=>this.#y();#m=()=>this.close(!0);constructor(e,t){this.#e=e,this.#t=t,this.#n=t.view,this.#d=t.paused??!1,globalThis.addEventListener?.(`offline`,this.#f),globalThis.addEventListener?.(`online`,this.#p),globalThis.addEventListener?.(`pagehide`,this.#m);let n=t.initial;if(n===void 0)this.#h({});else{let e=++this.#u;queueMicrotask(()=>{e===this.#u&&!this.#c&&this.#g(n)})}}get view(){return this.#n}change(e){this.#c||RM(e,this.#n)||(this.#n=e,this.#l=!1,this.#x(),this.#h(this.#r===void 0?{}:{replaces:this.#r}))}pause(){this.#d||(this.#d=!0,this.#x())}resume(){this.#d&&(this.#d=!1,this.#y())}close(e=!1){this.#c||(this.#c=!0,this.#u+=1,globalThis.removeEventListener?.(`offline`,this.#f),globalThis.removeEventListener?.(`online`,this.#p),globalThis.removeEventListener?.(`pagehide`,this.#m),this.#x(),this.#r!==void 0&&this.#e.retire(this.#r,e).catch(()=>void 0))}async#h(e){let t=++this.#u,n;try{n=await this.#e.subscribe({view:this.#n,...e})}catch(e){if(t!==this.#u)return;this.#t.onError?.(BM(e));return}if(t!==this.#u||this.#c){this.#e.retire(n.subscription).catch(()=>void 0);return}this.#_(n)}#g(e){let t;try{t=this.#e.parseSubscribed(e)}catch(e){this.#t.onError?.(Error(`The first answer failed contract validation: ${zM(e)}`));return}this.#_(t)}#_(e){let t=LM(this.#n,e);if(t!==void 0){this.#w(Error(`The subscription answered ${t}`));return}this.#r=e.subscription;let n=e.initial;if(n.type===`snapshot`)this.#v(n.snapshot,{kind:`snapshot`});else if(n.subscription!==e.subscription||n.snapshot.id!==n.id){this.#w(Error(`A recreated subscription's reset is not its own snapshot`));return}else this.#v(n.snapshot,{kind:`reset`,reason:n.reason});this.#y()}#v(e,t){this.#i={sidebar:e.sidebar??this.#i?.sidebar,visible:e.visible,applied:e.id},this.#t.onState(this.#i,t)}#y(){if(this.#c||this.#l||this.#d||this.#a!==void 0||this.#r===void 0||this.#i===void 0)return;this.#o!==void 0&&clearTimeout(this.#o),this.#o=void 0;let e=this.#e.url(Ik.events);e.searchParams.set(Lk.subscription,this.#r),e.searchParams.set(Lk.after,this.#i.applied);let t=this.#e.open(e);this.#a=t;let n=!1;this.#s=setTimeout(()=>{this.#a===t&&this.#w(new ae(`Opening the live stream`))},M),t.onopen=()=>{this.#b(),n&&this.#t.onConnected?.(),n=!0};for(let e of _M)t.addEventListener(e,n=>{this.#a===t&&n instanceof MessageEvent&&typeof n.data==`string`&&(this.#b(),this.#C(n.data,e,n.lastEventId))});t.onerror=()=>{this.#a===t&&(this.#t.onDisconnected?.(),t.readyState===2&&(this.#a=void 0,this.#o=setTimeout(()=>{this.#o=void 0,!(this.#c||this.#l||this.#i===void 0)&&this.#h({resume:this.#i.applied})},EM)))}}#b(){this.#s!==void 0&&clearTimeout(this.#s),this.#s=void 0}#x(){this.#b(),this.#a?.close(),this.#a=void 0,this.#o!==void 0&&clearTimeout(this.#o),this.#o=void 0}#S(){this.#x(),this.#y()}#C(e,t,n){let r=this.#i;if(r===void 0||this.#l)return;let i;try{i=gM.parse(JSON.parse(e))}catch(e){this.#w(Error(`A frame failed contract validation: ${zM(e)}`));return}if(i.subscription!==this.#r)return;if(i.type!==t||i.id!==n){this.#w(Error(`A frame's SSE event or id is not the frame's own type and id`));return}let a=DM(r.applied),o=DM(i.id);if(o.epoch===a.epoch&&o.seq<=a.seq)return;if(i.type===`reset`){if(i.snapshot.id!==i.id){this.#w(Error(`A reset frame names a snapshot other than itself`));return}let e=IM(this.#n,i.snapshot);if(e!==void 0){this.#w(Error(`A reset frame re-sent ${e}`));return}this.#v(i.snapshot,{kind:`reset`,reason:i.reason});return}if(o.epoch!==a.epoch){this.#w(Error(`A frame names another server's epoch`));return}if(i.base!==r.applied){this.#S();return}let s;try{s={...kM(r,i,this.#n),applied:i.id}}catch(e){this.#w(Error(`A patch could not be applied: ${zM(e)}`));return}this.#i=s,this.#t.onState(s,{kind:`frame`,frame:i})}#w(e){this.#l=!0,this.#x(),this.#t.onError?.(e)}};function kM(e,t,n){switch(t.type){case`sidebar.snapshot`:return{sidebar:t.rows,visible:e.visible};case`run.changed`:{let n=e.sidebar??[],r=n.findIndex(e=>e.id===t.row.id);return{sidebar:r===-1?[...n,t.row]:n.map((e,n)=>n===r?t.row:e),visible:e.visible}}case`run.removed`:return{sidebar:e.sidebar?.filter(e=>e.id!==t.run_id),visible:e.visible};default:return{sidebar:e.sidebar,visible:jM(e.visible,t,n)}}}function AM(e,t,n,r){let i=e.safeParse(SM(t,n));if(!i.success)throw Error(`the patched ${r} failed contract validation`);return i.data}function jM(e,t,n){let r=e=>Error(`a ${t.type} for ${e} this tab does not show`);if(t.type===`human-items.patch`){if(e.type!==`human-items`)throw r(`human items`);let i=AM(Mk,e,t.ops,`human items`);if(FM(n,i))throw Error(`a human-items.patch moved its detail to another item`);return i}if(e.type===`sidebar`||e.type===`human-items`||e.run_id!==t.run_id)throw r(`a run`);let i=n=>{if(n.run_id!==e.run_id)throw Error(`a ${t.type} moved its payload to another run`);return n};switch(t.type){case`detail.patch`:return{...e,detail:(()=>{let n=AM($A,e.detail,t.ops,`detail`);return i(n.run),n})()};case`timeline.patch`:if(e.type!==`timeline`||e.scope!==t.scope)throw r(`a timeline`);if(t.scope===`node`&&(e.scope!==`node`||e.node!==t.node))throw r(`a node's timeline`);return{...e,timeline:i(AM(hj,e.timeline,t.ops,`timeline`))};case`channel.patch`:if(e.type!==`channel`)throw r(`a channel`);return{...e,channel:i(AM(zj,e.channel,t.ops,`channel`))}}}function MM(e){return[e.type,e.run_id,e.scope,e.node].join(`\0`)}function NM(e){return Array.isArray(e)?e.map(NM):typeof e==`object`&&e?Object.fromEntries(Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,NM(t)])):e}function PM(e){if(e!==void 0){if(typeof e!=`string`)return JSON.stringify(NM(e));if(!e.startsWith(`{`))return e;try{return JSON.stringify(NM(JSON.parse(e)))}catch{return e}}}function FM(e,t){return t.detail===null?!1:!(`item`in e)||t.detail.item.id!==e.item}function IM(e,t){let n=t.visible;if(MM(n)!==MM(e))return`the state of another view`;if(n.type===`human-items`)return FM(e,n)?`the detail of another item`:void 0;if(n.type!==`sidebar`)return[n.detail.run.run_id,`timeline`in n?n.timeline.run_id:n.run_id,`channel`in n?n.channel.run_id:n.run_id].every(e=>e===n.run_id)?void 0:`a payload of another run`}function LM(e,t){if(MM(t.view)!==MM(e))return`another view`;let n=e=>`filter`in e?e.filter:void 0;if(PM(n(t.view))!==PM(n(e)))return`another filter`;let r=e=>`item`in e?e.item:void 0;return r(t.view)===r(e)?IM(e,t.initial.snapshot):`another item`}function RM(e,t){return JSON.stringify(e)===JSON.stringify(t)}function zM(e){return e instanceof Error?e.message:String(e)}function BM(e){return e instanceof Error?e:Error(String(e))}var VM=class extends Error{status;code;constructor(e,t,n,r){super(e,r),this.status=t,this.code=n,this.name=`TelemetryClientError`}},HM=50,UM=class{#e;#t;#n;constructor(e,t={}){this.#e=new URL(e),this.#t=t.fetch??globalThis.fetch,this.#n=t.eventSource}async listRuns(e=!1,t,n=HM){let r=this.#r(Ik.runs);return r.searchParams.set(Lk.includeSettled,String(e)),r.searchParams.set(Lk.limit,String(n)),t!==void 0&&r.searchParams.set(Lk.cursor,t),this.#a(r,uA.parse)}async selectRuns(e){if(e.length===0)throw new VM(`Invalid selection`);for(let t of e)if(KM(t,`run ID`),t.includes(`,`))throw new VM(`Invalid run ID`);let t=this.#r(Ik.runs);return t.searchParams.set(Lk.select,e.join(`,`)),this.#a(t,uA.parse)}async getRun(e,t={}){KM(e,`run ID`);let n=this.#r(Ik.run(e));return t.includeConversations!==void 0&&n.searchParams.set(Lk.includeConversations,String(t.includeConversations)),t.filter!==void 0&&n.searchParams.set(Lk.filter,t.filter),this.#a(n,KA.parse)}async getTimeline(e,t,n){KM(e,`run ID`);let r=this.#r(Ik.timeline(e));return n!==void 0&&r.searchParams.set(Lk.filter,n),t===void 0?r.searchParams.set(Lk.scope,Rk.run):(r.searchParams.set(Lk.scope,Rk.node),r.searchParams.set(Lk.node,t)),this.#a(r,hj.parse)}async getConversation(e,t){return KM(e,`run ID`),KM(t,`conversation ID`),this.#a(this.#r(Ik.conversation(e,t)),zA.parse)}async getArtifact(e,t){return KM(e,`run ID`),KM(t,`artifact ID`),this.#a(this.#r(Ik.artifact(e,t)),mj.parse)}async getTimelineEvents(e,t){KM(e,`run ID`),t.node!==void 0&&KM(t.node,`node ID`);let n=this.#r(Ik.timelineEvents(e));n.searchParams.set(Lk.scope,t.scope===`node`&&t.node!==void 0?Rk.node:Rk.run);for(let[e,r]of[[Lk.node,t.node],[Lk.span,t.span],[Lk.cursor,t.cursor],[Lk.from,t.from],[Lk.to,t.to],[Lk.filter,t.filter],[Lk.limit,t.limit===void 0?void 0:String(t.limit)]])r!==void 0&&n.searchParams.set(e,r);return this.#a(n,gj.parse,void 0,`This page of the run's history`)}subscribe(e){e.runId!==void 0&&KM(e.runId,`run ID`),e.after!==void 0&&KM(e.after,`cursor`);let t=this.#r(Ik.events);e.runId!==void 0&&t.searchParams.set(Lk.runId,e.runId),e.after!==void 0&&t.searchParams.set(Lk.after,e.after),e.filter!==void 0&&t.searchParams.set(Lk.filter,e.filter);let n=this.#i(t);for(let t of vj.options)n.addEventListener(t,n=>{try{let r=n,i=JSON.parse(r.data),a=t===`snapshot`?uA.parse(i):yj.parse(i);e.onEvent({id:r.lastEventId,event:t,data:a})}catch(t){e.onError?.(t)}});return n.onerror=t=>e.onError?.(t),{close:()=>n.close()}}live(e){return new OM({subscribe:e=>this.createSubscription(e),retire:(e,t)=>this.retireSubscription(e,t),open:e=>this.#i(e),url:e=>this.#r(e),parseSubscribed:e=>vM.parse(e)},e)}async createSubscription(e){return this.#a(this.#r(Ik.subscriptions),vM.parse,GM(`POST`,e),e.view.type===`sidebar`||e.view.type===`human-items`?`The read of this page`:`The read of this run's history`)}async retireSubscription(e,t=!1){KM(e,`subscription ID`);let n;try{n=await this.#t(this.#r(Ik.subscription(e)),{method:`DELETE`,...t?{keepalive:t}:{}})}catch(e){throw new VM(`Telemetry request failed`,void 0,void 0,{cause:e})}if(!n.ok&&n.status!==204)throw new VM(`Retiring a subscription failed with status ${n.status}`,n.status)}async listProjects(){return this.#a(this.#r(Ik.projects),Sj.parse)}async getProject(e){return KM(e,`project ID`),this.#a(this.#r(Ik.project(e)),Cj.parse)}async getChannel(e){return KM(e,`run ID`),this.#a(this.#r(Ik.channel(e)),zj.parse)}async claimNext(e,t){KM(e,`run ID`);let n=this.#r(Ik.channelNext(e));return t!==void 0&&n.searchParams.set(Lk.filter,t),this.#a(n,Vj.parse,{method:`POST`})}async reply(e,t,n){KM(e,`run ID`);let r=this.#r(Ik.channelReply(e));return n!==void 0&&r.searchParams.set(Lk.correlation,n),this.#a(r,Hj.parse,{method:`POST`,headers:{"content-type":`application/json`},body:t})}async surface(e,t){return KM(e,`run ID`),this.#a(this.#r(Ik.channelSurface(e)),Uj.parse,GM(`POST`,t))}async attest(e,t){return KM(e,`run ID`),this.#a(this.#r(Ik.attest(e)),Hj.parse,GM(`POST`,{reference:t}))}async stop(e,t=!1){return KM(e,`run ID`),this.#a(this.#r(Ik.stop(e)),Wj.parse,GM(`POST`,{force:t}))}async listHumanItems(e={}){let t=this.#r(ok.list);for(let[n,r]of Object.entries(e))r!=null&&t.searchParams.set(n,String(r));return this.#a(t,Ak.parse)}async getHumanItem(e){return KM(e,`human-item ID`),this.#a(this.#r(ok.item(e)),Ek.parse)}async answerHumanItem(e,t){return KM(e,`human-item ID`),this.#a(this.#r(ok.answer(e)),Dk.parse,GM(`POST`,typeof t==`string`?{text:t}:t))}async answerHumanItems(e){return this.#a(this.#r(ok.answers),kk.parse,GM(`POST`,{answers:e}))}async completeHumanItem(e){return KM(e,`human-item ID`),this.#a(this.#r(ok.complete(e)),Dk.parse,GM(`POST`,{}))}async dismissHumanItem(e,t){return KM(e,`human-item ID`),this.#a(this.#r(ok.dismiss(e)),Dk.parse,GM(`POST`,t?.trim()?{reason:t}:{}))}async reopenHumanItem(e){return KM(e,`human-item ID`),this.#a(this.#r(ok.reopen(e)),Dk.parse,GM(`POST`,{}))}async noteHumanItem(e,t){return KM(e,`human-item ID`),this.#a(this.#r(ok.note(e)),Dk.parse,GM(`POST`,{text:t}))}async shutdown(e,t={}){return this.#a(this.#r(Ik.shutdown),Yj.parse,GM(`POST`,{scope:e,...WM(t)}))}async unwatched(){return this.#a(this.#r(Ik.unwatched),Xj.parse)}async host(){return this.#a(this.#r(Ik.host),Qj.parse)}async getStatus(e){return KM(e,`run ID`),this.#a(this.#r(Ik.status(e)),$j.parse)}async getAgents(e){return KM(e,`run ID`),this.#a(this.#r(Ik.agents(e)),rM.parse)}async getNodeAgents(e,t){return KM(e,`run ID`),KM(t,`node ID`),this.#a(this.#r(Ik.nodeAgents(e,t)),rM.parse)}async getProjectAgents(e){return KM(e,`project ID`),this.#a(this.#r(Ik.projectAgents(e)),iM.parse)}#r(e){return new URL(e,this.#e)}#i(e){return(this.#n??(e=>{if(typeof EventSource>`u`)throw new VM(`EventSource is unavailable; provide an eventSource factory`);return new EventSource(e)}))(e.toString())}async#a(e,t,n,r){let i=r===void 0?void 0:new AbortController,a=i===void 0?void 0:setTimeout(()=>i.abort(),M);try{return await this.#o(e,t,{...n,...i===void 0?{}:{signal:i.signal}})}catch(e){throw i?.signal.aborted===!0&&r!==void 0?new VM(new ae(r).message,void 0,`deadline`,{cause:e}):e}finally{a!==void 0&&clearTimeout(a)}}async#o(e,t,n){let r;try{r=await this.#t(e,n)}catch(e){throw new VM(`Telemetry request failed`,void 0,void 0,{cause:e})}let i=await r.json().catch(e=>{throw r.ok?new VM(`Telemetry server returned invalid JSON`,r.status,void 0,{cause:e}):new VM(`Telemetry request failed with status ${r.status}`,r.status,void 0,{cause:e})});if(!r.ok){let e=_j.safeParse(i);throw new VM(e.success?e.data.error.message:`Telemetry request failed with status ${r.status}`,r.status,e.success?e.data.error.code:void 0)}try{return t(i)}catch(e){throw new VM(`Telemetry response failed contract validation`,r.status,void 0,{cause:e})}}};function WM(e){let{grace:t,force:n=!1}=e;if(t===void 0)return{force:n};if(!Number.isSafeInteger(t)||t<0)throw new VM(`Invalid grace: whole seconds, 0 or more`);return{grace:t,force:n}}function GM(e,t){return{method:e,headers:{"content-type":`application/json`},body:JSON.stringify(t)}}function KM(e,t){let n=[...e].some(e=>e.charCodeAt(0)<32);if(e.length===0||n||/[/?#]/u.test(e))throw new VM(`Invalid ${t}`)}function qM({outcome:e,label:t}){if(e===void 0)return null;if(e.kind===`refused`){let n=e.error,r=n instanceof VM?n.code:void 0,i=n instanceof VM?n.status:void 0;return(0,B.jsxs)(zr,{"aria-label":`${t} refused`,variant:`destructive`,children:[(0,B.jsx)(fe,{}),(0,B.jsxs)(Br,{children:[e.title,i!==void 0&&` · ${i}`,r!==void 0&&` ${r}`]}),(0,B.jsx)(Vr,{children:(0,B.jsx)(`pre`,{className:`verb-text`,children:n.message})})]})}return(0,B.jsxs)(zr,{"aria-label":`${t} receipt`,children:[(0,B.jsx)(Ne,{}),(0,B.jsx)(Br,{children:e.title}),(0,B.jsx)(Vr,{children:(0,B.jsx)(`pre`,{className:`verb-text`,children:JSON.stringify(e.payload,null,2)})})]})}async function JM(e,t){try{return{kind:`answered`,title:e,payload:await t()}}catch(t){return{kind:`refused`,title:e,error:t instanceof Error?t:Error(String(t))}}}var YM={Complete:Ne,Failed:Be,Stopped:Qe,Unfinished:ze,"Waiting on you":We,"Driver dead":lt,Idle:Le,Running:qe},XM=e=>e.toLowerCase().replaceAll(/[^a-z]+/gu,`-`);function ZM({state:e,large:t=!1}){let n=e.known?YM[e.word]:Pe,r=t?16:13;return(0,B.jsxs)(`span`,{className:`run-state-group`,"data-large":t,children:[(0,B.jsxs)(`span`,{"aria-label":`Run state`,className:`run-state`,"data-run-state":e.known?XM(e.word):`unknown`,role:`group`,title:e.word,children:[(0,B.jsx)(n,{"aria-label":e.word,role:`img`,size:r}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:e.word})]}),e.failed>0&&(0,B.jsxs)(`span`,{className:`run-failures`,title:`${e.failed} failed nodes`,children:[(0,B.jsx)(Be,{"aria-hidden":`true`,size:r}),e.failed,` failed`]})]})}function QM(e,t,n){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)();return{run:(0,z.useCallback)(async(...r)=>{i(!0);let a=await JM(typeof e==`string`?e:e(...r),()=>t(...r));return o(a),i(!1),a.kind===`answered`&&n?.(),a},[e,t,n]),pending:r,outcome:a}}function $M(e){return/\[[^\]]+\]/.exec(e)?.[0]}function eN({runId:e,control:t,ended:n,state:r}){let{stop:i,stopOpen:a,setStopOpen:o,forceOpen:s,setForceOpen:c,refusal:l}=tN(t),u=l===void 0?void 0:$M(l.message),d=i.outcome,f=i.pending;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`run-actions`,children:[r!==void 0&&(0,B.jsx)(`span`,{className:`run-actions-badge`,children:(0,B.jsx)(ZM,{state:r})}),!n&&(0,B.jsxs)(ui,{"aria-label":`Stop`,disabled:f,onClick:()=>o(!0),size:`sm`,title:`Stop`,type:`button`,variant:`destructive`,children:[(0,B.jsx)(et,{size:14}),(0,B.jsx)(`span`,{className:`run-action-label`,children:`Stop`})]})]}),(0,B.jsx)(Ko,{onOpenChange:o,open:a,children:(0,B.jsxs)(Xo,{children:[(0,B.jsxs)(Zo,{children:[(0,B.jsxs)($o,{children:[`Stop `,e,`?`]}),(0,B.jsx)(es,{children:`The run is stopped as the acting session. A run another session owns is refused, naming its owner.`})]}),(0,B.jsxs)(Qo,{children:[(0,B.jsx)(Jo,{asChild:!0,children:(0,B.jsx)(ui,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsx)(ui,{disabled:f,onClick:()=>void i.run(!1),type:`button`,variant:`destructive`,children:`Stop run`})]})]})}),(0,B.jsx)(Ko,{onOpenChange:c,open:s,children:(0,B.jsxs)(Xo,{children:[(0,B.jsxs)(Zo,{children:[(0,B.jsxs)($o,{children:[`Force-stop `,e,u!==void 0&&`, overriding ${u}`,`?`]}),(0,B.jsxs)(es,{children:[l?.message,` — `,`a forced stop is journalled forced with the owner it overrode.`]})]}),(0,B.jsxs)(Qo,{children:[(0,B.jsx)(Jo,{asChild:!0,children:(0,B.jsx)(ui,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsxs)(ui,{disabled:f,onClick:()=>void i.run(!0),type:`button`,variant:`destructive`,children:[`Force stop`,u!==void 0&&`, overriding ${u}`]})]})]})}),d!==void 0&&(0,B.jsxs)(`div`,{className:`run-outcomes`,children:[(0,B.jsx)(qM,{label:`Stop`,outcome:d}),l!==void 0&&(0,B.jsx)(`div`,{className:`composer-actions`,children:(0,B.jsx)(ui,{onClick:()=>c(!0),size:`sm`,type:`button`,variant:`destructive`,children:`Force stop…`})})]})]})}function tN(e){let[t,n]=(0,z.useState)(!1),[r,i]=(0,z.useState)(!1),a=QM(e=>e?`Forced stop`:`Stop`,(0,z.useCallback)(async t=>{try{return await e.stop(t)}finally{n(!1),i(!1)}},[e.stop]));return{stop:a,stopOpen:t,setStopOpen:n,forceOpen:r,setForceOpen:i,refusal:a.outcome?.kind===`refused`&&a.outcome.error instanceof VM&&a.outcome.error.code===`not_owner`?a.outcome.error:void 0}}function nN(e,t,n){let[r,i]=(0,z.useState)({}),a=(0,z.useRef)({key:e});(0,z.useEffect)(()=>{a.current.key=e},[e]),(0,z.useEffect)(()=>{if(e===void 0)return;let n=a.current.out;if(n?.key===e){n.again=!0;return}let r=()=>{let n={key:e,again:!1};a.current.out=n;let o=t=>{a.current.out===n&&(a.current.out=void 0),a.current.key===e&&(t(),n.again&&r())};t().then(t=>o(()=>i({key:e,value:t}))).catch(t=>o(()=>i(n=>({...n.key===e?n:{},key:e,error:rN(t)}))))};r()},[e,n]);let o=r.key===e?r:void 0;return{value:o?.value,error:o?.error,loading:e!==void 0&&o?.value===void 0&&o?.error===void 0}}function rN(e){return e instanceof Error?e:Error(String(e))}function iN(e,t){let[n,r]=(0,z.useState)(0),i=(0,z.useCallback)(()=>r(e=>e+1),[]);return{status:nN(t,()=>e.getStatus(t??``),n),stop:(0,z.useCallback)(async n=>{try{return await e.stop(t??``,n)}finally{i()}},[e,t,i]),reread:i}}function aN(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=aN(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var oN={value:()=>{}};function sN(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new cN(n)}function cN(e){this._=e}function lN(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}cN.prototype=sN.prototype={constructor:cN,on:function(e,t){var n=this._,r=lN(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=uN(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=dN(n[i],e.name,t);else if(t==null)for(i in n)n[i]=dN(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new cN(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function uN(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function dN(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=oN,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var fN={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function pN(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),fN.hasOwnProperty(t)?{space:fN[t],local:e}:e}function mN(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function hN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function gN(e){var t=pN(e);return(t.local?hN:mN)(t)}function _N(){}function vN(e){return e==null?_N:function(){return this.querySelector(e)}}function yN(e){typeof e!=`function`&&(e=vN(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new sF(r,this._parents)}function bN(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xN(){return[]}function SN(e){return e==null?xN:function(){return this.querySelectorAll(e)}}function CN(e){return function(){return bN(e.apply(this,arguments))}}function wN(e){e=typeof e==`function`?CN(e):SN(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new sF(r,i)}function TN(e){return function(){return this.matches(e)}}function EN(e){return function(t){return t.matches(e)}}var DN=Array.prototype.find;function ON(e){return function(){return DN.call(this.children,e)}}function kN(){return this.firstElementChild}function AN(e){return this.select(e==null?kN:ON(typeof e==`function`?e:EN(e)))}var jN=Array.prototype.filter;function MN(){return Array.from(this.children)}function NN(e){return function(){return jN.call(this.children,e)}}function PN(e){return this.selectAll(e==null?MN:NN(typeof e==`function`?e:EN(e)))}function FN(e){typeof e!=`function`&&(e=TN(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new sF(r,this._parents)}function IN(e){return Array(e.length)}function LN(){return new sF(this._enter||this._groups.map(IN),this._parents)}function RN(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}RN.prototype={constructor:RN,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function zN(e){return function(){return e}}function BN(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new RN(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function VN(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new RN(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function HN(e){return e.__data__}function UN(e,t){if(!arguments.length)return Array.from(this,HN);var n=t?VN:BN,r=this._parents,i=this._groups;typeof e!=`function`&&(e=zN(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=WN(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new sF(o,r),o._enter=s,o._exit=c,o}function WN(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function GN(){return new sF(this._exit||this._groups.map(IN),this._parents)}function KN(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function qN(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new sF(s,this._parents)}function JN(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function YN(e){e||=XN;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new sF(i,this._parents).order()}function XN(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function ZN(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function QN(){return Array.from(this)}function $N(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function eP(){let e=0;for(let t of this)++e;return e}function tP(){return!this.node()}function nP(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function rP(e){return function(){this.removeAttribute(e)}}function iP(e){return function(){this.removeAttributeNS(e.space,e.local)}}function aP(e,t){return function(){this.setAttribute(e,t)}}function oP(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function sP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function cP(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function lP(e,t){var n=pN(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?iP:rP:typeof t==`function`?n.local?cP:sP:n.local?oP:aP)(n,t))}function uP(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function dP(e){return function(){this.style.removeProperty(e)}}function fP(e,t,n){return function(){this.style.setProperty(e,t,n)}}function pP(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function mP(e,t,n){return arguments.length>1?this.each((t==null?dP:typeof t==`function`?pP:fP)(e,t,n??``)):hP(this.node(),e)}function hP(e,t){return e.style.getPropertyValue(t)||uP(e).getComputedStyle(e,null).getPropertyValue(t)}function gP(e){return function(){delete this[e]}}function _P(e,t){return function(){this[e]=t}}function vP(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function yP(e,t){return arguments.length>1?this.each((t==null?gP:typeof t==`function`?vP:_P)(e,t)):this.node()[e]}function bP(e){return e.trim().split(/^|\s+/)}function xP(e){return e.classList||new SP(e)}function SP(e){this._node=e,this._names=bP(e.getAttribute(`class`)||``)}SP.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function CP(e,t){for(var n=xP(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function wP(e,t){for(var n=xP(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function TP(e){return function(){CP(this,e)}}function EP(e){return function(){wP(this,e)}}function DP(e,t){return function(){(t.apply(this,arguments)?CP:wP)(this,e)}}function OP(e,t){var n=bP(e+``);if(arguments.length<2){for(var r=xP(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?DP:t?TP:EP)(n,t))}function kP(){this.textContent=``}function AP(e){return function(){this.textContent=e}}function jP(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function MP(e){return arguments.length?this.each(e==null?kP:(typeof e==`function`?jP:AP)(e)):this.node().textContent}function NP(){this.innerHTML=``}function PP(e){return function(){this.innerHTML=e}}function FP(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function IP(e){return arguments.length?this.each(e==null?NP:(typeof e==`function`?FP:PP)(e)):this.node().innerHTML}function LP(){this.nextSibling&&this.parentNode.appendChild(this)}function RP(){return this.each(LP)}function zP(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BP(){return this.each(zP)}function VP(e){var t=typeof e==`function`?e:gN(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function HP(){return null}function UP(e,t){var n=typeof e==`function`?e:gN(e),r=t==null?HP:typeof t==`function`?t:vN(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function WP(){var e=this.parentNode;e&&e.removeChild(this)}function GP(){return this.each(WP)}function KP(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qP(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function JP(e){return this.select(e?qP:KP)}function YP(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function XP(e){return function(t){e.call(this,t,this.__data__)}}function ZP(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function QP(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function $P(e,t,n){return function(){var r=this.__on,i,a=XP(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function eF(e,t,n){var r=ZP(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?$P:QP,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function tF(e,t,n){var r=uP(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function nF(e,t){return function(){return tF(this,e,t)}}function rF(e,t){return function(){return tF(this,e,t.apply(this,arguments))}}function iF(e,t){return this.each((typeof t==`function`?rF:nF)(e,t))}function*aF(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var oF=[null];function sF(e,t){this._groups=e,this._parents=t}function cF(){return new sF([[document.documentElement]],oF)}function lF(){return this}sF.prototype=cF.prototype={constructor:sF,select:yN,selectAll:wN,selectChild:AN,selectChildren:PN,filter:FN,data:UN,enter:LN,exit:GN,join:KN,merge:qN,selection:lF,order:JN,sort:YN,call:ZN,nodes:QN,node:$N,size:eP,empty:tP,each:nP,attr:lP,style:mP,property:yP,classed:OP,text:MP,html:IP,raise:RP,lower:BP,append:VP,insert:UP,remove:GP,clone:JP,datum:YP,on:eF,dispatch:iF,[Symbol.iterator]:aF};function uF(e){return typeof e==`string`?new sF([[document.querySelector(e)]],[document.documentElement]):new sF([[e]],oF)}function dF(e){let t;for(;t=e.sourceEvent;)e=t;return e}function fF(e,t){if(e=dF(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var pF={passive:!1},mF={capture:!0,passive:!1};function hF(e){e.stopImmediatePropagation()}function gF(e){e.preventDefault(),e.stopImmediatePropagation()}function _F(e){var t=e.document.documentElement,n=uF(e).on(`dragstart.drag`,gF,mF);`onselectstart`in t?n.on(`selectstart.drag`,gF,mF):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function vF(e,t){var n=e.document.documentElement,r=uF(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,gF,mF),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var yF=e=>()=>e;function bF(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}bF.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function xF(e){return!e.ctrlKey&&!e.button}function SF(){return this.parentNode}function CF(e,t){return t??{x:e.x,y:e.y}}function wF(){return navigator.maxTouchPoints||`ontouchstart`in this}function TF(){var e=xF,t=SF,n=CF,r=wF,i={},a=sN(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,pF).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!(u||!e.call(this,n,r))){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(uF(n.view).on(`mousemove.drag`,m,mF).on(`mouseup.drag`,h,mF),_F(n.view),hF(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(gF(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){uF(e.view).on(`mousemove.drag mouseup.drag`,null),vF(e.view,l),gF(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r)){var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s,c;for(s=0;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(hF(n),c(`start`,n,i[s]))}}function _(e){var t=e.changedTouches,n=t.length,r,a;for(r=0;r<n;++r)(a=i[t[r].identifier])&&(gF(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(hF(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=fF(l||r,t),p,m,h;if((h=n.call(e,new bF(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=fF(l||a,t),_=o;break}u.call(r,e,new bF(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:yF(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:yF(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:yF(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:yF(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function EF(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function DF(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function OF(){}var kF=.7,AF=1/kF,jF=`\\s*([+-]?\\d+)\\s*`,MF=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,NF=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,PF=/^#([0-9a-f]{3,8})$/,FF=RegExp(`^rgb\\(${jF},${jF},${jF}\\)$`),IF=RegExp(`^rgb\\(${NF},${NF},${NF}\\)$`),LF=RegExp(`^rgba\\(${jF},${jF},${jF},${MF}\\)$`),RF=RegExp(`^rgba\\(${NF},${NF},${NF},${MF}\\)$`),zF=RegExp(`^hsl\\(${MF},${NF},${NF}\\)$`),BF=RegExp(`^hsla\\(${MF},${NF},${NF},${MF}\\)$`),VF={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};EF(OF,KF,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:HF,formatHex:HF,formatHex8:UF,formatHsl:WF,formatRgb:GF,toString:GF});function HF(){return this.rgb().formatHex()}function UF(){return this.rgb().formatHex8()}function WF(){return aI(this).formatHsl()}function GF(){return this.rgb().formatRgb()}function KF(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=PF.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?qF(t):n===3?new ZF(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?JF(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?JF(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=FF.exec(e))?new ZF(t[1],t[2],t[3],1):(t=IF.exec(e))?new ZF(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=LF.exec(e))?JF(t[1],t[2],t[3],t[4]):(t=RF.exec(e))?JF(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=zF.exec(e))?iI(t[1],t[2]/100,t[3]/100,1):(t=BF.exec(e))?iI(t[1],t[2]/100,t[3]/100,t[4]):VF.hasOwnProperty(e)?qF(VF[e]):e===`transparent`?new ZF(NaN,NaN,NaN,0):null}function qF(e){return new ZF(e>>16&255,e>>8&255,e&255,1)}function JF(e,t,n,r){return r<=0&&(e=t=n=NaN),new ZF(e,t,n,r)}function YF(e){return e instanceof OF||(e=KF(e)),e?(e=e.rgb(),new ZF(e.r,e.g,e.b,e.opacity)):new ZF}function XF(e,t,n,r){return arguments.length===1?YF(e):new ZF(e,t,n,r??1)}function ZF(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}EF(ZF,XF,DF(OF,{brighter(e){return e=e==null?AF:AF**+e,new ZF(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?kF:kF**+e,new ZF(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ZF(nI(this.r),nI(this.g),nI(this.b),tI(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:QF,formatHex:QF,formatHex8:$F,formatRgb:eI,toString:eI}));function QF(){return`#${rI(this.r)}${rI(this.g)}${rI(this.b)}`}function $F(){return`#${rI(this.r)}${rI(this.g)}${rI(this.b)}${rI((isNaN(this.opacity)?1:this.opacity)*255)}`}function eI(){let e=tI(this.opacity);return`${e===1?`rgb(`:`rgba(`}${nI(this.r)}, ${nI(this.g)}, ${nI(this.b)}${e===1?`)`:`, ${e})`}`}function tI(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nI(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rI(e){return e=nI(e),(e<16?`0`:``)+e.toString(16)}function iI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new sI(e,t,n,r)}function aI(e){if(e instanceof sI)return new sI(e.h,e.s,e.l,e.opacity);if(e instanceof OF||(e=KF(e)),!e)return new sI;if(e instanceof sI)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new sI(o,s,c,e.opacity)}function oI(e,t,n,r){return arguments.length===1?aI(e):new sI(e,t,n,r??1)}function sI(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}EF(sI,oI,DF(OF,{brighter(e){return e=e==null?AF:AF**+e,new sI(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?kF:kF**+e,new sI(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new ZF(uI(e>=240?e-240:e+120,i,r),uI(e,i,r),uI(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new sI(cI(this.h),lI(this.s),lI(this.l),tI(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=tI(this.opacity);return`${e===1?`hsl(`:`hsla(`}${cI(this.h)}, ${lI(this.s)*100}%, ${lI(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function cI(e){return e=(e||0)%360,e<0?e+360:e}function lI(e){return Math.max(0,Math.min(1,e||0))}function uI(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var dI=e=>()=>e;function fI(e,t){return function(n){return e+n*t}}function pI(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function mI(e){return(e=+e)==1?hI:function(t,n){return n-t?pI(t,n,e):dI(isNaN(t)?n:t)}}function hI(e,t){var n=t-e;return n?fI(e,n):dI(isNaN(e)?t:e)}var gI=(function e(t){var n=mI(t);function r(e,t){var r=n((e=XF(e)).r,(t=XF(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=hI(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function _I(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function vI(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function yI(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=OI(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function bI(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xI(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function SI(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=OI(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var CI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,wI=new RegExp(CI.source,`g`);function TI(e){return function(){return e}}function EI(e){return function(t){return e(t)+``}}function DI(e,t){var n=CI.lastIndex=wI.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=CI.exec(e))&&(i=wI.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:xI(r,i)})),n=wI.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?EI(c[0].x):TI(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function OI(e,t){var n=typeof t,r;return t==null||n===`boolean`?dI(t):(n===`number`?xI:n===`string`?(r=KF(t))?(t=r,gI):DI:t instanceof KF?gI:t instanceof Date?bI:vI(t)?_I:Array.isArray(t)?yI:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?SI:xI)(e,t)}var kI=180/Math.PI,AI={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function jI(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*kI,skewX:Math.atan(c)*kI,scaleX:o,scaleY:s}}var MI;function NI(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?AI:jI(t.a,t.b,t.c,t.d,t.e,t.f)}function PI(e){return e==null||(MI||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),MI.setAttribute(`transform`,e),!(e=MI.transform.baseVal.consolidate()))?AI:(e=e.matrix,jI(e.a,e.b,e.c,e.d,e.e,e.f))}function FI(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:xI(e,i)},{i:c-2,x:xI(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:xI(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:xI(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:xI(e,n)},{i:s-2,x:xI(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var II=FI(NI,`px, `,`px)`,`deg)`),LI=FI(PI,`, `,`)`,`)`),RI=1e-12;function zI(e){return((e=Math.exp(e))+1/e)/2}function BI(e){return((e=Math.exp(e))-1/e)/2}function VI(e){return((e=Math.exp(2*e))-1)/(e+1)}var HI=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<RI)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=zI(y),c=s/(n*g)*(i*VI(t*r+y)-BI(y));return[a+c*d,o+c*f,s*i/zI(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),UI=0,WI=0,GI=0,KI=1e3,qI,JI,YI=0,XI=0,ZI=0,QI=typeof performance==`object`&&performance.now?performance:Date,$I=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eL(){return XI||=($I(tL),QI.now()+ZI)}function tL(){XI=0}function nL(){this._call=this._time=this._next=null}nL.prototype=rL.prototype={constructor:nL,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?eL():+n)+(t==null?0:+t),!this._next&&JI!==this&&(JI?JI._next=this:qI=this,JI=this),this._call=e,this._time=n,cL()},stop:function(){this._call&&(this._call=null,this._time=1/0,cL())}};function rL(e,t,n){var r=new nL;return r.restart(e,t,n),r}function iL(){eL(),++UI;for(var e=qI,t;e;)(t=XI-e._time)>=0&&e._call.call(void 0,t),e=e._next;--UI}function aL(){XI=(YI=QI.now())+ZI,UI=WI=0;try{iL()}finally{UI=0,sL(),XI=0}}function oL(){var e=QI.now(),t=e-YI;t>KI&&(ZI-=t,YI=e)}function sL(){for(var e,t=qI,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:qI=n);JI=e,cL(r)}function cL(e){UI||(WI&&=clearTimeout(WI),e-XI>24?(e<1/0&&(WI=setTimeout(aL,e-QI.now()-ZI)),GI&&=clearInterval(GI)):(GI||=(YI=QI.now(),setInterval(oL,KI)),UI=1,$I(aL)))}function lL(e,t,n){var r=new nL;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var uL=sN(`start`,`end`,`cancel`,`interrupt`),dL=[];function fL(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;gL(e,n,{name:t,index:r,group:i,on:uL,tween:dL,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function pL(e,t){var n=hL(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function mL(e,t){var n=hL(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function hL(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function gL(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=rL(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return lL(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(lL(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function _L(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function vL(e){return this.each(function(){_L(this,e)})}function yL(e,t){var n,r;return function(){var i=mL(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function bL(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=mL(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function xL(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=hL(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?yL:bL)(n,e,t))}function SL(e,t,n){var r=e._id;return e.each(function(){var e=mL(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return hL(e,r).value[t]}}function CL(e,t){var n;return(typeof t==`number`?xI:t instanceof KF?gI:(n=KF(t))?(t=n,gI):DI)(e,t)}function wL(e){return function(){this.removeAttribute(e)}}function TL(e){return function(){this.removeAttributeNS(e.space,e.local)}}function EL(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function DL(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function OL(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function kL(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function AL(e,t){var n=pN(e),r=n===`transform`?LI:CL;return this.attrTween(e,typeof t==`function`?(n.local?kL:OL)(n,r,SL(this,`attr.`+e,t)):t==null?(n.local?TL:wL)(n):(n.local?DL:EL)(n,r,t))}function jL(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ML(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function NL(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ML(e,i)),n}return i._value=t,i}function PL(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&jL(e,i)),n}return i._value=t,i}function FL(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=pN(e);return this.tween(n,(r.local?NL:PL)(r,t))}function IL(e,t){return function(){pL(this,e).delay=+t.apply(this,arguments)}}function LL(e,t){return t=+t,function(){pL(this,e).delay=t}}function RL(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?IL:LL)(t,e)):hL(this.node(),t).delay}function zL(e,t){return function(){mL(this,e).duration=+t.apply(this,arguments)}}function BL(e,t){return t=+t,function(){mL(this,e).duration=t}}function VL(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?zL:BL)(t,e)):hL(this.node(),t).duration}function HL(e,t){if(typeof t!=`function`)throw Error();return function(){mL(this,e).ease=t}}function UL(e){var t=this._id;return arguments.length?this.each(HL(t,e)):hL(this.node(),t).ease}function WL(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();mL(this,e).ease=n}}function GL(e){if(typeof e!=`function`)throw Error();return this.each(WL(this._id,e))}function KL(e){typeof e!=`function`&&(e=TN(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new xR(r,this._parents,this._name,this._id)}function qL(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new xR(o,this._parents,this._name,this._id)}function JL(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function YL(e,t,n){var r,i,a=JL(t)?pL:mL;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function XL(e,t){var n=this._id;return arguments.length<2?hL(this.node(),n).on.on(e):this.each(YL(n,e,t))}function ZL(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function QL(){return this.on(`end.remove`,ZL(this._id))}function $L(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=vN(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,fL(l[f],t,n,f,l,hL(u,n)));return new xR(a,this._parents,t,n)}function eR(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=SN(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=hL(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&fL(p,t,n,h,f,m);a.push(f),o.push(u)}return new xR(a,o,t,n)}var tR=cF.prototype.constructor;function nR(){return new tR(this._groups,this._parents)}function rR(e,t){var n,r,i;return function(){var a=hP(this,e),o=(this.style.removeProperty(e),hP(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function iR(e){return function(){this.style.removeProperty(e)}}function aR(e,t,n){var r,i=n+``,a;return function(){var o=hP(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function oR(e,t,n){var r,i,a;return function(){var o=hP(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),hP(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function sR(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=mL(this,e),l=c.on,u=c.value[a]==null?s||=iR(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function cR(e,t,n){var r=(e+=``)==`transform`?II:CL;return t==null?this.styleTween(e,rR(e,r)).on(`end.style.`+e,iR(e)):typeof t==`function`?this.styleTween(e,oR(e,r,SL(this,`style.`+e,t))).each(sR(this._id,e)):this.styleTween(e,aR(e,r,t),n).on(`end.style.`+e,null)}function lR(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function uR(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&lR(e,a,n)),r}return a._value=t,a}function dR(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,uR(e,t,n??``))}function fR(e){return function(){this.textContent=e}}function pR(e){return function(){var t=e(this);this.textContent=t??``}}function mR(e){return this.tween(`text`,typeof e==`function`?pR(SL(this,`text`,e)):fR(e==null?``:e+``))}function hR(e){return function(t){this.textContent=e.call(this,t)}}function gR(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&hR(r)),t}return r._value=e,r}function _R(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,gR(e))}function vR(){for(var e=this._name,t=this._id,n=CR(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=hL(c,t);fL(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new xR(r,this._parents,e,n)}function yR(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=mL(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var bR=0;function xR(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function SR(e){return cF().transition(e)}function CR(){return++bR}var wR=cF.prototype;xR.prototype=SR.prototype={constructor:xR,select:$L,selectAll:eR,selectChild:wR.selectChild,selectChildren:wR.selectChildren,filter:KL,merge:qL,selection:nR,transition:vR,call:wR.call,nodes:wR.nodes,node:wR.node,size:wR.size,empty:wR.empty,each:wR.each,on:XL,attr:AL,attrTween:FL,style:cR,styleTween:dR,text:mR,textTween:_R,remove:QL,tween:xL,delay:RL,duration:VL,ease:UL,easeVarying:GL,end:yR,[Symbol.iterator]:wR[Symbol.iterator]};function TR(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var ER={time:null,delay:0,duration:250,ease:TR};function DR(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function OR(e){var t,n;e instanceof xR?(t=e._id,e=e._name):(t=CR(),(n=ER).time=eL(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&fL(c,e,t,l,o,n||DR(c,t));return new xR(r,this._parents,e,t)}cF.prototype.interrupt=vL,cF.prototype.transition=OR;var kR=e=>()=>e;function AR(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function jR(e,t,n){this.k=e,this.x=t,this.y=n}jR.prototype={constructor:jR,scale:function(e){return e===1?this:new jR(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new jR(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var MR=new jR(1,0,0);NR.prototype=jR.prototype;function NR(e){for(;!e.__zoom;)if(!(e=e.parentNode))return MR;return e.__zoom}function PR(e){e.stopImmediatePropagation()}function FR(e){e.preventDefault(),e.stopImmediatePropagation()}function IR(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function LR(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function RR(){return this.__zoom||MR}function zR(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function BR(){return navigator.maxTouchPoints||`ontouchstart`in this}function VR(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function HR(){var e=IR,t=LR,n=VR,r=zR,i=BR,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=HI,l=sN(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,RR).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,RR),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(MR.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new jR(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new jR(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new jR(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=uF(this.that).datum();l.call(e,this.that,new AR(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=fF(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],_L(this),s.start();FR(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=uF(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=fF(t,i),l=t.clientX,u=t.clientY;_F(t.view),PR(t),a.mouse=[c,this.__zoom.invert(c)],_L(this),a.start();function d(e){if(FR(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=fF(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),vF(e.view,a.moved),FR(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=fF(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);FR(r),s>0?uF(this).transition().duration(s).call(x,d,c,r):uF(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(PR(t),s=0;s<i;++s)c=r[s],l=fF(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),_L(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(FR(e),s=0;s<a;++s)c=i[s],l=fF(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(PR(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=fF(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=uF(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:kR(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:kR(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:kR(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:kR([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var UR={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},WR=[[-1/0,-1/0],[1/0,1/0]],GR=[`Enter`,` `,`Escape`],KR={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},qR;(function(e){e.Strict=`strict`,e.Loose=`loose`})(qR||={});var JR;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(JR||={});var YR;(function(e){e.Partial=`partial`,e.Full=`full`})(YR||={});var XR={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},ZR;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(ZR||={});var QR;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(QR||={});var $;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})($||={});var $R={[$.Left]:$.Right,[$.Right]:$.Left,[$.Top]:$.Bottom,[$.Bottom]:$.Top};function ez(e){return e===null?null:e?`valid`:`invalid`}var tz=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,nz=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),rz=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),iz=(e,t=[0,0])=>{let{width:n,height:r}=Rz(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},az=(e,t={nodeOrigin:[0,0]})=>e.length===0?{x:0,y:0,width:0,height:0}:bz(e.reduce((e,n)=>{let r=typeof n==`string`,i=!t.nodeLookup&&!r?n:void 0;return t.nodeLookup&&(i=r?t.nodeLookup.get(n):rz(n)?n:t.nodeLookup.get(n.id)),vz(e,i?Sz(i,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),oz=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=vz(n,Sz(e)),r=!0)}),r?bz(n):{x:0,y:0,width:0,height:0}},sz=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=wz(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},cz=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function lz(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=Rz(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function uz({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=Fz(oz(lz(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function dz({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent)if(!s)a?.(`005`,UR.error005());else{let e=s.measured.width,t=s.measured.height;e&&t&&(d=[[c,l],[c+e,l+t]])}else s&&Lz(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=Lz(d)?mz(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,UR.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function fz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=cz(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var pz=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),mz=(e={x:0,y:0},t,n)=>({x:pz(e.x,t[0][0],t[1][0]-(n?.width??0)),y:pz(e.y,t[0][1],t[1][1]-(n?.height??0))});function hz(e,t,n){let{width:r,height:i}=Rz(n),{x:a,y:o}=n.internals.positionAbsolute;return mz(e,[[a,o],[a+r,o+i]],t)}var gz=(e,t,n)=>e<t?pz(Math.abs(e-t),1,t)/t:e>n?-pz(Math.abs(e-n),1,t)/t:0,_z=(e,t,n=15,r=40)=>[gz(e.x,r,t.width-r)*n,gz(e.y,r,t.height-r)*n],vz=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),yz=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),bz=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),xz=(e,t=[0,0])=>{let{x:n,y:r}=rz(e)?e.internals.positionAbsolute:iz(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Sz=(e,t=[0,0])=>{let{x:n,y:r}=rz(e)?e.internals.positionAbsolute:iz(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Cz=(e,t)=>bz(vz(yz(e),yz(t))),wz=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Tz=(e,t)=>wz(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Ez=e=>Dz(e.width)&&Dz(e.height)&&Dz(e.x)&&Dz(e.y),Dz=e=>!isNaN(e)&&isFinite(e),Oz=(e,t)=>(e,t)=>{},kz=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Az=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?kz(s,o):s},jz=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function Mz(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Nz(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=Mz(e,n),i=Mz(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=Mz(e.top??e.y??0,n),i=Mz(e.bottom??e.y??0,n),a=Mz(e.left??e.x??0,t),o=Mz(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Pz(e,t,n,r,i,a){let{x:o,y:s}=jz(e,[t,n,r]),{x:c,y:l}=jz({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var Fz=(e,t,n,r,i,a)=>{let o=Nz(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=pz(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=Pz(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},Iz=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function Lz(e){return e!=null&&e!==`parent`}function Rz(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function zz(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Bz(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function Vz(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Hz(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function Uz(e){return{...KR,...e||{}}}function Wz(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=Xz(e),s=Az({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?kz(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var Gz=e=>({width:e.offsetWidth,height:e.offsetHeight}),Kz=e=>e?.getRootNode?.()||window?.document,qz=[`INPUT`,`SELECT`,`TEXTAREA`];function Jz(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?qz.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var Yz=e=>`clientX`in e,Xz=(e,t)=>{let n=Yz(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},Zz=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Gz(t)}})};function Qz({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function $z(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function eB({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case $.Left:return[t-$z(t-r,a),n];case $.Right:return[t+$z(r-t,a),n];case $.Top:return[t,n-$z(n-i,a)];case $.Bottom:return[t,n+$z(i-n,a)]}}function tB({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,curvature:o=.25}){let[s,c]=eB({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=eB({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=Qz({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function nB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function rB({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function iB({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=vz(Sz(e),Sz(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Tz({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},bz(a))>0}var aB=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,oB=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),sB=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,UR.error006()),t;let r=n.getEdgeId||aB,i;return i=tz(e)?{...e}:{...e,id:r(e)},oB(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function cB({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=nB({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var lB={[$.Left]:{x:-1,y:0},[$.Right]:{x:1,y:0},[$.Top]:{x:0,y:-1},[$.Bottom]:{x:0,y:1}},uB=({source:e,sourcePosition:t=$.Bottom,target:n})=>t===$.Left||t===$.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},dB=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function fB({source:e,sourcePosition:t=$.Bottom,target:n,targetPosition:r=$.Top,center:i,offset:a,stepPosition:o}){let s=lB[t],c=lB[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=uB({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=nB({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function pB(e,t,n,r){let i=Math.min(dB(e,t)/2,dB(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function mB({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=fB({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=pB(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function hB(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function gB(e){let{sourceNode:t,targetNode:n}=e;if(!hB(t)||!hB(n))return null;let r=t.internals.handleBounds||_B(t.handles),i=n.internals.handleBounds||_B(n.handles),a=yB(r?.source??[],e.sourceHandle),o=yB(e.connectionMode===qR.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,UR.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||$.Bottom,c=o?.position||$.Top,l=vB(t,a,s),u=vB(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function _B(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function vB(e,t,n=$.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??Rz(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case $.Top:return{x:i+o/2,y:a};case $.Right:return{x:i+o,y:a+s/2};case $.Bottom:return{x:i+o/2,y:a+s};case $.Left:return{x:i,y:a+s/2}}}function yB(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function bB(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function xB(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=bB(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var SB=1e3,CB=10,wB={nodeOrigin:[0,0],nodeExtent:WR,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},TB={...wB,checkEquality:!0};function EB(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function DB(e,t,n){let r=EB(wB,n);for(let n of e.values())if(n.parentId)MB(n,e,t,r);else{let e=mz(iz(n,r.nodeOrigin),Lz(n.extent)?n.extent:r.nodeExtent,Rz(n));n.internals.positionAbsolute=e}}function OB(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function kB(e){return e===`manual`}function AB(e,t,n,r={}){let i=EB(TB,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!kB(i.zIndexMode)?SB:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=mz(iz(u,i.nodeOrigin),Lz(u.extent)?u.extent:i.nodeExtent,Rz(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:OB(u,e),z:NB(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&MB(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function jB(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function MB(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=EB(wB,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}jB(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*CB),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=PB(e,u,o,s,a&&!kB(c)?SB:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function NB(e,t,n){let r=Dz(e.zIndex)?e.zIndex:0;return kB(n)?r:r+(e.selected?t:0)}function PB(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=Rz(e),l=iz(e,n),u=Lz(e.extent)?mz(l,e.extent,c):l,d=mz({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=hz(d,c,t));let f=NB(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function FB(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Cz(a.get(n.parentId)?.expandedRect??xz(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=Rz(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function IB(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=Gz(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=Lz(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=hz(h,s,n))}else m&&(h=mz(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:Zz(`source`,r.nodeElement,p,d,e.id),target:Zz(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&MB(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:xz(g,i)}))}}if(f.length>0){let e=FB(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function LB({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function RB(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function zB(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;RB(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),RB(`target`,s,c,e,i,o),t.set(r.id,r)}}function BB(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:BB(n,t):!1}function VB(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function HB(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!BB(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function UB({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function WB({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=kz(a,t);return{x:o.x-a.x,y:o.y-a.y}}function GB({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=uF(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?yz(oz(s)):null,x=v&&l?WB({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:kz(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=dz({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=UB({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=_z(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=Wz(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=HB(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=UB({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=TF().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=Wz(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=Xz(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=Wz(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=Xz(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=Xz(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=UB({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!VB(t,`.${g}`,v))&&(!_||VB(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function KB(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Tz(i,xz(e))>0&&r.push(e);return r}var qB=250;function JB(e,t,n,r){let i=[],a=1/0,o=KB(e,n,t+qB);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=vB(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function YB(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...vB(o,c,c.position,!0)}:c}function XB(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function ZB(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var QB=()=>!0;function $B(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=QB,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=Kz(e.target),E=0,D,{x:O,y:k}=Xz(e),A=XB(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=YB(i,A,r,c,t);if(!N)return;let P=Xz(e,j),F=!1,I=null,L=!1,R=null;function ee(){if(!u||!j)return;let[e,t]=_z(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(ee)}let te={...N,nodeId:i,type:A,position:N.position},ne=c.get(i),re={inProgress:!0,isValid:null,from:vB(ne,te,$.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:ne,to:P,toHandle:null,toPosition:$R[te.position],toNode:null,pointer:P};function ie(){M=!0,y(re),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&ie();function ae(e){if(!M){let{x:t,y:n}=Xz(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;ie()}if(!x()||!te){oe(e);return}let a=b();P=Xz(e,j),D=JB(Az(P,a,!1,[1,1]),n,c,te),F||=(ee(),!0);let s=eV(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});R=s.handleDomNode,I=s.connection,L=ZB(!!D,s.isValid);let u=c.get(i),f=u?vB(u,te,$.Left,!0):re.from,p={...re,from:f,isValid:L,to:s.toHandle&&L?jz({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:L&&s.toHandle?s.toHandle.position:$R[te.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),re=p}function oe(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||R)&&I&&L&&h?.(I);let{inProgress:t,...n}=re,r={...n,toPosition:re.toHandle?re.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),F=!1,L=!1,I=null,R=null,T.removeEventListener(`mousemove`,ae),T.removeEventListener(`mouseup`,oe),T.removeEventListener(`touchmove`,ae),T.removeEventListener(`touchend`,oe)}}T.addEventListener(`mousemove`,ae),T.addEventListener(`mouseup`,oe),T.addEventListener(`touchmove`,ae),T.addEventListener(`touchend`,oe)}function eV(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=QB,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=Xz(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=XB(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===qR.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=YB(t,e,a,u,n,!0)}return _}var tV={onPointerDown:$B,isValid:eV};function nV({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=uF(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&Iz()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=HR().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:fF}}var rV=e=>({x:e.x,y:e.y,zoom:e.k}),iV=({x:e,y:t,zoom:n})=>MR.translate(e,t).scale(n),aV=(e,t)=>e.target.closest(`.${t}`),oV=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),sV=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,cV=(e,t=0,n=sV,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},lV=e=>{let t=e.ctrlKey&&Iz()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function uV({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(aV(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=fF(u),t=d*2**lV(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===JR.Vertical?0:u.deltaX*f,m=i===JR.Horizontal?0:u.deltaY*f;!Iz()&&u.shiftKey&&i!==JR.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=rV(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function dV({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=aV(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function fV({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=rV(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function pV({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&oV(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,rV(a.transform))}}function mV({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&oV(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=rV(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function hV({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:a,userSelectionActive:o,noWheelClassName:s,noPanClassName:c,lib:l,connectionInProgress:u}){return d=>{let f=e||t,p=n&&d.ctrlKey,m=d.type===`wheel`;if(d.button===1&&d.type===`mousedown`&&(aV(d,`${l}-flow__node`)||aV(d,`${l}-flow__edge`)))return!0;if(!r&&!f&&!i&&!a&&!n||o||u&&!m||aV(d,s)&&m||aV(d,c)&&(!m||i&&m&&!e)||!n&&d.ctrlKey&&m)return!1;if(!n&&d.type===`touchstart`&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!i&&!p&&m||!r&&(d.type===`mousedown`||d.type===`touchstart`)||Array.isArray(r)&&!r.includes(d.button)&&d.type===`mousedown`)return!1;let h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||m)&&h}}function gV({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=HR().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=uF(e).call(f);y({x:i.x,y:i.y,zoom:pz(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(lV);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?OI:HI).transform(cV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,zoomActivationKeyPressed:S,lib:C,onTransformChange:w,connectionInProgress:T,paneClickDistance:E,selectionOnDrag:D}){r&&!l.isZoomingOrPanning&&v();let O=i&&!S&&!r;f.clickDistance(D?1/0:!Dz(E)||E<0?0:E);let k=O?uV({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):dV({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,k,{passive:!1});let A=fV({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,A);let j=pV({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:w});f.on(`zoom`,j);let M=mV({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,M);let N=hV({zoomActivationKeyPressed:S,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:C,connectionInProgress:T});f.filter(N),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=iV(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=iV(e);return await g(n,t),n}function x(e){if(p){let t=iV(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?NR(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?OI:HI).scaleTo(cV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?OI:HI).scaleBy(cV(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!Dz(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var _V;(function(e){e.Line=`line`,e.Handle=`handle`})(_V||={});function vV({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function yV(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function bV(e,t){return Math.max(0,t-e)}function xV(e,t){return Math.max(0,e-t)}function SV(e,t,n){return Math.max(0,t-e,e-n)}function CV(e,t){return e?!t:t}function wV(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=SV(E,h,g),j=SV(D,_,v);if(o){let e=0,t=0;c&&w<0?e=bV(y+w+O,o[0][0]):!c&&w>0&&(e=xV(y+E+O,o[1][0])),l&&T<0?t=bV(b+T+k,o[0][1]):!l&&T>0&&(t=xV(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=xV(y+w,s[0][0]):!c&&w<0&&(e=bV(y+E,s[1][0])),l&&T>0?t=xV(b+T,s[0][1]):!l&&T<0&&(t=bV(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=SV(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?xV(b+k+E/C,o[1][1])*C:bV(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?bV(b+E/C,s[1][1])*C:xV(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=SV(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?xV(y+D*C+O,o[1][0])/C:bV(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?bV(y+D*C,s[1][0])/C:xV(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(CV(c,l)?-w:w)/C:w=(CV(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var TV={width:0,height:0,x:0,y:0},EV={...TV,pointerX:0,pointerY:0,aspectRatio:1};function DV(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function OV({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=uF(e),o={controlDirection:yV(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...TV},h={...EV};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:yV(e)};let g,_=null,v=[],y,b,x,S=!1,C=TF().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=Wz(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=Lz(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=DV(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=Wz(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=wV(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let F=vV({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),I={...m,direction:F};p?.(e,I)!==!1&&(S=!0,d?.(e,I),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var kV=be((e=>{var t=ge();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),AV=be(((e,t)=>{t.exports=kV()})),jV=be((e=>{var t=ge(),n=AV();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),MV=L(be(((e,t)=>{t.exports=jV()}))(),1),NV=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},PV=e=>e?NV(e):NV,{useDebugValue:FV}=z.default,{useSyncExternalStoreWithSelector:IV}=MV.default,LV=e=>e;function RV(e,t=LV,n){let r=IV(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return FV(r),r}var zV=(e,t)=>{let n=PV(e),r=(e,r=t)=>RV(n,e,r);return Object.assign(r,n),r},BV=(e,t)=>e?zV(e,t):zV;function VV(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var HV=(0,z.createContext)(null),UV=HV.Provider,WV=UR.error001(`react`);function GV(e,t){let n=(0,z.useContext)(HV);if(n===null)throw Error(WV);return RV(n,e,t)}function KV(){let e=(0,z.useContext)(HV);if(e===null)throw Error(WV);return(0,z.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var qV={display:`none`},JV={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},YV=`react-flow__node-desc`,XV=`react-flow__edge-desc`,ZV=`react-flow__aria-live`,QV=e=>e.ariaLiveMessage,$V=e=>e.ariaLabelConfig;function eH({rfId:e}){let t=GV(QV);return(0,B.jsx)(`div`,{id:`${ZV}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:JV,children:t})}function tH({rfId:e,disableKeyboardA11y:t}){let n=GV($V);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{id:`${YV}-${e}`,style:qV,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),(0,B.jsx)(`div`,{id:`${XV}-${e}`,style:qV,children:n[`edge.a11yDescription.default`]}),!t&&(0,B.jsx)(eH,{rfId:e})]})}var nH=(0,z.forwardRef)(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>(0,B.jsx)(`div`,{className:aN([`react-flow__panel`,n,...`${e}`.split(`-`)]),style:r,ref:a,...i,children:t}));nH.displayName=`Panel`;var rH=`https://reactflow.dev?utm_source=attribution`;function iH({proOptions:e,position:t=`bottom-right`}){return e?.hideAttribution?null:(0,B.jsx)(nH,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${rH}`,children:(0,B.jsx)(`a`,{href:rH,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var aH=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},oH=e=>e.id;function sH(e,t){return VV(e.selectedNodes.map(oH),t.selectedNodes.map(oH))&&VV(e.selectedEdges.map(oH),t.selectedEdges.map(oH))}function cH({onSelectionChange:e}){let t=KV(),{selectedNodes:n,selectedEdges:r}=GV(aH,sH);return(0,z.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var lH=e=>!!e.onSelectionChangeHandlers;function uH({onSelectionChange:e}){let t=GV(lH);return e||t?(0,B.jsx)(cH,{onSelectionChange:e}):null}var dH=[0,0],fH={x:0,y:0,zoom:1},pH=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],mH=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),hH={translateExtent:WR,nodeOrigin:dH,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function gH(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=GV(mH,VV),l=KV();(0,z.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=hH,s()}),[]);let u=(0,z.useRef)(hH);return(0,z.useEffect)(()=>{for(let s of pH){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:Uz(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},pH.map(t=>e[t])),null}function _H(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function vH(e){let[t,n]=(0,z.useState)(e===`system`?null:e);return(0,z.useEffect)(()=>{if(e!==`system`){n(e);return}let t=_H(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?_H()?.matches?`dark`:`light`:t}var yH=typeof document<`u`?document:null;function bH(e=null,t={target:yH,actInsideInputWithModifier:!0}){let[n,r]=(0,z.useState)(!1),i=(0,z.useRef)(!1),a=(0,z.useRef)(new Set([])),[o,s]=(0,z.useMemo)(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(`+`,`
81
+ `).replace(`
82
+
83
+ `,`
84
+ +`).split(`
85
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return(0,z.useEffect)(()=>{let n=t?.target??yH,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&Jz(e))return!1;let n=SH(e.code,s);if(a.current.add(e[n]),xH(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=SH(e.code,s);xH(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function xH(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function SH(e,t){return t.includes(e)?`code`:`key`}var CH=()=>{let e=KV();return(0,z.useMemo)(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=Fz(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return Az(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=jz(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function wH(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)TH(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function TH(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing);break}}function EH(e,t){return wH(e,t)}function DH(e,t){return wH(e,t)}function OH(e,t){return{id:e,type:`select`,selected:t}}function kH(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);!(a.selected===void 0&&!e)&&a.selected!==e&&(n&&(a.selected=e),r.push(OH(a.id,e)))}return r}function AH({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function jH(e){return{id:e.id,type:`remove`}}var MH=Oz(`React Flow`,`https://reactflow.dev/`);function NH(e,t,n={}){return sB(e,t,{...n,onError:n.onError??MH})}var PH=e=>nz(e),FH=e=>tz(e);function IH(e){return(0,z.forwardRef)(e)}var LH=typeof window<`u`?z.useLayoutEffect:z.useEffect;function RH(e){let[t,n]=(0,z.useState)(BigInt(0)),[r]=(0,z.useState)(()=>zH(()=>n(e=>e+BigInt(1))));return LH(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function zH(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var BH=(0,z.createContext)(null);function VH({children:e}){let t=KV(),n=RH((0,z.useCallback)(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=AH({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=RH((0,z.useCallback)(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(AH({items:s,lookup:o}))},[])),i=(0,z.useMemo)(()=>({nodeQueue:n,edgeQueue:r}),[]);return(0,B.jsx)(BH.Provider,{value:i,children:e})}function HH(){let e=(0,z.useContext)(BH);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var UH=e=>!!e.panZoom;function WH(){let e=CH(),t=KV(),n=HH(),r=GV(UH),i=(0,z.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=PH(e)?e:n.get(e.id),a=i.parentId?Bz(i.position,i.measured,i.parentId,n,r):i.position;return xz({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&PH(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&FH(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await fz({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(jH);o?.(f),c(e)}if(m){let e=d.map(jH);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Ez(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=xz(s?r:a),l=Tz(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=Ez(e)?e:a(e);if(!r)return!1;let i=Tz(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return az(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??Hz();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,z.useMemo)(()=>({...i,...e,viewportInitialized:r}),[r])}var GH=e=>e.selected,KH=typeof window<`u`?window:void 0;function qH({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=KV(),{deleteElements:r}=WH(),i=bH(e,{actInsideInputWithModifier:!1}),a=bH(t,{target:KH});(0,z.useEffect)(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(GH),edges:e.filter(GH)}),n.setState({nodesSelectionActive:!1})}},[i]),(0,z.useEffect)(()=>{n.setState({multiSelectionActive:a})},[a])}function JH(e){let t=KV();(0,z.useEffect)(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=Gz(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,UR.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var YH={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},XH=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function ZH({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:i=.5,panOnScrollMode:a=JR.Free,zoomOnDoubleClick:o=!0,panOnDrag:s=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:m,noWheelClassName:h,noPanClassName:g,onViewportChange:_,isControlledViewport:v,paneClickDistance:y,selectionOnDrag:b}){let x=KV(),S=(0,z.useRef)(null),{userSelectionActive:C,lib:w,connectionInProgress:T}=GV(XH,VV),E=bH(f),D=(0,z.useRef)();JH(S);let O=(0,z.useCallback)(e=>{_?.({x:e[0],y:e[1],zoom:e[2]}),v||x.setState({transform:e})},[_,v]);return(0,z.useEffect)(()=>{if(S.current){D.current=gV({domNode:S.current,minZoom:u,maxZoom:d,translateExtent:l,viewport:c,onDraggingChange:e=>x.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=x.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=x.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=x.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=D.current.getViewport();return x.setState({panZoom:D.current,transform:[e,t,n],domNode:S.current.closest(`.react-flow`)}),()=>{D.current?.destroy()}}},[]),(0,z.useEffect)(()=>{D.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:i,panOnScrollMode:a,zoomOnDoubleClick:o,panOnDrag:s,zoomActivationKeyPressed:E,preventScrolling:p,noPanClassName:g,userSelectionActive:C,noWheelClassName:h,lib:w,onTransformChange:O,connectionInProgress:T,selectionOnDrag:b,paneClickDistance:y})},[e,t,n,r,i,a,o,s,E,p,g,C,h,w,O,T,b,y]),(0,B.jsx)(`div`,{className:`react-flow__renderer`,ref:S,style:YH,children:m})}var QH=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function $H(){let{userSelectionActive:e,userSelectionRect:t}=GV(QH,VV);return e&&t?(0,B.jsx)(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var eU=(e,t)=>n=>{n.target===t.current&&e?.(n)},tU=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function nU({isSelecting:e,selectionKeyPressed:t,selectionMode:n=YR.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:p,onPaneMouseLeave:m,children:h}){let g=(0,z.useRef)(0),_=KV(),{userSelectionActive:v,elementsSelectable:y,dragging:b,panBy:x,autoPanSpeed:S}=GV(tU,VV),C=y&&(e||v),w=(0,z.useRef)(null),T=(0,z.useRef)(),E=(0,z.useRef)(new Set),D=(0,z.useRef)(new Set),O=(0,z.useRef)(!1),k=(0,z.useRef)(!1),A=(0,z.useRef)({x:0,y:0}),j=(0,z.useRef)(!1),M=e=>{if(k.current||O.current||_.getState().connection.inProgress){k.current=!1,O.current=!1;return}l?.(e),_.getState().resetSelectedElements(),_.setState({nodesSelectionActive:!1})},N=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},P=d?e=>d(e):void 0,F=e=>{k.current&&=(e.stopPropagation(),!1)},I=n=>{let{domNode:r,transform:i}=_.getState();if(T.current=r?.getBoundingClientRect(),!T.current)return;let a=n.target===w.current;if(!a&&n.target.closest(`.nokey`)||!e||!(o&&a||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),k.current=!1;let{x:s,y:c}=Xz(n.nativeEvent,T.current),l=Az({x:s,y:c},i);_.setState({userSelectionRect:{width:0,height:0,startX:l.x,startY:l.y,x:s,y:c}}),a||(n.stopPropagation(),n.preventDefault())};function L(e,t){let{userSelectionRect:r}=_.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=_.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=jz(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=E.current,g=D.current;E.current=new Set(sz(a,m,i,n===YR.Partial,!0).map(e=>e.id)),D.current=new Set;let v=u?.selectable??!0;for(let e of E.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??v)&&D.current.add(e)}}Vz(h,E.current)||c(kH(a,E.current,!0)),Vz(g,D.current)||l(kH(o,D.current)),_.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function R(){if(!i||!T.current)return;let[e,t]=_z(A.current,T.current,S);x({x:e,y:t}).then(e=>{if(!k.current||!e){g.current=requestAnimationFrame(R);return}let{x:t,y:n}=A.current;L(t,n),g.current=requestAnimationFrame(R)})}let ee=()=>{cancelAnimationFrame(g.current),g.current=0,j.current=!1};return(0,z.useEffect)(()=>()=>ee(),[]),(0,B.jsxs)(`div`,{className:aN([`react-flow__pane`,{draggable:r===!0||Array.isArray(r)&&r.includes(0),dragging:b,selection:e}]),onClick:C?void 0:eU(M,w),onContextMenu:eU(N,w),onWheel:eU(P,w),onPointerEnter:C?void 0:f,onPointerMove:C?e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=_.getState();if(!T.current||!n)return;let{x:o,y:c}=Xz(e.nativeEvent,T.current);A.current={x:o,y:c};let l=jz({x:n.startX,y:n.startY},r);if(!k.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}k.current=!0,j.current||=(R(),!0),L(o,c)}:p,onPointerUp:e=>{if(!C){e.target===w.current&&_.getState().connection.inProgress&&(O.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!v&&e.target===w.current&&_.getState().userSelectionRect&&M?.(e),_.setState({userSelectionActive:!1,userSelectionRect:null}),k.current&&(c?.(e),_.setState({nodesSelectionActive:E.current.size>0})),ee())},onPointerCancel:C?e=>{e.target?.releasePointerCapture?.(e.pointerId),ee()}:void 0,onPointerDownCapture:C?I:void 0,onClickCapture:C?F:void 0,onPointerLeave:m,ref:w,style:YH,children:[h,(0,B.jsx)($H,{})]})}function rU({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,UR.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function iU({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=KV(),[c,l]=(0,z.useState)(!1),u=(0,z.useRef)();return(0,z.useEffect)(()=>{if(!t)return u.current=GB({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{rU({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),(0,z.useEffect)(()=>{t||!e.current||!u.current||u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var aU=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function oU(){let e=KV();return(0,z.useCallback)(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=aU(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=kz(t,i));let{position:a,positionAbsolute:s}=dz({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var sU=(0,z.createContext)(null),cU=sU.Provider;sU.Consumer;var lU=()=>(0,z.useContext)(sU),uU=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),dU=(0,z.createContext)(null);function fU({children:e}){let t=GV(uU,VV);return(0,B.jsx)(dU.Provider,{value:t,children:e})}function pU(){let e=(0,z.useContext)(dU);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var mU={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},hU=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return mU;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===qR.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function gU({type:e=`source`,position:t=$.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},p){let m=o||null,h=e===`target`,g=KV(),_=lU(),{connectOnClick:v,noPanClassName:y,rfId:b}=pU(),{connectingFrom:x,connectingTo:S,clickConnecting:C,isPossibleEndHandle:w,connectionInProcess:T,clickConnectionInProcess:E,valid:D}=GV(hU(_,m,e),VV);_||g.getState().onError?.(`010`,UR.error010());let O=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=g.getState();t(NH(i,e,{onError:n}))}n?.(i),s?.(i)},k=e=>{if(!_)return;let t=Yz(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=g.getState();tV.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:m,nodeId:_,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:O,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,B.jsx)(`div`,{"data-handleid":m,"data-nodeid":_,"data-handlepos":t,"data-id":`${b}-${_}-${m}-${e}`,className:aN([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,y,l,{source:!h,target:h,connectable:r,connectablestart:i,connectableend:a,clickconnecting:C,connectingfrom:x,connectingto:S,valid:D,connectionindicator:r&&(!T||w)&&(T||E?a:i)}]),onMouseDown:k,onTouchStart:k,onClick:v?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!_||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:_,handleId:m,handleType:e}),g.setState({connectionClickStartHandle:{nodeId:_,type:e,id:m}});return}let p=Kz(t.target),h=n||c,{connection:v,isValid:y}=tV.isValid(t.nativeEvent,{handle:{nodeId:_,id:m,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:h,flowId:u,doc:p,lib:l,nodeLookup:d});y&&v&&O(v);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),g.setState({connectionClickStartHandle:null})}:void 0,ref:p,...f,children:c})}var _U=(0,z.memo)(IH(gU));function vU({data:e,isConnectable:t,sourcePosition:n=$.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[e?.label,(0,B.jsx)(_U,{type:`source`,position:n,isConnectable:t})]})}function yU({data:e,isConnectable:t,targetPosition:n=$.Top,sourcePosition:r=$.Bottom}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(_U,{type:`target`,position:n,isConnectable:t}),e?.label,(0,B.jsx)(_U,{type:`source`,position:r,isConnectable:t})]})}function bU(){return null}function xU({data:e,isConnectable:t,targetPosition:n=$.Top}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(_U,{type:`target`,position:n,isConnectable:t}),e?.label]})}var SU={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},CU={input:vU,default:yU,output:xU,group:bU};function wU(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var TU=e=>{let{width:t,height:n,x:r,y:i}=oz(e.nodeLookup,{filter:e=>!!e.selected});return{width:Dz(t)?t:null,height:Dz(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function EU({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=KV(),{width:i,height:a,transformString:o,userSelectionActive:s}=GV(TU,VV),c=oU(),l=(0,z.useRef)(null);(0,z.useEffect)(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(iU({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return(0,B.jsx)(`div`,{className:aN([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:(0,B.jsx)(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(SU,e.key)&&(e.preventDefault(),c({direction:SU[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var DU=typeof window<`u`?window:void 0,OU=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function kU({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:m,panActivationKeyCode:h,zoomActivationKeyCode:g,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:b,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:w,autoPanOnSelection:T,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,preventScrolling:A,onSelectionContextMenu:j,noWheelClassName:M,noPanClassName:N,disableKeyboardA11y:P,onViewportChange:F,isControlledViewport:I}){let{nodesSelectionActive:L,userSelectionActive:R}=GV(OU,VV),ee=bH(l,{target:DU}),te=bH(h,{target:DU}),ne=te||w,re=te||b,ie=u&&ne!==!0,ae=ee||R||ie;return qH({deleteKeyCode:c,multiSelectionKeyCode:m}),(0,B.jsx)(ZH,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:v,zoomOnPinch:y,panOnScroll:re,panOnScrollSpeed:x,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!ee&&ne,defaultViewport:E,translateExtent:D,minZoom:O,maxZoom:k,zoomActivationKeyCode:g,preventScrolling:A,noWheelClassName:M,noPanClassName:N,onViewportChange:F,isControlledViewport:I,paneClickDistance:s,selectionOnDrag:ie,children:(0,B.jsxs)(nU,{onSelectionStart:f,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:ne,autoPanOnSelection:T,isSelecting:!!ae,selectionMode:d,selectionKeyPressed:ee,paneClickDistance:s,selectionOnDrag:ie,children:[e,L&&(0,B.jsx)(EU,{onSelectionContextMenu:j,noPanClassName:N,disableKeyboardA11y:P})]})})}kU.displayName=`FlowRenderer`;var AU=(0,z.memo)(kU),jU=e=>t=>e?sz(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function MU(e){return GV((0,z.useCallback)(jU(e),[e]),VV)}var NU=e=>e.updateNodeInternals;function PU(){let e=GV(NU),[t]=(0,z.useState)(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,z.useEffect)(()=>()=>{t?.disconnect()},[t]),t}function FU({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=KV(),a=(0,z.useRef)(null),o=(0,z.useRef)(null),s=(0,z.useRef)(e.sourcePosition),c=(0,z.useRef)(e.targetPosition),l=(0,z.useRef)(t),u=n&&!!e.internals.handleBounds;return(0,z.useEffect)(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),(0,z.useEffect)(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),(0,z.useEffect)(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function IU({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:p,disableKeyboardA11y:m,rfId:h,nodeTypes:g,nodeClickDistance:_,onError:v}){let{node:y,internals:b,isParent:x}=GV(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},VV),S=y.type||`default`,C=g?.[S]||CU[S];C===void 0&&(v?.(`003`,UR.error003(S)),S=`default`,C=g?.default||CU.default);let w=!!(y.draggable||s&&y.draggable===void 0),T=!!(y.selectable||c&&y.selectable===void 0),E=!!(y.connectable||l&&y.connectable===void 0),D=!!(y.focusable||u&&y.focusable===void 0),O=KV(),k=zz(y),A=FU({node:y,nodeType:S,hasDimensions:k,resizeObserver:d}),j=iU({nodeRef:A,disabled:y.hidden||!w,noDragClassName:f,handleSelector:y.dragHandle,nodeId:e,isSelectable:T,nodeClickDistance:_}),M=oU();if(y.hidden)return null;let N=Rz(y),P=wU(y),F=T||w||t||n||r||i,I=n?e=>n(e,{...b.userNode}):void 0,L=r?e=>r(e,{...b.userNode}):void 0,R=i?e=>i(e,{...b.userNode}):void 0,ee=a?e=>a(e,{...b.userNode}):void 0,te=o?e=>o(e,{...b.userNode}):void 0,ne=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=O.getState();T&&(!r||!w||i>0)&&rU({id:e,store:O,nodeRef:A}),t&&t(n,{...b.userNode})},re=t=>{if(!(Jz(t.nativeEvent)||m)){if(GR.includes(t.key)&&T){let n=t.key===`Escape`;rU({id:e,store:O,unselect:n,nodeRef:A})}else if(w&&y.selected&&Object.prototype.hasOwnProperty.call(SU,t.key)){t.preventDefault();let{ariaLabelConfig:e}=O.getState();O.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~b.positionAbsolute.x,y:~~b.positionAbsolute.y})}),M({direction:SU[t.key],factor:t.shiftKey?4:1})}}},ie=()=>{if(m||!A.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=O.getState();i&&(sz(new Map([[e,y]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(y.position.x+N.width/2,y.position.y+N.height/2,{zoom:t[2]}))};return(0,B.jsx)(`div`,{className:aN([`react-flow__node`,`react-flow__node-${S}`,{[p]:w},y.className,{selected:y.selected,selectable:T,parent:x,draggable:w,dragging:j}]),ref:A,style:{zIndex:b.z,transform:`translate(${b.positionAbsolute.x}px,${b.positionAbsolute.y}px)`,pointerEvents:F?`all`:`none`,visibility:k?`visible`:`hidden`,...y.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:L,onMouseLeave:R,onContextMenu:ee,onClick:ne,onDoubleClick:te,onKeyDown:D?re:void 0,tabIndex:D?0:void 0,onFocus:D?ie:void 0,role:y.ariaRole??(D?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":m?void 0:`${YV}-${h}`,"aria-label":y.ariaLabel,...y.domAttributes,children:(0,B.jsx)(cU,{value:e,children:(0,B.jsx)(C,{id:e,data:y.data,type:S,positionAbsoluteX:b.positionAbsolute.x,positionAbsoluteY:b.positionAbsolute.y,selected:y.selected??!1,selectable:T,draggable:w,deletable:y.deletable??!0,isConnectable:E,sourcePosition:y.sourcePosition,targetPosition:y.targetPosition,dragging:j,dragHandle:y.dragHandle,zIndex:b.z,parentId:y.parentId,...N})})})}var LU=(0,z.memo)(IU),RU=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function zU(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=GV(RU,VV),a=MU(e.onlyRenderVisibleElements),o=PU();return(0,B.jsx)(`div`,{className:`react-flow__nodes`,style:YH,children:a.map(a=>(0,B.jsx)(LU,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}zU.displayName=`NodeRenderer`;var BU=(0,z.memo)(zU);function VU(e){return GV((0,z.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&iB({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),VV)}var HU=({color:e=`none`,strokeWidth:t=1})=>(0,B.jsx)(`polyline`,{className:`arrow`,style:{strokeWidth:t,...e&&{stroke:e}},strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`}),UU=({color:e=`none`,strokeWidth:t=1})=>(0,B.jsx)(`polyline`,{className:`arrowclosed`,style:{strokeWidth:t,...e&&{stroke:e,fill:e}},strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`}),WU={[QR.Arrow]:HU,[QR.ArrowClosed]:UU};function GU(e){let t=KV();return(0,z.useMemo)(()=>Object.prototype.hasOwnProperty.call(WU,e)?WU[e]:(t.getState().onError?.(`009`,UR.error009(e)),null),[e])}var KU=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=GU(t);return c?(0,B.jsx)(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:(0,B.jsx)(c,{color:n,strokeWidth:o})}):null},qU=({defaultColor:e,rfId:t})=>{let n=GV(e=>e.edges),r=GV(e=>e.defaultEdgeOptions),i=(0,z.useMemo)(()=>xB(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?(0,B.jsx)(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:(0,B.jsx)(`defs`,{children:i.map(e=>(0,B.jsx)(KU,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};qU.displayName=`MarkerDefinitions`;var JU=(0,z.memo)(qU);function YU({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=(0,z.useState)({x:1,y:0,width:0,height:0}),p=aN([`react-flow__edge-textwrapper`,l]),m=(0,z.useRef)(null);return(0,z.useEffect)(()=>{if(m.current){let e=m.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,B.jsxs)(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:p,visibility:d.width?`visible`:`hidden`,...u,children:[i&&(0,B.jsx)(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),(0,B.jsx)(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:m,style:r,children:n}),c]}):null}YU.displayName=`EdgeText`;var XU=(0,z.memo)(YU);function ZU({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`path`,{...u,d:e,fill:`none`,className:aN([`react-flow__edge-path`,u.className])}),l?(0,B.jsx)(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&Dz(t)&&Dz(n)?(0,B.jsx)(XU,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function QU({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===$.Left||e===$.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function $U({sourceX:e,sourceY:t,sourcePosition:n=$.Bottom,targetX:r,targetY:i,targetPosition:a=$.Top}){let[o,s]=QU({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=QU({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=Qz({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function eW(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})=>{let[v,y,b]=$U({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s});return(0,B.jsx)(ZU,{id:e.isInternal?void 0:t,path:v,labelX:y,labelY:b,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:_})})}var tW=eW({isInternal:!1}),nW=eW({isInternal:!0});tW.displayName=`SimpleBezierEdge`,nW.displayName=`SimpleBezierEdgeInternal`;function rW(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:p=$.Bottom,targetPosition:m=$.Top,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=mB({sourceX:n,sourceY:r,sourcePosition:p,targetX:i,targetY:a,targetPosition:m,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition});return(0,B.jsx)(ZU,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:v})})}var iW=rW({isInternal:!1}),aW=rW({isInternal:!0});iW.displayName=`SmoothStepEdge`,aW.displayName=`SmoothStepEdgeInternal`;function oW(e){return(0,z.memo)(({id:t,...n})=>{let r=e.isInternal?void 0:t;return(0,B.jsx)(iW,{...n,id:r,pathOptions:(0,z.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var sW=oW({isInternal:!1}),cW=oW({isInternal:!0});sW.displayName=`StepEdge`,cW.displayName=`StepEdgeInternal`;function lW(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})=>{let[g,_,v]=cB({sourceX:n,sourceY:r,targetX:i,targetY:a});return(0,B.jsx)(ZU,{id:e.isInternal?void 0:t,path:g,labelX:_,labelY:v,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:p,markerStart:m,interactionWidth:h})})}var uW=lW({isInternal:!1}),dW=lW({isInternal:!0});uW.displayName=`StraightEdge`,dW.displayName=`StraightEdgeInternal`;function fW(e){return(0,z.memo)(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=$.Bottom,targetPosition:s=$.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,pathOptions:_,interactionWidth:v})=>{let[y,b,x]=tB({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:_?.curvature});return(0,B.jsx)(ZU,{id:e.isInternal?void 0:t,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:p,style:m,markerEnd:h,markerStart:g,interactionWidth:v})})}var pW=fW({isInternal:!1}),mW=fW({isInternal:!0});pW.displayName=`BezierEdge`,mW.displayName=`BezierEdgeInternal`;var hW={default:mW,straight:dW,step:cW,smoothstep:aW,simplebezier:nW},gW={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},_W=(e,t,n)=>n===$.Left?e-t:n===$.Right?e+t:e,vW=(e,t,n)=>n===$.Top?e-t:n===$.Bottom?e+t:e,yW=`react-flow__edgeupdater`;function bW({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return(0,B.jsx)(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:aN([yW,`${yW}-${s}`]),cx:_W(t,r,e),cy:vW(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function xW({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:p}){let m=KV(),h=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:h,rfId:g,panBy:_,updateConnection:v}=m.getState(),y=t.type===`target`;tV.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>m.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>m.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,dragThreshold:m.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),_=e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),v=()=>p(!0),y=()=>p(!1);return(0,B.jsxs)(B.Fragment,{children:[(e===!0||e===`source`)&&(0,B.jsx)(bW,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:g,onMouseEnter:v,onMouseOut:y,type:`source`}),(e===!0||e===`target`)&&(0,B.jsx)(bW,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:_,onMouseEnter:v,onMouseOut:y,type:`target`})]})}function SW({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,rfId:m,edgeTypes:h,noPanClassName:g,onError:_,disableKeyboardA11y:v}){let y=GV(t=>t.edgeLookup.get(e)),b=GV(e=>e.defaultEdgeOptions);y=b?{...b,...y}:y;let x=y.type||`default`,S=h?.[x]||hW[x];S===void 0&&(_?.(`011`,UR.error011(x)),x=`default`,S=h?.default||hW.default);let C=!!(y.focusable||t&&y.focusable===void 0),w=d!==void 0&&(y.reconnectable||n&&y.reconnectable===void 0),T=!!(y.selectable||r&&y.selectable===void 0),E=(0,z.useRef)(null),[D,O]=(0,z.useState)(!1),[k,A]=(0,z.useState)(!1),j=KV(),{zIndex:M=y.zIndex,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R}=GV((0,z.useCallback)(t=>{let n=t.nodeLookup.get(y.source),r=t.nodeLookup.get(y.target);if(!n||!r)return gW;let i=gB({id:e,sourceNode:n,targetNode:r,sourceHandle:y.sourceHandle||null,targetHandle:y.targetHandle||null,connectionMode:t.connectionMode,onError:_}),a=rB({selected:y.selected,zIndex:y.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||gW,zIndex:a}},[y.source,y.target,y.sourceHandle,y.targetHandle,y.selected,y.zIndex]),VV),ee=(0,z.useMemo)(()=>y.markerStart?`url('#${bB(y.markerStart,m)}')`:void 0,[y.markerStart,m]),te=(0,z.useMemo)(()=>y.markerEnd?`url('#${bB(y.markerEnd,m)}')`:void 0,[y.markerEnd,m]);if(y.hidden||N===null||P===null||F===null||I===null)return null;let ne=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=j.getState();T&&(j.setState({nodesSelectionActive:!1}),y.selected&&a?(r({nodes:[],edges:[y]}),E.current?.blur()):n([e])),i&&i(t,y)},re=a?e=>{a(e,{...y})}:void 0,ie=o?e=>{o(e,{...y})}:void 0,ae=s?e=>{s(e,{...y})}:void 0,oe=c?e=>{c(e,{...y})}:void 0,se=l?e=>{l(e,{...y})}:void 0;return(0,B.jsx)(`svg`,{style:{zIndex:M},children:(0,B.jsxs)(`g`,{className:aN([`react-flow__edge`,`react-flow__edge-${x}`,y.className,g,{selected:y.selected,animated:y.animated,inactive:!T&&!i,updating:D,selectable:T}]),onClick:ne,onDoubleClick:re,onContextMenu:ie,onMouseEnter:ae,onMouseMove:oe,onMouseLeave:se,onKeyDown:C?t=>{if(!v&&GR.includes(t.key)&&T){let{unselectNodesAndEdges:n,addSelectedEdges:r}=j.getState();t.key===`Escape`?(E.current?.blur(),n({edges:[y]})):r([e])}}:void 0,tabIndex:C?0:void 0,role:y.ariaRole??(C?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":y.ariaLabel===null?void 0:y.ariaLabel||`Edge from ${y.source} to ${y.target}`,"aria-describedby":C?`${XV}-${m}`:void 0,ref:E,...y.domAttributes,children:[!k&&(0,B.jsx)(S,{id:e,source:y.source,target:y.target,type:y.type,selected:y.selected,animated:y.animated,selectable:T,deletable:y.deletable??!0,label:y.label,labelStyle:y.labelStyle,labelShowBg:y.labelShowBg,labelBgStyle:y.labelBgStyle,labelBgPadding:y.labelBgPadding,labelBgBorderRadius:y.labelBgBorderRadius,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R,data:y.data,style:y.style,sourceHandleId:y.sourceHandle,targetHandleId:y.targetHandle,markerStart:ee,markerEnd:te,pathOptions:`pathOptions`in y?y.pathOptions:void 0,interactionWidth:y.interactionWidth}),w&&(0,B.jsx)(xW,{edge:y,isReconnectable:w,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:p,sourceX:N,sourceY:P,targetX:F,targetY:I,sourcePosition:L,targetPosition:R,setUpdateHover:O,setReconnecting:A})]})})}var CW=(0,z.memo)(SW),wW=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function TW({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,disableKeyboardA11y:h}){let{edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,onError:y}=GV(wW,VV),b=VU(t);return(0,B.jsxs)(`div`,{className:`react-flow__edges`,children:[(0,B.jsx)(JU,{defaultColor:e,rfId:n}),b.map(e=>(0,B.jsx)(CW,{id:e,edgesFocusable:g,edgesReconnectable:_,elementsSelectable:v,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:p,onReconnectEnd:m,rfId:n,onError:y,edgeTypes:r,disableKeyboardA11y:h},e))]})}TW.displayName=`EdgeRenderer`;var EW=(0,z.memo)(TW),DW=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function OW({children:e}){let t=KV(),n=(0,z.useRef)(null),[r]=(0,z.useState)(()=>t.getState().transform);return LH(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=DW(r)))};return r(),t.subscribe(r)},[t]),(0,B.jsx)(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:DW(r)},children:e})}function kW(e){let t=WH(),n=(0,z.useRef)(!1);(0,z.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var AW=e=>e.panZoom?.syncViewport;function jW(e){let t=GV(AW),n=KV();return(0,z.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function MW(e){return e.connection.inProgress?{...e.connection,to:Az(e.connection.to,e.transform)}:{...e.connection}}function NW(e){return e?t=>e(MW(t)):MW}function PW(e){return GV(NW(e),VV)}var FW=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function IW({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=GV(FW,VV);return a&&i&&c?(0,B.jsx)(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:(0,B.jsx)(`g`,{className:aN([`react-flow__connection`,ez(s)]),children:(0,B.jsx)(LW,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var LW=({style:e,type:t=ZR.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:p}=PW();if(!i)return;if(n)return(0,B.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:ez(r),toNode:u,toHandle:d,pointer:p});let m=``,h={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case ZR.Bezier:[m]=tB(h);break;case ZR.SimpleBezier:[m]=$U(h);break;case ZR.Step:[m]=mB({...h,borderRadius:0});break;case ZR.SmoothStep:[m]=mB(h);break;default:[m]=cB(h)}return(0,B.jsx)(`path`,{d:m,fill:`none`,className:`react-flow__connection-path`,style:e})};LW.displayName=`ConnectionLine`;var RW={};function zW(e=RW){(0,z.useRef)(e),KV(),(0,z.useEffect)(()=>{},[e])}function BW(){KV(),(0,z.useRef)(!1),(0,z.useEffect)(()=>{},[])}function VW({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:p,connectionLineType:m,connectionLineStyle:h,connectionLineComponent:g,connectionLineContainerStyle:_,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:w,onlyRenderVisibleElements:T,elementsSelectable:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,defaultMarkerColor:M,zoomOnScroll:N,zoomOnPinch:P,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:R,panOnDrag:ee,autoPanOnSelection:te,onPaneClick:ne,onPaneMouseEnter:re,onPaneMouseMove:ie,onPaneMouseLeave:ae,onPaneScroll:oe,onPaneContextMenu:se,paneClickDistance:ce,nodeClickDistance:le,onEdgeContextMenu:ue,onEdgeMouseEnter:de,onEdgeMouseMove:fe,onEdgeMouseLeave:pe,reconnectRadius:me,onReconnect:he,onReconnectStart:ge,onReconnectEnd:_e,noDragClassName:ve,noWheelClassName:ye,noPanClassName:be,disableKeyboardA11y:xe,nodeExtent:Se,rfId:Ce,viewport:we,onViewportChange:Te,nodesDraggable:Ee}){return zW(e),zW(t),BW(),kW(n),jW(we),(0,B.jsx)(AU,{onPaneClick:ne,onPaneMouseEnter:re,onPaneMouseMove:ie,onPaneMouseLeave:ae,onPaneContextMenu:se,onPaneScroll:oe,paneClickDistance:ce,deleteKeyCode:w,selectionKeyCode:v,selectionOnDrag:y,selectionMode:b,onSelectionStart:f,onSelectionEnd:p,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:E,zoomOnScroll:N,zoomOnPinch:P,zoomOnDoubleClick:R,panOnScroll:F,panOnScrollSpeed:I,panOnScrollMode:L,panOnDrag:ee,autoPanOnSelection:te,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,onSelectionContextMenu:d,preventScrolling:j,noDragClassName:ve,noWheelClassName:ye,noPanClassName:be,disableKeyboardA11y:xe,onViewportChange:Te,isControlledViewport:!!we,children:(0,B.jsxs)(OW,{children:[(0,B.jsx)(EW,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:he,onReconnectStart:ge,onReconnectEnd:_e,onlyRenderVisibleElements:T,onEdgeContextMenu:ue,onEdgeMouseEnter:de,onEdgeMouseMove:fe,onEdgeMouseLeave:pe,reconnectRadius:me,defaultMarkerColor:M,noPanClassName:be,disableKeyboardA11y:xe,rfId:Ce}),(0,B.jsx)(IW,{style:h,type:m,component:g,containerStyle:_}),(0,B.jsx)(`div`,{className:`react-flow__edgelabel-renderer`}),(0,B.jsx)(BU,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:le,onlyRenderVisibleElements:T,noPanClassName:be,noDragClassName:ve,disableKeyboardA11y:xe,nodeExtent:Se,rfId:Ce,nodesDraggable:Ee}),(0,B.jsx)(`div`,{className:`react-flow__viewport-portal`})]})})}VW.displayName=`GraphView`;var HW=(0,z.memo)(VW),UW=Oz(`React Flow`,`https://reactflow.dev/`),WW=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??WR;zB(h,g,_);let{nodesInitialized:x}=AB(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=Fz(oz(p,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:WR,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:qR.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...XR},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:UW,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:KR,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},GW=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>BV((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await uz({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...WW({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:i,fitViewQueued:a,zIndexMode:o,nodesSelectionActive:s}=m(),{nodesInitialized:c,hasSelectedNodes:l}=AB(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:i,checkEquality:!0,zIndexMode:o}),u=s&&l;a&&c?(h(),p({nodes:e,nodesInitialized:c,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):p({nodes:e,nodesInitialized:c,nodesSelectionActive:u})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();zB(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=IB(e,n,r,i,a,o,l);d&&(DB(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=vB(e,o.fromHandle,$.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=FB(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(EH(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(DH(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>OH(e,!0)));return}i(kH(r,new Set([...e]),!0)),a(kH(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>OH(e,!0)));return}a(kH(n,new Set([...e]))),i(kH(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(OH(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(OH(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,OH(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,OH(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();e[0][0]===o[0][0]&&e[0][1]===o[0][1]&&e[1][0]===o[1][0]&&e[1][1]===o[1][1]||(AB(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return LB({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...XR}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...WW()})}},Object.is);function KW({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:p}){let[m]=(0,z.useState)(()=>GW({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return(0,B.jsx)(UV,{value:m,children:(0,B.jsx)(VH,{children:(0,B.jsx)(fU,{children:p})})})}function qW({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p}){return(0,z.useContext)(HV)?(0,B.jsx)(B.Fragment,{children:e}):(0,B.jsx)(KW,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:p,children:e})}var JW={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function YW({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onSelectionChange:k,onSelectionDragStart:A,onSelectionDrag:j,onSelectionDragStop:M,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onBeforeDelete:I,connectionMode:L,connectionLineType:R=ZR.Bezier,connectionLineStyle:ee,connectionLineComponent:te,connectionLineContainerStyle:ne,deleteKeyCode:re=`Backspace`,selectionKeyCode:ie=`Shift`,selectionOnDrag:ae=!1,selectionMode:oe=YR.Full,panActivationKeyCode:se=`Space`,multiSelectionKeyCode:ce=Iz()?`Meta`:`Control`,zoomActivationKeyCode:le=Iz()?`Meta`:`Control`,snapToGrid:ue,snapGrid:de,onlyRenderVisibleElements:fe=!1,selectNodesOnDrag:pe,nodesDraggable:me,autoPanOnNodeFocus:he,nodesConnectable:ge,nodesFocusable:_e,nodeOrigin:ve=dH,edgesFocusable:ye,edgesReconnectable:be,elementsSelectable:xe=!0,defaultViewport:Se=fH,minZoom:Ce=.5,maxZoom:we=2,translateExtent:Te=WR,preventScrolling:Ee=!0,nodeExtent:De,defaultMarkerColor:Oe=`#b1b1b7`,zoomOnScroll:ke=!0,zoomOnPinch:Ae=!0,panOnScroll:je=!1,panOnScrollSpeed:Me=.5,panOnScrollMode:Ne=JR.Free,zoomOnDoubleClick:Pe=!0,panOnDrag:Fe=!0,onPaneClick:Ie,onPaneMouseEnter:Le,onPaneMouseMove:Re,onPaneMouseLeave:ze,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:He=1,nodeClickDistance:Ue=0,children:We,onReconnect:Ge,onReconnectStart:Ke,onReconnectEnd:qe,onEdgeContextMenu:Je,onEdgeDoubleClick:Ye,onEdgeMouseEnter:Xe,onEdgeMouseMove:Ze,onEdgeMouseLeave:Qe,reconnectRadius:$e=10,onNodesChange:et,onEdgesChange:tt,noDragClassName:nt=`nodrag`,noWheelClassName:rt=`nowheel`,noPanClassName:it=`nopan`,fitView:at,fitViewOptions:ot,connectOnClick:st,attributionPosition:ct,proOptions:lt,defaultEdgeOptions:ut,elevateNodesOnSelect:dt=!0,elevateEdgesOnSelect:ft=!1,disableKeyboardA11y:pt=!1,autoPanOnConnect:mt,autoPanOnNodeDrag:ht,autoPanOnSelection:gt=!0,autoPanSpeed:_t,connectionRadius:vt,isValidConnection:yt,onError:bt,style:xt,id:St,nodeDragThreshold:Ct,connectionDragThreshold:wt,viewport:Tt,onViewportChange:Et,width:Dt,height:Ot,colorMode:kt=`light`,debug:At,onScroll:jt,ariaLabelConfig:Mt,zIndexMode:Nt=`basic`,...Pt},Ft){let It=St||`1`,Lt=vH(kt),Rt=(0,z.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),jt?.(e)},[jt]);return(0,B.jsx)(`div`,{"data-testid":`rf__wrapper`,...Pt,onScroll:Rt,style:{...xt,...JW},ref:Ft,className:aN([`react-flow`,i,Lt]),id:St,role:`application`,children:(0,B.jsxs)(qW,{nodes:e,edges:t,width:Dt,height:Ot,fitView:at,fitViewOptions:ot,minZoom:Ce,maxZoom:we,nodeOrigin:ve,nodeExtent:De,zIndexMode:Nt,children:[(0,B.jsx)(gH,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:m,onConnectEnd:h,onClickConnectStart:g,onClickConnectEnd:_,nodesDraggable:me,autoPanOnNodeFocus:he,nodesConnectable:ge,nodesFocusable:_e,edgesFocusable:ye,edgesReconnectable:be,elementsSelectable:xe,elevateNodesOnSelect:dt,elevateEdgesOnSelect:ft,minZoom:Ce,maxZoom:we,nodeExtent:De,onNodesChange:et,onEdgesChange:tt,snapToGrid:ue,snapGrid:de,connectionMode:L,translateExtent:Te,connectOnClick:st,defaultEdgeOptions:ut,fitView:at,fitViewOptions:ot,onNodesDelete:E,onEdgesDelete:D,onDelete:O,onNodeDragStart:C,onNodeDrag:w,onNodeDragStop:T,onSelectionDrag:j,onSelectionDragStart:A,onSelectionDragStop:M,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:it,nodeOrigin:ve,rfId:It,autoPanOnConnect:mt,autoPanOnNodeDrag:ht,autoPanSpeed:_t,onError:bt,connectionRadius:vt,isValidConnection:yt,selectNodesOnDrag:pe,nodeDragThreshold:Ct,connectionDragThreshold:wt,onBeforeDelete:I,debug:At,ariaLabelConfig:Mt,zIndexMode:Nt}),(0,B.jsx)(HW,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:y,onNodeMouseLeave:b,onNodeContextMenu:x,onNodeDoubleClick:S,nodeTypes:a,edgeTypes:o,connectionLineType:R,connectionLineStyle:ee,connectionLineComponent:te,connectionLineContainerStyle:ne,selectionKeyCode:ie,selectionOnDrag:ae,selectionMode:oe,deleteKeyCode:re,multiSelectionKeyCode:ce,panActivationKeyCode:se,zoomActivationKeyCode:le,onlyRenderVisibleElements:fe,defaultViewport:Se,translateExtent:Te,minZoom:Ce,maxZoom:we,preventScrolling:Ee,zoomOnScroll:ke,zoomOnPinch:Ae,zoomOnDoubleClick:Pe,panOnScroll:je,panOnScrollSpeed:Me,panOnScrollMode:Ne,panOnDrag:Fe,autoPanOnSelection:gt,onPaneClick:Ie,onPaneMouseEnter:Le,onPaneMouseMove:Re,onPaneMouseLeave:ze,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:He,nodeClickDistance:Ue,onSelectionContextMenu:N,onSelectionStart:P,onSelectionEnd:F,onReconnect:Ge,onReconnectStart:Ke,onReconnectEnd:qe,onEdgeContextMenu:Je,onEdgeDoubleClick:Ye,onEdgeMouseEnter:Xe,onEdgeMouseMove:Ze,onEdgeMouseLeave:Qe,reconnectRadius:$e,defaultMarkerColor:Oe,noDragClassName:nt,noWheelClassName:rt,noPanClassName:it,rfId:It,disableKeyboardA11y:pt,nodeExtent:De,viewport:Tt,onViewportChange:Et,nodesDraggable:me}),(0,B.jsx)(uH,{onSelectionChange:k}),We,(0,B.jsx)(iH,{proOptions:lt,position:ct}),(0,B.jsx)(tH,{rfId:It,disableKeyboardA11y:pt})]})})}var XW=IH(YW);UR.error014();function ZW({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,B.jsx)(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:aN([`react-flow__background-pattern`,n,r])})}function QW({radius:e,className:t}){return(0,B.jsx)(`circle`,{cx:e,cy:e,r:e,className:aN([`react-flow__background-pattern`,`dots`,t])})}var $W;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})($W||={});var eG={[$W.Dots]:1,[$W.Lines]:1,[$W.Cross]:6},tG=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function nG({id:e,variant:t=$W.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=(0,z.useRef)(null),{transform:f,patternId:p}=GV(tG,VV),m=r||eG[t],h=t===$W.Dots,g=t===$W.Cross,_=Array.isArray(n)?n:[n,n],v=[_[0]*f[2]||1,_[1]*f[2]||1],y=m*f[2],b=Array.isArray(a)?a:[a,a],x=g?[y,y]:v,S=[b[0]*f[2]||1+x[0]/2,b[1]*f[2]||1+x[1]/2],C=`${p}${e||``}`;return(0,B.jsxs)(`svg`,{className:aN([`react-flow__background`,l]),style:{...c,...YH,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[(0,B.jsx)(`pattern`,{id:C,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${S[0]},-${S[1]})`,children:h?(0,B.jsx)(QW,{radius:y/2,className:u}):(0,B.jsx)(ZW,{dimensions:x,lineWidth:i,variant:t,className:u})}),(0,B.jsx)(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${C})`})]})}nG.displayName=`Background`;var rG=(0,z.memo)(nG);function iG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:(0,B.jsx)(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function aG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:(0,B.jsx)(`path`,{d:`M0 0h32v4.2H0z`})})}function oG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:(0,B.jsx)(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function sG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,B.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function cG(){return(0,B.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:(0,B.jsx)(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function lG({children:e,className:t,...n}){return(0,B.jsx)(`button`,{type:`button`,className:aN([`react-flow__controls-button`,t]),...n,children:e})}var uG=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function dG({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":p}){let m=KV(),{isInteractive:h,minZoomReached:g,maxZoomReached:_,ariaLabelConfig:v}=GV(uG,VV),{zoomIn:y,zoomOut:b,fitView:x}=WH();return(0,B.jsxs)(nH,{className:aN([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":p??v[`controls.ariaLabel`],children:[t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(lG,{onClick:()=>{y(),a?.()},className:`react-flow__controls-zoomin`,title:v[`controls.zoomIn.ariaLabel`],"aria-label":v[`controls.zoomIn.ariaLabel`],disabled:_,children:(0,B.jsx)(iG,{})}),(0,B.jsx)(lG,{onClick:()=>{b(),o?.()},className:`react-flow__controls-zoomout`,title:v[`controls.zoomOut.ariaLabel`],"aria-label":v[`controls.zoomOut.ariaLabel`],disabled:g,children:(0,B.jsx)(aG,{})})]}),n&&(0,B.jsx)(lG,{className:`react-flow__controls-fitview`,onClick:()=>{x(i),s?.()},title:v[`controls.fitView.ariaLabel`],"aria-label":v[`controls.fitView.ariaLabel`],children:(0,B.jsx)(oG,{})}),r&&(0,B.jsx)(lG,{className:`react-flow__controls-interactive`,onClick:()=>{m.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),c?.(!h)},title:v[`controls.interactive.ariaLabel`],"aria-label":v[`controls.interactive.ariaLabel`],children:h?(0,B.jsx)(cG,{}):(0,B.jsx)(sG,{})}),u]})}dG.displayName=`Controls`;var fG=(0,z.memo)(dG);function pG({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:p}){let{background:m,backgroundColor:h}=a||{},g=o||m||h;return(0,B.jsx)(`rect`,{className:aN([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:g,stroke:s,strokeWidth:c},shapeRendering:d,onClick:p?t=>p(t,e):void 0})}var mG=(0,z.memo)(pG),hG=e=>e.nodes.map(e=>e.id),gG=e=>e instanceof Function?e:()=>e;function _G({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=mG,onClick:o}){let s=GV(hG,VV),c=gG(t),l=gG(e),u=gG(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return(0,B.jsx)(B.Fragment,{children:s.map(e=>(0,B.jsx)(yG,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function vG({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:p}=GV(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=Rz(r);return{node:r,x:i,y:a,width:o,height:s}},VV);return!l||l.hidden||!zz(l)?null:(0,B.jsx)(s,{x:u,y:d,width:f,height:p,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var yG=(0,z.memo)(vG),bG=(0,z.memo)(_G),xG=200,SG=150,CG=e=>!e.hidden,wG=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?Cz(oz(e.nodeLookup,{filter:CG}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},TG=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,EG=(e,t)=>TG(e.viewBB,t.viewBB)&&TG(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,DG=`react-flow__minimap-desc`;function OG({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:p,onNodeClick:m,pannable:h=!1,zoomable:g=!1,ariaLabel:_,inversePan:v,zoomStep:y=1,offsetScale:b=5}){let x=KV(),S=(0,z.useRef)(null),{boundingRect:C,viewBB:w,rfId:T,panZoom:E,translateExtent:D,flowWidth:O,flowHeight:k,ariaLabelConfig:A}=GV(wG,EG),j=e?.width??xG,M=e?.height??SG,N=C.width/j,P=C.height/M,F=Math.max(N,P),I=F*j,L=F*M,R=b*F,ee=C.x-(I-C.width)/2-R,te=C.y-(L-C.height)/2-R,ne=I+R*2,re=L+R*2,ie=`${DG}-${T}`,ae=(0,z.useRef)(0),oe=(0,z.useRef)();ae.current=F,(0,z.useEffect)(()=>{if(S.current&&E)return oe.current=nV({domNode:S.current,panZoom:E,getTransform:()=>x.getState().transform,getViewScale:()=>ae.current}),()=>{oe.current?.destroy()}},[E]),(0,z.useEffect)(()=>{oe.current?.update({translateExtent:D,width:O,height:k,inversePan:v,pannable:h,zoomStep:y,zoomable:g})},[h,g,v,y,D,O,k]);let se=p?e=>{let[t,n]=oe.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,ce=m?(0,z.useCallback)((e,t)=>{let n=x.getState().nodeLookup.get(t).internals.userNode;m(e,n)},[]):void 0,le=_??A[`minimap.ariaLabel`];return(0,B.jsx)(nH,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*F:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:aN([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:(0,B.jsxs)(`svg`,{width:j,height:M,viewBox:`${ee} ${te} ${ne} ${re}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":ie,ref:S,onClick:se,children:[le&&(0,B.jsx)(`title`,{id:ie,children:le}),(0,B.jsx)(bG,{onClick:ce,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),(0,B.jsx)(`path`,{className:`react-flow__minimap-mask`,d:`M${ee-R},${te-R}h${ne+R*2}v${re+R*2}h${-ne-R*2}z
86
+ M${w.x},${w.y}h${w.width}v${w.height}h${-w.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}OG.displayName=`MiniMap`,(0,z.memo)(OG);var kG=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,AG={[_V.Line]:`right`,[_V.Handle]:`bottom-right`};function jG({nodeId:e,position:t,variant:n=_V.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:p=!0,shouldResize:m,onResizeStart:h,onResize:g,onResizeEnd:_}){let v=lU(),y=typeof e==`string`?e:v,b=KV(),x=(0,z.useRef)(null),S=n===_V.Handle,C=GV((0,z.useCallback)(kG(S&&p),[S,p]),VV),w=(0,z.useRef)(null),T=t??AG[n];return(0,z.useEffect)(()=>{if(!(!x.current||!y))return w.current||=OV({domNode:x.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=b.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=b.getState(),o=[],s={x:e.x,y:e.y},c=r.get(y);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=FB([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...Bz({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:y,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:y,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:y,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};b.getState().triggerNodeChanges([n])}}),w.current.update({controlPosition:T,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:h,onResize:g,onResizeEnd:_,shouldResize:m}),()=>{w.current?.destroy()}},[T,s,c,l,u,d,h,g,_,m]),(0,B.jsx)(`div`,{className:aN([`react-flow__resize-control`,`nodrag`,...T.split(`-`),n,r]),ref:x,style:{...i,scale:C,...o&&{[S?`backgroundColor`:`borderColor`]:o}},children:a})}(0,z.memo)(jG);var MG={agent:Oe,human:ut,command:st,change:T};function NG({data:e}){let t=MG[e.kind]??at,n=e.style===`success`?ke:e.style===`danger`||e.style===`muted`?ft:e.style===`active`?Pe:Ve;return(0,B.jsxs)(`article`,{"aria-label":`${e.label}: ${e.state}`,className:x(`dag-node`,`state-${e.state}`,`token-${e.style}`),"data-selected":e.selected,children:[(0,B.jsx)(_U,{type:`target`,position:$.Left}),(0,B.jsxs)(`div`,{className:`node-heading`,children:[(0,B.jsxs)(f,{className:`node-kind px-1.5 py-0 text-[9px] tracking-[.1em] uppercase`,variant:`outline`,children:[(0,B.jsx)(t,{"aria-label":e.kind,role:`img`,size:10}),e.kind]}),(0,B.jsx)(n,{className:x(e.style===`active`&&`spin`),size:17})]}),(0,B.jsx)(`strong`,{children:e.label}),(0,B.jsx)(`span`,{className:`node-status`,children:e.state}),e.reason!==void 0&&(0,B.jsx)(`span`,{className:`node-reason`,title:e.reason,children:e.reason}),e.awaits!==void 0&&(0,B.jsx)(`span`,{className:`node-awaits`,title:e.awaits,children:e.awaits}),(0,B.jsx)(_U,{type:`source`,position:$.Right})]})}function PG({data:e,id:t,markerEnd:n,style:r}){return(0,B.jsx)(ZU,{id:t,path:FG(e?.points??[]),markerEnd:n,style:r})}function FG(e){let[t,...n]=e;return t?`M ${t.x} ${t.y} ${n.map(e=>`L ${e.x} ${e.y}`).join(` `)}`:``}function IG({edits:e}){return e===void 0?null:(0,B.jsxs)(`section`,{"aria-labelledby":`rejected-edits-title`,className:`rejected-edits`,children:[(0,B.jsx)(`h2`,{id:`rejected-edits-title`,children:`Refused edits`}),(0,B.jsx)(`ol`,{children:e.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsx)(`span`,{className:`rejected-edit-what`,children:e.author}),(0,B.jsx)(`span`,{className:`rejected-edit-reason`,children:e.reason})]},`${e.at}:${e.envelope??``}:${e.index??``}`))})]})}var LG={dagNode:NG},RG={routed:PG};function zG({nodes:e,selectedNodeId:t,onSelectNode:n,journalSeq:r,rejectedEdits:i}){let a=(0,z.useMemo)(()=>{let t=new Map;for(let n of e)le(n.status)&&t.set(n.id,ye(n));return t},[e]),o=(0,z.useMemo)(()=>new Map(e.map(e=>[e.id,_e(e)])),[e]),{nodes:s,edges:c}=(0,z.useMemo)(()=>{let n=new Set(e.map(e=>e.id)),r=ve({nodes:e.map(e=>({id:e.id,label:e.label,kind:e.kind,state:e.status,...pe(a.get(e.id),o.get(e.id))})),edges:e.flatMap(e=>(e.task?.deps??[]).filter(e=>n.has(e)).map(t=>({id:`${t}->${e.id}`,source:t,target:e.id})))});return{nodes:r.nodes.map(e=>({id:e.id,type:`dagNode`,position:{x:e.x,y:e.y},data:{label:e.label,kind:e.kind,state:e.state,style:e.style,selected:e.id===t,...a.get(e.id)===void 0?{}:{reason:a.get(e.id)},...o.get(e.id)===void 0?{}:{awaits:o.get(e.id)}},width:e.width,height:e.height,measured:{width:e.width,height:e.height},handles:[{type:`target`,position:$.Left,x:0,y:e.height/2,width:0,height:0},{type:`source`,position:$.Right,x:e.width,y:e.height/2,width:0,height:0}]})),edges:r.edges.map(t=>({id:t.id,source:t.source,target:t.target,type:`routed`,data:{points:t.points},animated:e.find(({id:e})=>e===t.target)?.status===`running`}))}},[e,a,o,t]);return(0,B.jsxs)(`div`,{className:`graph-wrap`,"data-journal-seq":r,children:[(0,B.jsxs)(XW,{nodes:s,edges:c,colorMode:`dark`,nodeTypes:LG,edgeTypes:RG,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,fitView:!0,minZoom:.05,onInit:e=>void e.fitView(),onNodeClick:(e,t)=>n(t.id),"aria-label":`DAG execution graph`,children:[(0,B.jsx)(rG,{color:`var(--border)`,gap:22}),(0,B.jsx)(fG,{showInteractive:!1})]}),(0,B.jsx)(IG,{edits:i}),(0,B.jsx)(`ol`,{className:`accessible-node-list`,"aria-label":`DAG nodes`,children:e.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),children:[e.label,`: `,e.status,a.get(e.id)===void 0?``:` — ${a.get(e.id)}`,o.get(e.id)===void 0?``:` — ${o.get(e.id)}`]})},e.id))})]})}function BG({value:e,label:t=`Record`}){return e==null?(0,B.jsx)(`span`,{children:`Not recorded`}):typeof e==`boolean`?(0,B.jsx)(`span`,{children:e?`Yes`:`No`}):typeof e==`string`||typeof e==`number`?(0,B.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:String(e)}):Array.isArray(e)?e.length===0?(0,B.jsx)(`span`,{children:`None`}):(0,B.jsx)(`ol`,{"aria-label":t,children:e.map((e,n)=>(0,B.jsx)(`li`,{"aria-label":`${t}.${n}`,children:(0,B.jsx)(BG,{label:`${t}.${n}`,value:e})},n))}):typeof e==`object`?(0,B.jsx)(`div`,{className:`structured-fields`,children:Object.entries(e).map(([e,n])=>(0,B.jsxs)(`fieldset`,{"aria-label":`${t}.${e}`,children:[(0,B.jsx)(`legend`,{children:e.replaceAll(`_`,` `)}),(0,B.jsx)(BG,{label:`${t}.${e}`,value:n})]},e))}):(0,B.jsx)(`span`,{children:`Not recorded`})}function VG(e,t){let[n,r]=(0,z.useState)(0);return{host:nN(`host`,()=>e.host(),n),unwatched:nN(`unwatched`,()=>e.unwatched(),n),refresh:(0,z.useCallback)(()=>{r(e=>e+1),t?.()},[t])}}var HG=[`Run`,`Node`,`Provider`,`Age (ms)`,`Proof`];function UG(e,t){let n=e?.runs??[];if(t===void 0)return n;let r=new Map(t.map(e=>[e.id,e])),i=new Set(n.map(e=>e.run_id));return[...n.flatMap(e=>{let t=r.get(e.run_id);if(t===void 0)return[];let{done:n,failed:i,running:a}=t.nodes;return[{run_id:e.run_id,state:t.state,node_counts:{...e.node_counts,done:n,failed:i,running:a}}]}),...(e===void 0?[]:t).filter(e=>!i.has(e.id)).map(({id:e,state:t,nodes:{done:n,failed:r,running:i}})=>({run_id:e,state:t,node_counts:{done:n,failed:r,running:i}}))]}function WG({client:e,onRefresh:t,list:n,rows:r,listError:i,children:a}){let{host:o,unwatched:s,refresh:c}=VG(e,t),l=o.value?.reading;return(0,B.jsx)(Iu,{className:`min-h-0 flex-1`,children:(0,B.jsxs)(`section`,{"aria-label":`Host`,className:`channel-view host-page`,children:[(0,B.jsxs)(`h2`,{children:[`This host`,l&&(0,B.jsxs)(B.Fragment,{children:[` · `,(0,B.jsx)(`output`,{"aria-label":`Host name`,className:`host-name`,children:l.host})]})]}),(0,B.jsx)(ui,{onClick:c,children:`Refresh host`}),(o.error||s.error)&&(0,B.jsx)(`p`,{role:`alert`,children:o.error?.message??s.error?.message}),o.loading&&(0,B.jsx)(`p`,{role:`status`,children:`Reading host…`}),l&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:`Runs root`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Runs root path`,children:l.root})})]}),l.root_error&&(0,B.jsx)(`p`,{role:`alert`,children:l.root_error}),(0,B.jsxs)(`section`,{"aria-label":`Free space`,children:[(0,B.jsx)(`h3`,{children:`Free space`}),l.free_space.map((e,t)=>(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:`Filesystem`}),(0,B.jsx)(`dd`,{children:e.roots.map((e,t)=>(0,B.jsxs)(`span`,{children:[t>0&&` · `,e.role,`:`,` `,(0,B.jsx)(`output`,{"aria-label":`Filesystem root path`,children:e.path??`unresolved`}),e.measured_at&&(0,B.jsxs)(B.Fragment,{children:[` `,`(measured at`,` `,(0,B.jsx)(`output`,{"aria-label":`Measured root ancestor`,children:e.measured_at}),`)`]})]},e.role))}),(0,B.jsx)(`dt`,{children:`Free bytes`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Free capacity bytes`,children:e.free_bytes??`Unknown`})}),(0,B.jsx)(`dt`,{children:`Total bytes`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Total capacity bytes`,children:e.total_bytes??`Unknown`})}),e.error&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Error`}),(0,B.jsx)(`dd`,{children:e.error})]})]},e.roots[0]?.path??t))]}),(0,B.jsxs)(`section`,{"aria-label":`Providers and dispatches`,children:[(0,B.jsx)(`h3`,{children:`Providers and dispatches`}),l.dispatches.length===0?(0,B.jsx)(`p`,{children:`No live dispatches`}):(0,B.jsx)(`section`,{"aria-label":`Providers and dispatches table`,className:`host-table`,children:(0,B.jsxs)(`table`,{children:[(0,B.jsx)(`thead`,{children:(0,B.jsx)(`tr`,{children:HG.map(e=>(0,B.jsx)(`th`,{children:e},e))})}),(0,B.jsx)(`tbody`,{children:l.dispatches.map(e=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{"data-label":`Run`,children:e.run}),(0,B.jsx)(`td`,{"data-label":`Node`,children:e.node}),(0,B.jsx)(`td`,{"data-label":`Provider`,children:e.launcher}),(0,B.jsx)(`td`,{"data-label":`Age (ms)`,children:(0,B.jsx)(`output`,{"aria-label":`Dispatch age milliseconds`,className:`host-age`,children:e.age_ms??`Unknown`})}),(0,B.jsxs)(`td`,{"data-label":`Proof`,children:[e.proof,e.unproven&&`: ${e.unproven}`]})]},`${e.run}/${e.node}`))})]})})]}),(0,B.jsxs)(`section`,{"aria-label":`Gone dispatches`,children:[(0,B.jsx)(`h3`,{children:`Gone dispatches`}),l.gone.map(e=>(0,B.jsxs)(`p`,{children:[e.run,` · `,e.node,` · `,e.reason]},`${e.run}/${e.node}`))]}),l.skipped.map(e=>(0,B.jsxs)(`p`,{children:[e.path,`: `,e.reason]},e.path))]}),(0,B.jsxs)(`section`,{"aria-label":`Unwatched runs`,children:[(0,B.jsxs)(`h3`,{children:[`Unwatched runs: `,s.value?.reported.length??`…`]}),s.value?.reported.map(e=>(0,B.jsxs)(`dl`,{children:[(0,B.jsx)(`dt`,{children:e.run}),(0,B.jsxs)(`dd`,{children:[e.standing,` · `,e.why_not_watched]})]},e.run)),s.value?.unresolved.map(e=>(0,B.jsx)(`p`,{children:e},e))]}),(0,B.jsxs)(`section`,{"aria-label":`Runs on the host`,children:[(0,B.jsx)(`h3`,{children:`Runs on the host`}),i&&(0,B.jsxs)(`p`,{role:`alert`,children:[`Listing unavailable: `,i.message]}),UG(n,r).map(e=>(0,B.jsx)(`p`,{children:[e.run_id,e.state,j(e.node_counts)].filter(Boolean).join(` · `)},e.run_id))]}),(0,B.jsxs)(`details`,{"aria-label":`Provider health`,children:[(0,B.jsx)(`summary`,{children:`Provider health`}),(0,B.jsx)(BG,{value:n?.provider_health})]}),a]})})}function GG(e,t,n){let{value:r,error:i}=nN(t?`host-listing`:void 0,async()=>{let[t,n]=await Promise.all([e.listRuns(!0),e.listProjects()]);return{...t,runs:n.projects.flatMap(e=>e.runs),next_cursor:void 0}},n);return t?{list:r,error:i}:{}}function KG(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function qG(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function JG(e){return e}var YG=[],XG=`skip`;function ZG(e,t,n,r){if(!e||typeof e!=`object`)throw Error("Unexpected value `"+e+"` for `tree`, expected node");let i=!0,a,o,s,c;if(typeof n==`function`||n&&typeof n==`object`?(a=t,o=n,r&&(i=!1)):(o=t,n&&(i=!1)),typeof o==`function`)s=o;else if(o&&typeof o==`object`){if(!(o.enter===null||o.enter===void 0))if(typeof o.enter==`function`)s=o.enter;else throw Error("Unexpected value `"+o.enter+"` for `visitors.enter`, expected optional visitor");if(typeof o.exit==`function`)c=o.exit;else throw Error("Unexpected value `"+o.exit+"` for `visitors.exit`, expected visitor (pass a visitor directly if you only want an enter visitor)")}else throw Error("Unexpected value `"+o+"` for `enter` or `visitors`, expected visitor or object with visitors");let l=Lv(a),u=i?1:-1;d(e,void 0,[])();function d(e,t,n){let r=e&&typeof e==`object`?e:{};if(typeof r.type==`string`){let t=typeof r.tagName==`string`?r.tagName:typeof r.name==`string`?r.name:void 0;Object.defineProperty(o,"name",{value:`node (`+JG(e.type+(t?`<`+t+`>`:``))+`)`})}return o;function o(){let r=!a||l(e,t,n[n.length-1]||void 0),o=YG;if(s&&r&&(o=QG(s(e,n,t)),o[0]===!1))return o;if(`children`in e&&e.children){let t=e;if(t.children&&o[0]!==`skip`){let e=(i?-1:t.children.length)+u,r=[...n,t];for(;e>-1&&e<t.children.length;){let n=t.children[e],i=d(n,e,r)();if(i[0]===!1)return i;e=typeof i[1]==`number`?i[1]:e+u}}}if(c&&r){let r=QG(c(e,n,t));if(r[0]===`skip`)throw Error("Unexpected value `"+r[0]+"` from `exit`, expected `CONTINUE`, `EXIT`, index, or nothing");if(r[0]===!1||typeof r[1]==`number`)return r}return o}}}function QG(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?YG:[e]}function $G(e,t,n){let r=Lv((n||{}).ignore||[]),i=eK(t),a=-1;for(;++a<i.length;)ZG(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return XG}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i===!1)o.lastIndex=n+1;else{if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function eK(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([tK(e[0]),nK(e[1])])}return t}function tK(e){return typeof e==`string`?new RegExp(qG(e),`g`):e}function nK(e){return typeof e==`function`?e:function(){return e}}var rK=`phrasing`,iK=[`autolink`,`link`,`image`,`label`];function aK(){return{transforms:[pK],enter:{literalAutolink:sK,literalAutolinkEmail:cK,literalAutolinkHttp:cK,literalAutolinkWww:cK},exit:{literalAutolink:fK,literalAutolinkEmail:dK,literalAutolinkHttp:lK,literalAutolinkWww:uK}}}function oK(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:rK,notInConstruct:iK},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:rK,notInConstruct:iK},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:rK,notInConstruct:iK}]}}function sK(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function cK(e){this.config.enter.autolinkProtocol.call(this,e)}function lK(e){this.config.exit.autolinkProtocol.call(this,e)}function uK(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function dK(e){this.config.exit.autolinkEmail.call(this,e)}function fK(e){this.exit(e)}function pK(e){$G(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,mK],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,_K],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,gK],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,hK]],{ignore:[`link`,`linkReference`]})}function mK(e,t,n,r,i){if(!bK(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),ph(n.charCodeAt(0))||!vK(n))return!1;let o=yK(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function hK(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function gK(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function _K(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function vK(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function yK(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=KG(e,`(`),a=KG(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function bK(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||mh(t)||ph(t)}AK.peek=kK;function xK(){this.buffer()}function SK(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function CK(){this.buffer()}function wK(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function TK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=rh(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EK(e){this.exit(e)}function DK(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=rh(this.sliceSerialize(e)).toLowerCase(),n.label=t}function OK(e){this.exit(e)}function kK(){return`[`}function AK(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function jK(){return{enter:{gfmFootnoteCallString:xK,gfmFootnoteCall:SK,gfmFootnoteDefinitionLabelString:CK,gfmFootnoteDefinition:wK},exit:{gfmFootnoteCallString:TK,gfmFootnoteCall:EK,gfmFootnoteDefinitionLabelString:DK,gfmFootnoteDefinition:OK}}}function MK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:AK},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
87
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?PK:NK))),s(),o}}function NK(e,t,n){return t===0?e:PK(e,t,n)}function PK(e,t,n){return(n?``:` `)+e}var FK=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];BK.attention=VK,BK.peek=HK;function IK(){return{canContainEols:[`delete`],enter:{strikethrough:RK},exit:{strikethrough:zK}}}function LK(){return{handlers:{delete:BK},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:FK}]}}function RK(e){this.enter({type:`delete`,children:[],position:void 0},e)}function zK(e){this.exit(e)}function BK(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function VK(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function HK(){return`~`}function UK(e){return e.length}function WK(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||UK,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=GK(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=KK(r[d]);else{let e=KK(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&o===``)&&(n.delimiterStart!==!1||d)&&i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
88
+ `)}function GK(e){return e==null?``:String(e)}function KK(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function qK(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),JK);return i(),o}function JK(e,t,n){return`>`+(n?``:` `)+e}function YK(e,t){return XK(e,t.inConstruct,!0)&&!XK(e,t.notInConstruct,!1)}function XK(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ZK(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
89
+ `&&YK(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
90
+ `}function QK(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function $K(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function eq(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function tq(e,t,n,r){let i=eq(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if($K(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,nq);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(QK(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
91
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
92
+ `),a&&(u+=s.move(a+`
93
+ `)),u+=s.move(c),l(),u}function nq(e,t,n){return(n?``:` `)+e}function rq(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function iq(e,t,n,r){let i=rq(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
94
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function aq(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function oq(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function sq(e,t,n){let r=wh(e),i=wh(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}cq.peek=lq;function cq(e,t,n,r){let i=aq(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=sq(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=oq(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=sq(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+oq(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function lq(e,t,n){return n.options.emphasis||`*`}function uq(e,t){let n=!1;return Jv(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Wm(e)&&(t.options.setext||n))}function dq(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(uq(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
95
+ `,after:`
96
+ `});return r(),t(),o+`
97
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
98
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
99
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=oq(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}fq.peek=pq;function fq(e){return e.value||``}function pq(){return`<`}mq.peek=hq;function mq(e,t,n,r){let i=rq(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function hq(){return`!`}gq.peek=_q;function gq(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function _q(){return`!`}vq.peek=yq;function vq(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function yq(){return"`"}function bq(e,t){let n=Wm(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}xq.peek=Sq;function xq(e,t,n,r){let i=rq(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(bq(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Sq(e,t,n){return bq(e,n)?`<`:`[`}Cq.peek=wq;function Cq(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function wq(){return`[`}function Tq(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Eq(e){let t=Tq(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Dq(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Oq(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function kq(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Dq(n):Tq(n),s=e.ordered?o===`.`?`)`:`.`:Eq(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Oq(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Aq(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function jq(e,t,n,r){let i=Aq(n),a=n.bulletCurrent||Tq(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Mq(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var Nq=Lv([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Pq(e,t,n,r){return(e.children.some(function(e){return Nq(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Fq(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Iq.peek=Lq;function Iq(e,t,n,r){let i=Fq(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=sq(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=oq(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=sq(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+oq(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Lq(e,t,n){return n.options.strong||`*`}function Rq(e,t,n,r){return n.safe(e.value,r)}function zq(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Bq(e,t,n){let r=(Oq(n)+(n.options.ruleSpaces?` `:``)).repeat(zq(n));return n.options.ruleSpaces?r.slice(0,-1):r}var Vq={blockquote:qK,break:ZK,code:tq,definition:iq,emphasis:cq,hardBreak:ZK,heading:dq,html:fq,image:mq,imageReference:gq,inlineCode:vq,link:xq,linkReference:Cq,list:kq,listItem:jq,paragraph:Mq,root:Pq,strong:Iq,text:Rq,thematicBreak:Bq};function Hq(){return{enter:{table:Uq,tableData:qq,tableHeader:qq,tableRow:Gq},exit:{codeText:Jq,table:Wq,tableData:Kq,tableHeader:Kq,tableRow:Kq}}}function Uq(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function Wq(e){this.exit(e),this.data.inTable=void 0}function Gq(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function Kq(e){this.exit(e)}function qq(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function Jq(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Yq));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Yq(e,t){return t===`|`?t:e}function Xq(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[Zq],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
100
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
101
+ `))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return WK(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=Vq.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function Zq(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&Qq(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function Qq(e,t){let n=!1;return Jv(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&Wm(e)&&(t.options.setext||n))}function $q(){return{exit:{taskListCheckValueChecked:tJ,taskListCheckValueUnchecked:tJ,paragraph:nJ}}}function eJ(){return{handlers:{paragraph:rJ},join:[iJ]}}function tJ(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function nJ(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function rJ(e,t,n,r){if(!t||t.type!==`listItem`||aJ(t)!==e)return Vq.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+Vq.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function iJ(e,t,n){if(!(e.type===`definition`&&n.type===`listItem`))return;let r=aJ(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function aJ(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function oJ(){return[aK(),jK(),IK(),Hq(),$q()]}function sJ(e){return{extensions:[oK(),MK(e),LK(),Xq(e),eJ()]}}var cJ={tokenize:SJ,partial:!0},lJ={tokenize:CJ,partial:!0},uJ={tokenize:wJ,partial:!0},dJ={tokenize:TJ,partial:!0},fJ={tokenize:EJ,partial:!0},pJ={name:`wwwAutolink`,tokenize:bJ,previous:DJ},mJ={name:`protocolAutolink`,tokenize:xJ,previous:OJ},hJ={name:`emailAutolink`,tokenize:yJ,previous:kJ},gJ={};function _J(){return{text:gJ}}for(var vJ=48;vJ<123;)gJ[vJ]=hJ,vJ++,vJ===58?vJ=65:vJ===91&&(vJ=97);gJ[43]=hJ,gJ[45]=hJ,gJ[46]=hJ,gJ[95]=hJ,gJ[72]=[hJ,mJ],gJ[104]=[hJ,mJ],gJ[87]=[hJ,pJ],gJ[119]=[hJ,pJ];function yJ(e,t,n){let r=this,i,a;return o;function o(t){return!AJ(t)||!kJ.call(r,r.previous)||jJ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return AJ(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(fJ,u,l)(t):t===45||t===95||ah(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&ih(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function bJ(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!DJ.call(r,r.previous)||jJ(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(cJ,e.attempt(lJ,e.attempt(uJ,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function xJ(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&OJ.call(r,r.previous)&&!jJ(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(ih(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||sh(t)||dh(t)||mh(t)||ph(t)?n(t):e.attempt(lJ,e.attempt(uJ,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function SJ(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function CJ(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(dJ,c,s)(t):t===null||dh(t)||mh(t)||t!==45&&ph(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function wJ(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(dJ,t,a)(o):o===null||dh(o)||mh(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function TJ(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||dh(o)||mh(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||dh(e)||mh(e)?t(e):r(e)}function a(e){return ih(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):ih(t)?(e.consume(t),o):n(t)}}function EJ(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return ah(e)?n(e):t(e)}}function DJ(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||dh(e)}function OJ(e){return!ih(e)}function kJ(e){return!(e===47||AJ(e))}function AJ(e){return e===43||e===45||e===46||e===95||ah(e)}function jJ(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var MJ={tokenize:BJ,partial:!0};function NJ(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:LJ,continuation:{tokenize:RJ},exit:zJ}},text:{91:{name:`gfmFootnoteCall`,tokenize:IJ},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:PJ,resolveTo:FJ}}}}function PJ(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=rh(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function FJ(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function IJ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||dh(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(rh(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return dh(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function LJ(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||dh(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=rh(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return dh(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),_h(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function RJ(e,t,n){return e.check(Mh,t,e.attempt(MJ,t,n))}function zJ(e){e.exit(`gfmFootnoteDefinition`)}function BJ(e,t,n){let r=this;return _h(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function VJ(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Xm(o,o.length,0,Th(s,e.slice(r+1,n),t)),Xm(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Xm(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=wh(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=wh(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var HJ=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){UJ(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function UJ(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function WJ(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function GJ(){return{flow:{null:{name:`table`,tokenize:KJ,resolveAll:qJ}}}}function KJ(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):U(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):fh(t)?_h(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||dh(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,fh(t)?_h(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return fh(t)?_h(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||U(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return fh(t)?_h(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||U(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||U(n)?(e.exit(`tableRow`),t(n)):fh(n)?_h(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||dh(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function qJ(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new HJ;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(YJ(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=JJ(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=JJ(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=JJ(f,t,o,i,n,d)):(o[0]=o[1],d=JJ(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&YJ(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=WJ(t.events,n))}return e}function JJ(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},XJ(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=XJ(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=XJ(t.events,n[2]),a=XJ(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},XJ(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function YJ(e,t,n,r,i){let a=[],o=XJ(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function XJ(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var ZJ={name:`tasklistCheck`,tokenize:$J};function QJ(){return{text:{91:ZJ}}}function $J(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return dh(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return U(r)?t(r):fh(r)?e.check({tokenize:eY},t,n)(r):n(r)}}function eY(e,t,n){return _h(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function tY(e){return $m([_J(),NJ(),VJ(e),GJ(),QJ()])}var nY={};function rY(e){let t=this,n=e||nY,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(tY(n)),a.push(oJ()),o.push(sJ(n))}var iY=new Set([`http:`,`https:`,`mailto:`]);function aY(e){try{return new URL(e)}catch{return}}function oY(e){let t=e===void 0?void 0:aY(e)?.protocol;return t!==void 0&&iY.has(t)?e:void 0}var sY={target:`_blank`,rel:`noopener noreferrer`},cY=typeof window>`u`?z.useEffect:z.useLayoutEffect;function lY(e,t){let n=(0,z.useRef)(null);return cY(()=>{let t=n.current;if(!t||e===void 0)return;let r=()=>{t.removeAttribute(`data-otg-table-cut`);let e=t.querySelector(`table`);if(!e||t.scrollHeight<=t.clientHeight)return;let n=e.getBoundingClientRect().top-t.getBoundingClientRect().top;t.toggleAttribute(`data-otg-table-cut`,n<t.clientHeight)};r();let i=t.clientWidth,a=new ResizeObserver(()=>{t.clientWidth!==i&&(i=t.clientWidth,r())});a.observe(t);let o=!0;return document.fonts?.ready.then(()=>{o&&r()}),()=>{o=!1,a.disconnect()}},[e,t]),n}function uY(e){return e.tagName===`img`?{type:`text`,value:String(e.properties?.alt||`image`)}:(e.children&&=e.children.map(uY),e)}function dY(){let e=t=>{t.tagName===`a`?uY(t):t.children?.forEach(e)};return e}function fY({href:e,children:t}){let n=oY(e);return(0,B.jsx)(`a`,{href:n,...n===void 0?{}:sY,children:t})}var pY={a:({href:e,children:t})=>(0,B.jsx)(fY,{href:e,children:t}),img:({src:e,alt:t})=>(0,B.jsx)(fY,{href:typeof e==`string`?e:void 0,children:t||`image`})},mY=[rY],hY=[dY];function gY({source:e,clamp:t}){let n=t!==void 0&&Number.isInteger(t)&&t>0?t:void 0,r=lY(n,e),i=n===void 0?void 0:{WebkitLineClamp:n,maxHeight:`calc(${n} * 1lh)`};return(0,B.jsx)(`div`,{className:n===void 0?`otg-markdown`:`otg-markdown otg-markdown--clamped`,ref:r,style:i,children:(0,B.jsx)(Ky,{components:pY,rehypePlugins:hY,remarkPlugins:mY,children:e})})}function _Y({title:e,body:t,badges:n,meta:r,links:i,actions:a,clamp:o,children:s,className:c,...l}){let u=(0,z.useId)();return(0,B.jsx)(`article`,{...l,"aria-labelledby":u,className:c?`otg-card ${c}`:`otg-card`,children:(0,B.jsxs)(`div`,{className:`otg-card__surface`,children:[(0,B.jsxs)(`div`,{className:`otg-card__header`,children:[n!=null&&(0,B.jsx)(`div`,{className:`otg-card__badges`,children:n}),(0,B.jsx)(`h3`,{className:`otg-card__title`,id:u,children:e}),a!=null&&(0,B.jsx)(`div`,{className:`otg-card__actions`,children:a})]}),r!=null&&(0,B.jsx)(`div`,{className:`otg-card__meta`,children:r}),i!=null&&(0,B.jsx)(`div`,{className:`otg-card__links`,children:i}),t?(0,B.jsx)(gY,{source:t,...o===void 0?{}:{clamp:o}}):null,s]})})}var vY=new Map([[`github.com`,`GitHub`],[`linear.app`,`Linear`]]);function yY(e){return vY.get(aY(e)?.hostname??``)??`tracker`}function bY({url:e,label:t,...n}){let r=oY(e);return(0,B.jsx)(`a`,{"aria-label":`Open ${yY(e)} issue ${t}`,...n,href:r,...sY,className:[`otg-source-link`,n.className].filter(Boolean).join(` `),children:t})}var xY=15e3;function SY(e,t,n){let[r,i]=(0,z.useState)(!1),[a,o]=(0,z.useState)(!1),[s,c]=(0,z.useState)(!1),[l,u]=(0,z.useState)(``),[d,f]=(0,z.useState)(!1),p=(0,z.useRef)(null),{key:m,phase:h,followUp:g}=e,_=h===`sending`||g?.phase===`failed`||g?.phase===`sending`;return(0,z.useLayoutEffect)(()=>{if(f(!1),_)return;let e=setTimeout(()=>f(!0),xY);return()=>clearTimeout(e)},[`${m}:${h}:${g?.kind??``}:${g?.phase??``}`,_]),(0,z.useEffect)(()=>{c(!1),u(``)},[m]),(0,z.useEffect)(()=>{g?.kind===`note`&&g.phase===`done`&&(c(!1),u(``))},[g]),(0,z.useEffect)(()=>{if(!d||r||s)return;let e=p.current?.contains(document.activeElement)??!1;a&&e||t()},[d,r,a,s,t]),(0,z.useEffect)(()=>{if(!r)return;let e=e=>{let t=p.current;t!==null&&e.target instanceof Node&&!t.contains(e.target)&&i(!1)};return document.addEventListener(`pointerover`,e,!0),()=>document.removeEventListener(`pointerover`,e,!0)},[r]),(0,z.useEffect)(()=>{let e=p.current;if(e===null)return;let t=()=>n(e.getBoundingClientRect().height);t();let r=new ResizeObserver(t);return r.observe(e),()=>{r.disconnect(),n(0)}},[n]),{holds:{ref:p,onFocus:()=>o(!0),onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||o(!1)},onPointerEnter:()=>i(!0),onPointerLeave:()=>i(!1)},writing:s,setWriting:c,text:l,setText:u}}var CY={complete:`Completed`,dismiss:`Dismissed`},wY={complete:`Completing`,dismiss:`Dismissing`},TY={complete:`Reopened`,dismiss:`Restored`};function EY(e){let{action:t,title:n,phase:r,error:i,followUp:a}=e;if(r===`failed`)return`Not ${CY[t].toLowerCase()}: ${n}. ${i??``}`.trim();let o=TY[t],s=t===`dismiss`?`Reason`:`Comment`;return a?.phase===`failed`?a.kind===`undo`?`Not ${o.toLowerCase()}: ${n}. ${a.error??``}`.trim():`${s} not saved: ${n}. ${a.error??``}`.trim():a?.phase===`done`?a.kind===`undo`?`${o}: ${n}`:`${s} saved: ${n}`:r===`sending`?`${wY[t]}: ${n}…`:`${CY[t]}: ${n}`}function DY({toast:e,onUndo:t,onNote:n,onClose:r,onRoom:i}){let{holds:a,writing:o,setWriting:s,text:c,setText:l}=SY(e,r,i),u=(0,z.useId)(),{action:d,phase:f,followUp:p}=e,m=f===`failed`||p?.phase===`failed`,h=f!==`failed`,g=p?.kind===`undo`&&p.phase===`done`,_=d===`dismiss`?`Add reason`:`Add comment`,v=d===`dismiss`?`Reason`:`Comment`;return(0,B.jsxs)(`section`,{"aria-label":`Action result`,className:`human-items-toast`,"data-phase":p?.phase??f,"data-tone":m?`failure`:`success`,...a,children:[(0,B.jsx)(`p`,{className:`human-items-toast-message`,role:m?`alert`:`status`,children:EY(e)}),h&&!g&&(0,B.jsxs)(`div`,{className:`human-items-toast-actions`,children:[(0,B.jsx)(OY,{label:d===`dismiss`?`Restore`:`Reopen`,onPress:t,reopen:e.reopen,sending:p?.kind===`undo`&&p.phase===`sending`}),!o&&(0,B.jsx)(`button`,{className:`human-items-toast-action`,onClick:()=>s(!0),type:`button`,children:_})]}),h&&!g&&o&&(0,B.jsxs)(`form`,{className:`human-items-toast-note`,onSubmit:e=>{e.preventDefault(),c.trim()!==``&&n(c)},children:[(0,B.jsx)(`label`,{className:`sr-only`,htmlFor:u,children:v}),(0,B.jsx)(`input`,{autoFocus:!0,id:u,onChange:e=>l(e.target.value),placeholder:`${v}, then Enter`,readOnly:p?.kind===`note`&&p.phase===`sending`,value:c}),(0,B.jsx)(`button`,{className:`human-items-toast-action`,type:`submit`,children:p?.kind===`note`&&p.phase===`failed`?`Send again`:`Send`})]}),(0,B.jsx)(`button`,{"aria-label":`Close`,className:`human-items-toast-close`,onClick:r,type:`button`,children:(0,B.jsx)(ft,{"aria-hidden":`true`,size:14})})]})}function OY({label:e,reopen:t,sending:n,onPress:r}){let[i,a]=(0,z.useState)(!1),[o,s]=(0,z.useState)(!1),c=(0,z.useId)();return t?.available===!1?(0,B.jsxs)(`fieldset`,{"aria-label":`${e} (unavailable)`,className:`human-items-toast-action human-items-unavailable`,onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1),children:[(0,B.jsx)(`button`,{"aria-describedby":c,disabled:!0,type:`button`,children:e}),(0,B.jsx)(`sup`,{className:`human-items-why-anchor`,children:(0,B.jsx)(`button`,{"aria-controls":c,"aria-expanded":i,"aria-label":`Why ${e} is unavailable`,className:`human-items-why`,onClick:()=>a(e=>!e),type:`button`,children:`?`})}),(0,B.jsx)(`span`,{className:`human-items-why-tip`,hidden:!(i||o),id:c,role:`tooltip`,children:t.reason})]}):(0,B.jsx)(`button`,{"aria-busy":n,className:`human-items-toast-action`,onClick:()=>{n||r()},type:`button`,children:n?`${e}…`:e})}var kY=ik.map(e=>({wire:e,label:ak[e]}));function AY(e){return ak[e.priority]}function jY(e){return e.kind===`task`?`Task`:`Question`}var MY={open:`Open`,answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`},NY=[`open`,`answered`,`completed`,`dismissed`],PY=NY.map(e=>({state:e,label:MY[e]}));function FY(e){return MY[e.state]}function IY(e){return e.state===`open`&&e.block.scope!==`nothing`}function LY(e){return e===1?`1 step`:`${e} steps`}function RY(e){let{item:t,blocked:n}=e;if(!IY(t))return[];switch(t.block.scope){case`host`:return[`blocks all work on this host`];case`plan`:return[`blocks all of ${t.block.plan}`];case`work`:return n.plans.map(({plan:e,count:t})=>`blocks ${LY(t)} in ${e}`);default:return[]}}function zY(e){let t=RY(e);return e.item.block.scope===`work`?e.blocked.plans.map(({count:e,preview:n},r)=>{let i=e-n.length,a=n.map(({node:e})=>e).join(`, `);return`${t[r]}: ${a}${i>0?` +${i} more`:``}`}).join(`; `):t.join(`; `)}function BY(e){if(e.block.scope===`host`)return`host`;let{plan:t,run:n,session:r}=e.owner;return t!==null&&n!==null?`plan ${t} / run ${n}`:t===null?n===null?`session ${r}`:`run ${n}`:`plan ${t}`}function VY(e){let t=RY(e);if(e.item.block.scope!==`work`)return t.map(t=>({phrase:t,nodes:e.nodes}));let n=0;return e.blocked.plans.map(({count:r},i)=>{let a=e.nodes.slice(n,n+r);return n+=r,{phrase:t[i]??``,nodes:a}})}function HY(e){return e===`user`?`you`:`the manager`}function UY(e){return e.resolution?.provenance??`manager`}var WY={"human-item-raised":`Raised`,"human-item-answered":`Answered`,"human-item-completed":`Completed`,"human-item-dismissed":`Dismissed`,"human-item-auto-resolved":`Resolved`,"human-item-reopened":`Reopened`,"human-item-noted":`Note`};function GY(e){return`${WY[e.action]} by ${HY(e.provenance)}`}function KY(e){let{item:t}=e,{plan:n,run:r}=t.owner,i=RY(e).join(`; `),a={answered:`Answered`,completed:`Completed`,dismissed:`Dismissed`}[t.state];return[{label:`Priority`,value:AY(t)},{label:`Kind`,value:jY(t)},{label:`State`,value:FY(t)},{label:`Source`,value:BY(t)},...n===null?[]:[{label:`Plan`,value:n}],...r===null?[]:[{label:`Run`,value:r}],{label:`Blocks`,value:i===``?`Nothing`:i},{label:`Raised`,at:t.created_at},...a===void 0?[]:[{label:a,at:t.updated_at,party:HY(UY(t))}]]}function qY(e,t){return e.find(e=>e===t)}var JY=[``,`task`,`question`],YY=[``,`yes`,`no`],XY=[``,...ik],ZY=NY,QY=[``,`session`,`run`,`plan`,`host`],$Y={kind:``,blocking:``,priority:``,state:`open`,source:``,sourceId:``};function eX(e){let t=e.sourceId.trim();return{...e.kind===``?{}:{kind:e.kind},...e.blocking===``?{}:{blocking:e.blocking===`yes`},...e.priority===``?{}:{priority:e.priority},...e.state===`open`?{}:{state:e.state},...e.source===`host`?{host:!0}:{},...e.source!==``&&e.source!==`host`&&t!==``?{[e.source]:t}:{}}}function tX(e){return Number(e.kind!==$Y.kind)+Number(e.blocking!==$Y.blocking)+Number(e.priority!==$Y.priority)+Number(e.state!==$Y.state)+Number(e.source!==$Y.source)}var nX=[`priority`,`kind`,`source`,`blocking`,`none`],rX=`priority`,iX=[{value:`priority`,label:`Priority`},{value:`kind`,label:`Kind`},{value:`source`,label:`Source`},{value:`blocking`,label:`Blocking`},{value:`none`,label:`None`}];function aX(e,t){let{item:n}=e;switch(t){case`priority`:return{key:n.priority,label:AY(n),rank:ik.indexOf(n.priority)};case`kind`:return{key:n.kind,label:jY(n),rank:n.kind===`task`?0:1};case`blocking`:return IY(n)?{key:`blocking`,label:`Blocking`,rank:0}:{key:`not-blocking`,label:`Not blocking`,rank:1};case`source`:{let e=BY(n);return{key:e,label:`Source: ${e}`,rank:0}}}}function oX(e,t){if(t===`none`)return[{key:`all`,items:e}];let n=new Map;return e.forEach((e,r)=>{let{key:i,label:a,rank:o}=aX(e,t),s=n.get(i);s?s.items.push(e):n.set(i,{label:a,rank:o,first:r,items:[e]})}),[...n.entries()].sort(([,e],[,t])=>e.rank-t.rank||e.first-t.first).map(([e,{label:t,items:n}])=>({key:e,label:t,items:n}))}function sX({answers:e,onRoom:t}){let n=(0,z.useRef)(null),{count:r,remaining:i,sending:a,sendError:o,notices:s}=e,c=r>0||o!==void 0||s.length>0;return(0,z.useEffect)(()=>{let e=n.current;if(e===null)return;let r=()=>t(e.getBoundingClientRect().height);r();let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect(),t(0)}},[t,c]),c?(0,B.jsxs)(`section`,{"aria-label":`Drafted answers`,className:`human-items-send`,ref:n,children:[r>0&&(0,B.jsxs)(`div`,{className:`human-items-send-bar`,children:[(0,B.jsx)(`button`,{className:`human-items-send-action`,"data-primary":`true`,disabled:a,onClick:()=>void e.send(),type:`button`,children:a?`Sending…`:`Send ${r} ${r===1?`answer`:`answers`}`}),(0,B.jsx)(`button`,{className:`human-items-send-action`,disabled:a,onClick:e.discard,type:`button`,children:`Discard`}),i>0&&(0,B.jsxs)(`span`,{className:`human-items-send-more`,children:[i,` more after this`]})]}),o!==void 0&&(0,B.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent, and your drafts are kept: `,o]}),s.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Not sent`,className:`human-items-not-sent`,children:s.map(t=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`p`,{children:[(0,B.jsxs)(`strong`,{children:[`Not sent: `,t.title]}),` (`,t.reason,`)`]}),t.choiceTitle!==void 0&&(0,B.jsxs)(`p`,{children:[`Choice: `,t.choiceTitle]}),t.text!==void 0&&(0,B.jsx)(gY,{source:t.text}),(0,B.jsx)(`button`,{className:`human-items-send-action`,onClick:()=>e.clearNotice(t.key),type:`button`,children:`Clear`})]},t.key))})]}):null}var cX=`onepipeline-ui.human-items.group-by`;function lX(){try{return qY(nX,window.localStorage.getItem(`onepipeline-ui.human-items.group-by`)??``)??`priority`}catch{return rX}}function uX(){let[e,t]=(0,z.useState)(lX);return{groupBy:e,setGroupBy:(0,z.useCallback)(e=>{t(e);try{window.localStorage.setItem(cX,e)}catch{}},[])}}var dX=`answered or dismissed elsewhere`,fX=`onepipeline-ui.human-items.draft.`,pX=/^[^\s/?#]+$/u,mX=J({title:K(),choice:K().optional(),choiceTitle:K().optional(),text:K().optional()});function hX(){try{let e={};for(let t=0;t<window.localStorage.length;t+=1){let n=window.localStorage.key(t);if(n===null||!n.startsWith(fX))continue;let r=n.slice(33),i=gX(window.localStorage.getItem(n));i!==void 0&&pX.test(r)&&(e[r]=i)}return e}catch{return}}function gX(e){if(e!==null)try{let t=mX.safeParse(JSON.parse(e));return t.success?t.data:void 0}catch{return}}function _X(e,t){try{t===void 0?window.localStorage.removeItem(`${fX}${e}`):window.localStorage.setItem(`${fX}${e}`,JSON.stringify(t))}catch{}}function vX(e){return e!==void 0&&e.trim()!==``}function yX(e){return e.choice!==void 0||vX(e.text)}function bX(e,t){return{id:e,...t.choice===void 0?{}:{choice:t.choice},...vX(t.text)?{text:t.text}:{}}}function xX(e){return e.kind===`conflict`?e.reason:`human items are unavailable on this host`}async function SX(e,t){try{return(await e.getHumanItem(t)).item.state!==`open`}catch(e){return e instanceof VM&&e.status===404||void 0}}function CX(e,t){return e[t]===void 0?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==t))}function wX(e,t,n,r,i,a){let[o,s]=(0,z.useState)(()=>hX()??{}),[c,l]=(0,z.useState)({}),[u,d]=(0,z.useState)([]),[f,p]=(0,z.useState)(!1),[m,h]=(0,z.useState)(),g=(0,z.useRef)(!1),_=(0,z.useRef)(0),v=(0,z.useRef)(o);v.current=o;let y=(0,z.useRef)(new Set),b=(0,z.useRef)(new Set),x=(0,z.useRef)(0),S=(0,z.useCallback)((e,t)=>{_X(e,t),s(n=>t===void 0?CX(n,e):{...n,[e]:t}),l(t=>CX(t,e)),h(void 0)},[]),C=(0,z.useCallback)((e,t)=>{let n=v.current[e];if(n===void 0)return;_X(e,void 0),s(t=>CX(t,e)),l(t=>CX(t,e)),_.current+=1;let r=_.current;d(e=>[...e,{...n,key:r,reason:t}])},[]),w=(0,z.useCallback)((e,t)=>{let{id:n,title:r}=e.item,{text:i}=v.current[n]??{},a={title:r,...v.current[n]?.choice===t.id?{}:{choice:t.id,choiceTitle:t.title},...i===void 0?{}:{text:i}};S(n,yX(a)?a:void 0)},[S]),T=(0,z.useCallback)((e,t)=>{let{id:n,title:r}=e.item,{choice:i,choiceTitle:a}=v.current[n]??{},o={title:r,...i===void 0?{}:{choice:i},...a===void 0?{}:{choiceTitle:a},...t===``?{}:{text:t}};S(n,o.choice===void 0&&t===``?void 0:o)},[S]),E=Object.entries(o).filter(([,e])=>yX(e)),D=E.slice(0,50),O=(0,z.useCallback)(async(t,n)=>{await SX(e,t)===!0?C(t,n):l(e=>({...e,[t]:n}))},[e,C]),k=(0,z.useCallback)(async()=>{if(g.current)return;let t=hX(),n=D.filter(([e])=>t!==void 0&&t[e]===void 0);for(let[e]of n)s(t=>CX(t,e));let r=D.flatMap(([e,t])=>n.some(([t])=>t===e)?[]:[bX(e,t)]);if(r.length!==0){g.current=!0,p(!0),h(void 0),a(r.map(({id:e})=>e));try{let t=await e.answerHumanItems(r);for(let{item:e}of t.answered)_X(e.item.id,void 0),s(t=>CX(t,e.item.id)),l(t=>CX(t,e.item.id));i(t.answered),await Promise.all(t.refused.map(({id:e,refusal:t})=>O(e,xX(t))))}catch(e){h(e instanceof Error?e.message:String(e))}finally{g.current=!1,p(!1),a([])}}},[D,e,i,a,O]),A=(0,z.useCallback)(()=>{for(let e of Object.keys(v.current))_X(e,void 0);s({}),l({}),h(void 0)},[]),j=(0,z.useCallback)(e=>{d(t=>t.filter(t=>t.key!==e))},[]);return(0,z.useEffect)(()=>{y.current.clear(),x.current+=1},[n]),(0,z.useEffect)(()=>{if(t===void 0||f)return;for(let e of Object.keys(o)){if(r(e))continue;let i=t.find(({item:t})=>t.id===e);if(i!==void 0){y.current.delete(e),i.item.state!==`open`&&C(e,dX);continue}y.current.has(e)||b.current.has(e)||n(e)}function n(t){let r=x.current;b.current.add(t),SX(e,t).then(e=>{if(e===!1&&r!==x.current&&!g.current){n(t);return}b.current.delete(t),!g.current&&(e===!0?C(t,dX):e===!1&&y.current.add(t))})}},[e,o,t,C,f,r]),{drafts:o,refusals:c,notices:u,sending:f,sendError:m,count:D.length,remaining:E.length-D.length,pressChoice:w,setText:T,retire:C,send:k,discard:A,clearNotice:j}}function TX(e){let[t,n]=(0,z.useState)($Y),[r,i]=(0,z.useState)(),a=(0,z.useMemo)(()=>{if(!e)return;let n=eX(t);return{type:`human-items`,...Object.keys(n).length===0?{}:{filter:n},...r===void 0?{}:{item:r}}},[e,JSON.stringify(eX(t)),r]);return(0,z.useEffect)(()=>{e||(n($Y),i(void 0))},[e]),{choice:t,setChoice:n,selectedId:r,setSelectedId:i,view:a}}function EX(e,t,n,r,i=``){let[a,o]=(0,z.useState)({}),[s,c]=(0,z.useState)(),[l,u]=(0,z.useState)([]),[d,f]=(0,z.useState)({}),[p,m]=(0,z.useState)({}),[h,g]=(0,z.useState)(),_=(0,z.useRef)(new Set),v=(0,z.useRef)(new Map),y=(0,z.useRef)(0),b=(0,z.useRef)(void 0);b.current=s;let x=t.items,S=(0,z.useRef)(i);S.current=i,(0,z.useEffect)(()=>{m(e=>Object.keys(e).length===0?e:{})},[i]);let C=(0,z.useMemo)(()=>{if(x===void 0)return;let e=x.flatMap(e=>{if(d[e.item.id]!==void 0)return[];let t=p[e.item.id]?.view;return t===void 0||!OX(t,e)?[e]:t.item.state===r?[t]:[]}),t=t=>e.some(({item:e})=>e.id===t);for(let{view:n,at:a,filter:o}of Object.values(p))o===i&&n.item.state===r&&!t(n.item.id)&&e.splice(Math.min(a,e.length),0,n);for(let{view:n,at:r}of l)t(n.item.id)||e.splice(Math.min(r,e.length),0,n);return e},[x,l,p,d,r,i]);(0,z.useEffect)(()=>{x!==void 0&&m(e=>{let t=Object.entries(e).filter(([e,{view:t}])=>{let n=x.find(({item:t})=>t.id===e);return n===void 0?t.item.state===r:OX(t,n)});return t.length===Object.keys(e).length?e:Object.fromEntries(t)})},[x,r]);let w=t.error===void 0&&t.item===n?t.detail:void 0,T=n===void 0?void 0:p[n]?.view,E=w&&T!==void 0&&OX(T,{item:w.item})?{...w,item:T.item,reopen:T.reopen}:w,D=(0,z.useRef)(x);D.current=x;let O=wX(e,x,i,(0,z.useCallback)(e=>_.current.has(e),[]),(0,z.useCallback)(e=>{let t=S.current;m(n=>{let r={...n};for(let{item:n}of e){let e=Math.max(0,D.current?.findIndex(({item:e})=>e.id===n.item.id)??0);r[n.item.id]={view:n,at:e,filter:t}}return r});let n=new Set(e.map(({item:e})=>e.item.id));u(e=>e.filter(({view:e})=>!n.has(e.item.id)))},[]),(0,z.useCallback)(e=>{let t=D.current??[];u(e.flatMap(e=>{let n=t.findIndex(({item:t})=>t.id===e),r=t[n];return r===void 0?[]:[{view:r,at:n}]}))},[])),{retire:k}=O,A=(0,z.useCallback)((e,t)=>c(n=>n?.key===e?t(n):n),[]),j=(0,z.useCallback)((t,n)=>{let{id:r,title:i}=t.item;if(_.current.has(r))return;_.current.add(r);let a=++y.current,s=S.current,l=Math.max(0,D.current?.findIndex(({item:e})=>e.id===r)??0);o(e=>({...e,[r]:{}})),f(e=>({...e,[r]:{view:t,at:l}})),c({key:a,id:r,title:i,action:n.action,phase:`sending`});let u=n.action===`complete`?e.completeHumanItem(r):e.dismissHumanItem(r,n.reason);v.current.set(a,u),u.then(e=>{m(t=>({...t,[r]:{view:e.item,at:l,filter:s}})),o(e=>({...e,[r]:{}})),k(r,`dismissed here`),A(a,t=>({...t,phase:`done`,reopen:e.item.reopen}))},e=>{let t=kX(e);o(e=>({...e,[r]:{error:t}})),A(a,e=>({...e,phase:`failed`,error:t})),g({id:r})}).finally(()=>{_.current.delete(r),f(DX(r))})},[e,A,k]),M=(0,z.useCallback)((e,t)=>{let n=b.current;if(n===void 0)return;let r=v.current.get(n.key);if(r===void 0||n.followUp?.phase===`sending`)return;let{key:i,id:a}=n,o=S.current;A(i,t=>({...t,followUp:{kind:e,phase:`sending`}})),r.then(n=>{if(e===`undo`&&!n.item.reopen.available){A(i,e=>({...e,followUp:void 0}));return}t(a).then(t=>{m(e=>({...e,[a]:{view:t.item,at:e[a]?.at??0,filter:o}})),A(i,n=>({...n,reopen:t.item.reopen,followUp:{kind:e,phase:`done`}}))},t=>A(i,n=>({...n,followUp:{kind:e,phase:`failed`,error:kX(t)}})))},()=>A(i,e=>({...e,followUp:void 0})))},[A]),N=(0,z.useCallback)(()=>M(`undo`,t=>e.reopenHumanItem(t)),[e,M]),P=(0,z.useCallback)(t=>M(`note`,n=>e.noteHumanItem(n,t)),[e,M]),F=(0,z.useCallback)(()=>c(void 0),[]);return{items:C,listError:n===void 0||C===void 0?t.error:void 0,detail:E===null?void 0:E,gone:n!==void 0&&E===null,detailError:n===void 0?void 0:t.error,writes:a,answers:O,write:j,toast:s,undo:N,note:P,closeToast:F,returned:h}}function DX(e){return t=>t[e]===void 0?t:Object.fromEntries(Object.entries(t).filter(([t])=>t!==e))}function OX(e,t){return Date.parse(e.item.updated_at)>Date.parse(t.item.updated_at)}function kX(e){return e instanceof Error?e.message:String(e)}var AX=`data-card-action`,jX=4;function MX({client:e,live:t,choice:n,setChoice:r,selectedId:i,setSelectedId:a}){let o=EX(e,t,i,n.state,JSON.stringify(n)),{groupBy:s,setGroupBy:c}=uX(),[l,u]=(0,z.useState)(0),[d,f]=(0,z.useState)(0),p=(0,z.useRef)(null),m=o.items?.find(({item:e})=>e.id===i)??o.detail,h=(0,z.useRef)(void 0);m===void 0?h.current?.item.id!==i&&(h.current=void 0):h.current=m;let g=(e,t)=>{e.item.id===i&&a(void 0),o.write(e,t)},_=o.returned;(0,z.useEffect)(()=>{_!==void 0&&p.current?.querySelector(`[data-item-id="${CSS.escape(_.id)}"]`)?.scrollIntoView({block:`nearest`})},[_]);let v=oX(o.items??[],s);return(0,B.jsxs)(`section`,{"aria-label":`Action items`,className:`human-items-page`,"data-detail-open":i!==void 0,style:NX(l,d),children:[(0,B.jsx)(IX,{choice:n,groupBy:s,onChange:r,onGroupBy:c}),(0,B.jsxs)(`div`,{className:`human-items-body`,children:[(0,B.jsxs)(`section`,{"aria-label":`Action item list`,className:`human-items-list`,children:[o.listError&&(0,B.jsx)(`p`,{role:`alert`,children:o.listError}),o.items===void 0&&!o.listError&&(0,B.jsx)(`p`,{role:`status`,children:`Reading action items…`}),o.items?.length===0&&(0,B.jsx)(`p`,{role:`status`,children:`No action items match these filters.`}),(0,B.jsx)(`div`,{className:`human-items-groups`,onKeyDown:e=>FX(e,p.current),ref:p,children:v.map(e=>(0,B.jsx)(PX,{answering:o.answers,group:e,groupBy:s,onSelect:a,onWrite:g,selectedId:i,writes:o.writes},e.key))}),(o.items?.length??0)>0&&(0,B.jsx)(`button`,{className:`card-actions-entry`,onFocus:()=>p.current?.querySelector(`[${AX}]`)?.focus(),type:`button`,children:`Card actions: use the arrow keys`})]}),i!==void 0&&(0,B.jsx)(KX,{answering:o.answers,error:o.detailError,detail:o.detail,gone:o.gone,lastShown:h.current,onClose:()=>a(void 0),onWrite:g,state:o.writes[i],view:m})]}),(0,B.jsx)(sX,{answers:o.answers,onRoom:f}),o.toast&&(0,B.jsx)(DY,{onClose:o.closeToast,onNote:o.note,onRoom:u,onUndo:o.undo,toast:o.toast})]})}function NX(e,t){return{"--toast-room":`${e}px`,"--send-room":`${t}px`}}function PX({group:e,groupBy:t,selectedId:n,writes:r,answering:i,onSelect:a,onWrite:o}){let s=(0,z.useId)(),c=e.items.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsx)(zX,{answering:i,groupBy:t,onSelect:()=>a(e.item.id),onWrite:o,selected:e.item.id===n,state:r[e.item.id],view:e})},e.item.id));return e.label===void 0?(0,B.jsx)(`ul`,{"aria-label":`Action items`,children:c}):(0,B.jsxs)(`section`,{"aria-labelledby":s,className:`human-items-group`,children:[(0,B.jsxs)(`h2`,{className:`human-items-group-heading`,id:s,children:[e.label,` `,(0,B.jsxs)(`span`,{className:`human-items-group-count`,children:[`(`,e.items.length,`)`]})]}),(0,B.jsx)(`ul`,{"aria-labelledby":s,children:c})]})}function FX(e,t){let n=e.target;if(t===null||!(n instanceof HTMLElement)||!n.hasAttribute(AX))return;let r=[...t.querySelectorAll(`[${AX}]`)],i=r.indexOf(n),a=e.key===`ArrowRight`||e.key===`ArrowDown`?r[Math.min(i+1,r.length-1)]:e.key===`ArrowLeft`||e.key===`ArrowUp`?r[Math.max(i-1,0)]:e.key===`Home`?r[0]:e.key===`End`?r.at(-1):void 0;a!==void 0&&(e.preventDefault(),a.focus())}function IX({choice:e,groupBy:t,onChange:n,onGroupBy:r}){let i=(0,z.useId)(),[a,o]=(0,z.useState)(!1),s=(t,r)=>n({...e,[t]:r}),c=e.source!==``&&e.source!==`host`,l=tX(e)+Number(t!==rX);return(0,B.jsxs)(`div`,{className:`human-items-controls`,"data-open":a,children:[(0,B.jsxs)(`button`,{"aria-controls":`${i}-filters`,"aria-expanded":a,"aria-label":l>0?`Filters, ${l} changed`:`Filters`,className:`human-items-filters-toggle`,onClick:()=>o(e=>!e),type:`button`,children:[(0,B.jsx)(ot,{"aria-hidden":`true`,size:14}),`Filters`,l>0&&(0,B.jsx)(`span`,{"aria-hidden":`true`,className:`human-items-filters-count`,children:l})]}),(0,B.jsxs)(`fieldset`,{className:`human-items-filters`,id:`${i}-filters`,children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Filter action items`}),(0,B.jsx)(`label`,{htmlFor:`${i}-group`,children:`Group by`}),(0,B.jsx)(`select`,{id:`${i}-group`,onChange:e=>r(qY(nX,e.target.value)??`priority`),value:t,children:iX.map(({value:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{htmlFor:`${i}-kind`,children:`Kind`}),(0,B.jsxs)(`select`,{id:`${i}-kind`,onChange:e=>s(`kind`,qY(JY,e.target.value)??``),value:e.kind,children:[(0,B.jsx)(`option`,{value:``,children:`Any kind`}),(0,B.jsx)(`option`,{value:`task`,children:`Task`}),(0,B.jsx)(`option`,{value:`question`,children:`Question`})]}),(0,B.jsx)(`label`,{htmlFor:`${i}-blocking`,children:`Blocking`}),(0,B.jsxs)(`select`,{id:`${i}-blocking`,onChange:e=>s(`blocking`,qY(YY,e.target.value)??``),value:e.blocking,children:[(0,B.jsx)(`option`,{value:``,children:`Any`}),(0,B.jsx)(`option`,{value:`yes`,children:`Yes`}),(0,B.jsx)(`option`,{value:`no`,children:`No`})]}),(0,B.jsx)(`label`,{htmlFor:`${i}-priority`,children:`Priority`}),(0,B.jsxs)(`select`,{id:`${i}-priority`,onChange:e=>s(`priority`,qY(XY,e.target.value)??``),value:e.priority,children:[(0,B.jsx)(`option`,{value:``,children:`Any priority`}),kY.map(({wire:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))]}),(0,B.jsx)(`label`,{htmlFor:`${i}-state`,children:`State`}),(0,B.jsx)(`select`,{id:`${i}-state`,onChange:e=>s(`state`,qY(ZY,e.target.value)??`open`),value:e.state,children:PY.map(({state:e,label:t})=>(0,B.jsx)(`option`,{value:e,children:t},e))}),(0,B.jsx)(`label`,{htmlFor:`${i}-source`,children:`Source`}),(0,B.jsxs)(`select`,{id:`${i}-source`,onChange:e=>s(`source`,qY(QY,e.target.value)??``),value:e.source,children:[(0,B.jsx)(`option`,{value:``,children:`Any source`}),(0,B.jsx)(`option`,{value:`session`,children:`Session`}),(0,B.jsx)(`option`,{value:`run`,children:`Run`}),(0,B.jsx)(`option`,{value:`plan`,children:`Plan`}),(0,B.jsx)(`option`,{value:`host`,children:`Host`})]}),c&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`label`,{htmlFor:`${i}-source-id`,children:`Source identifier`}),(0,B.jsx)(`input`,{id:`${i}-source-id`,onChange:e=>s(`sourceId`,e.target.value),placeholder:`${e.source} id`,type:`search`,value:e.sourceId})]})]})]})}function LX(e){return e.target instanceof Element&&e.target.closest(`a, button, textarea, input, select`)===null}function RX({view:e,groupBy:t}){let{item:n}=e;return(0,B.jsxs)(B.Fragment,{children:[t!==`priority`&&(0,B.jsx)(`span`,{className:`human-item-priority`,"data-priority":n.priority,children:AY(n)}),t!==`kind`&&(0,B.jsx)(`span`,{className:`human-item-kind`,children:jY(n)}),t!==`blocking`&&IY(n)&&(0,B.jsx)(`span`,{className:`human-item-blocking`,children:`Blocking`})]})}function zX({view:e,groupBy:t,selected:n,state:r,answering:i,onSelect:a,onWrite:o}){let{item:s}=e,c=s.state===`open`,l=zY(e),u=[...c?[]:[FY(s)],...l?[l]:[],...t===`source`?[]:[`Source: ${BY(s)}`]],d=(s.choices?.length??0)>0;return(0,B.jsxs)(_Y,{actions:(0,B.jsx)(BX,{item:e,onSelect:a,onWrite:o}),badges:(0,B.jsx)(RX,{groupBy:t,view:e}),body:s.body,className:`human-item-card`,clamp:jX,"data-blocking":IY(s),"data-item-id":s.id,"data-selected":n,meta:u.length===0?void 0:u.map((e,t)=>(0,B.jsxs)(z.Fragment,{children:[t>0&&` · `,(0,B.jsx)(`span`,{children:e})]},e)),onClick:e=>{LX(e)&&a()},title:s.title,children:[s.kind===`question`&&c&&d&&(0,B.jsxs)(`fieldset`,{className:`human-item-choices`,children:[(0,B.jsxs)(`legend`,{className:`sr-only`,children:[`Choices: `,s.title]}),s.choices?.map(t=>(0,B.jsx)(VX,{answering:i,choice:t,view:e},t.id))]}),s.kind===`question`&&c&&(0,B.jsx)(HX,{answering:i,label:`Answer: ${s.title}`,view:e}),(0,B.jsx)(UX,{view:e}),(0,B.jsx)(WX,{reason:i.refusals[s.id]}),(0,B.jsx)(GX,{state:r})]})}function BX({item:e,onSelect:t,onWrite:n}){let{item:r}=e,i=r.state===`open`;return(0,B.jsxs)(B.Fragment,{children:[r.tracker&&(0,B.jsx)(bY,{className:`human-item-tracker`,"data-card-action":``,label:r.tracker.task,title:r.tracker.task,onClick:e=>e.stopPropagation(),tabIndex:-1,url:r.tracker.url}),(0,B.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:t,type:`button`,"aria-label":`Details: ${r.title}`,children:`Details`}),i&&r.kind===`task`&&(0,B.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:()=>n(e,{action:`complete`}),type:`button`,"aria-label":`Complete: ${r.title}`,children:`Complete`}),i&&(0,B.jsx)(`button`,{className:`human-item-action`,"data-card-action":``,tabIndex:-1,onClick:()=>n(e,{action:`dismiss`}),type:`button`,"aria-label":`Dismiss: ${r.title}`,children:`Dismiss`})]})}function VX({view:e,choice:t,answering:n}){return(0,B.jsx)(`button`,{"aria-pressed":n.drafts[e.item.id]?.choice===t.id,className:`human-item-choice`,disabled:n.sending,onClick:()=>n.pressChoice(e,t),type:`button`,children:t.title})}function HX({view:e,label:t,answering:n}){return(0,B.jsx)(`textarea`,{"aria-busy":n.sending,"aria-label":t,className:`human-item-answer`,onChange:t=>n.setText(e,t.target.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||e.preventDefault()},placeholder:(e.item.choices?.length??0)>0?`Or write your own answer`:`Write an answer`,readOnly:n.sending,rows:1,value:n.drafts[e.item.id]?.text??``})}function UX({view:e}){let{item:t}=e;if(t.state!==`answered`||t.resolution===null)return null;let{choice:n,text:r}=t.resolution,i=t.choices?.find(({id:e})=>e===n);return(0,B.jsxs)(`section`,{"aria-label":`Answer`,className:`human-item-answered`,children:[i&&(0,B.jsx)(`p`,{className:`human-item-answered-choice`,children:i.title}),r!==null&&(0,B.jsx)(gY,{source:r})]})}function WX({reason:e}){return e===void 0?null:(0,B.jsxs)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:[`Not sent: `,e]})}function GX({state:e}){return e?.error?(0,B.jsx)(`p`,{className:`human-item-status`,"data-failed":`true`,role:`alert`,children:e.error}):null}function KX({view:e,detail:t,gone:n,lastShown:r,error:i,state:a,answering:o,onWrite:s,onClose:c}){if(n&&e===void 0)return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,B.jsxs)(`header`,{className:`human-item-detail-head`,children:[r&&(0,B.jsx)(`h2`,{children:r.item.title}),(0,B.jsx)(ui,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(ft,{size:14})})]}),(0,B.jsx)(`p`,{role:`status`,children:`Resolved: this item needs nothing more from you.`})]});let u=t??e;if(u===void 0)return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,children:[(0,B.jsx)(ui,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(ft,{size:14})}),i?(0,B.jsx)(`p`,{role:`alert`,children:i}):(0,B.jsx)(`p`,{role:`status`,children:`Reading…`})]});let{item:d}=u,f=d.state===`open`,p=d.choices??[],m=d.kind===`question`&&f;return(0,B.jsxs)(`aside`,{"aria-label":`Action item detail`,className:`human-item-detail`,tabIndex:0,children:[(0,B.jsxs)(`header`,{className:`human-item-detail-head`,children:[(0,B.jsx)(`h2`,{children:d.title}),(0,B.jsx)(ui,{"aria-label":`Close detail`,onClick:c,size:`sm`,type:`button`,variant:`ghost`,children:(0,B.jsx)(ft,{size:14})})]}),i&&(0,B.jsx)(`p`,{role:`alert`,children:i}),(0,B.jsx)(`section`,{"aria-label":`Full body`,className:`human-item-detail-body`,children:(0,B.jsx)(gY,{source:d.body})}),m&&p.length>0&&(0,B.jsxs)(`fieldset`,{className:`human-item-choice-list`,children:[(0,B.jsx)(`legend`,{children:`Choices`}),p.map(e=>(0,B.jsxs)(`div`,{className:`human-item-choice-entry`,children:[(0,B.jsx)(VX,{answering:o,choice:e,view:u}),(0,B.jsx)(`div`,{className:`human-item-choice-description`,children:(0,B.jsx)(gY,{source:e.description})})]},e.id))]}),m&&(0,B.jsx)(HX,{answering:o,label:`Answer in detail: ${d.title}`,view:u}),(0,B.jsx)(UX,{view:u}),(0,B.jsx)(WX,{reason:o.refusals[d.id]}),(0,B.jsxs)(`div`,{className:`human-item-detail-actions`,children:[f&&d.kind===`task`&&(0,B.jsx)(ui,{onClick:()=>s(u,{action:`complete`}),size:`sm`,type:`button`,children:`Complete`}),f&&(0,B.jsx)(ui,{onClick:()=>s(u,{action:`dismiss`}),size:`sm`,type:`button`,variant:`outline`,children:`Dismiss`}),(0,B.jsx)(GX,{state:a})]}),t?.history!==void 0&&t.history.length>0&&(0,B.jsx)(qX,{history:t.history}),(0,B.jsxs)(`dl`,{className:`human-item-metadata`,children:[KY(u).map(e=>(0,B.jsxs)(z.Fragment,{children:[(0,B.jsx)(`dt`,{children:e.label}),(0,B.jsx)(`dd`,{children:`value`in e?e.value:(0,B.jsxs)(B.Fragment,{children:[e.party!==void 0&&`By ${e.party} · `,(0,B.jsx)(l,{at:e.at,relative:!0})]})})]},e.label)),t&&t.nodes.length>0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Blocked steps`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`section`,{"aria-label":`Blocked steps`,className:`human-item-steps`,children:VY(t).map(({phrase:e,nodes:t})=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{children:e}),(0,B.jsx)(`ul`,{children:t.map(e=>(0,B.jsxs)(`li`,{children:[e.run,` / `,e.node,`: `,e.title]},`${e.run}/${e.node}`))})]},e))})})]}),d.tracker&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`dt`,{children:`Tracker`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(bY,{className:`human-item-tracker-full`,label:d.tracker.task,url:d.tracker.url})})]})]})]})}function qX({history:e}){return(0,B.jsxs)(`section`,{"aria-label":`History`,className:`human-item-history`,children:[(0,B.jsx)(`h3`,{children:`History`}),(0,B.jsx)(`ol`,{children:e.map((e,t)=>(0,B.jsxs)(`li`,{children:[GY(e),` · `,(0,B.jsx)(l,{at:e.at,relative:!0})]},t))})]})}function JX({className:e,state:t}){let n=YX(t);return(0,B.jsxs)(f,{className:x(`gap-1.5 tracking-[.03em] uppercase`,n&&ZX[n],e),variant:`outline`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,className:x(`size-1.5 rounded-full bg-current`,t===`running`&&`animate-pulse`)}),t]})}function YX(e){return rZ[e]}var XX=e=>{let t=YX(e);return x(`size-2 shrink-0 rounded-full bg-current`,t===void 0?`text-muted-foreground`:QX[t])},ZX={success:`border-success bg-success-surface text-success`,destructive:`border-destructive bg-destructive-surface text-destructive`,warning:`border-warning bg-warning-surface text-warning`,info:`border-info bg-info-surface text-info`},QX={success:`text-success`,destructive:`text-destructive`,warning:`text-warning`,info:`text-info`},$X=`success`,eZ=`destructive`,tZ=`warning`,nZ={blocked:tZ,cancelled:eZ,"complete-but-draft":tZ,"complete-but-held":tZ,done:$X,failed:eZ,"not-completed":eZ,parked:void 0,pending:void 0,ready:void 0,running:`info`,skipped:tZ,unknown:void 0,waiting:void 0},rZ={...nZ,complete:nZ.done,settled:nZ.done,active:nZ.running},iZ=`/human-items`;function aZ(e){return e===`/human-items`||e===`/human-items/`}function oZ(e){return aZ(e)?`/`:e}function sZ(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}var cZ=()=>window.location.pathname;function lZ(){let e=(0,z.useSyncExternalStore)(sZ,cZ,cZ),t=(0,z.useCallback)(()=>{let e=new URLSearchParams;for(let t of new URLSearchParams(window.location.search).getAll(`hide-kind`))e.append(`hide-kind`,t);let t=e.size>0?`?${e}`:``;window.history.pushState(null,``,`${iZ}${t}`),window.dispatchEvent(new PopStateEvent(`popstate`))},[]);return{active:aZ(e),open:t}}var uZ={graph:`graph`,overall:`overall`};function dZ(e){return e!==null&&Object.hasOwn(uZ,e)}var fZ={projects:`projects`,runs:`runs`};function pZ(e){return e!==null&&Object.hasOwn(fZ,e)}var mZ={timeline:`Timeline`,task:`Task`,criteria:`Acceptance criteria`,dependencies:`Dependencies`,remote:`Remote`};function hZ(e){return e!==null&&Object.hasOwn(mZ,e)}function gZ(e,t){let n=e.get(t);return n!==null&&ce(n)?n:void 0}function _Z(){let e=(0,z.useSyncExternalStore)(vZ,yZ,yZ),t=new URLSearchParams(e),n=t.get(`list`),r=pZ(n)?n:`projects`,i=t.get(`project`),a=i!==null&&(i===`none`||bj(i))?i:void 0,o=gZ(t,`run`),s=gZ(t,`node`),c=gZ(t,`event`),l=t.get(`view`),u=t.get(`tab`),d=u===`pr`||u===`checks`?`remote`:hZ(u)?u:`timeline`,f=dZ(l)?l:s===void 0?`overall`:`graph`,p=(0,z.useCallback)((e,t=!1)=>{let n=new URLSearchParams(window.location.search);e(n);let r=t?window.location.pathname:oZ(window.location.pathname);window.history.pushState(null,``,`${r}?${n}`),window.dispatchEvent(new PopStateEvent(`popstate`))},[]);return{list:r,host:t.get(`page`)===`host`,hiddenKinds:t.getAll(`hide-kind`),selectHost:()=>p(e=>{e.set(`page`,`host`)}),selectKinds:e=>p(t=>{t.delete(`hide-kind`);for(let n of e)t.append(`hide-kind`,n)},!0),projectKey:a,runId:o,nodeId:s,itemId:c,view:f,nodeTab:d,selectList:e=>p(t=>{e===`projects`?t.delete(`list`):t.set(`list`,e),t.delete(`project`)}),selectProject:e=>p(t=>{e===void 0?t.delete(`project`):t.set(`project`,e),t.delete(`list`),t.delete(`run`),t.delete(`node`),t.delete(`event`),t.delete(`tab`)}),selectRun:e=>p(t=>{t.set(`run`,e),t.delete(`page`),t.delete(`node`),t.delete(`event`),t.delete(`tab`)}),selectNode:e=>p(t=>{e?t.set(`node`,e):t.delete(`node`),t.delete(`event`),t.delete(`tab`),t.set(`view`,`graph`)}),selectItem:e=>p(t=>{e?t.set(`event`,e):t.delete(`event`)}),showOverall:()=>p(e=>{e.set(`view`,`overall`),e.delete(`node`),e.delete(`event`),e.delete(`tab`)}),selectNodeTab:e=>p(t=>{e===`timeline`?t.delete(`tab`):t.set(`tab`,e),e!==`timeline`&&t.delete(`event`)})}}function vZ(e){return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)}function yZ(){return window.location.search}function bZ(e){return[...e].sort((e,t)=>{let n=e.started_at,r=t.started_at;return n!==void 0&&r===void 0?-1:n===void 0&&r!==void 0?1:(r===void 0?0:Date.parse(r))-(n===void 0?0:Date.parse(n))||Date.parse(t.updated_at)-Date.parse(e.updated_at)||e.id.localeCompare(t.id)})}function xZ(e){let t=new Map;for(let n of e){let e=n.group?.project??`none`,r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}return[...t].map(([e,t])=>{let n=bZ(t),r=t[0]?.group?.project??null,i=t.map(e=>e.updated_at).reduce((e,t)=>Date.parse(t)>Date.parse(e)?t:e);return{key:e,project:r,label:r===null?`Other runs`:n.find(e=>e.group?.name)?.group?.name??r,rows:n,updatedAt:i}}).sort((e,t)=>Number(e.project===null)-Number(t.project===null)||Date.parse(t.updatedAt)-Date.parse(e.updatedAt)||e.key.localeCompare(t.key))}function SZ(e){let{done:t,failed:n,running:r}=e.nodes;return j({done:t,failed:n,running:r})}function CZ(e,t){let n=new Map(e.map(e=>[e.id,JSON.stringify(e)])),r=t.filter(e=>n.get(e.id)!==JSON.stringify(e)).length,i=new Set(t.map(e=>e.id));return r+e.filter(e=>!i.has(e.id)).length}function wZ(e,t,n,r){let[i,a]=(0,z.useState)(new Set),o=(0,z.useCallback)(e=>{a(t=>t.has(e)?t:new Set(t).add(e))},[]),s=(0,z.useCallback)(e=>{a(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),c=(0,z.useMemo)(()=>xZ(e??[]),[e]),l=c.find(e=>e.rows.some(e=>e.id===n))?.key,[u,d]=(0,z.useState)();return l!==u&&(d(l),l!==void 0&&o(l)),(0,z.useMemo)(()=>({kinds:[...new Set(e?.flatMap(e=>e.kind?[e.kind]:[])??[])].sort(),groups:c.map(e=>{let n=e.rows.filter(e=>!e.kind||!t.includes(e.kind)),a=n[0];return{key:e.key,label:e.label,runs:n,expanded:i.has(e.key),toggle:()=>s(e.key),open:()=>{o(e.key),a&&r(a.id)}}})}),[e,c,t,i,o,s,r])}var TZ=240,EZ=`data-row-key`;function DZ(e,t){let n=(0,z.useRef)(new Map);(0,z.useLayoutEffect)(()=>{let t=e.current;if(t===null)return;let r=t.getBoundingClientRect().top,i=[...t.querySelectorAll(`[${EZ}]`)],a=new Map(i.map(e=>[e.getAttribute(`data-row-key`)??``,e.getBoundingClientRect().top-r])),o=[...n.current.keys()].filter(e=>a.has(e)),s=[...a.keys()].filter(e=>n.current.has(e));if(o.join(`
102
+ `)!==s.join(`
103
+ `)&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)for(let e of i){let t=n.current.get(e.getAttribute(`data-row-key`)??``),r=a.get(e.getAttribute(`data-row-key`)??``);t===void 0||r===void 0||t===r||e.animate([{transform:`translateY(${t-r}px)`},{transform:`translateY(0)`}],{duration:TZ,easing:`ease-out`})}n.current=a},[e,t])}function OZ({rows:e,failed:t=!1,selectedRunId:n,onSelect:r,onOpenProject:i,onHost:a,hostCurrent:o=!1,onActionItems:s,actionItemsCurrent:c=!1,hiddenKinds:l,onKindsChange:u,updates:d,drawerOpen:f=!1,drawerRef:p}){let{kinds:m,groups:h}=wZ(e,l,n,i??r),g=(0,z.useRef)(null);return DZ(g,h),(0,B.jsx)(`nav`,{"aria-label":`Projects`,className:`run-nav`,"data-open":f,id:`run-navigation`,ref:p,children:(0,B.jsx)(Iu,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`px-[18px] py-6 max-sm:px-2`,children:[(0,B.jsxs)(`div`,{className:`brand`,children:[(0,B.jsx)(`div`,{"aria-hidden":`true`,className:`brand-mark`,children:(0,B.jsx)(Ee,{size:20})}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Local orchestration`}),(0,B.jsx)(`h1`,{children:`DAG Observatory`})]})]}),(0,B.jsx)(Yu,{className:`my-[22px]`}),(0,B.jsxs)(`div`,{className:`nav-pages`,children:[(0,B.jsx)(ui,{"aria-current":o?`page`:void 0,onClick:a,variant:`ghost`,children:`Host`}),s&&(0,B.jsx)(ui,{"aria-current":c?`page`:void 0,onClick:s,variant:`ghost`,children:`Action items`})]}),m.length>0&&(0,B.jsxs)(`details`,{className:`kind-filter`,children:[(0,B.jsxs)(`summary`,{children:[(0,B.jsxs)(`span`,{children:[`Run kinds:`,` `,m.filter(e=>!l.includes(e)).length,` of`,` `,m.length]}),(0,B.jsx)(Ae,{"aria-hidden":`true`,size:14})]}),(0,B.jsxs)(`fieldset`,{children:[(0,B.jsx)(`legend`,{className:`sr-only`,children:`Run kinds`}),m.map(e=>(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:!l.includes(e),onChange:t=>u(t.target.checked?l.filter(t=>t!==e):[...l,e])}),e]},e))]})]}),d,e===void 0?(0,B.jsx)(`p`,{role:`status`,children:t?`Projects did not load`:`Loading projects…`}):(0,B.jsx)(`div`,{className:`nav-rows`,ref:g,children:h.map(e=>(0,B.jsxs)(`fieldset`,{"aria-label":`Project ${e.label}`,className:`project-group`,children:[(0,B.jsxs)(`div`,{className:`project-row`,[EZ]:`project:${e.key}`,children:[(0,B.jsx)(`button`,{"aria-expanded":e.expanded,"aria-label":`${e.expanded?`Collapse`:`Expand`} ${e.label}`,className:`project-toggle`,onClick:e.toggle,type:`button`,children:(0,B.jsx)(je,{"aria-hidden":`true`,"data-open":e.expanded,size:12})}),(0,B.jsxs)(`button`,{className:`project-open`,onClick:e.open,type:`button`,children:[(0,B.jsx)(`span`,{className:`project-name`,children:e.label}),(0,B.jsxs)(`span`,{className:`project-count`,children:[e.runs.length,(0,B.jsx)(`span`,{className:`sr-only`,children:` shown runs`})]})]})]}),e.expanded&&e.runs.length===0&&(0,B.jsx)(`p`,{className:`run-list-status`,role:`status`,children:`No runs of the shown kinds.`}),e.expanded&&e.runs.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Runs of ${e.label}`,className:`run-list`,children:e.runs.map(e=>{let t=n===e.id,i=[e.state,SZ(e)].filter(Boolean).join(` · `);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`button`,{"aria-current":t?`page`:void 0,className:`run-link`,"data-active":t,onClick:()=>r(e.id),title:i,type:`button`,"data-row-key":`run:${e.id}`,children:[(0,B.jsxs)(Vf,{children:[(0,B.jsx)(Hf,{asChild:!0,children:(0,B.jsx)(`span`,{role:`img`,"aria-label":e.state,className:x(`run-dot`,XX(e.state))})}),(0,B.jsx)(Uf,{children:e.state})]}),(0,B.jsx)(`span`,{className:`run-link-name`,children:e.name}),e.kind&&(0,B.jsx)(`span`,{"aria-label":e.kind,className:`run-link-tag`,role:`note`,children:e.kind}),t&&(0,B.jsx)(`span`,{className:`run-link-counts`,children:i})]})},e.id)})})]},e.key))})]})})})}function kZ(){let[e,t]=(0,z.useState)(!1),n=(0,z.useRef)(null),r=(0,z.useRef)(null),i=(0,z.useRef)(!1),a=(0,z.useCallback)(()=>t(!1),[]),o=(0,z.useCallback)(()=>t(e=>!e),[]);return(0,z.useEffect)(()=>{if(!e)return;let r=e=>{e.key===`Escape`&&t(!1)},i=()=>{n.current?.offsetParent===null&&t(!1)};return document.addEventListener(`keydown`,r),window.addEventListener(`resize`,i),()=>{document.removeEventListener(`keydown`,r),window.removeEventListener(`resize`,i)}},[e]),(0,z.useEffect)(()=>{e?r.current?.querySelector(`button`)?.focus():i.current&&n.current?.focus(),i.current=e},[e]),{open:e,close:a,toggle:o,menuButton:n,drawer:r}}function AZ(e,t){let[n,r]=(0,z.useState)(0),i=(0,z.useRef)(void 0),a=(0,z.useRef)(t);a.current=t;let o=e===`live`,s=(0,z.useRef)(o);s.current=o;let c=(0,z.useCallback)(e=>{i.current=void 0,r(0),a.current(e)},[]),l=(0,z.useCallback)(()=>{i.current!==void 0&&c(i.current.value)},[c]),u=(0,z.useCallback)((e,t=1)=>{s.current?c(e):(i.current={value:e},r(e=>e+t))},[c]),d=(0,z.useCallback)(()=>{i.current=void 0,r(0)},[]);return(0,z.useEffect)(()=>{o&&l()},[o,l]),(0,z.useEffect)(()=>{if(typeof e!=`number`)return;let t=setInterval(l,e*1e3);return()=>clearInterval(t)},[e,l]),{waiting:n,show:c,take:l,offer:u,drop:d}}function jZ(e,t){let[n,r]=(0,z.useState)(),[i,a]=(0,z.useState)(),[o,s]=(0,z.useState)({}),c=(0,z.useRef)([]),[l,u]=(0,z.useState)(),[d,f]=(0,z.useState)(),[p,m]=(0,z.useState)(),[h,g]=(0,z.useState)(),[_,v]=(0,z.useState)(),[y,b]=(0,z.useState)(),[x,S]=(0,z.useState)(0),C=t.runId,w=l===void 0||C!==void 0&&l.some(e=>e.id===C)?C:C!==void 0||t.selectFirst?bZ(l)[0]?.id:void 0,T=(0,z.useMemo)(()=>t.humanItems??te(t.host?void 0:w,t.view,t.nodeId,t.filter),[t.humanItems,t.host,w,t.view,t.nodeId,t.filter]),E=(0,z.useRef)(void 0),D=(0,z.useRef)(T);D.current=T;let O=(0,z.useRef)(t.first),k=AZ(t.navigationUpdates,f),A=AZ(t.mainUpdates,(0,z.useCallback)(e=>{r(e.state),a(e.view);let{visible:t}=e.state;if(t.type===`human-items`){let{items:n,detail:r}=t;s({items:n,detail:r,...e.view.type===`human-items`&&e.view.item!==void 0?{item:e.view.item}:{}})}m(new Date().toISOString()),e.reset!==void 0&&b(`The live view was re-sent whole: ${e.reset}.`)},[])),j=t.navigationUpdates!==`off`||t.mainUpdates!==`off`,M=(0,z.useRef)(j);M.current=j,(0,z.useEffect)(()=>{g(void 0);let t=!0,n=O.current;if(O.current=void 0,n?.error!==void 0){g(n.error);return}let r=e.live({view:D.current,paused:!M.current,...n?.answer!==void 0&&JSON.stringify(n.address.view)===JSON.stringify(D.current)?{initial:n.answer}:{},onState:(e,n)=>{let i=c.current;e.sidebar!==void 0&&(c.current=e.sidebar,u(e.sidebar)),g(void 0),v(void 0);let a={state:e,view:r.view,...n.kind===`reset`?{reset:n.reason}:{}};if(n.kind===`snapshot`){if(A.show(a),e.sidebar!==void 0){if(t)k.show(e.sidebar);else if(i!==e.sidebar){let t=CZ(i,e.sidebar);t>0&&k.offer(e.sidebar,t)}}t=!1;return}if(n.kind===`reset`){e.sidebar!==void 0&&k.offer(e.sidebar),A.offer(a);return}if(n.frame.type===`sidebar.snapshot`){k.show(n.frame.rows);return}let o=n.frame.type===`run.changed`||n.frame.type===`run.removed`;o&&e.sidebar!==void 0&&k.offer(e.sidebar),(!o||e.visible.type===`sidebar`)&&A.offer(a)},onError:e=>{if(r.view.type===`human-items`){s(t=>({...t.items===void 0?{}:{items:t.items},error:e.message})),r.change({type:`sidebar`});return}if(e instanceof VM&&(e.code===`run_not_found`||e.code===`node_not_found`)){r.change({type:`sidebar`});return}g(e)},onDisconnected:()=>v(Error(`Live telemetry stream disconnected`)),onConnected:()=>v(void 0)});return E.current=r,()=>{r.close(),E.current===r&&(E.current=void 0)}},[e,x,A.show,A.offer,k.show,k.offer]),(0,z.useEffect)(()=>{JSON.stringify(E.current?.view)!==JSON.stringify(T)&&A.drop(),E.current?.change(T),T.type!==`human-items`&&s(e=>Object.keys(e).length===0?e:{})},[T,A.drop]),(0,z.useEffect)(()=>{j?E.current?.resume():E.current?.pause()},[j]);let N=(0,z.useCallback)(()=>{k.take(),A.take()},[k.take,A.take]),P=(0,z.useCallback)(()=>{b(void 0),N(),S(e=>e+1)},[N]),F=n?.visible,I=F!==void 0&&F.type!==`sidebar`&&F.type!==`human-items`&&F.run_id===w&&MZ(F,T)&&JSON.stringify(i)===JSON.stringify(T)?F:void 0,L=(0,z.useRef)(void 0),R=I?.detail??(L.current?.run.run_id===w?L.current:void 0);L.current=R;let ee=(0,z.useMemo)(()=>NZ(R),[R]),ne=h!==void 0&&T.type===`timeline`&&R!==void 0;return{rows:l,navigationRows:d,navigationWaiting:k.waiting,hostRows:n?.sidebar,mainWaiting:A.waiting,runId:w,detail:R,timeline:I&&`timeline`in I?I.timeline:void 0,humanItems:o,timelineError:ne?h:void 0,loading:n===void 0&&h===void 0,lastUpdated:p,activity:ee,error:ne?_:h??_,notice:y,refresh:P}}function MZ(e,t){return t.type===e.type?t.type===`timeline`&&e.type===`timeline`?t.scope===e.scope&&(t.scope===`run`||e.scope===`node`&&e.node===t.node):!0:!1}function NZ(e){let t=e?.run.live_activity;if(t===void 0)return[];let n=GA.safeParse(t);return n.success?n.data:[]}var PZ={minutes:60,seconds:1},FZ=e=>Object.hasOwn(PZ,e),IZ=600%PZ.minutes==0?{amount:String(600/PZ.minutes),unit:`minutes`}:{amount:`600`,unit:`seconds`};function LZ(e){let t=e.amount.trim();if(!/^\d+$/u.test(t))return;let n=Number(t)*PZ[e.unit];return Number.isSafeInteger(n)?n:void 0}function RZ(e){if(e===0)return`no grace`;let t=Math.floor(e/60),n=e%60,r=(e,t)=>`${e} ${t}${e===1?``:`s`}`;return t===0?r(n,`second`):n===0?r(t,`minute`):`${r(t,`minute`)} ${r(n,`second`)}`}function zZ(e){return e.map(e=>({runId:e.run_id,owner:he(e.launch)}))}function BZ(e,t){return t instanceof VM&&t.status!==void 0&&t.code!==void 0?{phase:`refused`,sent:e,error:t}:{phase:`lost`,sent:e,error:t instanceof Error?t:Error(String(t))}}var VZ={dispatchStopped:`dispatch-stopped`,hostShutdown:`host-shutdown`};function HZ(e,t,n){let r=new Set(e.runs.map(({runId:e})=>e)),i=Object.values(VZ);return n.flatMap(e=>{if(!r.has(e.run_id))return[];let n=e.last_event;if(n===null||!i.includes(n))return[];let a=t.get(e.run_id);return a!==void 0&&a.last_event===n&&a.last_progress_at===e.last_progress_at?[]:[{runId:e.run_id,recorded:n===VZ.hostShutdown?VZ.hostShutdown:VZ.dispatchStopped}]})}function UZ(e){return new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).format(e)}function WZ(e){return(0,z.useMemo)(()=>{let t=new Map;for(let n of e)t.set(n.owner,(t.get(n.owner)??0)+1);return[...t].map(([e,t])=>({owner:e,count:t}))},[e])}var GZ=`Each live dispatch is asked to stop and commit, and given the grace to end itself; whatever is still standing then is torn down, and every branch the run's records name is pushed to its origin. Nothing is sent until you confirm.`;function KZ({open:e,onOpenChange:t,runs:n,blocked:r,unreadable:i=0,onConfirm:a}){let o=(0,z.useId)(),[s,c]=(0,z.useState)(IZ),[l,u]=(0,z.useState)(!1),d=LZ(s),f=n!==void 0&&r===void 0,p=()=>{c(IZ),u(!1),t(!1)};return(0,B.jsx)(Ko,{onOpenChange:e=>e?t(!0):p(),open:e,children:(0,B.jsxs)(Xo,{className:`shutdown-dialog`,children:[(0,B.jsxs)(Zo,{children:[(0,B.jsx)($o,{children:`Shut down the entire host?`}),(0,B.jsx)(es,{children:GZ})]}),(0,B.jsxs)(`div`,{className:`shutdown-dialog-body`,children:[r===void 0?n===void 0?(0,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:`Reading which runs this acts on…`}):(0,B.jsx)(JZ,{caption:`It acts on all ${qZ(n.length)} on this host, over their owners — each is interrupted, torn down and pushed:`,label:`Runs on this host`,runs:n,warning:!0}):(0,B.jsx)(`p`,{className:`shutdown-blocked`,role:`status`,children:r}),i>0&&(0,B.jsxs)(`p`,{className:`shutdown-scope-note`,children:[i===1?`1 run root on this host could not be read`:`${i} run roots on this host could not be read`,`: the engine cannot read them either, so this shutdown signals nothing in them and pushes none of their branches.`]}),(0,B.jsxs)(`fieldset`,{className:`shutdown-grace`,children:[(0,B.jsx)(`legend`,{children:`Grace`}),(0,B.jsxs)(`div`,{className:`shutdown-grace-row`,children:[(0,B.jsx)(is,{className:`sr-only`,htmlFor:`${o}-grace`,children:`Grace`}),(0,B.jsx)(ts,{"aria-describedby":`${o}-grace-help`,"aria-invalid":d===void 0,id:`${o}-grace`,inputMode:`numeric`,min:0,onChange:e=>c({...s,amount:e.target.value}),step:1,type:`number`,value:s.amount}),(0,B.jsx)(is,{className:`sr-only`,htmlFor:`${o}-unit`,children:`Grace unit`}),(0,B.jsx)(`select`,{className:`composer-select`,id:`${o}-unit`,onChange:e=>{let t=e.target.value;FZ(t)&&c({...s,unit:t})},value:s.unit,children:Object.keys(PZ).map(e=>(0,B.jsx)(`option`,{value:e,children:e},e))})]}),(0,B.jsx)(`p`,{className:`channel-age`,id:`${o}-grace-help`,children:d===void 0?`The grace is a whole number of minutes or seconds, 0 or more.`:`How long each live dispatch has to end itself once asked: ${RZ(d)}. The engine's default is ${RZ(LZ(IZ)??0)}.`})]}),(0,B.jsxs)(`div`,{className:`composer-check shutdown-force`,children:[(0,B.jsx)(`input`,{checked:l,id:`${o}-force`,onChange:e=>u(e.target.checked),type:`checkbox`}),(0,B.jsx)(is,{htmlFor:`${o}-force`,children:`Force: skip the interrupt and the wait and go straight to the teardown — whatever a worker had not committed is lost.`})]})]}),(0,B.jsxs)(Qo,{children:[(0,B.jsx)(Jo,{asChild:!0,children:(0,B.jsx)(ui,{type:`button`,variant:`outline`,children:`Cancel`})}),(0,B.jsx)(ui,{disabled:!f||d===void 0,onClick:()=>{d!==void 0&&(a(d,l),p())},type:`button`,variant:`destructive`,children:`Shut down the host`})]})]})})}var qZ=e=>e===1?`1 run`:`${e} runs`;function JZ({caption:e,label:t,runs:n,warning:r=!1}){let i=WZ(n);return(0,B.jsxs)(`div`,{className:`shutdown-runs`,"data-warning":r,children:[(0,B.jsx)(`p`,{className:`shutdown-scope-note`,children:e}),(0,B.jsx)(`ul`,{"aria-label":t,children:i.map(({owner:e,count:t})=>(0,B.jsxs)(`li`,{children:[e,` — `,qZ(t)]},e))})]})}function YZ(e,t,n){let[r,i]=(0,z.useState)(),a=XZ(r!==void 0,e,t,n);return{open:r,setOpen:i,opener:e=>()=>i(e),runs:a.rows===void 0||r===void 0?void 0:zZ(a.rows),blocked:a.blocked,unreadable:e?.unreadable?.length??0}}function XZ(e,t,n,r){let i=(0,z.useRef)(new Set),a=t?.next_cursor;return(0,z.useEffect)(()=>{if(!e){i.current.clear();return}a===void 0||r||i.current.has(a)||(i.current.add(a),n())},[e,a,r,n]),t===void 0?{blocked:`Reading the runs listing this view holds…`}:a===void 0?{rows:t.runs}:!r&&i.current.has(a)?{blocked:`The rest of the runs listing could not be read (${t.runs.length} runs read), so the runs this acts on cannot all be named. Close this and try again.`}:{blocked:`Reading the rest of the runs listing so every run this acts on can be named (${t.runs.length} read so far)…`}}function ZZ(e,t){let[n,r]=(0,z.useState)({phase:`idle`}),i=(0,z.useRef)(!1);return{state:n,confirm:(0,z.useCallback)((n,a,o)=>{if(i.current)return;i.current=!0;let s={scope:e,runs:n,grace:a,force:o,sentAt:Date.now()};r({phase:`sending`,sent:s}),t({grace:a,force:o}).then(e=>r({phase:`answered`,sent:s,report:e}),e=>r(BZ(s,e))).finally(()=>{i.current=!1})},[e,t]),dismiss:(0,z.useCallback)(()=>{i.current||r({phase:`idle`})},[])}}var QZ=[`host`];function $Z(e){return{host:ZZ(`host`,(0,z.useCallback)(t=>e.shutdown(`host`,t),[e]))}}function eQ({list:e,loadMore:t,loadingMore:n,shutdowns:r}){let{open:i,setOpen:a,opener:o,runs:s,blocked:c,unreadable:l}=YZ(e,t,n),u=r.host.state.phase===`sending`;return(0,B.jsxs)(`fieldset`,{"aria-label":`Shut down runs on this host`,className:`host-shutdown`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`This host`}),(0,B.jsx)(`div`,{className:`host-shutdown-actions`,children:(0,B.jsxs)(ui,{disabled:u,onClick:o(`host`),size:`sm`,type:`button`,variant:`destructive`,children:[(0,B.jsx)(tt,{size:14}),` Shut down the entire host`]})}),QZ.map(e=>(0,B.jsx)(KZ,{blocked:c,onConfirm:(e,t)=>s!==void 0&&r.host.confirm(s,e,t),onOpenChange:t=>a(t?e:void 0),open:i===e,runs:i===e?s:void 0,unreadable:l},e))]})}var tQ=1e3;function nQ(e,t){let[n,r]=(0,z.useState)(()=>Date.now());(0,z.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),tQ);return()=>clearInterval(e)},[]);let i=HZ(e,(0,z.useRef)(new Map(t.filter(t=>e.runs.some(({runId:e})=>e===t.run_id)).map(e=>[e.run_id,e]))).current,t);return{now:n,progress:i,done:i.filter(({recorded:e})=>e===VZ.hostShutdown).length,deadline:e.sentAt+e.grace*1e3,asks:!e.force&&e.grace>0}}function rQ({label:e,state:t,rows:n,onDismiss:r}){return t.phase===`idle`?null:(0,B.jsxs)(`section`,{"aria-label":e,className:`shutdown-status`,children:[t.phase===`sending`?(0,B.jsx)(aQ,{rows:n,sent:t.sent}):t.phase===`lost`?(0,B.jsxs)(zr,{"aria-label":`${e} lost`,variant:`destructive`,children:[(0,B.jsx)(lt,{}),(0,B.jsx)(Br,{children:`Shutdown lost: no answer came back`}),(0,B.jsxs)(Vr,{children:[(0,B.jsxs)(`p`,{children:[`The request sent at `,UZ(t.sent.sentAt),` ended without an answer (`,t.error.message,`). The engine may still be carrying out the shutdown — check the runs before sending another.`]}),(0,B.jsx)(iQ,{sent:t.sent})]})]}):t.phase===`refused`?(0,B.jsxs)(zr,{"aria-label":`${e} refused`,variant:`destructive`,children:[(0,B.jsx)(fe,{}),(0,B.jsxs)(Br,{children:[`Shutdown refused · `,t.error.status,` `,t.error.code]}),(0,B.jsxs)(Vr,{children:[(0,B.jsx)(`pre`,{className:`verb-text`,children:t.error.message}),(0,B.jsx)(`p`,{children:`Nothing was signalled and nothing was pushed.`})]})]}):(0,B.jsx)(sQ,{label:e,report:t.report}),t.phase!==`sending`&&(0,B.jsx)(`div`,{className:`composer-actions`,children:(0,B.jsx)(ui,{onClick:r,size:`sm`,type:`button`,variant:`outline`,children:`Dismiss`})})]})}function iQ({sent:e}){return(0,B.jsxs)(`p`,{className:`channel-age`,children:[`Sent `,UZ(e.sentAt),` · scope `,e.scope,` · grace`,` `,RZ(e.grace),e.force?` · forced`:``,` · `,e.runs.length,` `,e.runs.length===1?`run`:`runs`,` in scope`]})}function aQ({sent:e,rows:t}){let{now:n,progress:r,done:i,deadline:a,asks:o}=nQ(e,t);return(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`shutdown-inflight`,role:`status`,children:[(0,B.jsxs)(`p`,{className:`shutdown-inflight-head`,children:[(0,B.jsx)(qe,{"aria-hidden":`true`,className:`animate-spin`,size:14}),(0,B.jsx)(`strong`,{children:`Shutdown in progress`}),` — still waiting for the engine's answer, `,_(Math.max(0,n-e.sentAt)),` after it was sent.`]}),(0,B.jsx)(iQ,{sent:e}),(0,B.jsx)(`p`,{children:o?n<a?`Waiting out the ${RZ(e.grace)} grace until ${UZ(a)} (${_(a-n)} left) for each live dispatch to end itself; runs are worked through one after another, each with its own grace.`:`The first grace ran out at ${UZ(a)}; the engine is tearing down what is still standing and pushing branches, run by run.`:`Forced: nothing is asked or waited for; the engine is tearing the runs down and pushing their branches.`}),(0,B.jsxs)(`p`,{children:[i,` of `,e.runs.length,` `,e.runs.length===1?`run has`:`runs have`,` recorded their shutdown.`]}),r.length>0&&(0,B.jsx)(`ul`,{"aria-label":`Recorded so far`,children:r.map(({runId:e,recorded:t})=>(0,B.jsxs)(`li`,{children:[e,`:`,` `,t===VZ.hostShutdown?`put down — host-shutdown recorded after its teardown and pushes`:`its dispatches are stopping — dispatch-stopped recorded`]},e))})]})}function oQ(e){let t=e.remote===null?``:` to ${e.remote}`,n=e.commit===null?``:` at ${e.commit}`;switch(e.result){case`pushed`:return`pushed${t}${n}`;case`already-on-origin`:return`already on its origin${t}${n}; nothing was pushed`;case`no-remote`:return`not pushed: this identity has no origin${n}`;case`refused`:return`could not be preserved${n}`}}function sQ({label:e,report:t}){return(0,B.jsxs)(zr,{"aria-label":`${e} report`,variant:t.complete?`default`:`destructive`,children:[t.complete?(0,B.jsx)(Ne,{}):(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:t.complete?`Shutdown complete`:`Shutdown incomplete`}),(0,B.jsxs)(Vr,{className:`shutdown-report`,children:[!t.complete&&(0,B.jsx)(`p`,{children:`Not everything went as asked: a dispatch was killed at the deadline or is still running, a teardown was not clean, or a branch could not be preserved. Read the runs below.`}),(0,B.jsxs)(`p`,{className:`channel-age`,children:[`Scope `,t.scope,` · grace `,RZ(t.grace_seconds),t.forced?` · forced`:``,` · runs root `,t.root]}),t.runs.length===0?(0,B.jsx)(`p`,{children:`No run was selected: nothing was signalled.`}):t.runs.map(e=>(0,B.jsxs)(`section`,{"aria-label":`Shutdown of ${e.run_id}`,className:`shutdown-report-run`,children:[(0,B.jsxs)(`h4`,{children:[e.run_id,` · owner `,e.owner,e.forced_over_owner&&` — another session's run, acted on over its owner`]}),e.dispatches.length===0?(0,B.jsx)(`p`,{children:`No live dispatch to interrupt.`}):(0,B.jsx)(`ul`,{"aria-label":`Dispatches of ${e.run_id}`,children:e.dispatches.map(e=>(0,B.jsxs)(`li`,{children:[e.node,` (pid `,e.pid,`): interrupt`,` `,e.interrupt,`; ended `,e.ended,` after`,` `,_(e.waited_ms),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.node}-${e.pid}`))}),(0,B.jsxs)(`p`,{children:[`Teardown: `,e.teardown]}),e.branches.length===0?(0,B.jsx)(`p`,{children:`No branch this run's records name.`}):(0,B.jsx)(`ul`,{"aria-label":`Branches of ${e.run_id}`,children:e.branches.map(e=>(0,B.jsxs)(`li`,{children:[e.identity,`@`,e.branch,`: `,oQ(e),(0,B.jsxs)(`span`,{className:`channel-age`,children:[` — `,e.detail]})]},`${e.identity}@${e.branch}`))})]},e.run_id)),t.not_pushed_unread===null?t.not_pushed.length===0?(0,B.jsx)(`p`,{children:`Other unpublished branches on this host: none.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host, which this shutdown did not push (`,t.not_pushed.length,`):`]}),(0,B.jsx)(`ul`,{"aria-label":`Branches not pushed`,children:t.not_pushed.map(({identity:e,branch:t})=>(0,B.jsxs)(`li`,{children:[e,`@`,t]},`${e}@${t}`))})]}):(0,B.jsxs)(`p`,{children:[`Other unpublished branches on this host: not read —`,` `,t.not_pushed_unread,`. This is not a count of zero: there may be work on this host nothing outside it carries.`]}),(0,B.jsxs)(`details`,{children:[(0,B.jsx)(`summary`,{children:`The engine's own report`}),(0,B.jsx)(`pre`,{className:`verb-text`,children:t.rendered})]})]})]})}function cQ(e){if(e===void 0||e===``)return;let t;try{t=new URL(e).pathname}catch{return lQ}let n=/\/[^/]+\/([^/]+)\/pull\/(\d+)\/?$/u.exec(t);return n===null?lQ:`${n[1]}#${n[2]}`}var lQ=`Change request`,uQ={crosshair:!0,ticks:{minSpacingPx:80}},dQ=2e3;function fQ(e){let[t,n]=e;if(n-t>=2e3)return e;let r=(t+n)/2;return[r-dQ/2,r+dQ/2]}var pQ=1e3;function mQ({completedAt:e,startedAt:t}){let n=t===void 0?void 0:F(t),r=e===void 0?void 0:F(e),i=hQ(n!==void 0&&r===void 0);return n===void 0?null:r===void 0?(0,B.jsxs)(B.Fragment,{children:[_(i-n.getTime()),` · running`]}):(0,B.jsx)(B.Fragment,{children:_(r.getTime()-n.getTime())})}function hQ(e){let[t,n]=(0,z.useState)(()=>Date.now());return(0,z.useEffect)(()=>{if(!e)return;n(Date.now());let t=setInterval(()=>n(Date.now()),pQ);return()=>clearInterval(t)},[e]),t}var gQ={passed:Ne,failed:Be,skipped:Ie,neutral:Fe,queued:Pe,running:qe,"not recorded":Re};function _Q(e){if(e.conclusion===void 0){if(e.status===void 0)return`not recorded`;if(e.status===`in_progress`)return`running`;if(e.status!==`completed`)return`queued`}switch(e.conclusion){case`success`:return`passed`;case`skipped`:return`skipped`;case`neutral`:return`neutral`;default:return`failed`}}function vQ({check:e}){let t=_Q(e),n=gQ[t];return(0,B.jsxs)(`span`,{className:`check-status`,"data-check":t.replace(` `,`-`),title:[e.status??`not recorded`,e.conclusion].filter(Boolean).join(`: `),children:[(0,B.jsx)(n,{"aria-label":t,role:`img`,size:14}),(0,B.jsx)(`span`,{"aria-hidden":`true`,children:t})]})}function yQ({control:e}){if(e===void 0)return null;let t=e.addressable?`Turn reachable`:`No turn to reach`,n=e.addressable?`a planner's note can be delivered into the ${e.member??`member`} turn in flight`:e.reason,r=e.addressable?Ze:Xe;return(0,B.jsxs)(f,{"aria-label":`${t}: ${n}`,className:x(`node-view-control gap-1.5`,e.addressable?`border-info bg-info-surface text-info`:`border-warning bg-warning-surface text-warning`),title:n,variant:`outline`,children:[(0,B.jsx)(r,{"aria-hidden":`true`,size:12}),t]})}function bQ({failure:e}){return(0,B.jsxs)(`p`,{className:`page-failed`,role:`alert`,children:[(0,B.jsxs)(`span`,{children:[`Earlier rows did not load: `,e.message]}),(0,B.jsx)(`button`,{onClick:e.retry,type:`button`,children:`Try again`})]})}function xQ({failure:e,loading:t,onLoad:n}){return e===void 0?(0,B.jsx)(`button`,{className:`load-earlier`,disabled:t,onClick:n,type:`button`,children:t?`Loading earlier rows…`:`Load earlier rows`}):(0,B.jsx)(bQ,{failure:e})}function SQ(e,t){let[n,r]=(0,z.useState)(null);return(0,z.useLayoutEffect)(()=>{n!==null&&!n.isConnected&&r(null)}),(0,z.useLayoutEffect)(()=>{let i=e.current;if(!t||n!==null||i===null)return;let a=()=>{let e=i.querySelector(`[aria-label^="Timeline plot"]`);return e===null?!1:(getComputedStyle(e).position===`static`&&(e.style.position=`relative`),r(e),!0)};if(a())return;let o=new MutationObserver(()=>{a()&&o.disconnect()});return o.observe(i,{childList:!0,subtree:!0}),()=>o.disconnect()}),n}function CQ({container:e,range:t,stretches:n}){let r=SQ(e,n.length>0);if(r===null)return null;let i=Math.max(t[1]-t[0],1),a=e=>(Math.min(Math.max(e,t[0]),t[1])-t[0])/i*100;return(0,fn.createPortal)(n.map(([e,t])=>(0,B.jsx)(`span`,{className:`history-hatch`,"data-from":e,"data-to":t,style:{left:`${a(e)}%`,width:`${a(t)-a(e)}%`},children:(0,B.jsx)(`span`,{className:`history-hatch-label`,children:D})},`${e}-${t}`)),r)}function wQ(e){return e===`human-step`?`human step`:e}function TQ(e){return e.style===`human-step`}function EQ(e){switch(e){case`not-released`:return`not released yet`;case`awaiting-human-step`:return`waiting for the human step`;case`not-answered`:return`the registry did not answer`;case`not-landed`:return`released, but not carrying this work yet`;default:return e}}function DQ(e){if(e!==void 0)return e?`yes — a later acknowledgement replaced this one`:`no`}function OQ(e){if(e!==void 0)return e===`live`?`Live — into the turn that was already running`:e===`next`?`Deferred — onto the node's next dispatch`:e}function kQ(e){return[e.identity,e.target].filter(Boolean).join(` · `)||e.dep}function AQ({release:e}){let t=[[`Dependency`,e.dep],[`Identity`,e.identity],[`Release target`,e.target],[`Style`,e.style===void 0?void 0:wQ(e.style)],[`Version`,e.version],[`Probe outcome`,e.outcome],[`Probed through`,e.form],[`Probe took`,e.elapsed_ms===void 0?void 0:`${e.elapsed_ms} ms`],[`Acknowledged by`,e.actor],[`Superseded`,DQ(e.superseded)],[`Landed as`,e.landing_commit],[`Adopted`,OQ(e.delivery)]].filter(([,e])=>e!==void 0);return(0,B.jsxs)(B.Fragment,{children:[t.length>0&&(0,B.jsx)(`dl`,{className:`facts`,children:t.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))}),e.awaiting!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Held on`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.awaiting.map(e=>(0,B.jsxs)(`li`,{children:[TQ(e)?(0,B.jsxs)(zr,{children:[(0,B.jsx)(d,{}),(0,B.jsxs)(Br,{children:[`Waiting on a person · `,kQ(e)]}),(0,B.jsx)(Vr,{children:e.action??`The release is a human step and the run recorded no action for it.`})]}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Waiting on an automated release · `,kQ(e)]}),(0,B.jsx)(`p`,{className:`detail-note`,children:[e.last_answer===void 0?void 0:EQ(e.last_answer),e.waited_seconds===void 0?void 0:`waited ${e.waited_seconds}s`].filter(e=>e!==void 0).join(` · `)})]},`${e.dep}·${e.identity??``}·${e.target??``}`))})]}),e.versions!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Versions adopted`}),(0,B.jsx)(`ul`,{className:`release-awaiting`,children:e.versions.map(e=>(0,B.jsx)(`li`,{children:(0,B.jsxs)(`p`,{className:`detail-note`,children:[e.identity,` · `,e.target,` · `,e.version]})},`${e.identity}·${e.target}`))})]})]})}function jQ({node:e}){let t=e.result?.release??void 0;if(t===void 0)return(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=t.identity!==e.task?.repo;return(0,B.jsx)(B.Fragment,{children:[t.target,t.style===void 0?void 0:wQ(t.style),t.version,n?t.identity:void 0].filter(e=>e!==void 0).join(` · `)})}function MQ({artifactId:e,client:t,runId:n}){let r=nN(`${n}/${e}`,()=>t.getArtifact(n,e),0),i=r.value?.turns??[];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Oneharness conversation`}),r.loading?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`Loading conversation…`}):r.value===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:`The history store holds no readable copy of that conversation.`}):r.value.unavailable===void 0?(0,B.jsx)(di,{className:`gap-0 py-3`,children:(0,B.jsx)(fi,{className:`px-3`,children:i.map(e=>(0,B.jsx)(XS,{turn:e},e.id))})}):(0,B.jsxs)(zr,{variant:`destructive`,children:[(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:`Transcript unavailable`}),(0,B.jsx)(Vr,{children:r.value.unavailable})]})]})}function NQ({artifactId:e,client:t,heading:n,missing:r,noun:i,runId:a,unreadable:o}){let s=PQ(e),c=nN(s===void 0?void 0:`${a}/${s}`,()=>t.getArtifact(a,s??``),0),l=c.value?.content;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:n}),s===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:r}):c.loading?(0,B.jsxs)(`p`,{"aria-live":`polite`,className:`detail-note`,children:[`Loading `,i,`…`]}):l===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`detail-note`,children:o}):(0,B.jsxs)(B.Fragment,{children:[c.value?.truncated===!0&&(0,B.jsxs)(`p`,{className:`detail-note`,children:[`The server keeps the end of a `,i,` this long; its beginning is not shown.`]}),(0,B.jsx)(`section`,{"aria-label":n,children:(0,B.jsx)(`pre`,{children:l})})]})]})}function PQ(e){if(!(e===void 0||/[/?#]/u.test(e)))return e}function FQ(e,t,n,r){let[i,a]=(0,z.useState)(),o=t===void 0||n===void 0?void 0:JSON.stringify([t,n]);(0,z.useEffect)(()=>{if(o===void 0||t===void 0||n===void 0)return;let r=!0;return e.getConversation(t,n).then(e=>{r&&a({key:o,conversation:e})}).catch(e=>{if(!r)return;let t=e instanceof Error?e:Error(String(e));a(e=>e?.key===o&&e.conversation!==void 0?e:{key:o,error:t})}),()=>{r=!1}},[e,t,n,o,r]);let s=i?.key===o?i:void 0;return(0,z.useMemo)(()=>({conversation:s?.conversation,error:s?.error,loading:o!==void 0&&s===void 0}),[s,o])}var IQ=32;function LQ(e){return e===null?null:e.closest(`[data-slot="scroll-area-viewport"]`)??e.parentElement}function RQ(e,t){let n=(0,z.useRef)(null),r=(0,z.useRef)(!0),i=(0,z.useRef)({key:e,count:t}),a=(0,z.useCallback)(()=>{let e=n.current;e!==null&&(r.current=e.scrollHeight-e.scrollTop-e.clientHeight<=IQ)},[]),o=(0,z.useCallback)(e=>{n.current?.removeEventListener(`scroll`,a),n.current=LQ(e),n.current?.addEventListener(`scroll`,a,{passive:!0}),a()},[a]);return(0,z.useLayoutEffect)(()=>{let a=i.current;i.current={key:e,count:t};let o=a.key===e&&a.count>0&&t>a.count,s=n.current;!o||s===null||!r.current||(s.scrollTop=s.scrollHeight)},[e,t]),o}var zQ=25;function BQ({client:e,runId:t,node:n,row:r}){let i=r===void 0?void 0:s$(r),a=i?.kind===`conversation`?i.value:void 0,o=FQ(e,t,a,r===void 0?void 0:n$(r));return(0,B.jsx)(`section`,{"aria-label":`Timeline item detail`,className:`timeline-detail`,children:(0,B.jsx)(Iu,{className:`h-full`,children:(0,B.jsx)(`div`,{className:`p-[22px] max-sm:p-3`,ref:RQ(a,r$(r,o)),children:r===void 0?(0,B.jsxs)(`div`,{className:`detail-placeholder`,children:[(0,B.jsx)(Ke,{size:30}),(0,B.jsx)(`p`,{children:`Select an item in the timeline to read what it recorded.`})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(g,{row:r}),(0,B.jsx)(Yu,{className:`my-4`}),(0,B.jsx)(VQ,{client:e,runId:t,node:n,reference:i,row:r,transcript:o})]})})})})}function VQ({client:e,runId:t,row:n,node:r,reference:i,transcript:a}){let o=i$(n);if(o!==void 0)return(0,B.jsx)(ZQ,{redirection:o,row:n});let s=a$(n);if(s!==void 0)return(0,B.jsx)(AQ,{release:s});let c=o$(n);return c===void 0?i?.kind===`conversation`?(0,B.jsxs)(B.Fragment,{children:[n.rowKind===`event`&&(0,B.jsx)(e$,{row:n,reference:i}),(0,B.jsx)(KQ,{row:n,transcript:a})]}):l$(n)?(0,B.jsx)(qQ,{client:e,runId:t,reference:i,row:n}):i?.kind===`worker_report`&&PQ(i.value)!==void 0?(0,B.jsx)(JQ,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):i?.kind===`oneharness_session`&&PQ(i.value)!==void 0?(0,B.jsx)(YQ,{artifactId:i.value,client:e,reference:i,row:n,runId:t}):u$(n,i)&&r!==void 0?(0,B.jsx)(XQ,{node:r,reference:i}):(0,B.jsx)(e$,{reference:i,row:n}):(0,B.jsx)($Q,{row:n,surface:c})}function HQ({turn:e}){return e.judges===void 0||e.judges.length===0?null:(0,B.jsx)(`ul`,{"aria-label":`Judges on turn ${e.id}`,className:`judge-decisions`,children:e.judges.map(e=>(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`span`,{className:`judge-decision-who`,children:[e.judge,` (`,e.kind,`)`]}),` `,e.decision,` — `,e.reason]},e.judge))})}function UQ(e){return e.tool?.turn??e.id}function WQ(e,t){if(e.rowKind!==`event`||e.event.tool===void 0)return;let n=UQ(e.event),r=t.find(({id:e})=>e===n);if(r===void 0)return;let{index:i,tool_call_id:a}=e.event.tool;return a!==void 0&&r.tools.some(e=>e.toolCallId===a)?{turnId:r.id,toolCallId:a}:{turnId:r.id,eventIndex:i}}function GQ({turn:e}){let t=[e.unknown.instruction_truncated===!0?`its prompt`:void 0,e.unknown.truncated===!0?`its reply`:void 0,e.tools.some(e=>e.output_truncated===!0)?`a tool's output`:void 0,e.tools.some(e=>e.input_truncated===!0)?`a tool's input`:void 0].filter(e=>e!==void 0);return t.length===0?null:(0,B.jsxs)(zr,{className:`mb-3`,role:`note`,children:[(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:`Cut by the recorder`}),(0,B.jsxs)(Vr,{children:[`The run's recorder cut `,t.join(`, `),` to its bound, and no whole copy exists: neither the member's report nor a history file this run names holds it.`]})]})}function KQ({row:e,transcript:t}){let[n,r]=(0,z.useState)(zQ),i=t.conversation?.conversation.turns??[],a=e.rowKind===`event`?UQ(e.event):void 0,o=a===void 0?i:i.filter(({id:e})=>e===a),s=np(o.map(e=>({id:e.id,time:Date.parse(e.timestamp)})));if(t.loading)return(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-inline`,children:[(0,B.jsx)(Xu,{className:`h-2 w-40`}),(0,B.jsx)(Xu,{className:`h-2 w-24`}),`Loading transcript…`]});if(t.conversation===void 0)return(0,B.jsxs)(zr,{variant:`destructive`,children:[(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:`Transcript unavailable`}),(0,B.jsx)(Vr,{children:t.error?.message??`The server recorded no transcript.`})]});let{conversation:c,attribution:l}=t.conversation,u=d$(l.agentRole,l.transportRole),d=WQ(e,o);return(0,B.jsx)(di,{className:`gap-0 py-3`,children:(0,B.jsxs)(fi,{className:`px-3`,children:[(0,B.jsxs)(`header`,{className:`transcript-header`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsxs)(`p`,{className:`eyebrow`,children:[e.dispatch===void 0?``:`${e.dispatch.label} · `,u,l.persona?` · ${l.persona}`:``]}),(0,B.jsx)(`h4`,{children:c.name})]}),(0,B.jsx)(Gf,{state:c.state})]}),(0,B.jsx)(Yu,{className:`my-2.5`}),(0,B.jsx)(`div`,{className:`conversation-timeline-sticky`,children:(0,B.jsx)(tp,{cursor:s.cursor,...d===void 0?{}:{focus:d},onSelectTurn:s.scrollTo,turns:[...o]})}),o.length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`This turn is no longer part of the recorded transcript.`}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`div`,{ref:s.containerRef,children:o.slice(0,n).map(e=>(0,B.jsxs)(`div`,{ref:t=>s.register(e.id,t),children:[(0,B.jsx)(GQ,{turn:e}),(0,B.jsx)(XS,{author:{label:u},...d?.turnId===e.id?{focus:d}:{},turn:e}),(0,B.jsx)(HQ,{turn:e})]},e.id))}),o.length>n&&(0,B.jsxs)(ui,{onClick:()=>r(n+zQ),size:`sm`,type:`button`,variant:`outline`,children:[`Show more of `,o.length,` turns`]})]})]})})}function qQ({row:e,client:t,runId:n,reference:r}){let i=e.rowKind===`span`?e.span.detail:void 0,a=i?.artifact_id??(r?.kind===`gate_log`?r.value:void 0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Verification record`}),(0,B.jsx)(`dl`,{className:`facts`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Result`}),(0,B.jsx)(`dd`,{children:i?.ok===void 0?e.status??`in progress`:i.ok?`passed`:`failed`})]})}),i?.output_tail&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Output`}),(0,B.jsx)(`pre`,{children:i.output_tail})]}),(0,B.jsx)(NQ,{artifactId:a,client:t,heading:`Full log`,missing:`No readable log was recorded.`,noun:`log`,runId:n,unreadable:`No readable log was recorded.`}),(0,B.jsxs)(`p`,{className:`detail-note`,children:[`Verification `,e.status??`in progress`,`.`]})]})}function JQ({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(NQ,{artifactId:e,client:t,heading:`Worker report`,missing:`This settlement recorded no report.`,noun:`report`,runId:i,unreadable:`This run kept no readable copy of that report.`}),(0,B.jsx)(e$,{reference:n,row:r})]})}function YQ({artifactId:e,client:t,reference:n,row:r,runId:i}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(MQ,{artifactId:e,client:t,runId:i}),(0,B.jsx)(e$,{reference:n,row:r})]})}function XQ({node:e,reference:t}){let n=e.detail?.verification.checks??[],r=e.detail?.publication;return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Publication`}),r?.pr_url&&(0,B.jsx)(t$,{fallback:``,reference:{kind:`pr`,value:r.pr_url}}),r?.merged&&r.commit_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.commit_url,rel:`noreferrer`,target:`_blank`,children:[`Merged commit `,r.commit?.slice(0,8),` `,(0,B.jsx)(Ue,{size:13})]})}):r?.branch_url?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:r.branch_url,rel:`noreferrer`,target:`_blank`,children:[`Branch `,r.branch,` `,(0,B.jsx)(Ue,{size:13})]})}):!r?.pr_url&&(0,B.jsx)(t$,{fallback:`No publication was recorded.`,reference:t}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Observed checks`}),n.length===0?(0,B.jsx)(`p`,{className:`detail-note`,children:`No checks were observed on this node.`}):(0,B.jsx)(`dl`,{className:`facts`,children:n.map(e=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.name}),(0,B.jsx)(`dd`,{children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.state}):e.state})]},e.name))})]})}function ZQ({redirection:e,row:t}){return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Delivery`}),(0,B.jsx)(`dd`,{children:e.delivered?`Live — into the turn that was already running`:`Deferred — onto the node's next dispatch`})]}),e.turn!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Turn`}),(0,B.jsx)(`dd`,{children:e.turn===`turn-end`?`Left to end — the note reached it as it ended`:`Interrupted — its replacement opened on the note`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Redirected at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(l,{at:t.startedAt,relative:!0})})]}),e.member!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Member`}),(0,B.jsx)(`dd`,{children:e.member})]}),e.input_bytes!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Note`}),(0,B.jsxs)(`dd`,{children:[e.input_bytes,` bytes offered`]})]}),(0,B.jsx)(QQ,{row:t})]}),e.reason!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Why it was not delivered`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.reason})]})]})}function QQ({row:e}){let t=e.rowKind===`event`?Se(e.event):void 0;return t===void 0?null:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Author`}),(0,B.jsx)(`dd`,{children:t})]})}function $Q({surface:e,row:t}){let n=[[`Kind`,e.kind],[`Raised by`,e.source],[`Blocking`,e.blocking===void 0?void 0:e.blocking?`yes — dependents wait on the answer`:`no — nothing waits on it`]].filter(([,e])=>e!==void 0);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(l,{at:t.startedAt,relative:!0})})]}),n.map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:t})]},e))]}),e.message!==void 0&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Message`}),(0,B.jsx)(`p`,{className:`detail-note`,children:e.message})]})]})}function e$({row:e,reference:t}){if(e.rowKind===`event`)return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(l,{at:e.startedAt,relative:!0})})]}),Object.entries(e.event.fields??{}).map(([e,t])=>(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e}),(0,B.jsx)(`dd`,{children:typeof t==`string`?t:JSON.stringify(t)})]},e))]}),t!==void 0&&(0,B.jsx)(t$,{reference:t,fallback:`No recorded artifact.`})]});let n=e.rowKind===`group`?void 0:e,r=e.rowKind===`span`&&e.span.count!==void 0?`${e.span.count} records`:void 0,a=(e.rowKind===`span`?e.span.reasons:void 0)??[];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Recorded at`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(l,{at:e.startedAt,relative:!0})})]}),e.rowKind===`span`&&(e.endedAt!==null||e.status===`running`)&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Ended`}),(0,B.jsx)(`dd`,{children:e.endedAt===null?`Still running`:(0,B.jsx)(l,{at:e.endedAt,relative:!0})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Status`}),(0,B.jsx)(`dd`,{children:e.status??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Duration`}),(0,B.jsx)(`dd`,{children:e.durationMs===null?`Not recorded`:_(e.durationMs)})]}),r!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Aggregated`}),(0,B.jsx)(`dd`,{children:r})]}),a.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Waiting on`}),(0,B.jsx)(`dd`,{children:a.map(i).join(` and `)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Step`}),(0,B.jsx)(`dd`,{children:c$(n)??`None`})]}),(0,B.jsx)(QQ,{row:e})]}),(0,B.jsx)(`h3`,{className:`detail-heading`,children:`Reference`}),(0,B.jsx)(t$,{fallback:e.rowKind===`span`&&e.span.kind===`dispatch`?`No transcript was recorded for this dispatch.`:`This item points at no recorded artifact.`,reference:t})]})}function t$({reference:e,fallback:t}){return e===void 0?(0,B.jsx)(`p`,{className:`detail-note`,children:t}):e.value.startsWith(`http`)?(0,B.jsx)(`p`,{className:`detail-link`,children:(0,B.jsxs)(`a`,{href:e.value,rel:`noreferrer`,target:`_blank`,children:[e.kind===`pr`?cQ(e.value):e.value,` `,(0,B.jsx)(Ue,{size:13})]})}):(0,B.jsxs)(`p`,{className:`detail-note`,children:[(0,B.jsx)(`span`,{className:`detail-reference-kind`,children:e.kind}),(0,B.jsx)(`code`,{children:e.value})]})}function n$(e){if(e.rowKind!==`span`)return e.id;let t=e.span.events.at(-1);return[e.span.id,e.span.status??``,e.span.ended_at??``,e.span.events.length,t?.id??``,t?.at??``,t?.status??``].join(`|`)}function r$(e,t){return t.conversation===void 0?0:e?.rowKind===`event`?1:t.conversation.conversation.turns.length}function i$(e){return e.rowKind===`event`?e.event.redirection:void 0}function a$(e){return e.rowKind===`event`?e.event.release:void 0}function o$(e){return e.rowKind===`event`?e.event.surface:void 0}function s$(e){if(e.rowKind===`span`)return e.span.reference;if(e.rowKind===`event`)return e.event.reference}function c$(e){if(e?.rowKind===`span`)return e.span.step_id;if(e?.rowKind===`event`)return e.event.step_id}function l$(e){return e.kind===`verification`||e.kind.startsWith(`verification-`)}function u$(e,t){return t?.kind===`pr`||e.kind===`publication`||e.kind.startsWith(`pr-`)||e.kind.startsWith(`publication-`)}function d$(e,t){return r(e,t)}var f$=500,p$=pj.omit({events:!0});function m$(e,t){if(t===void 0)return e;let n=new Set(e.events.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return r.length===0?e:{...e,events:[...e.events,...r].sort((e,t)=>Date.parse(e.at)-Date.parse(t.at)||(e.journal_order??0)-(t.journal_order??0))}}function h$(e){let t=e.flatMap(e=>{let t=e.events_total;if(t===void 0||t<=e.events.length)return[];let n=e.events[0],r=Date.parse(e.started_at),i=n===void 0?Date.parse(e.ended_at??e.started_at):Date.parse(n.at);return i>r?[[r,i]]:[]}).sort((e,t)=>e[0]-t[0]),n=[];for(let[e,r]of t){let t=n.at(-1);t!==void 0&&e<=t[1]?t[1]=Math.max(t[1],r):n.push([e,r])}return n}function g$({client:e,runId:t,scope:n,nodeId:r,filter:i,timeline:a}){let o=(0,z.useRef)(new Map),s=(0,z.useRef)(new Map),c=(0,z.useRef)(new Map),l=(0,z.useRef)(new Set),u=(0,z.useRef)(new Set),[d,f]=(0,z.useState)(0),[p,m]=(0,z.useState)(),[h,g]=(0,z.useState)(!1),_=(0,z.useRef)(!1),v=(0,z.useCallback)(()=>f(e=>e+1),[]),y=(0,z.useCallback)(e=>{for(let t of e.rows)o.current.set(t.id,t)},[]),b=(0,z.useCallback)((e,t)=>{m({message:e instanceof Error?e.message:String(e),retry:()=>{m(void 0),t()}}),v()},[v]),x=(0,z.useMemo)(()=>{if(a===void 0)return a;if(n===`node`)for(let e of a.spans)for(let t of e.events)o.current.has(t.id)||o.current.set(t.id,{...t,span_id:e.id});let e=new Map;for(let t of o.current.values()){let n=e.get(t.span_id);n===void 0?e.set(t.span_id,[t]):n.push(t)}return e.size===0&&s.current.size===0?a:{...a,spans:a.spans.map(t=>{let n=m$(t,e.get(t.id)),r=s.current.get(t.id);return r===void 0?n:{...r,...n,events:n.events}})}},[a,d,n]),S=r??``,C=(0,z.useMemo)(()=>n!==`node`||c.current.get(S)===null?[]:h$((x?.spans??[]).filter(e=>!u.current.has(e.id))),[x,n,S,d]),w=n===`node`&&c.current.has(S)?c.current.get(S)!==null:(a?.spans??[]).some(e=>e.events_total!==void 0&&e.events_total>e.events.length),T=n===`node`&&c.current.get(S)===null,E=(0,z.useCallback)(a=>{if(_.current||n!==`node`||r===void 0||c.current.get(S)===null)return;_.current=!0,g(!0);let o=c.current.get(S)??void 0;e.getTimelineEvents(t,{scope:n,node:r,...a===!0?{limit:f$}:{},...o===void 0?{}:{cursor:o},...i===void 0?{}:{filter:i}}).then(e=>{y(e),c.current.set(S,e.next_cursor),v()}).catch(e=>b(e,()=>E(a))).finally(()=>{_.current=!1,g(!1)})},[v,e,S,b,i,r,t,n,y]),D=(0,z.useCallback)(async(r,a)=>{try{let a;for(;;){let o=await e.getTimelineEvents(t,{scope:n,limit:f$,...r,...a===void 0?{}:{cursor:a},...i===void 0?{}:{filter:i}});y(o);let{span:c}=o;if(r.span!==void 0&&c!==void 0&&s.current.set(r.span,p$.parse(c)),o.next_cursor===null&&r.span!==void 0&&r.from===void 0&&r.to===void 0&&u.current.add(r.span),v(),o.next_cursor===null)return;a=o.next_cursor}}catch(e){b(e,a)}},[v,e,b,i,t,n,y]),O=(0,z.useCallback)(e=>{let t=`span:${e}`;l.current.has(t)||(l.current.add(t),D({span:e,...r===void 0?{}:{node:r}},()=>{l.current.delete(t),O(e)}))},[r,D]),k=(0,z.useCallback)(e=>{let t=`row:${e??``}`;l.current.has(t)||(l.current.add(t),D(e===void 0?{}:{node:e},()=>{l.current.delete(t),k(e)}))},[D]),A=(0,z.useCallback)((e,t,n)=>{let r=`stretch:${n??``}:${e}:${t}`;l.current.has(r)||(l.current.add(r),D({...n===void 0?{}:{node:n},from:new Date(e).toISOString(),to:new Date(t).toISOString()},()=>{l.current.delete(r),A(e,t,n)}))},[D]);return{...x===void 0?{}:{timeline:x},unheld:C,canLoadEarlier:w,readToStart:T,loadingEarlier:h,loadEarlier:E,loadSpan:O,loadRow:k,loadStretch:A,...p===void 0?{}:{failure:p}}}var _$=`No earlier history remains`,v$=`This node is not on the run's graph, so the plan holds no task for it.`;function y$({client:e,runId:t,node:n,nodes:r,timeline:i,timelineError:a,filter:o,runLoaded:s=!0,onRetry:c,selectedItemId:l,onSelectItem:u,onBack:d,selectedTab:f,onSelectTab:p}){let m=(0,z.useMemo)(()=>h(i,n.id),[i,n.id]);(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(l===void 0?d():u())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,u,l]);let g=n.detail?.publication===void 0?n.result?.pr??void 0:n.detail.publication.pr_url;return(0,B.jsx)(`section`,{"aria-label":`Timeline for ${n.label}`,className:`node-view`,children:(0,B.jsxs)(Yd,{className:`node-tabs`,onValueChange:e=>{hZ(e)&&p(e)},value:f,children:[(0,B.jsxs)(`section`,{"aria-label":`Node header`,className:`node-view-head`,children:[(0,B.jsx)(`nav`,{"aria-label":`Breadcrumb`,children:(0,B.jsxs)(`ol`,{className:`breadcrumb`,children:[(0,B.jsx)(`li`,{children:(0,B.jsxs)(ui,{onClick:d,size:`sm`,type:`button`,variant:`ghost`,children:[(0,B.jsx)(De,{size:14}),` Graph`]})}),(0,B.jsx)(`li`,{"aria-current":`page`,children:(0,B.jsx)(`span`,{className:`breadcrumb-node`,children:n.label})})]})}),(0,B.jsxs)(`div`,{className:`node-view-facts`,children:[(0,B.jsx)(JX,{className:`node-view-state`,state:n.status}),(0,B.jsx)(yQ,{control:n.control}),(0,B.jsxs)(`span`,{className:`node-view-meta`,children:[ie(n),` node ·`,` `,s?`${n.telemetry?.turns??0} turns · ${n.telemetry?.lint??0} lint turns`:`turns ${R}`]}),g!==void 0&&(0,B.jsxs)(`a`,{className:`node-view-pr`,href:g,rel:`noreferrer`,target:`_blank`,children:[cQ(g),` `,(0,B.jsx)(Ue,{size:12})]})]}),(0,B.jsx)(Zd,{"aria-label":`Node details`,variant:`line`,children:Object.entries(mZ).map(([e,t])=>(0,B.jsx)(Qd,{value:e,children:t},e))})]}),(0,B.jsx)(P$,{node:n,nodes:r}),(0,B.jsx)(M$,{node:n}),(0,B.jsx)(N$,{node:n}),(0,B.jsxs)($d,{className:`node-tab-panel`,value:`task`,children:[n.task===void 0?(0,B.jsx)(`p`,{children:v$}):s?(0,B.jsx)(gY,{source:k$(n.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:R}),(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Settled as`}),(0,B.jsx)(`dd`,{children:F$(n.result?.outcome)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:F$(n.result?.detail)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Graph overrides`}),(0,B.jsx)(`dd`,{children:s?(n.task?.sets??[]).length===0?`None`:(0,B.jsx)(`ol`,{"aria-label":`Graph overrides`,className:`sets-served`,children:n.task?.sets?.map((e,t)=>(0,B.jsx)(`li`,{children:(0,B.jsx)(`code`,{children:e})},t))}):R})]})]})]}),(0,B.jsx)($d,{className:`node-tab-panel`,value:`criteria`,children:n.task===void 0?(0,B.jsx)(`p`,{children:v$}):s?(0,B.jsx)(gY,{source:A$(n.task)}):(0,B.jsx)(`p`,{className:`loading-value`,children:R})}),(0,B.jsx)($d,{className:`node-tab-panel`,value:`dependencies`,children:(0,B.jsxs)(`dl`,{className:`facts`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Dependencies`}),(0,B.jsx)(`dd`,{children:(n.task?.deps??[]).map(e=>{let t=r.find(t=>t.id===e)?.status;return t===void 0?e:`${e} (${t})`}).join(`, `)||`None`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unblocks`}),(0,B.jsx)(`dd`,{children:n.dependents.join(`, `)||`None`})]})]})}),(0,B.jsxs)($d,{className:`node-tab-panel`,value:`remote`,children:[!s&&(0,B.jsx)(`p`,{className:`loading-value`,children:`Loading…`}),(0,B.jsxs)(`dl`,{className:`facts`,hidden:!s,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Publication`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(j$,{node:n})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Branch`}),(0,B.jsx)(`dd`,{children:n.detail?.publication?.branch??`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Merge`}),(0,B.jsx)(`dd`,{children:n.detail?.publication?n.detail.publication.merged?`Merged`:`Not merged`:`Not recorded`})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Release`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(jQ,{node:n})})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Verification coverage`}),(0,B.jsxs)(`dd`,{children:[`Hook:`,` `,n.detail?.verification.pre_push_hook?`present`:`not recorded`,` · `,`Required checks:`,` `,n.detail?.verification.required_checks?.join(`, `)||`none configured`]})]}),(0,B.jsxs)(`div`,{className:`remote-check-facts`,children:[(0,B.jsx)(`dt`,{children:`Observed checks`}),(0,B.jsx)(`dd`,{children:(n.detail?.verification.checks??[]).length===0?`No checks observed`:(0,B.jsxs)(`table`,{"aria-label":`Remote checks`,className:`remote-checks`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:`Name`}),(0,B.jsx)(`th`,{children:`Status`}),(0,B.jsx)(`th`,{children:`Runtime`}),(0,B.jsx)(`th`,{children:`Required`})]})}),(0,B.jsx)(`tbody`,{children:n.detail?.verification.checks?.map(e=>(0,B.jsxs)(`tr`,{className:e.status===`completed`&&![`success`,`neutral`,`skipped`].includes(e.conclusion??``)?`check-failing`:void 0,children:[(0,B.jsx)(`th`,{scope:`row`,children:e.url?(0,B.jsx)(`a`,{href:e.url,rel:`noreferrer`,target:`_blank`,children:e.name}):e.name}),(0,B.jsx)(`td`,{children:(0,B.jsx)(vQ,{check:e})}),(0,B.jsx)(`td`,{children:(0,B.jsx)(mQ,{...e.started_at===void 0?{}:{startedAt:e.started_at},...e.completed_at===void 0?{}:{completedAt:e.completed_at}})}),(0,B.jsxs)(`td`,{title:e.requirement,className:e.required?`check-required`:`check-optional`,children:[(0,B.jsx)(`svg`,{role:`img`,"aria-label":e.required?`required`:`not required`,width:`12`,height:`12`,viewBox:`0 0 12 12`,children:e.required?(0,B.jsx)(`path`,{d:`M6 0.5 L11 2.5 V6 C11 9 8.5 11 6 11.5 C3.5 11 1 9 1 6 V2.5 Z`,fill:`currentColor`}):(0,B.jsx)(`circle`,{cx:`6`,cy:`6`,r:`4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeDasharray:`2 1.5`})}),e.required?`Required`:`Optional`]})]},e.name))})]})})]})]})]}),(0,B.jsx)($d,{className:`node-timeline-panel`,value:`timeline`,children:a===void 0?i===void 0?(0,B.jsx)(`div`,{"aria-live":`polite`,className:`loading-state`,children:`Loading the recorded timeline…`}):m.rows.length===0?(0,B.jsxs)(di,{className:`m-5 items-center gap-2 p-8 text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`m-0`,children:`This node has no recorded timeline yet.`}),(0,B.jsx)(`p`,{className:`m-0 text-[11px]`,children:`Spans and events appear here as the run records them.`})]}):(0,B.jsx)(b$,{client:e,...o===void 0?{}:{filter:o},node:n,onSelectItem:u,runId:t,selectedItemId:l,timeline:i}):(0,B.jsxs)(zr,{className:`m-5 w-auto`,variant:`destructive`,children:[(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:`Timeline unavailable`}),(0,B.jsxs)(Vr,{children:[a.message,` `,c!==void 0&&(0,B.jsx)(ui,{onClick:c,size:`sm`,variant:`outline`,children:`Try again`})]})]})})]})})}function b$({client:e,filter:n,node:r,onSelectItem:i,runId:o,selectedItemId:s,timeline:c}){let l=g$({client:e,runId:o,scope:`node`,nodeId:r.id,timeline:c,...n===void 0?{}:{filter:n}}),u=l.timeline??c,d=(0,z.useMemo)(()=>re(u,r.id),[u,r.id]),[f,h]=(0,z.useState)(()=>new Set),g=(0,z.useMemo)(()=>{if(s!==void 0)return t(d.tree,s).find(e=>e.rowKind===`group`)?.id},[d.tree,s]),_=(0,z.useMemo)(()=>g===void 0?f:new Set([...f,g]),[f,g]),v=(0,z.useMemo)(()=>p(d.tree,_),[d.tree,_]),b=(0,z.useMemo)(()=>v.flatMap(e=>e.entryKind===`row`?[{id:e.row.id,time:Date.parse(e.row.startedAt)}]:[]),[v]),x=np(b),[S,C]=(0,z.useState)(!1),[w,T]=(0,z.useState)(),E=(0,z.useMemo)(()=>Ce(d.items,d.lanes),[d.items,d.lanes]),D=(0,z.useMemo)(()=>y(d.markers,d.items,s),[d.items,d.markers,s]),O=(0,z.useMemo)(()=>x$([...d.items,...d.markers.map(({at:e})=>({start:e}))]),[d.items,d.markers]),k=(0,z.useMemo)(()=>x$([...S?d.items:E,...D.map(({at:e})=>({start:e}))]),[S,d.items,E,D]),A=x.cursor===void 0?void 0:Math.min(Math.max(x.cursor,O[0]),O[1]),j=s===void 0?void 0:a(d.rows,s),M=(0,z.useRef)(0),N=e=>{M.current=Date.now()+500,i(e),x.scrollTo(e)},P=(0,z.useRef)(N);P.current=N;let F=(0,z.useCallback)(e=>P.current(e),[]),I=(0,z.useRef)(null),{containerRef:L}=x,R=(0,z.useCallback)(e=>{I.current=e,L(e)},[L]),ee=(0,z.useRef)(null),te=(0,z.useRef)(void 0),{loadEarlier:ne,loadSpan:ie,loadStretch:ae}=l,oe=(0,z.useRef)(void 0),se=()=>{te.current=T$(I.current),oe.current=b.length,ne()},ce=()=>{l.canLoadEarlier&&!l.loadingEarlier&&l.failure===void 0&&se()};(0,z.useLayoutEffect)(()=>{let e=I.current,t=te.current;if(e===null||t===void 0||l.loadingEarlier)return;te.current=void 0;let n=!1;for(let[r,i]of T$(e)){let a=t.get(r);if(a===void 0)n=!0;else if(n){e.scrollTop+=i-a;return}}},[u,l.loadingEarlier]);let{canLoadEarlier:le,loadingEarlier:ue}=l,de=b.length;(0,z.useEffect)(()=>{let e=oe.current;if(!(e===void 0||ue)){if(de>e||!le||l.failure!==void 0){oe.current=void 0;return}te.current=T$(I.current),ne(!0)}},[de,le,ue,ne,l.failure]),(0,z.useEffect)(()=>{s!==void 0&&j===void 0&&le&&!ue&&l.failure===void 0&&ne()},[s,j,le,ue,ne,l.failure]);let fe=j?.rowKind===`span`?j.span.id:void 0;(0,z.useEffect)(()=>{fe!==void 0&&ie(fe)},[fe,ie]),(0,z.useEffect)(()=>{if(w===void 0)return;let e=setTimeout(()=>ae(w[0],w[1],r.id),250);return()=>clearTimeout(e)},[w,ae,r.id]);let{scrollTo:pe}=x;return(0,z.useEffect)(()=>{s!==void 0&&(M.current=Date.now()+500,pe(s))},[s,pe]),(0,B.jsxs)(`div`,{className:`node-execution`,"data-expanded":S,children:[(0,B.jsxs)(`section`,{"aria-label":`Node timeline`,className:`node-timeline-sticky`,"data-testid":`node-timeline`,ref:ee,children:[(0,B.jsx)(CQ,{container:ee,range:w??k,stretches:l.unheld}),(0,B.jsx)(wt,{...uQ,axis:{origin:O[0]},cursor:A,expanded:S,getFailureExcerpt:e=>e.payload.rowKind===`span`?e.payload.span.detail?.output_tail:void 0,items:S?d.items:E,lanes:d.lanes,markers:D,onExpandedChange:C,onRangeChange:e=>T(e[0]<=k[0]&&e[1]>=k[1]?void 0:fQ(e)),onSelect:e=>N(e.id),range:w??k,selectedId:s})]}),(0,B.jsxs)(`section`,{"aria-label":`Node transcript`,className:`node-transcript`,onKeyDown:e=>{C$.has(e.key)&&w$(e.currentTarget)&&ce()},onScroll:e=>{w$(e.currentTarget)&&Date.now()>M.current&&ce()},onWheel:e=>{e.deltaY<0&&w$(e.currentTarget)&&ce()},ref:R,children:[l.readToStart&&l.failure===void 0&&(0,B.jsx)(`p`,{className:`history-start`,role:`status`,children:_$}),(l.canLoadEarlier||l.failure!==void 0)&&(0,B.jsx)(xQ,{...l.failure===void 0?{}:{failure:l.failure},loading:l.loadingEarlier,onLoad:se}),m(v).map(e=>{let t=e.entries.map(e=>e.entryKind===`row`?(0,B.jsx)(O$,{onOpen:F,register:x.register,row:e.row,selected:e.row.id===s},e.row.id):(0,B.jsx)(E$,{entry:e,onToggle:()=>h(t=>{let n=new Set(t);return n.has(e.group.id)?n.delete(e.group.id):n.add(e.group.id),n})},`collapse-${e.group.id}`));return e.dispatch===void 0?(0,B.jsx)(z.Fragment,{children:t},e.id):(0,B.jsxs)(`section`,{"aria-label":e.dispatch.label,className:`transcript-dispatch`,children:[(0,B.jsx)(`h3`,{children:e.dispatch.label}),t]},e.id)})]}),j!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(ui,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>i(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(ft,{})}),(0,B.jsx)(BQ,{client:e,node:r,row:j,runId:o})]})]})}function x$(e){let t=e.map(({start:e})=>e),n=e.map(e=>e.end??e.start);if(t.length===0)return[0,1];let r=Math.min(...t),i=Math.max(...n);return[r,i>r?i:r+1]}var S$=120,C$=new Set([`ArrowUp`,`PageUp`,`Home`]);function w$(e){return e.scrollTop<S$}function T$(e){let t=new Map;for(let n of e?.querySelectorAll(`article.transcript-item[data-row-id]`)??[])t.set(n.dataset.rowId??``,n.getBoundingClientRect().top);return t}function E$({entry:e,onToggle:t}){let n=A(e.hidden,e.group.kind);return(0,B.jsx)(`p`,{className:`transcript-collapsed`,children:(0,B.jsxs)(`button`,{"aria-expanded":e.expanded,onClick:t,type:`button`,children:[(0,B.jsx)(`span`,{"aria-hidden":`true`,children:`…`}),e.expanded?`Collapse ${n}`:`Show ${n}`]})})}function D$(e,t){let[n,r]=[e.row,t.row];return e.selected===t.selected&&e.register===t.register&&e.onOpen===t.onOpen&&n.id===r.id&&n.rowKind===r.rowKind&&n.displayLabel===r.displayLabel&&n.displayKind===r.displayKind&&n.startedAt===r.startedAt&&n.durationMs===r.durationMs&&n.status===r.status&&n.sessionName===r.sessionName&&n.dispatch?.label===r.dispatch?.label&&(n.rowKind===`event`&&r.rowKind===`event`?n.category===r.category&&n.event.seq===r.event.seq:n.rowKind!==`event`&&r.rowKind!==`event`)}var O$=(0,z.memo)(function({row:e,selected:t,register:n,onOpen:r}){let{id:i}=e,a=(0,z.useCallback)(e=>n(i,e),[n,i]);return(0,B.jsx)(`article`,{"aria-label":e.displayLabel,className:`transcript-item`,"data-dispatch-group":e.dispatch?.label,"data-journal-seq":e.rowKind===`event`?e.event.seq:void 0,"data-row-id":e.id,"data-selected":t,ref:a,children:(0,B.jsxs)(`button`,{"aria-label":`Open ${e.displayLabel}`,onClick:()=>r(e.id),type:`button`,children:[(0,B.jsxs)(`span`,{className:`eyebrow`,children:[e.rowKind===`event`&&(0,B.jsx)(C,{category:e.category}),e.displayKind]}),(0,B.jsx)(`strong`,{children:e.displayLabel}),(0,B.jsxs)(`span`,{className:`transcript-facts`,children:[(0,B.jsx)(l,{at:e.startedAt}),e.durationMs!==null&&` · ${_(e.durationMs)}`,` · ${e.status??`recorded`}`,e.sessionName!==void 0&&` · ${e.sessionName}`]})]})})},D$);function k$(e){if(e.task!==void 0)return e.task;let t=e.steps??[];return t.length===0?`No task prose recorded.`:t.map(e=>`## ${e.id}\n\n${e.task}`).join(`
104
+
105
+ `)}function A$(e){let t=k$(e),n=/(?:^|\n)##[ \t]*acceptance[ \t]+criteria[ \t]*\r?\n([\s\S]*?)(?=\r?\n##[ \t]|$)/i.exec(t)?.[1]?.trim();return n===void 0||n.length===0?`No acceptance criteria recorded in this node's task.`:n}function j$({node:e}){let t=e.detail?.publication;if(t===void 0)return typeof e.result?.pr==`string`&&e.result.pr?(0,B.jsxs)(`a`,{className:`node-view-pr`,href:e.result.pr,rel:`noreferrer`,target:`_blank`,children:[cQ(e.result.pr),` `,(0,B.jsx)(Ue,{size:12})]}):(0,B.jsx)(B.Fragment,{children:`Not recorded`});let n=(t.merged?[[t.pr_url,cQ(t.pr_url)],[t.commit_url,`Commit ${t.commit?.slice(0,8)??``}`]]:[[t.pr_url,cQ(t.pr_url)],[t.branch_url,t.branch??`Branch`]]).filter(([e])=>e);return n.length===0?(0,B.jsx)(B.Fragment,{children:`Not recorded`}):(0,B.jsx)(B.Fragment,{children:n.map(([e,t],n)=>(0,B.jsxs)(`span`,{children:[n>0&&` · `,(0,B.jsxs)(`a`,{className:`node-view-pr`,href:e,rel:`noreferrer`,target:`_blank`,children:[t,` `,(0,B.jsx)(Ue,{size:12})]})]},e))})}function M$({node:e}){let t=se(e);if(t.length===0)return null;let n=e.result?.detail?.trim()||void 0;return(0,B.jsxs)(`section`,{"aria-label":`Awaited releases`,className:`node-awaiting m-5 rounded-lg border border-warning bg-warning-surface px-4 py-3 text-warning`,children:[(0,B.jsxs)(`h2`,{className:`flex items-center gap-2 text-sm font-semibold`,children:[(0,B.jsx)($e,{size:16}),e.status===`complete-but-held`?`Complete, and held unlanded until its releases arrive`:`Complete, and held as a draft until its releases arrive`]}),(0,B.jsxs)(`dl`,{className:`facts facts-stacked`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:t.length===1?`Awaits`:`Awaits ${t.length}`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`ul`,{className:`awaited-releases`,children:t.map(e=>(0,B.jsxs)(`li`,{children:[`the `,(0,B.jsx)(`strong`,{children:e.target}),` release of`,` `,(0,B.jsx)(`code`,{children:e.producer})]},`${e.producer} ${e.target}`))})})]}),n!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Detail`}),(0,B.jsx)(`dd`,{children:n})]})]})]})}function N$({node:e}){if(e.kind!==`command`)return null;let t=e.task?.command,n=e.task?.timeout_seconds,r=e.result?.outcome,i=e.result?.log;return(0,B.jsxs)(`section`,{"aria-label":`Command`,className:`node-command m-5`,children:[(0,B.jsxs)(`dl`,{className:`facts`,children:[t!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Command`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`code`,{children:t.join(` `)})})]}),n!==void 0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Timeout`}),(0,B.jsxs)(`dd`,{children:[n,` seconds`]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Outcome`}),(0,B.jsx)(`dd`,{children:r??e.status})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Log`}),(0,B.jsx)(`dd`,{children:i===void 0?`The command has not started.`:i.path})]})]}),i?.content===void 0?i!==void 0&&(0,B.jsx)(`p`,{className:`node-command-log-missing`,children:`The log is not readable from this run.`}):(0,B.jsxs)(`figure`,{className:`node-command-log-figure`,children:[(0,B.jsx)(`figcaption`,{children:`Command log`}),(0,B.jsx)(`pre`,{className:`node-command-log`,children:i.truncated===!0?`…${i.content}`:i.content})]})]})}function P$({node:e,nodes:t}){if(!le(e.status))return null;let n=e.status===`blocked`||e.status===`skipped`,r=de(e),i=e.result?.error||void 0,a=e.result?.exit_code;return(0,B.jsxs)(zr,{className:x(`m-5 w-auto`,n&&`border-warning bg-warning-surface text-warning`),variant:n?`default`:`destructive`,children:[n?(0,B.jsx)($e,{}):(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:n?`This node is ${e.status}`:`This node ${e.status===`cancelled`?`was cancelled`:e.status===`not-completed`?`did not complete`:`failed`}${e.failure?`: ${e.failure.class}`:``}`}),(0,B.jsx)(Vr,{children:(0,B.jsxs)(`dl`,{className:`facts`,children:[n&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e.status===`skipped`?`Unmet`:`Blocked by`}),(0,B.jsx)(`dd`,{children:e.blockers.length>0?e.blockers.map(e=>{let n=t.find(t=>t.id===e)?.status;return n===void 0?e:`${e} (${n})`}).join(`, `):`Nothing recorded; the run has not written what holds it.`})]}),e.status===`skipped`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Attempts`}),(0,B.jsx)(`dd`,{children:`Never attempted`})]}),!n&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Detail`}),(0,B.jsx)(`dd`,{children:r??`No reason was recorded for this outcome.`})]}),i!==void 0&&i!==r&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Error`}),(0,B.jsx)(`dd`,{children:i})]}),typeof a==`number`&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Exit code`}),(0,B.jsx)(`dd`,{children:a})]})]})})]})}function F$(e){return e==null||e===``?`Not recorded`:typeof e==`string`?e:JSON.stringify(e,null,2)}function I$({client:t,detail:n,nodes:r,timeline:i,timelineError:a,filter:o,onRetry:s,journalSeq:c,onSelectNode:l,selectedItemId:u,onSelectItem:d,state:f,status:p}){let m=n.run.run_id,h=g$({client:t,runId:m,scope:`run`,...o===void 0?{}:{filter:o},...i===void 0?{}:{timeline:i}}),g=h.timeline,_=xe(n.progress),v=(0,z.useMemo)(()=>we(g,r),[g,r]),y=(g?.spans??[]).filter(e=>e.node_id===void 0),x=y.find(e=>e.id===u),S=y.flatMap(e=>e.events).find(e=>(e.record_id??e.id)===u)??y.flatMap(e=>e.events).find(e=>e.id===u),C=x===void 0?S===void 0?void 0:b(S):ne(x),{loadSpan:w,loadRow:T}=h;(0,z.useEffect)(()=>{u!==void 0&&C===void 0&&g!==void 0&&T(void 0)},[u,C,g,T]);let E=x?.id;return(0,z.useEffect)(()=>{E!==void 0&&w(E)},[E,w]),(0,z.useEffect)(()=>{let e=e=>{e.key===`Escape`&&u!==void 0&&d()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,u]),(0,B.jsxs)(`div`,{className:`overall-view`,"data-journal-seq":c,children:[(0,B.jsx)(Iu,{className:`h-full`,children:(0,B.jsxs)(`div`,{className:`p-[34px] max-sm:p-3`,children:[(0,B.jsxs)(`section`,{"aria-label":`Whole DAG`,className:`overall-hero`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Whole DAG`}),(0,B.jsx)(`h2`,{children:m}),n.graph?.plan.goal?.text&&(0,B.jsx)(`p`,{className:`run-goal`,children:n.graph.plan.goal.text}),(0,B.jsxs)(`p`,{className:`overall-state`,children:[f!==void 0&&(0,B.jsx)(ZM,{large:!0,state:f}),(0,B.jsx)(`span`,{children:n.run.last_event?`last event ${n.run.last_event}`:`no events recorded yet`})]})]}),(0,B.jsxs)(`section`,{"aria-label":`Run metrics`,className:`metric-grid`,children:[(0,B.jsx)(B$,{icon:(0,B.jsx)(Ge,{}),label:`Nodes`,value:ee(r)}),(0,B.jsx)(B$,{icon:(0,B.jsx)(Ve,{}),label:`Wall time`,value:n.run.timing.wall_seconds===null?`not measured`:e(n.run.timing.wall_seconds)}),(0,B.jsx)(B$,{icon:(0,B.jsx)(He,{}),label:`Turns`,value:typeof n.run.turns==`number`?String(n.run.turns):R}),(0,B.jsx)(z$,{detail:n,runLoaded:_,status:p})]}),(0,B.jsx)(di,{className:`gap-0 py-[15px]`,children:(0,B.jsxs)(fi,{className:`px-[15px]`,children:[(0,B.jsxs)(`div`,{className:`section-heading`,children:[(0,B.jsx)(Ee,{size:16}),(0,B.jsx)(`h3`,{children:`Graph timeline`})]}),a===void 0?g===void 0?(0,B.jsx)(`p`,{"aria-live":`polite`,className:`m-0 text-[11px] text-muted-foreground`,children:`Loading the run's timeline…`}):g.spans.length===0?(0,B.jsx)(`p`,{className:`m-0 text-[11px] text-muted-foreground`,children:`This run has recorded no timeline yet.`}):(0,B.jsx)(L$,{failureShown:C===void 0,graph:v,history:h,runRecordsToLoad:y.some(e=>e.events_total===void 0||e.events_total>e.events.length),onOpenNode:l,onOpenItem:d,selectedItemId:u}):(0,B.jsxs)(zr,{className:`live-issue`,variant:`destructive`,children:[(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:`Timeline unavailable`}),(0,B.jsxs)(Vr,{children:[a.message,` `,s!==void 0&&(0,B.jsx)(ui,{onClick:s,size:`sm`,variant:`outline`,children:`Try again`})]})]})]})})]})}),C!==void 0&&(0,B.jsxs)(`aside`,{"aria-label":`Item detail panel`,className:`detail-drawer`,children:[(0,B.jsx)(ui,{"aria-label":`Close detail`,className:`drawer-close`,onClick:()=>d(),size:`icon`,variant:`ghost`,children:(0,B.jsx)(ft,{})}),(0,B.jsx)(BQ,{client:t,row:C,runId:m}),h.failure!==void 0&&(0,B.jsx)(bQ,{failure:h.failure})]})]})}function L$({failureShown:e,graph:t,history:n,runRecordsToLoad:r,onOpenNode:i,onOpenItem:a,selectedItemId:o}){let[s,c]=(0,z.useState)(),[u,d]=(0,z.useState)(!1),[f,p]=(0,z.useState)(new Set),m=s??t.range,[h,g]=(0,z.useState)(!1),{loadRow:_,loadStretch:v}=n;(0,z.useEffect)(()=>{if(s===void 0)return;let e=setTimeout(()=>v(s[0],s[1],void 0),250);return()=>clearTimeout(e)},[s,v]);let y=e=>{e.kind===`record`&&e.nodeId===void 0||e.nodeId===void 0?a(e.id):i(e.nodeId)},b=t.line.lanes.filter(({id:e})=>t.line.items.some(t=>t.laneId===e));return(0,B.jsxs)(`div`,{className:`graph-timeline`,"data-rows-open":u,children:[(0,B.jsx)(wt,{...uQ,axis:{origin:t.range[0]},expanded:!1,items:t.line.items,label:`Graph timeline`,lanes:b,markers:t.line.markers,onExpandedChange:d,onRangeChange:e=>c(fQ(e)),onSelect:e=>y(e.payload),range:m,selectedId:o}),t.line.markers.some(e=>e.at>t.range[1])&&(0,B.jsxs)(`section`,{"aria-label":`Records after execution`,className:`p-3 border-t`,children:[(0,B.jsx)(`h3`,{className:`eyebrow`,children:`After execution ended`}),t.line.markers.filter(e=>e.at>t.range[1]).map(e=>(0,B.jsxs)(ui,{onClick:()=>y(e.payload),variant:`outline`,size:`sm`,children:[e.payload.label,` ·`,` `,(0,B.jsx)(l,{at:e.payload.startedAt})]},e.id))]}),e&&n.failure!==void 0&&(0,B.jsx)(bQ,{failure:n.failure}),r&&!h&&(0,B.jsx)(`button`,{className:`load-earlier`,onClick:()=>{g(!0),_(void 0)},type:`button`,children:`Load the run's own records`}),u&&(0,B.jsx)(`ol`,{className:`graph-rows`,children:t.rows.map(e=>(0,B.jsx)(R$,{onOpen:y,onOpenNode:i,onExpandedChange:t=>{t&&_(e.nodeId),p(n=>{let r=new Set(n);return t?r.add(e.id):r.delete(e.id),r})},expanded:f.has(e.id),origin:t.range[0],range:m,onRangeChange:e=>c(fQ(e)),row:e,selectedItemId:o},e.id))})]})}function R$({row:e,range:t,origin:n,expanded:r,onExpandedChange:i,onRangeChange:a,onOpen:o,onOpenNode:s,selectedItemId:c}){let l=e.nodeId;return(0,B.jsxs)(`li`,{className:`graph-row`,"data-row-kind":e.kind,children:[(0,B.jsxs)(`header`,{className:`graph-row-head`,children:[l===void 0?(0,B.jsx)(`span`,{className:`graph-row-name`,children:e.label}):(0,B.jsx)(`button`,{className:`graph-row-name`,onClick:()=>s(l),type:`button`,children:e.label}),(0,B.jsxs)(`span`,{className:`graph-row-facts`,children:[_(e.workedMs),` recorded · `,_(e.idleMs),` `,`idle`]})]}),(0,B.jsx)(wt,{...uQ,axis:{origin:n},expanded:r,items:r?e.items:e.line,label:`${e.label} timeline`,lanes:e.lanes,markers:e.markers,onExpandedChange:i,onRangeChange:a,onSelect:e=>o(e.payload),range:t,selectedId:c})]})}function z$({detail:t,status:n,runLoaded:r}){let i=n.value?.unread_surfaces,a=t.run.last_progress_at;return(0,B.jsxs)(di,{"aria-label":`Run details`,className:`metric run-details gap-2 p-4`,role:`group`,children:[(0,B.jsx)(`p`,{children:`Run details`}),(0,B.jsxs)(`dl`,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Launching session`}),(0,B.jsx)(`dd`,{children:r?he(t.launch):R})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Unread surfaces`}),(0,B.jsxs)(`dd`,{children:[i===void 0?n.error===void 0?R:`Unavailable`:i.oldest_seconds===null?String(i.count):`${i.count} · oldest ${e(i.oldest_seconds)}`,n.error!==void 0&&(0,B.jsxs)(`span`,{className:`run-details-error`,role:`alert`,children:[` `,`Status unavailable: `,n.error.message]})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`Last progress`}),(0,B.jsx)(`dd`,{children:(0,B.jsx)(`output`,{"aria-label":`Last progress`,children:r?a===void 0||a<=0?`—`:(0,B.jsx)(l,{at:new Date(a*1e3).toISOString(),relative:!0}):R})})]})]})]})}function B$({icon:e,label:t,value:n}){return(0,B.jsxs)(di,{"aria-label":t,className:`metric flex-row items-center gap-3 p-4`,role:`group`,children:[e,(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{children:t}),(0,B.jsx)(`strong`,{children:n})]})]})}var V$=6,H$=8,U$=`[aria-describedby^="timeline-detail-"]`,W$=e=>{if(!(e instanceof Element))return;let t=o(e);if(t!==void 0)return t;let n=e.closest(U$);if(!(n instanceof HTMLElement))return;let r=document.getElementById(n.getAttribute(`aria-describedby`)??``)?.textContent?.trim();return r?{element:n,detail:r}:void 0},G$=(e,t)=>t!==void 0&&e?.element===t.element&&e.detail===t.detail?e:t;function K$(){let e=(0,z.useRef)(null),[t,n]=(0,z.useState)(),[r,i]=(0,z.useState)(),a=t??r,o=(0,z.useCallback)(()=>{n(void 0),i(void 0)},[]);(0,z.useEffect)(()=>{let e=e=>n(t=>G$(t,W$(e.target))),t=e=>i(t=>G$(t,W$(e.target))),r=e=>i(t=>G$(t,W$(e.relatedTarget))),a=()=>n(void 0);return document.addEventListener(`pointerover`,e),document.addEventListener(`pointerleave`,a),document.addEventListener(`focusin`,t),document.addEventListener(`focusout`,r),()=>{document.removeEventListener(`pointerover`,e),document.removeEventListener(`pointerleave`,a),document.removeEventListener(`focusin`,t),document.removeEventListener(`focusout`,r)}},[]);let s=(0,z.useCallback)(()=>{let t=e.current;if(t===null||a===void 0)return;if(!a.element.isConnected)return o();let n=a.element.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.innerWidth-r.width-H$,s=Math.min(Math.max(n.left,H$),Math.max(H$,i)),c=n.bottom+V$,l=n.top-r.height-V$,u=Math.max(H$,window.innerHeight-r.height-H$),d=c+r.height<=window.innerHeight-H$?c:l,f=Math.min(Math.max(d,H$),u);t.style.left=`${Math.round(s)}px`,t.style.top=`${Math.round(f)}px`,t.style.visibility=`visible`},[a,o]);return(0,z.useLayoutEffect)(s,[s]),(0,z.useEffect)(()=>{if(a!==void 0)return window.addEventListener(`scroll`,s,!0),window.addEventListener(`resize`,s),()=>{window.removeEventListener(`scroll`,s,!0),window.removeEventListener(`resize`,s)}},[a,s]),a===void 0?null:(0,fn.createPortal)((0,B.jsx)(`div`,{"aria-hidden":`true`,className:`timeline-popover`,"data-testid":`timeline-popover`,ref:e,style:{visibility:`hidden`},children:a.detail},a.detail),document.body)}var q$=[{setting:`live`,label:`Live`},{setting:10,label:`Every 10 seconds`},{setting:30,label:`Every 30 seconds`},{setting:60,label:`Every minute`},{setting:300,label:`Every 5 minutes`},{setting:`off`,label:`Off`}],J$=`live`,Y$={navigation:`dag-ui.updates.navigation`,main:`dag-ui.updates.main`};function X$(e){return q$.find(({setting:t})=>String(t)===e)?.setting}function Z$(e){try{return window.localStorage.getItem(e)}catch{return null}}function Q$(e,t){try{window.localStorage.setItem(e,String(t))}catch{}}function $$(e,t){let[n,r]=(0,z.useState)(()=>X$(Z$(e))??t);return[n,(0,z.useCallback)(t=>{r(t),Q$(e,t)},[e])]}function e1(){let[e,t]=$$(Y$.navigation,30),[n,r]=$$(Y$.main,J$);return{navigation:e,setNavigation:t,main:n,setMain:r}}function t1({name:e,caption:t,setting:n,waiting:r,onChange:i}){return(0,B.jsxs)(`div`,{className:`update-setting`,children:[(0,B.jsxs)(`label`,{children:[(0,B.jsx)(`span`,{children:t}),(0,B.jsx)(`select`,{"aria-label":e,onChange:e=>{let t=X$(e.target.value);t!==void 0&&i(t)},value:String(n),children:q$.map(({setting:e,label:t})=>(0,B.jsx)(`option`,{value:String(e),children:t},e))})]}),r>0&&(0,B.jsxs)(`output`,{"aria-label":`${e} waiting`,className:`update-waiting`,children:[r,` waiting`]})]})}var n1=new UM(window.location.origin,{fetch:window.fetch.bind(window)});function r1(e){let t=(0,z.useRef)({value:e,count:0});return t.current.value!==e&&(t.current={value:e,count:t.current.count+1}),t.current.count}var i1=()=>Promise.resolve();function a1({client:e=n1,first:t,onDrawn:n}){let r=_Z(),i=lZ(),a=r.host||i.active,o=TX(i.active),s=zk.detailed,c=e1(),u=kZ(),d=jZ(e,{runId:r.runId,view:me(r.view,r.nodeId),nodeId:r.nodeId,filter:s,selectFirst:!a,host:a,humanItems:o.view,navigationUpdates:c.navigation,mainUpdates:c.main,...t===void 0?{}:{first:t}}),f=d.rows,p=d.runId,m=d.activity.at(-1),h=d.detail,g=(0,z.useMemo)(()=>h?N(h):[],[h]),_=iN(e,p),v=_.status.value?.liveness,y=(0,z.useMemo)(()=>h===void 0?void 0:oe({state:h.run.state,...v===void 0?{}:{liveness:v},statuses:h.graph?.node_status??{}}),[h,v]),b=$Z(e),[x,S]=(0,z.useState)(0),C=b.host.state.phase===`sending`,w=r1(f),{list:T,error:E}=GG(e,r.host||C,x+(C?w:0)),D=h===void 0?void 0:O(h),k=xe(h?.progress),A=h?.progress?.failed??d.timeline?.progress?.failed,j=!a&&(h?.progress?.complete===!1||d.timeline?.progress?.complete===!1),M=!a&&h===void 0&&d.error!==void 0,P=(0,z.useRef)(!1);(0,z.useLayoutEffect)(()=>{P.current||(h!==void 0||d.error!==void 0)&&(P.current=!0,n?.())},[h,d.error,n]);let F=I(h,g,r.nodeId);(0,z.useEffect)(()=>{if(a||!f)return;let e=xZ(f),t=e.find(e=>e.rows.some(e=>e.id===r.runId)),n=t?.rows.find(e=>e.id===r.runId),i=(t?.rows??e.flatMap(e=>e.rows)).filter(e=>!e.kind||!r.hiddenKinds.includes(e.kind));(!r.runId||n?.kind&&r.hiddenKinds.includes(n.kind))&&i[0]&&r.selectRun(i[0].id)},[f,r,a]),(0,z.useEffect)(()=>{if(p&&r.runId&&r.runId!==p){let e=new URLSearchParams(window.location.search);e.set(`run`,p),e.delete(`node`),e.delete(`event`),e.set(`view`,r.view),window.history.replaceState(null,``,`${window.location.pathname}?${e}`),window.dispatchEvent(new PopStateEvent(`popstate`))}},[r.runId,p,r.view]);let L=i.active?`Action items`:r.host?`Host`:p??`No DAG selected`,R=e=>(0,B.jsxs)(`section`,{"aria-label":p&&!a?`Run header`:`Workspace header`,className:`topbar${p&&!a?` run-topbar`:``}`,children:[(0,B.jsx)(`button`,{"aria-controls":`run-navigation`,"aria-expanded":u.open,"aria-label":`Open navigation`,className:`nav-menu`,onClick:u.toggle,ref:u.menuButton,type:`button`,children:(0,B.jsx)(Ye,{"aria-hidden":`true`,size:18})}),(0,B.jsx)(`div`,{className:`topbar-title`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Execution telemetry`}),(0,B.jsx)(`h2`,{title:L,children:L})]})}),(0,B.jsxs)(`div`,{className:`topbar-actions`,children:[!a&&p!==void 0&&(0,B.jsx)(eN,{control:_,runId:p,ended:h!==void 0&&(h.run.state===`settled`||h.run.state.startsWith(`ended-`)),...y===void 0?{}:{state:y}}),(0,B.jsxs)(`span`,{className:`connection`,children:[(0,B.jsx)(it,{size:15}),d.lastUpdated===void 0?`Waiting for first update`:(0,B.jsxs)(B.Fragment,{children:[`Last updated `,(0,B.jsx)(l,{at:d.lastUpdated,relative:!0})]})]}),!a&&m!==void 0&&(0,B.jsxs)(`button`,{className:`last-activity connection`,type:`button`,title:`${m.node}: ${o1(m)}`,onClick:()=>{r.selectNode(m.node),r.selectItem(m.event_id)},children:[m.node,`: `,o1(m)]})]}),e,(0,B.jsxs)(`div`,{className:`main-updates`,children:[(0,B.jsx)(t1,{caption:`Updates`,name:`Main area updates`,onChange:c.setMain,setting:c.main,waiting:d.mainWaiting}),(0,B.jsxs)(ui,{onClick:()=>{S(e=>e+1),d.refresh(),a||_.reread()},size:`sm`,type:`button`,variant:`outline`,children:[(0,B.jsx)(nt,{size:14}),` Refresh`]})]})]}),ee=(0,B.jsxs)(B.Fragment,{children:[d.error&&!M&&(0,B.jsxs)(zr,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:`Live telemetry issue`}),(0,B.jsxs)(Vr,{children:[d.error.message,` `,(0,B.jsx)(ui,{onClick:d.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),A!==void 0&&(0,B.jsxs)(zr,{className:`live-issue rounded-none border-x-0 border-t-0`,variant:`destructive`,children:[(0,B.jsx)(fe,{}),(0,B.jsx)(Br,{children:`The rest of this run's history did not load`}),(0,B.jsxs)(Vr,{children:[A,` `,(0,B.jsx)(ui,{onClick:d.refresh,size:`sm`,type:`button`,variant:`outline`,children:`Try again`})]})]}),d.notice&&(0,B.jsx)(`p`,{className:`live-notice`,role:`status`,children:d.notice}),(0,B.jsx)(rQ,{label:`Shutdown of the entire host`,onDismiss:b.host.dismiss,rows:T?.runs??[],state:b.host.state})]});return(0,B.jsxs)(Bf,{children:[(0,B.jsx)(K$,{}),(0,B.jsxs)(`div`,{className:`app-shell`,children:[(0,B.jsx)(OZ,{rows:d.navigationRows,failed:d.rows===void 0&&d.error!==void 0,selectedRunId:p,onSelect:e=>{r.selectRun(e),u.close()},onOpenProject:r.selectRun,onHost:()=>{r.selectHost(),u.close()},hostCurrent:r.host&&!i.active,onActionItems:()=>{i.open(),u.close()},actionItemsCurrent:i.active,hiddenKinds:r.hiddenKinds,onKindsChange:r.selectKinds,drawerOpen:u.open,drawerRef:u.drawer,updates:(0,B.jsx)(t1,{caption:`Navigation`,name:`Navigation updates`,onChange:c.setNavigation,setting:c.navigation,waiting:d.navigationWaiting})}),u.open&&(0,B.jsx)(`button`,{"aria-label":`Close navigation`,className:`nav-scrim`,onClick:u.close,type:`button`}),(0,B.jsx)(`main`,{className:`workspace`,inert:u.open,children:a?(0,B.jsxs)(B.Fragment,{children:[R(void 0),ee,i.active?(0,B.jsx)(MX,{client:e,live:d.humanItems,choice:o.choice,setChoice:o.setChoice,selectedId:o.selectedId,setSelectedId:o.setSelectedId}):(0,B.jsx)(WG,{client:e,listError:E,onRefresh:()=>S(e=>e+1),list:T,rows:d.hostRows,children:(0,B.jsx)(eQ,{list:T,loadMore:i1,loadingMore:!1,shutdowns:b})})]}):(0,B.jsxs)(Yd,{className:`min-h-0 flex-1 gap-0`,onValueChange:e=>e===`overall`?r.showOverall():r.selectNode(void 0),value:r.view,children:[R((0,B.jsx)(`div`,{className:`view-tabs`,children:(0,B.jsxs)(Zd,{"aria-label":`DAG views`,variant:`line`,children:[(0,B.jsxs)(Qd,{value:`graph`,children:[(0,B.jsx)(dt,{size:15}),` Graph`]}),(0,B.jsxs)(Qd,{value:`overall`,children:[(0,B.jsx)(rt,{size:15}),` Overall`]})]})})),ee,(0,B.jsx)($d,{className:`min-h-0`,value:r.view,children:M&&d.error?(0,B.jsx)(`div`,{className:`loading-state`,children:(0,B.jsxs)(`div`,{className:`read-failed`,role:`alert`,children:[(0,B.jsx)(`strong`,{children:`This run's history did not load`}),(0,B.jsx)(`p`,{children:d.error.message}),(0,B.jsx)(`button`,{onClick:d.refresh,type:`button`,children:`Try again`})]})}):!h&&(d.loading||p!==void 0)?(0,B.jsxs)(`div`,{"aria-live":`polite`,className:`loading-state`,children:[(0,B.jsx)(Xu,{className:`h-2 w-48`}),(0,B.jsx)(Xu,{className:`h-2 w-32`}),`Loading execution history…`]}):h&&p?r.view===`overall`?(0,B.jsx)(I$,{client:e,detail:h,filter:s,journalSeq:D?.last_seq,nodes:g,onRetry:d.refresh,state:y,status:_.status,timeline:d.timeline,timelineError:d.timelineError,onSelectNode:r.selectNode,onSelectItem:r.selectItem,selectedItemId:r.itemId},`${p}:${s??``}`):F?(0,B.jsx)(y$,{client:e,filter:s,runLoaded:k,onRetry:d.refresh,node:F,nodes:g,onBack:()=>r.selectNode(void 0),onSelectItem:r.selectItem,runId:p,selectedItemId:r.itemId,selectedTab:r.nodeTab,onSelectTab:r.selectNodeTab,timeline:d.timeline,timelineError:d.timelineError},`${p}:${F.id}:${s??``}`):(0,B.jsx)(zG,{journalSeq:D?.last_seq,nodes:g,rejectedEdits:D?.rejected_edits,selectedNodeId:r.nodeId,onSelectNode:r.selectNode}):(0,B.jsxs)(`div`,{className:`empty-state`,children:[(0,B.jsx)(dt,{size:34}),(0,B.jsx)(`h2`,{children:`No DAG runs found`}),(0,B.jsx)(`p`,{children:`Start an orchestrated run to see it appear here.`})]})})]})}),j&&A===void 0&&(0,B.jsx)(`p`,{className:`history-loading`,role:`status`,children:`The rest of this run's history is still loading`})]})]})}function o1(e){return e.description||e.kind}var s1=class extends z.Component{state={};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`DAG UI render failed`,e,t.componentStack)}render(){return this.state.error?(0,B.jsxs)(`main`,{className:`fatal-error`,role:`alert`,children:[(0,B.jsx)(`p`,{className:`eyebrow`,children:`Rendering error`}),(0,B.jsx)(`h1`,{children:`The DAG view could not be displayed.`}),(0,B.jsx)(`p`,{children:this.state.error.message}),(0,B.jsx)(ui,{onClick:()=>(this.props.onReload??(()=>window.location.reload()))(),type:`button`,variant:`secondary`,children:`Reload`})]}):this.props.children}};function c1(e,t,n){let r=n===void 0?e:document.createElement(`div`);r!==e&&(r.setAttribute(`data-app-behind-first-screen`,``),r.style.cssText=`position:fixed;inset:0;visibility:hidden;`,document.body.appendChild(r)),(0,rk.createRoot)(r).render((0,B.jsx)(z.StrictMode,{children:(0,B.jsx)(s1,{children:(0,B.jsx)(a1,{first:t,onDrawn:()=>{r!==e&&(n?.unmount(),e.replaceWith(r),r.id=`root`,r.removeAttribute(`data-app-behind-first-screen`),r.style.cssText=``)}})})}))}export{c1 as mountApp};