@nickduy/agent-studio 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nickduy/agent-studio",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Agent Studio: spec-driven E2E testing with Claude Code agents and Playwright",
5
5
  "type": "module",
6
6
  "bin": {
@@ -357,7 +357,7 @@ Any CRITICAL or REQUIRED finding, or any failed check → \`"status": "failed"\`
357
357
  - Is the verdict consistent with the Rule?
358
358
  - Did I check every checklist category?
359
359
  - Is every Must-fix item specific enough for the Coding agent to act on without asking?
360
- `,qc=[{id:"planner",label:"Planner",agent:{name:"Planner",description:"Asks the open questions, takes the answers and writes the solution",instructions:$b,model:"sonnet",permissions:Vy,review:"human"}},{id:"coding",label:"Coding",agent:{name:"Coding",description:"Implements the approved solution; never writes tests",instructions:_b,model:"opus",permissions:ku,review:"auto"}},{id:"unit-test",label:"Unit Test",agent:{name:"Unit Test",description:"Tests the diff with 100% line and branch coverage and runs the suite",instructions:Ob,model:"sonnet",permissions:ku,review:"auto"}},{id:"code-review",label:"Code Review",agent:{name:"Code Review",description:"Solution-architect review: CRITICAL/REQUIRED go back to Coding, OPTIONAL noted for later",instructions:Fb,model:"sonnet",permissions:ku,review:"auto"}}];function Ub(e){const t=qc.find(r=>r.id===e);if(!t)throw new Error(`Unknown agent template: ${e}`);const n=t.agent.permissions;return{...t.agent,skills:[],claudeMdSections:[],permissions:{...n,deniedCommands:[...n.deniedCommands],protectedPaths:[...n.protectedPaths]}}}function yt({status:e,children:t}){return e?s.jsx("span",{className:`badge ${e}`,children:t??e}):s.jsx("span",{className:"badge",children:"—"})}function An({status:e}){return s.jsx(yt,{status:e,children:e==="passed"?"done":e==="waiting"?"waiting for review":void 0})}function ni({status:e,children:t,title:n}){return e?s.jsxs("span",{className:`pill ${e}`,title:n,children:[s.jsx("i",{}),t??e]}):s.jsx("span",{className:"pill",children:"—"})}function Le({error:e}){return e?s.jsx("div",{className:"error-box",role:"alert",children:e}):null}function kn({value:e,onChange:t,items:n}){return s.jsx("div",{className:"tabs",role:"tablist",children:n.map(r=>s.jsx("button",{role:"tab","aria-selected":e===r.id,className:`tab ${e===r.id?"active":""}`,onClick:()=>t(r.id),children:r.label},r.id))})}const Qy={explorer:Ay,generator:kh,validator:bh,healer:Iy,runner:db,specwriter:hl,contextwriter:Sh,custom:hl};function Ft({agent:e,size:t=36}){const n=Qy[e];return s.jsx("span",{className:`agent-icon ${e}`,style:{width:t,height:t,borderRadius:t/3},title:Ne[e].label,children:s.jsx(n,{size:Math.round(t*.5)})})}function Bb({agents:e}){return s.jsx("span",{className:"row",style:{gap:0},children:e.map(t=>{const n=Qy[t.agent];return s.jsx("span",{className:`agent-chip agent-icon ${t.agent} ${t.status}`,title:`${Ne[t.agent].label}: ${t.status}`,children:s.jsx(n,{size:12})},t.id)})})}function Rt(e){if(!e)return"—";const t=new Date(e),n=(Date.now()-t.getTime())/1e3;return n<60?"just now":n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:t.toLocaleString("en-US",{hour12:!1})}function br(e,t){if(!e)return"—";const n=(t?Date.parse(t):Date.now())-Date.parse(e);if(n<1e3)return`${Math.max(n,0)} ms`;const r=Math.round(n/1e3);return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}const Sr={explore:"Explore",generate:"Generate",heal:"Heal",spec:"Write spec",testrun:"Test run",context:"Project context",custom:"Custom agent",pipeline:"Pipeline"};function qy(e){var t;return e.label??((t=Ne[e.agent])==null?void 0:t.label)??e.agent}function sn(e){return e==null?"—":e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(2)}M`}function Kt(e){return e==null?"—":e>0&&e<.01?"<$0.01":`$${e.toFixed(2)}`}function Hb({onClose:e,onNewSpec:t}){const n=ut(),{specs:r}=un(),i=$e(()=>Q.jobs()),[l,a]=j.useState(""),[o,u]=j.useState(0),c=m=>{e(),n(m)},h=j.useMemo(()=>{const m=[{group:"Actions",key:"new",label:"Create new spec",text:"new spec create",icon:s.jsx(qt,{size:16}),run:t},{group:"Actions",key:"runall",label:"Run all tests",text:"run all tests",icon:s.jsx(ft,{size:16}),run:()=>void Q.createJob({type:"testrun",repeatEach:1}).then(g=>c(`/runs/${g.id}`))},...r.map(g=>({group:"Specs",key:`s-${g.file}`,label:s.jsxs(s.Fragment,{children:[g.file," ",s.jsx("span",{className:"muted small",children:g.parsed.title})]}),text:`${g.file} ${g.parsed.title}`,icon:s.jsx(wr,{size:16}),run:()=>c(`/specs/${g.file}`)})),...r.flatMap(g=>g.parsed.tcs.map(w=>({group:"Test case",key:`t-${g.file}-${w.id}`,label:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:w.id})," ",w.title]}),text:`${w.id} ${w.title} ${g.file}`,icon:s.jsx(wr,{size:16}),run:()=>c(`/specs/${g.file}`)}))),...(i.data??[]).slice(0,20).map(g=>({group:"Jobs",key:`j-${g.id}`,label:s.jsxs(s.Fragment,{children:["#",g.id," ",Sr[g.type]," · ",g.target," ",s.jsx(An,{status:g.status})]}),text:`#${g.id} ${g.type} ${g.target} ${g.status}`,icon:s.jsx(ft,{size:16}),run:()=>c(`/runs/${g.id}`)}))],p=l.trim().toLowerCase();return p?m.filter(g=>g.text.toLowerCase().includes(p)):m},[l,r,i.data]);j.useEffect(()=>u(0),[l]);const d=m=>{var p;m.key==="ArrowDown"?(m.preventDefault(),u(g=>Math.min(g+1,h.length-1))):m.key==="ArrowUp"?(m.preventDefault(),u(g=>Math.max(g-1,0))):m.key==="Enter"&&((p=h[o])==null||p.run())};let f="";return s.jsx("div",{className:"overlay",onClick:e,children:s.jsxs("div",{className:"palette",onClick:m=>m.stopPropagation(),role:"dialog","aria-label":"Command palette",children:[s.jsx("input",{autoFocus:!0,placeholder:"Search specs, test cases, jobs, actions…",value:l,onChange:m=>a(m.target.value),onKeyDown:d}),s.jsxs("ul",{role:"listbox",children:[h.map((m,p)=>{const g=m.group!==f;return f=m.group,s.jsxs("div",{children:[g&&s.jsx("li",{className:"group",children:m.group}),s.jsxs("li",{role:"option","aria-selected":p===o,className:p===o?"active":"",onMouseEnter:()=>u(p),onClick:m.run,children:[m.icon,s.jsx("span",{children:m.label})]})]},m.key)}),h.length===0&&s.jsx("li",{className:"group",children:"No results"})]})]})})}const Gy=j.createContext(async()=>!1),In=()=>j.useContext(Gy);function Wb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(u=>{const c=r.current++;return new Promise(h=>n(d=>[...d,{...u,id:c,resolve:h}]))},[]),l=t[0],a=j.useCallback(u=>{n(c=>{var h;return(h=c[0])==null||h.resolve(u),c.slice(1)})},[]),o=j.useMemo(()=>i,[i]);return s.jsxs(Gy.Provider,{value:o,children:[e,l&&Pr.createPortal(s.jsx(Vb,{opts:l,onClose:a},l.id),document.body)]})}function Vb({opts:e,onClose:t}){const n=j.useRef(null),r=j.useRef(null),i=j.useRef(null);return j.useEffect(()=>{var a;(a=(e.danger?r:i).current)==null||a.focus();const l=o=>{var u,c;if(o.key==="Escape"&&(o.stopPropagation(),t(!1)),o.key==="Tab"){const h=[...((u=n.current)==null?void 0:u.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href]"))??[]],d=h.indexOf(document.activeElement);o.preventDefault(),(c=h[(d+(o.shiftKey?-1:1)+h.length)%h.length])==null||c.focus()}};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[e.danger,t]),s.jsx("div",{className:"overlay confirm-overlay",onClick:()=>t(!1),children:s.jsx("div",{ref:n,className:"modal confirm-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title","aria-describedby":"confirm-msg",onClick:l=>l.stopPropagation(),children:s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"confirm-head",children:[e.danger&&s.jsx("span",{className:"confirm-icon","aria-hidden":"true",children:s.jsx(Ar,{size:18})}),s.jsxs("div",{children:[s.jsx("h3",{id:"confirm-title",children:e.title}),e.message&&s.jsx("div",{id:"confirm-msg",className:"confirm-msg",children:e.message})]})]}),s.jsxs("div",{className:"confirm-actions",children:[s.jsx("button",{ref:r,type:"button",className:"btn ghost",onClick:()=>t(!1),children:e.cancelLabel??"Cancel"}),s.jsx("button",{ref:i,type:"button",className:`btn ${e.danger?"btn-danger-solid":""}`,onClick:()=>t(!0),children:e.confirmLabel??(e.danger?"Delete":"OK")})]})]})})})}function Rh(e,t){const n=In(),r=j.useRef(!1),i=j.useRef(t);i.current=t,j.useEffect(()=>{e.state!=="blocked"||r.current||(r.current=!0,n(i.current).then(l=>{r.current=!1,l?e.proceed():e.reset()}))},[e,n])}const Ky=j.createContext(e=>e),Qb=()=>j.useContext(Ky);function qb({children:e}){const[t,n]=j.useState(0),r=j.useCallback(i=>(n(l=>l+1),i.finally(()=>n(l=>l-1))),[]);return s.jsxs(Ky.Provider,{value:r,children:[e,t>0&&Pr.createPortal(s.jsx("div",{className:"loading-bar",role:"progressbar","aria-label":"Loading"}),document.body)]})}const Si=()=>{},Yy=j.createContext({show:Si,info:Si,success:Si,warning:Si,error:Si}),Ir=()=>j.useContext(Yy);function Gb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(o=>n(u=>u.filter(c=>c.id!==o)),[]),l=j.useCallback((o,u)=>{const c=(u==null?void 0:u.kind)??"info",h={id:r.current++,kind:c,message:o,duration:(u==null?void 0:u.duration)??(c==="error"?6e3:3500)};n(d=>[...d,h].slice(-4))},[]),a=j.useMemo(()=>({show:l,info:o=>l(o,{kind:"info"}),success:o=>l(o,{kind:"success"}),warning:o=>l(o,{kind:"warning"}),error:o=>l(o,{kind:"error"})}),[l]);return s.jsxs(Yy.Provider,{value:a,children:[e,Pr.createPortal(s.jsx("div",{className:"toasts",role:"region","aria-label":"Notifications",children:t.map(o=>s.jsx(Kb,{item:o,onClose:()=>i(o.id)},o.id))}),document.body)]})}function Kb({item:e,onClose:t}){const[n,r]=j.useState(!1);return j.useEffect(()=>{if(n)return;const i=setTimeout(t,e.duration);return()=>clearTimeout(i)},[n,e.duration,t]),s.jsxs("div",{className:`toast ${e.kind}`,role:e.kind==="error"?"alert":"status",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[s.jsx("span",{className:"toast-icon","aria-hidden":"true",children:e.kind==="success"?s.jsx(wh,{size:14}):e.kind==="error"?s.jsx(kr,{size:14}):e.kind==="warning"?"!":"i"}),s.jsx("span",{className:"toast-msg",children:e.message}),s.jsx("button",{className:"toast-close",onClick:t,"aria-label":"Dismiss notification",children:s.jsx(kr,{size:13})})]})}const Yb=15*60*1e3,Jb=2e3,Xb=5*60*1e3;async function Zb(){try{const e=await fetch("/api/update",{cache:"no-store"});return e.status===404?"other":e.ok?await e.json():null}catch{return null}}function eS(){const[e,t]=j.useState(null),[n,r]=j.useState(null),[i,l]=j.useState(null),a=j.useCallback(()=>{Q.updateStatus().then(t).catch(()=>{})},[]);if(j.useEffect(()=>{a();const u=setInterval(a,Yb);return window.addEventListener("focus",a),()=>{clearInterval(u),window.removeEventListener("focus",a)}},[a]),j.useEffect(()=>{if(!n)return;const u=Date.now();let c=!1;const h=setInterval(()=>{Zb().then(d=>{if(!d)return void(c=!0);if(d==="other"||d.current===n)return window.location.reload();(c||Date.now()-u>Xb)&&(r(null),t(d),d.error||l("The update did not finish. Run the command below in a terminal, then restart Agent Studio."))})},Jb);return()=>clearInterval(h)},[n]),!(e!=null&&e.required)&&!n)return null;const o=async()=>{l(null);try{const u=await Q.startUpdate();r(u.latest)}catch(u){l(u.message)}};return s.jsx("div",{className:"overlay update-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"update-title",children:s.jsx("div",{className:"modal",children:s.jsx("div",{className:"modal-body",children:n?s.jsxs(s.Fragment,{children:[s.jsxs("h3",{id:"update-title",children:["Updating to v",n," ..."]}),s.jsx("p",{className:"muted",children:"Installing and restarting Agent Studio. Progress is shown in the terminal where it runs; this page reloads by itself."})]}):s.jsxs(s.Fragment,{children:[s.jsx("h3",{id:"update-title",children:"Update required"}),s.jsxs("p",{children:["Agent Studio ",s.jsxs("b",{children:["v",e.latest]})," is available (you have v",e.current,"). Update to keep using the app."]}),(i||e.error)&&s.jsxs("div",{className:"error-box",role:"alert",children:[i||e.error,s.jsx("pre",{className:"update-cmd",children:e.command})]}),s.jsx("div",{className:"confirm-actions",children:s.jsxs("button",{className:"btn",onClick:()=>void o(),children:[s.jsx(Yn,{size:14})," Update and restart"]})})]})})})})}const Jy=j.createContext({refreshClaude:()=>{},openNewSpec:()=>{},openPalette:()=>{},theme:"light",toggleTheme:()=>{},crumbSlot:null,extraSlot:null}),hs=()=>j.useContext(Jy);function tS(){try{return localStorage.getItem("qa-studio.sidebar")==="collapsed"}catch{return!1}}const nS=.6,bu="Agent Studio (v0.1.8)";function rS(e,t){j.useLayoutEffect(()=>{const n=e.current,r=t.current;if(!n||!r)return;const i=()=>{r.style.zoom="";const o=getComputedStyle(n),u=n.clientHeight-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom),c=r.scrollHeight,h=c>u&&u>0?Math.max(nS,u/c):1;r.style.zoom=h<1?h.toFixed(3):""};i();const l=new ResizeObserver(i);l.observe(n);const a=new MutationObserver(i);return a.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),a.disconnect()}},[e,t])}function sS({collapsed:e,mobileOpen:t,onCloseMobile:n}){var y;const r=j.useRef(null),i=j.useRef(null);rS(r,i);const{specs:l,mapping:a}=un(),{openPalette:o}=hs(),u=Kn(),c=$e(()=>Q.jobs(),[u.pathname]),{reload:h}=c,d=(c.data??[]).some(x=>x.status==="queued"||x.status==="running"||x.status==="waiting");j.useEffect(()=>{if(!d)return;const x=setInterval(h,5e3);return()=>clearInterval(x)},[d,h]);const f=(c.data??[]).filter(x=>x.status==="running"||x.status==="queued").length,m=(c.data??[]).filter(x=>x.status==="waiting").length;j.useEffect(()=>(document.title=m?`● ${bu}`:bu,()=>{document.title=bu}),[m]);const p=a.filter(x=>x.status!=="orphan"&&x.testFile).length,g=a.filter(x=>x.status!=="orphan").length,w=(x,v,b,A,k,E)=>s.jsxs(G0,{to:x,end:k,className:({isActive:T})=>`side-link ${T&&!(E&&u.pathname.startsWith(E))?"active":""}`,title:e?b:void 0,children:[v,s.jsx("span",{className:"side-label",children:b}),A!==void 0&&s.jsx("span",{className:"count",children:A})]});return s.jsx("aside",{ref:r,id:"app-sidebar",className:`sidebar ${e?"collapsed":""} ${t?"mobile-open":""}`,"aria-label":"Main menu",children:s.jsxs("div",{ref:i,className:"side-inner",children:[s.jsxs("div",{className:"side-head",children:[s.jsx("span",{className:"logo",children:s.jsx(bh,{size:18})}),s.jsx("h2",{className:"side-label",children:"Agent Studio"}),s.jsx("button",{className:"side-close",onClick:n,"aria-label":"Close menu",children:s.jsx(kr,{size:18})})]}),s.jsxs("button",{className:"side-search",onClick:o,"aria-label":"Search (Ctrl+K)",children:[s.jsx(Ro,{size:16}),s.jsx("span",{className:"side-label",children:"Search"}),s.jsx("span",{className:"kbd side-label",children:"⌘K"})]}),s.jsx("div",{className:"side-group side-label",children:"Overview"}),s.jsxs("nav",{className:"side-nav","aria-label":"Overview",children:[w("/",s.jsx(ab,{size:17}),"Overview",void 0,!0),w("/chat",s.jsx(Ch,{size:17}),"Claude chat")]}),s.jsx("div",{className:"side-group side-label",children:"Specification"}),s.jsxs("nav",{className:"side-nav","aria-label":"Specification",children:[w("/specs",s.jsx(wr,{size:17}),"Specification",l.length,!1,"/specs/from-requirement"),w("/specs/from-requirement",s.jsx(hl,{size:17}),"Generator")]}),s.jsx("div",{className:"side-group side-label",children:"Testing"}),s.jsxs("nav",{className:"side-nav","aria-label":"Testing",children:[w("/mapping",s.jsx(jh,{size:17}),"Test cases",g?`${p}/${g}`:0),w("/test-runs",s.jsx(pb,{size:17}),"Test runs"),w("/runs",s.jsx(ft,{size:17}),"Recent runs",m?`${m} waiting`:f?`${f} running`:((y=c.data)==null?void 0:y.length)??0)]}),s.jsx("div",{className:"side-group side-label",children:"Settings"}),s.jsxs("nav",{className:"side-nav","aria-label":"Settings",children:[w("/agents",s.jsx($y,{size:17}),"Agents"),w("/usage",s.jsx(_y,{size:17}),"Claude usage"),w("/project",s.jsx(Sh,{size:17}),"Project"),w("/settings",s.jsx(hb,{size:17}),"Settings")]})]})})}function iS({setCrumbSlot:e,setExtraSlot:t,menuOpen:n,onMenu:r}){const{theme:i,toggleTheme:l,openPalette:a}=hs();return s.jsxs("header",{className:"topbar",children:[s.jsx("button",{className:"menu-btn",onClick:r,"aria-label":"Open menu","aria-expanded":n,"aria-controls":"app-sidebar",children:s.jsx(cb,{size:20})}),s.jsx("div",{className:"topbar-crumbs",ref:e}),s.jsx("div",{className:"topbar-spacer"}),s.jsx("div",{className:"topbar-extra",ref:t}),s.jsxs("button",{className:"top-search",onClick:a,"aria-label":"Search specs, TC-ID (Ctrl+K)",children:[s.jsx(Ro,{size:15}),s.jsx("span",{children:"Search specs, TC-ID…"})]}),s.jsx("button",{className:"theme-btn",onClick:l,title:"Toggle light/dark theme","aria-label":"Toggle light/dark theme",children:i==="dark"?s.jsx(zy,{size:17}):s.jsx(Dy,{size:17})})]})}const lS=/^[a-z0-9][a-z0-9_-]*$/;function aS({initial:e,onClose:t}){const n=ut(),{refresh:r}=un(),[i,l]=j.useState((e==null?void 0:e.name)??""),[a,o]=j.useState(null),u=async c=>{c.preventDefault();const h=i.trim().replace(/\.md$/,"");if(!lS.test(h))return o('Name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');try{await Q.createSpec(`${h}.md`,(e==null?void 0:e.content)??tb),r(),t(),n(`/specs/${h}.md`)}catch(d){o(d.message)}};return s.jsx("div",{className:"overlay",onClick:t,children:s.jsx("form",{className:"modal",onClick:c=>c.stopPropagation(),onSubmit:u,children:s.jsxs("div",{className:"modal-body",children:[s.jsx("h3",{style:{margin:0},children:e!=null&&e.content?"Import spec":"New spec"}),s.jsxs("div",{className:"row",children:[s.jsx("input",{className:"input grow",autoFocus:!0,placeholder:"spec-name",value:i,onChange:c=>l(c.target.value),"aria-label":"Spec name"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsx(Le,{error:a}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn",children:e!=null&&e.content?"Import":"Create spec"})]})]})})})}function oS(e){const[t,n]=j.useState(!1);return j.useEffect(()=>{const r=()=>n(!0);return window.addEventListener(Bc,r),()=>window.removeEventListener(Bc,r)},[]),j.useEffect(()=>{if(!t)return;let r=!1;const i=setInterval(()=>{X0().then(l=>{l&&!r&&(n(!1),e())})},3e3);return()=>{r=!0,clearInterval(i)}},[t,e]),t}function uS(){var k;const e=rb(),[t,n]=ib(),[r,i]=j.useState(!1),[l,a]=j.useState(null),[o,u]=j.useState(tS),[c,h]=j.useState(!1),{pathname:d}=Kn();j.useEffect(()=>h(!1),[d]);const[f,m]=j.useState(null),[p,g]=j.useState(null),[w,y]=j.useState(null),x=j.useCallback(()=>{Q.claudeStatus().then(y).catch(()=>{})},[]),{refresh:v}=e,b=oS(j.useCallback(()=>{v(),x()},[v,x]));j.useEffect(()=>{x();const E=setInterval(x,5*6e4);return()=>clearInterval(E)},[x]),j.useEffect(()=>{try{localStorage.setItem("qa-studio.sidebar",o?"collapsed":"open")}catch{}},[o]),j.useEffect(()=>{const E=T=>{(T.ctrlKey||T.metaKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),i(I=>!I)),T.key==="Escape"&&(i(!1),a(null),h(!1))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]);const A=j.useMemo(()=>({openNewSpec:E=>a(E??{}),openPalette:()=>i(!0),theme:t,toggleTheme:n,crumbSlot:f,extraSlot:p,refreshClaude:x}),[t,n,f,p,x]);return s.jsx(Ly.Provider,{value:e,children:s.jsx(Jy.Provider,{value:A,children:s.jsx(Gb,{children:s.jsx(qb,{children:s.jsxs(Wb,{children:[s.jsxs("div",{className:`shell ${o?"side-collapsed":""}`,children:[s.jsx(sS,{collapsed:o,mobileOpen:c,onCloseMobile:()=>h(!1)}),c&&s.jsx("div",{className:"side-backdrop",onClick:()=>h(!1),"aria-hidden":"true"}),s.jsx("button",{className:"side-toggle-dot",onClick:()=>u(E=>!E),"aria-label":o?"Expand menu":"Collapse menu",title:o?"Expand menu":"Collapse menu",children:s.jsx("span",{style:{display:"inline-flex",transform:o?void 0:"rotate(180deg)"},children:s.jsx(ti,{size:10})})}),s.jsxs("div",{className:"main",children:[s.jsx(iS,{setCrumbSlot:m,setExtraSlot:g,menuOpen:c,onMenu:()=>h(!0)}),b&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Agent Studio server is not running."})," Start it with ",s.jsx("code",{children:"npm run studio:start"})," in the repo folder; this page reconnects by itself."]}),!b&&(w==null?void 0:w.state)==="not-ready"&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Claude Code is not ready:"})," ",w.binary.ok?w.version.ok?(k=w.test)==null?void 0:k.message:w.version.detail:w.binary.detail,". Built-in agents (explore, generate, heal, spec generator, project context) cannot run. ",s.jsx(ye,{to:"/settings#claude",children:"Fix it in Settings"})]}),s.jsx("div",{className:"content",children:s.jsx(C0,{})})]})]}),r&&s.jsx(Hb,{onClose:()=>i(!1),onNewSpec:()=>(i(!1),a({}))}),l&&s.jsx(aS,{initial:l,onClose:()=>a(null)}),s.jsx(eS,{})]})})})})})}function ot({items:e}){const{crumbSlot:t}=hs();return t?Pr.createPortal(s.jsx("nav",{className:"crumbs","aria-label":"Breadcrumb",children:e.map((n,r)=>s.jsxs("span",{className:"crumb",children:[r>0&&s.jsx("span",{className:"sep",children:"/"}),n.to?s.jsx(ye,{to:n.to,children:n.label}):s.jsx("span",{className:"current",children:n.label}),n.count!==void 0&&s.jsx("span",{className:"pill-count",children:n.count})]},r))}),t):null}function cS({children:e}){const{extraSlot:t}=hs();return t?Pr.createPortal(e,t):null}function dS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const hS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pS={};function Fp(e,t){return(pS.jsx?fS:hS).test(e)}const mS=/[ \t\n\f\r]/g;function gS(e){return typeof e=="object"?e.type==="text"?Up(e.value):!1:Up(e)}function Up(e){return e.replace(mS,"")===""}class Sl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Sl.prototype.normal={};Sl.prototype.property={};Sl.prototype.space=void 0;function Xy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Sl(n,r,t)}function Gc(e){return e.toLowerCase()}class Ut{constructor(t,n){this.attribute=n,this.property=t}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let xS=0;const me=fs(),rt=fs(),Kc=fs(),Y=fs(),Oe=fs(),Zr=fs(),Ht=fs();function fs(){return 2**++xS}const Yc=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:rt,commaOrSpaceSeparated:Ht,commaSeparated:Zr,number:Y,overloadedBoolean:Kc,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Su=Object.keys(Yc);class Lh extends Ut{constructor(t,n,r,i){let l=-1;if(super(t,n),Bp(this,"space",i),typeof r=="number")for(;++l<Su.length;){const a=Su[l];Bp(this,Su[l],(r&Yc[a])===Yc[a])}}}Lh.prototype.defined=!0;function Bp(e,t,n){n&&(e[t]=n)}function ai(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Lh(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Gc(r)]=r,n[Gc(l.attribute)]=r}return new Sl(t,n,e.space)}const Zy=ai({properties:{ariaActiveDescendant:null,ariaAtomic:rt,ariaAutoComplete:null,ariaBusy:rt,ariaChecked:rt,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:rt,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:rt,ariaFlowTo:Oe,ariaGrabbed:rt,ariaHasPopup:null,ariaHidden:rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:Y,ariaLive:null,ariaModal:rt,ariaMultiLine:rt,ariaMultiSelectable:rt,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:rt,ariaReadOnly:rt,ariaRelevant:null,ariaRequired:rt,ariaRoleDescription:Oe,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:rt,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ev(e,t){return t in e?e[t]:t}function tv(e,t){return ev(e,t.toLowerCase())}const yS=ai({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zr,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alpha:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Oe,autoFocus:me,autoPlay:me,blocking:Oe,capture:null,charSet:null,checked:me,cite:null,className:Oe,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:rt,controls:me,controlsList:Oe,coords:Y|Zr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:Kc,draggable:rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Oe,height:Y,hidden:Kc,high:Y,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:me,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,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:me,optimum:Y,pattern:null,ping:Oe,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Oe,required:me,reversed:me,rows:Y,rowSpan:Y,sandbox:Oe,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootCustomElementRegistry:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shadowRootSerializable:me,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:rt,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:rt,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:me,disablePictureInPicture:me,disableRemotePlayback:me,exportParts:Zr,part:Oe,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:tv}),vS=ai({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:Ht,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:Oe,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:Zr,g2:Zr,glyphName:Zr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Ht,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,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:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ht,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ht,rev:Ht,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ht,requiredFeatures:Ht,requiredFonts:Ht,requiredFormats:Ht,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Ht,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ht,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ht,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ev}),nv=ai({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()}}),rv=ai({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tv}),sv=ai({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jS={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"},wS=/[A-Z]/g,Hp=/-[a-z]/g,kS=/^data[-\w.:]+$/i;function bS(e,t){const n=Gc(t);let r=t,i=Ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Hp,NS);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Hp.test(l)){let a=l.replace(wS,SS);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Lh}return new i(r,t)}function SS(e){return"-"+e.toLowerCase()}function NS(e){return e.charAt(1).toUpperCase()}const CS=Xy([Zy,yS,nv,rv,sv],"html"),Ah=Xy([Zy,vS,nv,rv,sv],"svg");function ES(e){return e.join(" ").trim()}var Wp=/\/\*(?:[^*]|\*(?!\/))*\*\//g,TS=/\n/g,PS=/^\s*/,RS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,LS=/^:\s*/,AS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,IS=/^[;\s]*/,DS=`
360
+ `,qc=[{id:"planner",label:"Planner",agent:{name:"Planner",description:"Asks the open questions, takes the answers and writes the solution",instructions:$b,model:"sonnet",permissions:Vy,review:"human"}},{id:"coding",label:"Coding",agent:{name:"Coding",description:"Implements the approved solution; never writes tests",instructions:_b,model:"opus",permissions:ku,review:"auto"}},{id:"unit-test",label:"Unit Test",agent:{name:"Unit Test",description:"Tests the diff with 100% line and branch coverage and runs the suite",instructions:Ob,model:"sonnet",permissions:ku,review:"auto"}},{id:"code-review",label:"Code Review",agent:{name:"Code Review",description:"Solution-architect review: CRITICAL/REQUIRED go back to Coding, OPTIONAL noted for later",instructions:Fb,model:"sonnet",permissions:ku,review:"auto"}}];function Ub(e){const t=qc.find(r=>r.id===e);if(!t)throw new Error(`Unknown agent template: ${e}`);const n=t.agent.permissions;return{...t.agent,skills:[],claudeMdSections:[],permissions:{...n,deniedCommands:[...n.deniedCommands],protectedPaths:[...n.protectedPaths]}}}function yt({status:e,children:t}){return e?s.jsx("span",{className:`badge ${e}`,children:t??e}):s.jsx("span",{className:"badge",children:"—"})}function An({status:e}){return s.jsx(yt,{status:e,children:e==="passed"?"done":e==="waiting"?"waiting for review":void 0})}function ni({status:e,children:t,title:n}){return e?s.jsxs("span",{className:`pill ${e}`,title:n,children:[s.jsx("i",{}),t??e]}):s.jsx("span",{className:"pill",children:"—"})}function Le({error:e}){return e?s.jsx("div",{className:"error-box",role:"alert",children:e}):null}function kn({value:e,onChange:t,items:n}){return s.jsx("div",{className:"tabs",role:"tablist",children:n.map(r=>s.jsx("button",{role:"tab","aria-selected":e===r.id,className:`tab ${e===r.id?"active":""}`,onClick:()=>t(r.id),children:r.label},r.id))})}const Qy={explorer:Ay,generator:kh,validator:bh,healer:Iy,runner:db,specwriter:hl,contextwriter:Sh,custom:hl};function Ft({agent:e,size:t=36}){const n=Qy[e];return s.jsx("span",{className:`agent-icon ${e}`,style:{width:t,height:t,borderRadius:t/3},title:Ne[e].label,children:s.jsx(n,{size:Math.round(t*.5)})})}function Bb({agents:e}){return s.jsx("span",{className:"row",style:{gap:0},children:e.map(t=>{const n=Qy[t.agent];return s.jsx("span",{className:`agent-chip agent-icon ${t.agent} ${t.status}`,title:`${Ne[t.agent].label}: ${t.status}`,children:s.jsx(n,{size:12})},t.id)})})}function Rt(e){if(!e)return"—";const t=new Date(e),n=(Date.now()-t.getTime())/1e3;return n<60?"just now":n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:t.toLocaleString("en-US",{hour12:!1})}function br(e,t){if(!e)return"—";const n=(t?Date.parse(t):Date.now())-Date.parse(e);if(n<1e3)return`${Math.max(n,0)} ms`;const r=Math.round(n/1e3);return r<60?`${r}s`:`${Math.floor(r/60)}m ${r%60}s`}const Sr={explore:"Explore",generate:"Generate",heal:"Heal",spec:"Write spec",testrun:"Test run",context:"Project context",custom:"Custom agent",pipeline:"Pipeline"};function qy(e){var t;return e.label??((t=Ne[e.agent])==null?void 0:t.label)??e.agent}function sn(e){return e==null?"—":e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`:`${(e/1e6).toFixed(2)}M`}function Kt(e){return e==null?"—":e>0&&e<.01?"<$0.01":`$${e.toFixed(2)}`}function Hb({onClose:e,onNewSpec:t}){const n=ut(),{specs:r}=un(),i=$e(()=>Q.jobs()),[l,a]=j.useState(""),[o,u]=j.useState(0),c=m=>{e(),n(m)},h=j.useMemo(()=>{const m=[{group:"Actions",key:"new",label:"Create new spec",text:"new spec create",icon:s.jsx(qt,{size:16}),run:t},{group:"Actions",key:"runall",label:"Run all tests",text:"run all tests",icon:s.jsx(ft,{size:16}),run:()=>void Q.createJob({type:"testrun",repeatEach:1}).then(g=>c(`/runs/${g.id}`))},...r.map(g=>({group:"Specs",key:`s-${g.file}`,label:s.jsxs(s.Fragment,{children:[g.file," ",s.jsx("span",{className:"muted small",children:g.parsed.title})]}),text:`${g.file} ${g.parsed.title}`,icon:s.jsx(wr,{size:16}),run:()=>c(`/specs/${g.file}`)})),...r.flatMap(g=>g.parsed.tcs.map(w=>({group:"Test case",key:`t-${g.file}-${w.id}`,label:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:w.id})," ",w.title]}),text:`${w.id} ${w.title} ${g.file}`,icon:s.jsx(wr,{size:16}),run:()=>c(`/specs/${g.file}`)}))),...(i.data??[]).slice(0,20).map(g=>({group:"Jobs",key:`j-${g.id}`,label:s.jsxs(s.Fragment,{children:["#",g.id," ",Sr[g.type]," · ",g.target," ",s.jsx(An,{status:g.status})]}),text:`#${g.id} ${g.type} ${g.target} ${g.status}`,icon:s.jsx(ft,{size:16}),run:()=>c(`/runs/${g.id}`)}))],p=l.trim().toLowerCase();return p?m.filter(g=>g.text.toLowerCase().includes(p)):m},[l,r,i.data]);j.useEffect(()=>u(0),[l]);const d=m=>{var p;m.key==="ArrowDown"?(m.preventDefault(),u(g=>Math.min(g+1,h.length-1))):m.key==="ArrowUp"?(m.preventDefault(),u(g=>Math.max(g-1,0))):m.key==="Enter"&&((p=h[o])==null||p.run())};let f="";return s.jsx("div",{className:"overlay",onClick:e,children:s.jsxs("div",{className:"palette",onClick:m=>m.stopPropagation(),role:"dialog","aria-label":"Command palette",children:[s.jsx("input",{autoFocus:!0,placeholder:"Search specs, test cases, jobs, actions…",value:l,onChange:m=>a(m.target.value),onKeyDown:d}),s.jsxs("ul",{role:"listbox",children:[h.map((m,p)=>{const g=m.group!==f;return f=m.group,s.jsxs("div",{children:[g&&s.jsx("li",{className:"group",children:m.group}),s.jsxs("li",{role:"option","aria-selected":p===o,className:p===o?"active":"",onMouseEnter:()=>u(p),onClick:m.run,children:[m.icon,s.jsx("span",{children:m.label})]})]},m.key)}),h.length===0&&s.jsx("li",{className:"group",children:"No results"})]})]})})}const Gy=j.createContext(async()=>!1),In=()=>j.useContext(Gy);function Wb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(u=>{const c=r.current++;return new Promise(h=>n(d=>[...d,{...u,id:c,resolve:h}]))},[]),l=t[0],a=j.useCallback(u=>{n(c=>{var h;return(h=c[0])==null||h.resolve(u),c.slice(1)})},[]),o=j.useMemo(()=>i,[i]);return s.jsxs(Gy.Provider,{value:o,children:[e,l&&Pr.createPortal(s.jsx(Vb,{opts:l,onClose:a},l.id),document.body)]})}function Vb({opts:e,onClose:t}){const n=j.useRef(null),r=j.useRef(null),i=j.useRef(null);return j.useEffect(()=>{var a;(a=(e.danger?r:i).current)==null||a.focus();const l=o=>{var u,c;if(o.key==="Escape"&&(o.stopPropagation(),t(!1)),o.key==="Tab"){const h=[...((u=n.current)==null?void 0:u.querySelectorAll("button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), a[href]"))??[]],d=h.indexOf(document.activeElement);o.preventDefault(),(c=h[(d+(o.shiftKey?-1:1)+h.length)%h.length])==null||c.focus()}};return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[e.danger,t]),s.jsx("div",{className:"overlay confirm-overlay",onClick:()=>t(!1),children:s.jsx("div",{ref:n,className:"modal confirm-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-title","aria-describedby":"confirm-msg",onClick:l=>l.stopPropagation(),children:s.jsxs("div",{className:"modal-body",children:[s.jsxs("div",{className:"confirm-head",children:[e.danger&&s.jsx("span",{className:"confirm-icon","aria-hidden":"true",children:s.jsx(Ar,{size:18})}),s.jsxs("div",{children:[s.jsx("h3",{id:"confirm-title",children:e.title}),e.message&&s.jsx("div",{id:"confirm-msg",className:"confirm-msg",children:e.message})]})]}),s.jsxs("div",{className:"confirm-actions",children:[s.jsx("button",{ref:r,type:"button",className:"btn ghost",onClick:()=>t(!1),children:e.cancelLabel??"Cancel"}),s.jsx("button",{ref:i,type:"button",className:`btn ${e.danger?"btn-danger-solid":""}`,onClick:()=>t(!0),children:e.confirmLabel??(e.danger?"Delete":"OK")})]})]})})})}function Rh(e,t){const n=In(),r=j.useRef(!1),i=j.useRef(t);i.current=t,j.useEffect(()=>{e.state!=="blocked"||r.current||(r.current=!0,n(i.current).then(l=>{r.current=!1,l?e.proceed():e.reset()}))},[e,n])}const Ky=j.createContext(e=>e),Qb=()=>j.useContext(Ky);function qb({children:e}){const[t,n]=j.useState(0),r=j.useCallback(i=>(n(l=>l+1),i.finally(()=>n(l=>l-1))),[]);return s.jsxs(Ky.Provider,{value:r,children:[e,t>0&&Pr.createPortal(s.jsx("div",{className:"loading-bar",role:"progressbar","aria-label":"Loading"}),document.body)]})}const Si=()=>{},Yy=j.createContext({show:Si,info:Si,success:Si,warning:Si,error:Si}),Ir=()=>j.useContext(Yy);function Gb({children:e}){const[t,n]=j.useState([]),r=j.useRef(1),i=j.useCallback(o=>n(u=>u.filter(c=>c.id!==o)),[]),l=j.useCallback((o,u)=>{const c=(u==null?void 0:u.kind)??"info",h={id:r.current++,kind:c,message:o,duration:(u==null?void 0:u.duration)??(c==="error"?6e3:3500)};n(d=>[...d,h].slice(-4))},[]),a=j.useMemo(()=>({show:l,info:o=>l(o,{kind:"info"}),success:o=>l(o,{kind:"success"}),warning:o=>l(o,{kind:"warning"}),error:o=>l(o,{kind:"error"})}),[l]);return s.jsxs(Yy.Provider,{value:a,children:[e,Pr.createPortal(s.jsx("div",{className:"toasts",role:"region","aria-label":"Notifications",children:t.map(o=>s.jsx(Kb,{item:o,onClose:()=>i(o.id)},o.id))}),document.body)]})}function Kb({item:e,onClose:t}){const[n,r]=j.useState(!1);return j.useEffect(()=>{if(n)return;const i=setTimeout(t,e.duration);return()=>clearTimeout(i)},[n,e.duration,t]),s.jsxs("div",{className:`toast ${e.kind}`,role:e.kind==="error"?"alert":"status",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[s.jsx("span",{className:"toast-icon","aria-hidden":"true",children:e.kind==="success"?s.jsx(wh,{size:14}):e.kind==="error"?s.jsx(kr,{size:14}):e.kind==="warning"?"!":"i"}),s.jsx("span",{className:"toast-msg",children:e.message}),s.jsx("button",{className:"toast-close",onClick:t,"aria-label":"Dismiss notification",children:s.jsx(kr,{size:13})})]})}const Yb=15*60*1e3,Jb=2e3,Xb=5*60*1e3;async function Zb(){try{const e=await fetch("/api/update",{cache:"no-store"});return e.status===404?"other":e.ok?await e.json():null}catch{return null}}function eS(){const[e,t]=j.useState(null),[n,r]=j.useState(null),[i,l]=j.useState(null),a=j.useCallback(()=>{Q.updateStatus().then(t).catch(()=>{})},[]);if(j.useEffect(()=>{a();const u=setInterval(a,Yb);return window.addEventListener("focus",a),()=>{clearInterval(u),window.removeEventListener("focus",a)}},[a]),j.useEffect(()=>{if(!n)return;const u=Date.now();let c=!1;const h=setInterval(()=>{Zb().then(d=>{if(!d)return void(c=!0);if(d==="other"||d.current===n)return window.location.reload();(c||Date.now()-u>Xb)&&(r(null),t(d),d.error||l("The update did not finish. Run the command below in a terminal, then restart Agent Studio."))})},Jb);return()=>clearInterval(h)},[n]),!(e!=null&&e.required)&&!n)return null;const o=async()=>{l(null);try{const u=await Q.startUpdate();r(u.latest)}catch(u){l(u.message)}};return s.jsx("div",{className:"overlay update-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"update-title",children:s.jsx("div",{className:"modal",children:s.jsx("div",{className:"modal-body",children:n?s.jsxs(s.Fragment,{children:[s.jsxs("h3",{id:"update-title",children:["Updating to v",n," ..."]}),s.jsx("p",{className:"muted",children:"Installing and restarting Agent Studio. Progress is shown in the terminal where it runs; this page reloads by itself."})]}):s.jsxs(s.Fragment,{children:[s.jsx("h3",{id:"update-title",children:"Update required"}),s.jsxs("p",{children:["Agent Studio ",s.jsxs("b",{children:["v",e.latest]})," is available (you have v",e.current,"). Update to keep using the app."]}),(i||e.error)&&s.jsxs("div",{className:"error-box",role:"alert",children:[i||e.error,s.jsx("pre",{className:"update-cmd",children:e.command})]}),s.jsx("div",{className:"confirm-actions",children:s.jsxs("button",{className:"btn",onClick:()=>void o(),children:[s.jsx(Yn,{size:14})," Update and restart"]})})]})})})})}const Jy=j.createContext({refreshClaude:()=>{},openNewSpec:()=>{},openPalette:()=>{},theme:"light",toggleTheme:()=>{},crumbSlot:null,extraSlot:null}),hs=()=>j.useContext(Jy);function tS(){try{return localStorage.getItem("qa-studio.sidebar")==="collapsed"}catch{return!1}}const nS=.6,bu="Agent Studio (v0.1.9)";function rS(e,t){j.useLayoutEffect(()=>{const n=e.current,r=t.current;if(!n||!r)return;const i=()=>{r.style.zoom="";const o=getComputedStyle(n),u=n.clientHeight-parseFloat(o.paddingTop)-parseFloat(o.paddingBottom),c=r.scrollHeight,h=c>u&&u>0?Math.max(nS,u/c):1;r.style.zoom=h<1?h.toFixed(3):""};i();const l=new ResizeObserver(i);l.observe(n);const a=new MutationObserver(i);return a.observe(r,{childList:!0,subtree:!0,characterData:!0}),()=>{l.disconnect(),a.disconnect()}},[e,t])}function sS({collapsed:e,mobileOpen:t,onCloseMobile:n}){var y;const r=j.useRef(null),i=j.useRef(null);rS(r,i);const{specs:l,mapping:a}=un(),{openPalette:o}=hs(),u=Kn(),c=$e(()=>Q.jobs(),[u.pathname]),{reload:h}=c,d=(c.data??[]).some(x=>x.status==="queued"||x.status==="running"||x.status==="waiting");j.useEffect(()=>{if(!d)return;const x=setInterval(h,5e3);return()=>clearInterval(x)},[d,h]);const f=(c.data??[]).filter(x=>x.status==="running"||x.status==="queued").length,m=(c.data??[]).filter(x=>x.status==="waiting").length;j.useEffect(()=>(document.title=m?`● ${bu}`:bu,()=>{document.title=bu}),[m]);const p=a.filter(x=>x.status!=="orphan"&&x.testFile).length,g=a.filter(x=>x.status!=="orphan").length,w=(x,v,b,A,k,E)=>s.jsxs(G0,{to:x,end:k,className:({isActive:T})=>`side-link ${T&&!(E&&u.pathname.startsWith(E))?"active":""}`,title:e?b:void 0,children:[v,s.jsx("span",{className:"side-label",children:b}),A!==void 0&&s.jsx("span",{className:"count",children:A})]});return s.jsx("aside",{ref:r,id:"app-sidebar",className:`sidebar ${e?"collapsed":""} ${t?"mobile-open":""}`,"aria-label":"Main menu",children:s.jsxs("div",{ref:i,className:"side-inner",children:[s.jsxs("div",{className:"side-head",children:[s.jsx("span",{className:"logo",children:s.jsx(bh,{size:18})}),s.jsx("h2",{className:"side-label",children:"Agent Studio"}),s.jsx("button",{className:"side-close",onClick:n,"aria-label":"Close menu",children:s.jsx(kr,{size:18})})]}),s.jsxs("button",{className:"side-search",onClick:o,"aria-label":"Search (Ctrl+K)",children:[s.jsx(Ro,{size:16}),s.jsx("span",{className:"side-label",children:"Search"}),s.jsx("span",{className:"kbd side-label",children:"⌘K"})]}),s.jsx("div",{className:"side-group side-label",children:"Overview"}),s.jsxs("nav",{className:"side-nav","aria-label":"Overview",children:[w("/",s.jsx(ab,{size:17}),"Overview",void 0,!0),w("/chat",s.jsx(Ch,{size:17}),"Claude chat")]}),s.jsx("div",{className:"side-group side-label",children:"Specification"}),s.jsxs("nav",{className:"side-nav","aria-label":"Specification",children:[w("/specs",s.jsx(wr,{size:17}),"Specification",l.length,!1,"/specs/from-requirement"),w("/specs/from-requirement",s.jsx(hl,{size:17}),"Generator")]}),s.jsx("div",{className:"side-group side-label",children:"Testing"}),s.jsxs("nav",{className:"side-nav","aria-label":"Testing",children:[w("/mapping",s.jsx(jh,{size:17}),"Test cases",g?`${p}/${g}`:0),w("/test-runs",s.jsx(pb,{size:17}),"Test runs"),w("/runs",s.jsx(ft,{size:17}),"Recent runs",m?`${m} waiting`:f?`${f} running`:((y=c.data)==null?void 0:y.length)??0)]}),s.jsx("div",{className:"side-group side-label",children:"Settings"}),s.jsxs("nav",{className:"side-nav","aria-label":"Settings",children:[w("/agents",s.jsx($y,{size:17}),"Agents"),w("/usage",s.jsx(_y,{size:17}),"Claude usage"),w("/project",s.jsx(Sh,{size:17}),"Project"),w("/settings",s.jsx(hb,{size:17}),"Settings")]})]})})}function iS({setCrumbSlot:e,setExtraSlot:t,menuOpen:n,onMenu:r}){const{theme:i,toggleTheme:l,openPalette:a}=hs();return s.jsxs("header",{className:"topbar",children:[s.jsx("button",{className:"menu-btn",onClick:r,"aria-label":"Open menu","aria-expanded":n,"aria-controls":"app-sidebar",children:s.jsx(cb,{size:20})}),s.jsx("div",{className:"topbar-crumbs",ref:e}),s.jsx("div",{className:"topbar-spacer"}),s.jsx("div",{className:"topbar-extra",ref:t}),s.jsxs("button",{className:"top-search",onClick:a,"aria-label":"Search specs, TC-ID (Ctrl+K)",children:[s.jsx(Ro,{size:15}),s.jsx("span",{children:"Search specs, TC-ID…"})]}),s.jsx("button",{className:"theme-btn",onClick:l,title:"Toggle light/dark theme","aria-label":"Toggle light/dark theme",children:i==="dark"?s.jsx(zy,{size:17}):s.jsx(Dy,{size:17})})]})}const lS=/^[a-z0-9][a-z0-9_-]*$/;function aS({initial:e,onClose:t}){const n=ut(),{refresh:r}=un(),[i,l]=j.useState((e==null?void 0:e.name)??""),[a,o]=j.useState(null),u=async c=>{c.preventDefault();const h=i.trim().replace(/\.md$/,"");if(!lS.test(h))return o('Name may only contain lowercase letters, digits, "-" or "_", and must start with a letter or digit.');try{await Q.createSpec(`${h}.md`,(e==null?void 0:e.content)??tb),r(),t(),n(`/specs/${h}.md`)}catch(d){o(d.message)}};return s.jsx("div",{className:"overlay",onClick:t,children:s.jsx("form",{className:"modal",onClick:c=>c.stopPropagation(),onSubmit:u,children:s.jsxs("div",{className:"modal-body",children:[s.jsx("h3",{style:{margin:0},children:e!=null&&e.content?"Import spec":"New spec"}),s.jsxs("div",{className:"row",children:[s.jsx("input",{className:"input grow",autoFocus:!0,placeholder:"spec-name",value:i,onChange:c=>l(c.target.value),"aria-label":"Spec name"}),s.jsx("span",{className:"muted",children:".md"})]}),s.jsx(Le,{error:a}),s.jsxs("div",{className:"row",style:{justifyContent:"flex-end"},children:[s.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),s.jsx("button",{type:"submit",className:"btn",children:e!=null&&e.content?"Import":"Create spec"})]})]})})})}function oS(e){const[t,n]=j.useState(!1);return j.useEffect(()=>{const r=()=>n(!0);return window.addEventListener(Bc,r),()=>window.removeEventListener(Bc,r)},[]),j.useEffect(()=>{if(!t)return;let r=!1;const i=setInterval(()=>{X0().then(l=>{l&&!r&&(n(!1),e())})},3e3);return()=>{r=!0,clearInterval(i)}},[t,e]),t}function uS(){var k;const e=rb(),[t,n]=ib(),[r,i]=j.useState(!1),[l,a]=j.useState(null),[o,u]=j.useState(tS),[c,h]=j.useState(!1),{pathname:d}=Kn();j.useEffect(()=>h(!1),[d]);const[f,m]=j.useState(null),[p,g]=j.useState(null),[w,y]=j.useState(null),x=j.useCallback(()=>{Q.claudeStatus().then(y).catch(()=>{})},[]),{refresh:v}=e,b=oS(j.useCallback(()=>{v(),x()},[v,x]));j.useEffect(()=>{x();const E=setInterval(x,5*6e4);return()=>clearInterval(E)},[x]),j.useEffect(()=>{try{localStorage.setItem("qa-studio.sidebar",o?"collapsed":"open")}catch{}},[o]),j.useEffect(()=>{const E=T=>{(T.ctrlKey||T.metaKey)&&T.key.toLowerCase()==="k"&&(T.preventDefault(),i(I=>!I)),T.key==="Escape"&&(i(!1),a(null),h(!1))};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[]);const A=j.useMemo(()=>({openNewSpec:E=>a(E??{}),openPalette:()=>i(!0),theme:t,toggleTheme:n,crumbSlot:f,extraSlot:p,refreshClaude:x}),[t,n,f,p,x]);return s.jsx(Ly.Provider,{value:e,children:s.jsx(Jy.Provider,{value:A,children:s.jsx(Gb,{children:s.jsx(qb,{children:s.jsxs(Wb,{children:[s.jsxs("div",{className:`shell ${o?"side-collapsed":""}`,children:[s.jsx(sS,{collapsed:o,mobileOpen:c,onCloseMobile:()=>h(!1)}),c&&s.jsx("div",{className:"side-backdrop",onClick:()=>h(!1),"aria-hidden":"true"}),s.jsx("button",{className:"side-toggle-dot",onClick:()=>u(E=>!E),"aria-label":o?"Expand menu":"Collapse menu",title:o?"Expand menu":"Collapse menu",children:s.jsx("span",{style:{display:"inline-flex",transform:o?void 0:"rotate(180deg)"},children:s.jsx(ti,{size:10})})}),s.jsxs("div",{className:"main",children:[s.jsx(iS,{setCrumbSlot:m,setExtraSlot:g,menuOpen:c,onMenu:()=>h(!0)}),b&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Agent Studio server is not running."})," Start it with ",s.jsx("code",{children:"npm run studio:start"})," in the repo folder; this page reconnects by itself."]}),!b&&(w==null?void 0:w.state)==="not-ready"&&s.jsxs("div",{className:"claude-banner",role:"alert",children:[s.jsx("b",{children:"Claude Code is not ready:"})," ",w.binary.ok?w.version.ok?(k=w.test)==null?void 0:k.message:w.version.detail:w.binary.detail,". Built-in agents (explore, generate, heal, spec generator, project context) cannot run. ",s.jsx(ye,{to:"/settings#claude",children:"Fix it in Settings"})]}),s.jsx("div",{className:"content",children:s.jsx(C0,{})})]})]}),r&&s.jsx(Hb,{onClose:()=>i(!1),onNewSpec:()=>(i(!1),a({}))}),l&&s.jsx(aS,{initial:l,onClose:()=>a(null)}),s.jsx(eS,{})]})})})})})}function ot({items:e}){const{crumbSlot:t}=hs();return t?Pr.createPortal(s.jsx("nav",{className:"crumbs","aria-label":"Breadcrumb",children:e.map((n,r)=>s.jsxs("span",{className:"crumb",children:[r>0&&s.jsx("span",{className:"sep",children:"/"}),n.to?s.jsx(ye,{to:n.to,children:n.label}):s.jsx("span",{className:"current",children:n.label}),n.count!==void 0&&s.jsx("span",{className:"pill-count",children:n.count})]},r))}),t):null}function cS({children:e}){const{extraSlot:t}=hs();return t?Pr.createPortal(e,t):null}function dS(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const hS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pS={};function Fp(e,t){return(pS.jsx?fS:hS).test(e)}const mS=/[ \t\n\f\r]/g;function gS(e){return typeof e=="object"?e.type==="text"?Up(e.value):!1:Up(e)}function Up(e){return e.replace(mS,"")===""}class Sl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Sl.prototype.normal={};Sl.prototype.property={};Sl.prototype.space=void 0;function Xy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Sl(n,r,t)}function Gc(e){return e.toLowerCase()}class Ut{constructor(t,n){this.attribute=n,this.property=t}}Ut.prototype.attribute="";Ut.prototype.booleanish=!1;Ut.prototype.boolean=!1;Ut.prototype.commaOrSpaceSeparated=!1;Ut.prototype.commaSeparated=!1;Ut.prototype.defined=!1;Ut.prototype.mustUseProperty=!1;Ut.prototype.number=!1;Ut.prototype.overloadedBoolean=!1;Ut.prototype.property="";Ut.prototype.spaceSeparated=!1;Ut.prototype.space=void 0;let xS=0;const me=fs(),rt=fs(),Kc=fs(),Y=fs(),Oe=fs(),Zr=fs(),Ht=fs();function fs(){return 2**++xS}const Yc=Object.freeze(Object.defineProperty({__proto__:null,boolean:me,booleanish:rt,commaOrSpaceSeparated:Ht,commaSeparated:Zr,number:Y,overloadedBoolean:Kc,spaceSeparated:Oe},Symbol.toStringTag,{value:"Module"})),Su=Object.keys(Yc);class Lh extends Ut{constructor(t,n,r,i){let l=-1;if(super(t,n),Bp(this,"space",i),typeof r=="number")for(;++l<Su.length;){const a=Su[l];Bp(this,Su[l],(r&Yc[a])===Yc[a])}}}Lh.prototype.defined=!0;function Bp(e,t,n){n&&(e[t]=n)}function ai(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const l=new Lh(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(l.mustUseProperty=!0),t[r]=l,n[Gc(r)]=r,n[Gc(l.attribute)]=r}return new Sl(t,n,e.space)}const Zy=ai({properties:{ariaActiveDescendant:null,ariaAtomic:rt,ariaAutoComplete:null,ariaBusy:rt,ariaChecked:rt,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:Oe,ariaCurrent:null,ariaDescribedBy:Oe,ariaDetails:null,ariaDisabled:rt,ariaDropEffect:Oe,ariaErrorMessage:null,ariaExpanded:rt,ariaFlowTo:Oe,ariaGrabbed:rt,ariaHasPopup:null,ariaHidden:rt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Oe,ariaLevel:Y,ariaLive:null,ariaModal:rt,ariaMultiLine:rt,ariaMultiSelectable:rt,ariaOrientation:null,ariaOwns:Oe,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:rt,ariaReadOnly:rt,ariaRelevant:null,ariaRequired:rt,ariaRoleDescription:Oe,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:rt,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function ev(e,t){return t in e?e[t]:t}function tv(e,t){return ev(e,t.toLowerCase())}const yS=ai({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Zr,acceptCharset:Oe,accessKey:Oe,action:null,allow:null,allowFullScreen:me,allowPaymentRequest:me,allowUserMedia:me,alpha:me,alt:null,as:null,async:me,autoCapitalize:null,autoComplete:Oe,autoFocus:me,autoPlay:me,blocking:Oe,capture:null,charSet:null,checked:me,cite:null,className:Oe,closedBy:null,colorSpace:null,cols:Y,colSpan:Y,command:null,commandFor:null,content:null,contentEditable:rt,controls:me,controlsList:Oe,coords:Y|Zr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:me,defer:me,dir:null,dirName:null,disabled:me,download:Kc,draggable:rt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:me,formTarget:null,headers:Oe,height:Y,hidden:Kc,high:Y,href:null,hrefLang:null,htmlFor:Oe,httpEquiv:Oe,id:null,imageSizes:null,imageSrcSet:null,inert:me,inputMode:null,integrity:null,is:null,isMap:me,itemId:null,itemProp:Oe,itemRef:Oe,itemScope:me,itemType:Oe,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:me,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:me,muted:me,name:null,nonce:null,noModule:me,noValidate:me,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:me,optimum:Y,pattern:null,ping:Oe,placeholder:null,playsInline:me,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:me,referrerPolicy:null,rel:Oe,required:me,reversed:me,rows:Y,rowSpan:Y,sandbox:Oe,scope:null,scoped:me,seamless:me,selected:me,shadowRootClonable:me,shadowRootCustomElementRegistry:me,shadowRootDelegatesFocus:me,shadowRootMode:null,shadowRootSerializable:me,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:rt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:me,useMap:null,value:rt,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Oe,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:me,declare:me,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:me,noHref:me,noShade:me,noWrap:me,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:rt,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:me,disablePictureInPicture:me,disableRemotePlayback:me,exportParts:Zr,part:Oe,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:tv}),vS=ai({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:Ht,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:Oe,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:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:me,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,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:Zr,g2:Zr,glyphName:Zr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Ht,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,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:Y,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:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Oe,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ht,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ht,rev:Ht,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ht,requiredFeatures:Ht,requiredFonts:Ht,requiredFormats:Ht,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:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Ht,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ht,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ht,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:ev}),nv=ai({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()}}),rv=ai({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tv}),sv=ai({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),jS={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"},wS=/[A-Z]/g,Hp=/-[a-z]/g,kS=/^data[-\w.:]+$/i;function bS(e,t){const n=Gc(t);let r=t,i=Ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&kS.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(Hp,NS);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!Hp.test(l)){let a=l.replace(wS,SS);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Lh}return new i(r,t)}function SS(e){return"-"+e.toLowerCase()}function NS(e){return e.charAt(1).toUpperCase()}const CS=Xy([Zy,yS,nv,rv,sv],"html"),Ah=Xy([Zy,vS,nv,rv,sv],"svg");function ES(e){return e.join(" ").trim()}var Wp=/\/\*(?:[^*]|\*(?!\/))*\*\//g,TS=/\n/g,PS=/^\s*/,RS=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,LS=/^:\s*/,AS=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,IS=/^[;\s]*/,DS=`
361
361
  `,Vp="/",Qp="*",Ni="",zS="comment",MS="declaration";function $S(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var g=p.match(TS);g&&(n+=g.length);var w=p.lastIndexOf(DS);r=~w?p.length-w:r+p.length}function l(){var p={line:n,column:r};return function(g){return g.position=new a(p),c(),g}}function a(p){this.start=p,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(p){var g=new Error(t.source+":"+n+":"+r+": "+p);if(g.reason=p,g.filename=t.source,g.line=n,g.column=r,g.source=e,!t.silent)throw g}function u(p){var g=p.exec(e);if(g){var w=g[0];return i(w),e=e.slice(w.length),g}}function c(){u(PS)}function h(p){for(var g;g=d();)p.push(g);return p}function d(){var p=l();if(!(Vp!=e.charAt(0)||Qp!=e.charAt(1))){for(var g=2;Ni!=e.charAt(g)&&(Qp!=e.charAt(g)||Vp!=e.charAt(g+1));)++g;if(g+=2,Ni===e.charAt(g-1))return o("End of comment missing");var w=e.slice(2,g-2);return r+=2,i(w),e=e.slice(g),r+=2,p({type:zS,comment:w})}}function f(){var p=l(),g=u(RS);if(g){if(d(),!u(LS))return o("property missing ':'");var w=u(AS),y=p({type:MS,property:g[0].replace(Wp,Ni).trim(),value:w?w[0].replace(Wp,Ni).trim():Ni});return u(IS),y}}function m(){var p=[];h(p);for(var g;g=f();)p.push(g),h(p);return p}return c(),m()}function _S(e,t){let n=null;if(!e||typeof e!="string")return n;const r=$S(e),i=typeof t=="function";return r.forEach(l=>{if(l.type!=="declaration")return;const{property:a,value:o}=l;i?t(a,o,l):o&&(n=n??{},n[a]=o)}),n}const iv=lv("end"),Ih=lv("start");function lv(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function OS(e){const t=Ih(e),n=iv(e);if(t&&n)return{start:t,end:n}}function Wi(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?qp(e.position):"start"in e||"end"in e?qp(e):"line"in e||"column"in e?Jc(e):""}function Jc(e){return Gp(e&&e.line)+":"+Gp(e&&e.column)}function qp(e){return Jc(e&&e.start)+"-"+Jc(e&&e.end)}function Gp(e){return e&&typeof e=="number"?e:1}class Do extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",l={},a=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?i=t:!l.cause&&t&&(a=!0,i=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=o?o.line:void 0,this.name=Wi(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=a&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Object.defineProperties(Do.prototype,{file:{configurable:!0,enumerable:!0,value:"",writable:!0},name:{configurable:!0,enumerable:!0,value:"",writable:!0},reason:{configurable:!0,enumerable:!0,value:"",writable:!0},message:{configurable:!0,enumerable:!0,value:"",writable:!0},stack:{configurable:!0,enumerable:!0,value:"",writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});const Dh={}.hasOwnProperty,FS=new Map,US=/[A-Z]/g,BS=/-([a-z])/g,HS=new Set(["table","tbody","thead","tfoot","tr"]),WS=new Set(["td","th"]),av="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VS(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ZS(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=XS(n,t.jsx,t.jsxs)}const 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"?Ah:CS,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=ov(i,e,void 0);return l&&typeof l!="string"?l:i.create(e,i.Fragment,{children:l||void 0},void 0)}function ov(e,t,n){if(t.type==="element")return QS(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qS(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return KS(e,t,n);if(t.type==="mdxjsEsm")return GS(e,t);if(t.type==="root")return YS(e,t,n);if(t.type==="text")return JS(e,t)}function QS(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ah,e.schema=i),e.ancestors.push(t);const l=cv(e,t.tagName,!1),a=eN(e,t);let o=Mh(e,t);return HS.has(t.tagName)&&(o=o.filter(function(u){return typeof u=="string"?!gS(u):!0})),uv(e,a,l,t),zh(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function qS(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pl(e,t.position)}function GS(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pl(e,t.position)}function KS(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ah,e.schema=i),e.ancestors.push(t);const l=t.name===null?e.Fragment:cv(e,t.name,!0),a=tN(e,t),o=Mh(e,t);return uv(e,a,l,t),zh(a,o),e.ancestors.pop(),e.schema=r,e.create(t,l,a,n)}function YS(e,t,n){const r={};return zh(r,Mh(e,t)),e.create(t,e.Fragment,r,n)}function JS(e,t){return t.value}function uv(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zh(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function XS(e,t,n){return r;function r(i,l,a,o){const c=Array.isArray(a.children)?n:t;return o?c(l,a,o):c(l,a)}}function ZS(e,t){return n;function n(r,i,l,a){const o=Array.isArray(l.children),u=Ih(r);return t(i,l,a,o,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function eN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Dh.call(t.properties,i)){const l=nN(e,i,t.properties[i]);if(l){const[a,o]=l;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&WS.has(t.tagName)?r=o:n[a]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const a=l.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else pl(e,t.position);else{const{name:i}=r;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else pl(e,t.position);else l=r.value===null?!0:r.value;n[i]=l}return n}function Mh(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:FS;for(;++r<t.children.length;){const l=t.children[r];let a;if(e.passKeys){const u=l.type==="element"?l.tagName:l.type==="mdxJsxFlowElement"||l.type==="mdxJsxTextElement"?l.name:void 0;if(u){const c=i.get(u)||0;a=u+"-"+c,i.set(u,c+1)}}const o=ov(e,l,a);o!==void 0&&n.push(o)}return n}function nN(e,t,n){if(n==null||typeof n=="number"&&Number.isNaN(n))return;const r=bS(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?dS(n):ES(n)),r.property==="style"?["style",typeof n=="object"?e.stylePropertyNameCase==="dom"?n:sN(n):rN(e,String(n))]:[e.elementAttributeNameCase==="react"&&r.space?jS[r.property]||r.property:r.attribute,n]}function rN(e,t){const n={};try{_S(t,function(r,i){if(r&&i){let l=r;l.slice(0,2)!=="--"&&(l=l.toLowerCase(),e.stylePropertyNameCase==="dom"&&(l.slice(0,4)==="-ms-"&&(l=l.slice(1)),l=l.replace(BS,aN))),n[l]=i}})}catch(r){if(e.ignoreInvalidStyle)return{};const i=r,l=new Do("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=av+"#cannot-parse-style-attribute",l}return n}function cv(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let l=-1,a;for(;++l<i.length;){const o=Fp(i[l])?{type:"Identifier",name:i[l]}:{type:"Literal",value:i[l]};a=a?{type:"MemberExpression",object:a,property:o,computed:!!(l&&o.type==="Literal"),optional:!1}:o}r=a}else r=Fp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Dh.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);pl(e)}function pl(e,t){const n=new Do("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=av+"#cannot-handle-mdx-estrees-without-createevaluater",n}function sN(e){const t={};let n;for(n in e)Dh.call(e,n)&&(t[iN(n)]=e[n]);return t}function iN(e){if(e.slice(0,2)==="--")return e;let t=e.replace(US,lN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lN(e){return"-"+e.toLowerCase()}function aN(e,t){return t.toUpperCase()}const Nu={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"]},oN={};function zo(e,t){const n=oN,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return dv(e,r,i)}function dv(e,t,n){if(uN(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 Kp(e.children,t,n)}return Array.isArray(e)?Kp(e,t,n):""}function Kp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=dv(e[i],t,n);return r.join("")}function uN(e){return!!(e&&typeof e=="object")}const Yp=document.createElement("i");function $h(e){const t="&"+e+";";Yp.innerHTML=t;const n=Yp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function yn(e,t,n,r){const i=e.length;let l=0,a;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);l<r.length;)a=r.slice(l,l+1e4),a.unshift(t,0),e.splice(...a),l+=1e4,t+=1e4}function nn(e,t){return e.length>0?(yn(e,e.length,0,t),e):t}const Jp={}.hasOwnProperty;function hv(e){const t={};let n=-1;for(;++n<e.length;)cN(t,e[n]);return t}function cN(e,t){let n;for(n in t){const i=(Jp.call(e,n)?e[n]:void 0)||(e[n]={}),l=t[n];let a;if(l)for(a in l){Jp.call(i,a)||(i[a]=[]);const o=l[a];dN(i[a],Array.isArray(o)?o:o?[o]:[])}}}function dN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);yn(e,0,0,r)}function fv(e,t){const 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 vn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vt=Dr(/[A-Za-z]/),jt=Dr(/[\dA-Za-z]/),hN=Dr(/[#-'*+\--9=?A-Z^-~]/);function ro(e){return e!==null&&(e<32||e===127)}const Xc=Dr(/\d/),fN=Dr(/[\dA-Fa-f]/),pv=Dr(/[!-/:-@[-`{-~]/);function he(e){return e!==null&&e<-2}function Fe(e){return e!==null&&(e<0||e===32)}function je(e){return e===-2||e===-1||e===32}const Nl=Dr(new RegExp("\\p{P}|\\p{S}","u")),as=Dr(/\s/);function Dr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function oi(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const l=e.charCodeAt(n);let a="";if(l===37&&jt(e.charCodeAt(n+1))&&jt(e.charCodeAt(n+2)))i=2;else if(l<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(l))||(a=String.fromCharCode(l));else if(l>55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(a=String.fromCharCode(l,o),i=1):a="�"}else a=String.fromCharCode(l);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ie(e,t,n,r){const i=r?r-1:1/0;let l=0;return a;function a(u){return je(u)?(e.enter(n),o(u)):t(u)}function o(u){return je(u)&&l++<i?(e.consume(u),o):(e.exit(n),t(u))}}function mv(e,t,n,r,i,l){let a=0;return o;function o(h){return je(h)?(e.enter(r),u(h)):c(h)}function u(h){return je(h)&&a<l?(e.consume(h),a++,u):(e.exit(r),c(h))}function c(h){return a>=i?t(h):n(h)}}const pN={tokenize:mN};function mN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ie(e,t,"linePrefix")}function i(o){return e.enter("paragraph"),l(o)}function l(o){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,a(o)}function a(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return he(o)?(e.consume(o),e.exit("chunkText"),l):(e.consume(o),a)}}let so=class{constructor(){this.index=new Map,this.map=[]}add(t,n,r){Xp(this,t,n,r,!1)}addBefore(t,n,r){Xp(this,t,n,r,!0)}consume(t){if(this.map.sort(function(l,a){return l[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const l of i)t.push(l);i=r.pop()}this.map.length=0,this.index.clear()}};function Xp(e,t,n,r,i){if(n===0&&r.length===0)return;const l=e.index.get(t);if(l){l[1]+=n,i?(r.push(...l[2]),l[2]=r):l[2].push(...r);return}const a=[t,n,r];e.map.push(a),e.index.set(t,a)}const gN={tokenize:xN},Zp={tokenize:yN};function xN(e){const t=this,n=[];let r=0,i,l,a;return o;function o(v){if(r<n.length){const b=n[r];return t.containerState=b[1],e.attempt(b[0].continuation,u,c)(v)}return c(v)}function u(v){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&x();const b=t.events.length;let A=b,k;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){k=t.events[A][1].end;break}y(r);let E=b;for(;E<t.events.length;)t.events[E][1].end={...k},E++;const T=new so;return T.add(A+1,0,t.events.slice(b)),T.add(b,E-b,[]),T.consume(t.events),c(v)}return o(v)}function c(v){if(r===n.length){if(!i)return f(v);if(i.currentConstruct&&i.currentConstruct.concrete)return p(v);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zp,h,d)(v)}function h(v){return i&&x(),y(r),f(v)}function d(v){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,p(v)}function f(v){return t.containerState={},e.attempt(Zp,m,p)(v)}function m(v){return r++,n.push([t.currentConstruct,t.containerState]),f(v)}function p(v){if(v===null){i&&x(),y(0),e.consume(v);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:l}),g(v)}function g(v){if(v===null){w(e.exit("chunkFlow"),!0),y(0),e.consume(v);return}return he(v)?(e.consume(v),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(v),g)}function w(v,b){const A=t.sliceStream(v);if(b&&A.push(null),v.previous=l,l&&(l.next=v),l=v,i.defineSkip(v.start),i.write(A),t.parser.lazy[v.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<a&&(!i.events[k][1].end||i.events[k][1].end.offset>a))return;const E=t.events.length;let T=E,I,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(I){C=t.events[T][1].end;break}I=!0}for(y(r),k=E;k<t.events.length;)t.events[k][1].end={...C},k++;const R=new so;R.add(T+1,0,t.events.slice(E)),R.add(E,k-E,[]),R.consume(t.events)}}function y(v){let b=n.length;for(;b-- >v;){const A=n[b];t.containerState=A[1],A[0].exit.call(t,e)}n.length=v}function x(){i.write([null]),l=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yN(e,t,n){return Ie(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Nr(e){if(e===null||Fe(e)||as(e))return 1;if(Nl(e))return 2}function Mo(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const l=e[i].resolveAll;l&&!r.includes(l)&&(t=l(t,n),r.push(l))}return t}const Zc={name:"attention",resolveAll:vN,tokenize:jN};function vN(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]==="exit"&&e[i][1].type==="attentionSequence"&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;const l=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,a={...e[i][1].end},o={...e[n][1].start};em(a,-l),em(o,l);const u={type:l>1?"strongSequence":"emphasisSequence",start:a,end:{...e[i][1].end}},c={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:o},h={type:l>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},d={type:l>1?"strong":"emphasis",start:{...u.start},end:{...c.end}};e[i][1].end={...u.start},e[n][1].start={...c.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=nn(r,[["enter",e[i][1],t],["exit",e[i][1],t]])),r=nn(r,[["enter",d,t],["enter",u,t],["exit",u,t],["enter",h,t]]),r=nn(r,Mo(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=nn(r,[["exit",h,t],["enter",c,t],["exit",c,t],["exit",d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=nn(r,[["enter",e[n][1],t],["exit",e[n][1],t]])),yn(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function jN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Nr(r);let l;return a;function a(u){return l=u,e.enter("attentionSequence"),o(u)}function o(u){if(u===l)return e.consume(u),o;const c=e.exit("attentionSequence"),h=Nr(u),d=!h||h===2&&i||n.includes(u)&&u!==42&&u!==95,f=!i||i===2&&h||n.includes(r)&&r!==42&&r!==95;return c._open=!!(l===42?d:d&&(i||!f)),c._close=!!(l===42?f:f&&(h||!d)),t(u)}}function em(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wN={name:"autolink",tokenize:kN};function kN(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),l}function l(m){return vt(m)?(e.consume(m),a):m===64?n(m):c(m)}function a(m){return m===43||m===45||m===46||jt(m)?(r=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),r=0,u):(m===43||m===45||m===46||jt(m))&&r++<32?(e.consume(m),o):(r=0,c(m))}function u(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||ro(m)?n(m):(e.consume(m),u)}function c(m){return m===64?(e.consume(m),h):hN(m)?(e.consume(m),c):n(m)}function h(m){return jt(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,h):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||jt(m))&&r++<63){const p=m===45?f:d;return e.consume(m),p}return n(m)}}const Cl={partial:!0,tokenize:bN};function bN(e,t,n){return r;function r(l){return je(l)?Ie(e,i,"linePrefix")(l):i(l)}function i(l){return l===null||he(l)?t(l):n(l)}}const gv={continuation:{tokenize:NN},exit:CN,name:"blockQuote",tokenize:SN};function SN(e,t,n){const r=this;return i;function i(a){if(a===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),l}return n(a)}function l(a){return je(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function NN(e,t,n){const r=this;return i;function i(a){return je(a)?Ie(e,l,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):l(a)}function l(a){return e.attempt(gv,t,n)(a)}}function CN(e){e.exit("blockQuote")}const xv={name:"characterEscape",tokenize:EN};function EN(e,t,n){return r;function r(l){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(l),e.exit("escapeMarker"),i}function i(l){return pv(l)?(e.enter("characterEscapeValue"),e.consume(l),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(l)}}const yv={name:"characterReference",tokenize:TN};function TN(e,t,n){const r=this;let i=0,l,a;return o;function o(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),l=31,a=jt,h(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),l=6,a=fN,h):(e.enter("characterReferenceValue"),l=7,a=Xc,h(d))}function h(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return a===jt&&!$h(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(d)&&i++<l?(e.consume(d),h):n(d)}}const ed={partial:!0,tokenize:PN};function PN(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),l)}function l(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const tm={concrete:!0,name:"codeFenced",tokenize:RN};function RN(e,t,n){const r=this,i={partial:!0,tokenize:A};let l=0,a=0,o;return u;function u(k){return c(k)}function c(k){const E=r.events[r.events.length-1];return l=E&&E[1].type==="linePrefix"?E[2].sliceSerialize(E[1],!0).length:0,o=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(k)}function h(k){return k===o?(a++,e.consume(k),h):a<3?n(k):(e.exit("codeFencedFenceSequence"),je(k)?Ie(e,d,"whitespace")(k):d(k))}function d(k){return k===null||he(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(ed,g,b)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(k))}function f(k){return k===null||he(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):je(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ie(e,m,"whitespace")(k)):k===96&&k===o?n(k):(e.consume(k),f)}function m(k){return k===null||he(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||he(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===o?n(k):(e.consume(k),p)}function g(k){return e.attempt(i,b,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),y}function y(k){return l>0&&je(k)?Ie(e,x,"linePrefix",l+1)(k):x(k)}function x(k){return k===null||he(k)?e.check(ed,g,b)(k):(e.enter("codeFlowValue"),v(k))}function v(k){return k===null||he(k)?(e.exit("codeFlowValue"),x(k)):(e.consume(k),v)}function b(k){return e.exit("codeFenced"),t(k)}function A(k,E,T){let I=0;return C;function C(D){return k.enter("lineEnding"),k.consume(D),k.exit("lineEnding"),R}function R(D){return k.enter("codeFencedFence"),je(D)?Ie(k,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):L(D)}function L(D){return D===o?(k.enter("codeFencedFenceSequence"),M(D)):T(D)}function M(D){return D===o?(I++,k.consume(D),M):I>=a?(k.exit("codeFencedFenceSequence"),je(D)?Ie(k,U,"whitespace")(D):U(D)):T(D)}function U(D){return D===null||he(D)?(k.exit("codeFencedFence"),E(D)):T(D)}}}const Cu={name:"codeIndented",tokenize:AN},LN={partial:!0,tokenize:IN};function AN(e,t,n){return r;function r(o){return e.enter("codeIndented"),mv(e,i,n,"linePrefix",4,4)(o)}function i(o){return o===null?a(o):he(o)?e.attempt(LN,i,a)(o):(e.enter("codeFlowValue"),l(o))}function l(o){return o===null||he(o)?(e.exit("codeFlowValue"),i(o)):(e.consume(o),l)}function a(o){return e.exit("codeIndented"),t(o)}}function IN(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):he(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):mv(e,t,l,"linePrefix",4,4)(a)}function l(a){return he(a)?i(a):n(a)}}const DN={name:"codeText",previous:MN,resolve:zN,tokenize:$N};function zN(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 MN(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $N(e,t,n){let r=0,i,l;return a;function a(d){return e.enter("codeText"),e.enter("codeTextSequence"),o(d)}function o(d){return d===96?(e.consume(d),r++,o):(e.exit("codeTextSequence"),u(d))}function u(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),u):d===96?(l=e.enter("codeTextSequence"),i=0,h(d)):he(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||he(d)?(e.exit("codeTextData"),u(d)):(e.consume(d),c)}function h(d){return d===96?(e.consume(d),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(l.type="codeTextData",c(d))}}class _N{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ci(this.left,r),l.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ci(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ci(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ci(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ci(this.left,n.reverse())}}}function Ci(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 vv(e){const t={};let n=-1,r,i,l,a,o,u,c;const h=new _N(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,l=0,l<u.length&&u[l][1].type==="lineEndingBlank"&&(l+=2),l<u.length&&u[l][1].type==="content"))for(;++l<u.length&&u[l][1].type!=="content";)u[l][1].type==="chunkText"&&(u[l][1]._isInFirstContentOfListItem=!0,l++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ON(h,n)),n=t[n],c=!0);else if(r[1]._container){for(l=n,i=void 0;l--;)if(a=h.get(l),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),a[1].type="lineEnding",i=l);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},o=h.slice(i,n),o.unshift(r),h.splice(i,n-i+1,o))}}return yn(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!c}function ON(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const l=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const o=a.events,u=[],c={};let h,d,f=-1,m=n,p=0,g=0;const w=[g];for(;m;){for(;e.get(++i)[1]!==m;);l.push(i),m._tokenizer||(h=r.sliceStream(m),m.next||h.push(null),d&&a.defineSkip(m.start),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(h),m._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++f<o.length;)o[f][0]==="exit"&&o[f-1][0]==="enter"&&o[f][1].type===o[f-1][1].type&&o[f][1].start.line!==o[f][1].end.line&&(g=f+1,w.push(g),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(a.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),f=w.length;f--;){const y=o.slice(w[f],w[f+1]),x=l.pop();u.push([x,x+y.length-1]),e.splice(x,2,y)}for(u.reverse(),f=-1;++f<u.length;)c[p+u[f][0]]=p+u[f][1],p+=u[f][1]-u[f][0]-1;return c}const FN={resolve:BN,tokenize:HN},UN={partial:!0,tokenize:WN};function BN(e){return vv(e),e}function HN(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(o)}function i(o){return o===null?l(o):he(o)?e.check(UN,a,l)(o):(e.consume(o),i)}function l(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function a(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function WN(e,t,n){const r=this;return i;function i(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ie(e,l,"linePrefix")}function l(a){if(a===null||he(a))return n(a);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function jv(e,t,n,r,i,l,a,o,u){const c=u||Number.POSITIVE_INFINITY;let h=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(l),e.consume(y),e.exit(l),f):y===null||y===32||y===41||ro(y)?n(y):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),g(y))}function f(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===62?(e.exit("chunkString"),e.exit(o),f(y)):y===null||y===60||he(y)?n(y):(e.consume(y),y===92?p:m)}function p(y){return y===60||y===62||y===92?(e.consume(y),m):m(y)}function g(y){return!h&&(y===null||y===41||Fe(y))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(y)):h<c&&y===40?(e.consume(y),h++,g):y===41?(e.consume(y),h--,g):y===null||y===32||y===40||ro(y)?n(y):(e.consume(y),y===92?w:g)}function w(y){return y===40||y===41||y===92?(e.consume(y),g):g(y)}}function wv(e,t,n,r,i,l){const a=this;let o=0,u;return c;function c(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(l),h}function h(m){return o>999||m===null||m===91||m===93&&!u||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(l),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):he(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||he(m)||o++>999?(e.exit("chunkString"),h(m)):(e.consume(m),u||(u=!je(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function kv(e,t,n,r,i,l){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,u):n(f)}function u(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(l),c(f))}function c(f){return f===a?(e.exit(l),u(a)):f===null?n(f):he(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ie(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||he(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(e.consume(f),h):h(f)}}function Vi(e,t){let n;return r;function r(i){return he(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):je(i)?Ie(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const VN={name:"definition",tokenize:qN},QN={partial:!0,tokenize:GN};function qN(e,t,n){const r=this;let i;return l;function l(m){return e.enter("definition"),a(m)}function a(m){return wv.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),u):n(m)}function u(m){return Fe(m)?Vi(e,c)(m):c(m)}function c(m){return jv(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(QN,d,d)(m)}function d(m){return je(m)?Ie(e,f,"whitespace")(m):f(m)}function f(m){return m===null||he(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function GN(e,t,n){return r;function r(o){return Fe(o)?Vi(e,i)(o):n(o)}function i(o){return kv(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return je(o)?Ie(e,a,"whitespace")(o):a(o)}function a(o){return o===null||he(o)?t(o):n(o)}}const KN={name:"hardBreakEscape",tokenize:YN};function YN(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),i}function i(l){return he(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const JN={name:"headingAtx",resolve:XN,tokenize:ZN};function XN(e,t){let n=e.length-2,r=3;if(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){const i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"};yn(e,r,n-r+1,[["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t]])}return e}function ZN(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),l(h)}function l(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Fe(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),u(h)):h===null||he(h)?(e.exit("atxHeading"),t(h)):je(h)?Ie(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function u(h){return h===35?(e.consume(h),u):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Fe(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const bv=["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"],td=["pre","script","style","textarea"],eC={concrete:!0,name:"htmlFlow",resolveTo:nC,tokenize:rC},tC={partial:!0,tokenize:sC};function nC(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 rC(e,t,n){const r=this;let i,l,a,o,u;return c;function c(N){return h(N)}function h(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),f):N===47?(e.consume(N),l=!0,g):N===63?(e.consume(N),i=3,r.interrupt?t:S):vt(N)?(e.consume(N),a=String.fromCharCode(N),w):n(N)}function f(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,o=0,p):vt(N)?(e.consume(N),i=4,r.interrupt?t:S):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:S):n(N)}function p(N){const F="CDATA[";return N===F.charCodeAt(o++)?(e.consume(N),o===F.length?r.interrupt?t:L:p):n(N)}function g(N){return vt(N)?(e.consume(N),a=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||Fe(N)){const F=N===47,Z=a.toLowerCase();return!F&&!l&&td.includes(Z)?(i=1,r.interrupt?t(N):L(N)):bv.includes(a.toLowerCase())?(i=6,F?(e.consume(N),y):r.interrupt?t(N):L(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):l?x(N):v(N))}return N===45||jt(N)?(e.consume(N),a+=String.fromCharCode(N),w):n(N)}function y(N){return N===62?(e.consume(N),r.interrupt?t:L):n(N)}function x(N){return je(N)?(e.consume(N),x):C(N)}function v(N){return N===47?(e.consume(N),C):N===58||N===95||vt(N)?(e.consume(N),b):je(N)?(e.consume(N),v):C(N)}function b(N){return N===45||N===46||N===58||N===95||jt(N)?(e.consume(N),b):A(N)}function A(N){return N===61?(e.consume(N),k):je(N)?(e.consume(N),A):v(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),u=N,E):je(N)?(e.consume(N),k):T(N)}function E(N){return N===u?(e.consume(N),u=null,I):N===null||he(N)?n(N):(e.consume(N),E)}function T(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Fe(N)?A(N):(e.consume(N),T)}function I(N){return N===47||N===62||je(N)?v(N):n(N)}function C(N){return N===62?(e.consume(N),R):n(N)}function R(N){return N===null||he(N)?L(N):je(N)?(e.consume(N),R):n(N)}function L(N){return N===45&&i===2?(e.consume(N),q):N===60&&i===1?(e.consume(N),J):N===62&&i===4?(e.consume(N),ae):N===63&&i===3?(e.consume(N),S):N===93&&i===5?(e.consume(N),X):he(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(tC,O,M)(N)):N===null||he(N)?(e.exit("htmlFlowData"),M(N)):(e.consume(N),L)}function M(N){return e.check(ed,U,O)(N)}function U(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),D}function D(N){return N===null||he(N)?M(N):(e.enter("htmlFlowData"),L(N))}function q(N){return N===45?(e.consume(N),S):L(N)}function J(N){return N===47?(e.consume(N),a="",B):L(N)}function B(N){if(N===62){const F=a.toLowerCase();return td.includes(F)?(e.consume(N),ae):L(N)}return vt(N)&&a.length<8?(e.consume(N),a+=String.fromCharCode(N),B):L(N)}function X(N){return N===93?(e.consume(N),S):L(N)}function S(N){return N===62?(e.consume(N),ae):N===45&&i===2?(e.consume(N),S):L(N)}function ae(N){return N===null||he(N)?(e.exit("htmlFlowData"),O(N)):(e.consume(N),ae)}function O(N){return e.exit("htmlFlow"),t(N)}}function sC(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Cl,t,n)}}const iC={name:"htmlText",tokenize:lC};function lC(e,t,n){const r=this;let i,l,a;return o;function o(S){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(S),u}function u(S){return S===33?(e.consume(S),c):S===47?(e.consume(S),A):S===63?(e.consume(S),v):vt(S)?(e.consume(S),T):n(S)}function c(S){return S===45?(e.consume(S),h):S===91?(e.consume(S),l=0,p):vt(S)?(e.consume(S),x):n(S)}function h(S){return S===45?(e.consume(S),m):n(S)}function d(S){return S===null?n(S):S===45?(e.consume(S),f):he(S)?(a=d,J(S)):(e.consume(S),d)}function f(S){return S===45?(e.consume(S),m):d(S)}function m(S){return S===62?q(S):S===45?f(S):d(S)}function p(S){const ae="CDATA[";return S===ae.charCodeAt(l++)?(e.consume(S),l===ae.length?g:p):n(S)}function g(S){return S===null?n(S):S===93?(e.consume(S),w):he(S)?(a=g,J(S)):(e.consume(S),g)}function w(S){return S===93?(e.consume(S),y):g(S)}function y(S){return S===62?q(S):S===93?(e.consume(S),y):g(S)}function x(S){return S===null||S===62?q(S):he(S)?(a=x,J(S)):(e.consume(S),x)}function v(S){return S===null?n(S):S===63?(e.consume(S),b):he(S)?(a=v,J(S)):(e.consume(S),v)}function b(S){return S===62?q(S):v(S)}function A(S){return vt(S)?(e.consume(S),k):n(S)}function k(S){return S===45||jt(S)?(e.consume(S),k):E(S)}function E(S){return he(S)?(a=E,J(S)):je(S)?(e.consume(S),E):q(S)}function T(S){return S===45||jt(S)?(e.consume(S),T):S===47||S===62||Fe(S)?I(S):n(S)}function I(S){return S===47?(e.consume(S),q):S===58||S===95||vt(S)?(e.consume(S),C):he(S)?(a=I,J(S)):je(S)?(e.consume(S),I):q(S)}function C(S){return S===45||S===46||S===58||S===95||jt(S)?(e.consume(S),C):R(S)}function R(S){return S===61?(e.consume(S),L):he(S)?(a=R,J(S)):je(S)?(e.consume(S),R):I(S)}function L(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),i=S,M):he(S)?(a=L,J(S)):je(S)?(e.consume(S),L):(e.consume(S),U)}function M(S){return S===i?(e.consume(S),i=void 0,D):S===null?n(S):he(S)?(a=M,J(S)):(e.consume(S),M)}function U(S){return S===null||S===34||S===39||S===60||S===61||S===96?n(S):S===47||S===62||Fe(S)?I(S):(e.consume(S),U)}function D(S){return S===47||S===62||Fe(S)?I(S):n(S)}function q(S){return S===62?(e.consume(S),e.exit("htmlTextData"),e.exit("htmlText"),t):n(S)}function J(S){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),B}function B(S){return je(S)?Ie(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):X(S)}function X(S){return e.enter("htmlTextData"),a(S)}}const _h={name:"labelEnd",resolveAll:cC,resolveTo:dC,tokenize:hC},aC={tokenize:fC},oC={tokenize:pC},uC={tokenize:mC};function cC(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&yn(e,0,e.length,n),e}function dC(e,t){let n=e.length,r=0,i,l,a;for(;n--;){const h=e[n][1];if(i){if(h.type==="link"||h.type==="labelLink"&&h._inactive)break;e[n][0]==="enter"&&h.type==="labelLink"&&(h._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(h.type==="labelImage"||h.type==="labelLink")&&!h._balanced&&(i=n,h.type!=="labelLink")){r=2;break}}else h.type==="labelEnd"&&(l=n)}const o={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[l][1].end}},c={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",o,t],["enter",u,t]],a=nn(a,e.slice(i+1,i+r+3)),a=nn(a,[["enter",c,t]]),a=nn(a,Mo(t.parser.constructs.insideSpan.null,e.slice(i+r+4,l-3),t)),a=nn(a,[["exit",c,t],e[l-2],e[l-1],["exit",u,t]]),a=nn(a,e.slice(l+1)),a=nn(a,[["exit",o,t]]),yn(e,i,e.length,a),e}function hC(e,t,n){const r=this,i=r._labelStarts;let l,a;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();l=i[i.length-1]}return o;function o(f){return l?l._inactive?d(f):(a=r.parser.defined.includes(vn(r.sliceSerialize({start:l.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),u):n(f)}function u(f){return f===40?e.attempt(aC,h,a?h:d)(f):f===91?e.attempt(oC,h,a?c:d)(f):a?h(f):d(f)}function c(f){return e.attempt(uC,h,d)(f)}function h(f){return i.pop(),t(f)}function d(f){return l._balanced=!0,n(f)}}function fC(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Fe(d)?Vi(e,l)(d):l(d)}function l(d){return d===41?h(d):jv(e,a,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function a(d){return Fe(d)?Vi(e,u)(d):h(d)}function o(d){return n(d)}function u(d){return d===34||d===39||d===40?kv(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):h(d)}function c(d){return Fe(d)?Vi(e,h)(d):h(d)}function h(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function pC(e,t,n){const r=this;return i;function i(o){return wv.call(r,e,l,a,"reference","referenceMarker","referenceString")(o)}function l(o){return r.parser.defined.includes(vn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function a(o){return n(o)}}function mC(e,t,n){return r;function r(l){return e.enter("reference"),e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),i}function i(l){return l===93?(e.enter("referenceMarker"),e.consume(l),e.exit("referenceMarker"),e.exit("reference"),t):n(l)}}const gC={name:"labelStartImage",resolveAll:_h.resolveAll,tokenize:xC};function xC(e,t,n){const r=this;let i;return l;function l(u){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(u),e.exit("labelImageMarker"),a}function a(u){return u===91?(e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),i=e.exit("labelImage"),o):n(u)}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(u))}}const yC={name:"labelStartLink",resolveAll:_h.resolveAll,tokenize:vC};function vC(e,t,n){const r=this;let i;return l;function l(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),i=e.exit("labelLink"),a}function a(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(o))}}const Eu={name:"lineEnding",tokenize:jC};function jC(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ie(e,t,"linePrefix")}}const Na={name:"thematicBreak",tokenize:wC};function wC(e,t,n){let r=0,i;return l;function l(c){return e.enter("thematicBreak"),a(c)}function a(c){return i=c,o(c)}function o(c){return c===i?(e.enter("thematicBreakSequence"),u(c)):r>=3&&(c===null||he(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),je(c)?Ie(e,o,"whitespace")(c):o(c))}}const It={continuation:{tokenize:NC},exit:EC,name:"list",tokenize:SC},kC={partial:!0,tokenize:TC},bC={partial:!0,tokenize:CC};function SC(e,t,n){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return o;function o(m){const p=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Xc(m)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(Na,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(m)}return n(m)}function u(m){return Xc(m)&&++a<10?(e.consume(m),u):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Cl,r.interrupt?n:h,e.attempt(kC,f,d))}function h(m){return r.containerState.initialBlankLine=!0,l++,f(m)}function d(m){return je(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function NC(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Cl,i,l);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ie(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!je(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bC,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ie(e,e.attempt(It,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function CC(e,t,n){const r=this;return Ie(e,i,"listItemIndent",r.containerState.size+1);function i(l){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(l):n(l)}}function EC(e){e.exit(this.containerState.type)}function TC(e,t,n){const r=this;return Ie(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(l){const a=r.events[r.events.length-1];return!je(l)&&a&&a[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const nm={name:"setextUnderline",resolveTo:PC,tokenize:RC};function PC(e,t){const n=new so;let r=e.length,i,l,a;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){i=r;break}e[r][1].type==="paragraph"&&(l=r)}else e[r][1].type==="content"&&n.add(r,1,[]),!a&&e[r][1].type==="definition"&&(a=r);const o={type:"setextHeading",start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",a?(n.add(l,0,[["enter",o,t]]),n.add(a+1,0,[["exit",e[i][1],t]]),e[i][1].end={...e[a][1].end}):e[i][1]=o,n.add(e.length,0,[["exit",o,t]]),n.consume(e),e}function RC(e,t,n){const r=this;let i;return l;function l(c){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,a(c)):n(c)}function a(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===i?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),je(c)?Ie(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||he(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const LC={tokenize:AC};function AC(e){const t=this,n=e.attempt(Cl,r,e.attempt(this.parser.constructs.flowInitial,i,Ie(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FN,i)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const IC={resolveAll:Nv()},DC=Sv("string"),zC=Sv("text");function Sv(e){return{resolveAll:Nv(e==="text"?MC:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],l=n.attempt(i,a,o);return a;function a(h){return c(h)?l(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),u}function u(h){return c(h)?(n.exit("data"),l(h)):(n.consume(h),u)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f<d.length;){const m=d[f];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function Nv(e){return t;function t(n,r){let i=-1,l;for(;++i<=n.length;)l===void 0?n[i]&&n[i][1].type==="data"&&(l=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==l+2&&(n[l][1].end=n[i-1][1].end,n.splice(l+2,i-l-2),i=l+2),l=void 0);return e?e(n,r):n}}function MC(e,t){const n=new so;let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const i=e[r-1][1],l=t.sliceStream(i);let a=l.length,o=-1,u=0,c;for(;a--;){const h=l[a];if(typeof h=="string"){for(o=h.length;h.charCodeAt(o-1)===32;)u++,o--;if(o)break;o=-1}else if(h===-2)c=!0,u++;else if(h!==-1){a++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(u=0),u){const h={type:r===e.length||c||u<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?o:i.start._bufferIndex+o,_index:i.start._index+a,line:i.end.line,column:i.end.column-u,offset:i.end.offset-u},end:{...i.end}};i.end={...h.start},i.start.offset===i.end.offset?Object.assign(i,h):n.add(r,0,[["enter",h,t],["exit",h,t]])}r++}return n.consume(e),e}const $C={42:It,43:It,45:It,48:It,49:It,50:It,51:It,52:It,53:It,54:It,55:It,56:It,57:It,62:gv},_C={91:VN},OC={[-2]:Cu,[-1]:Cu,32:Cu},FC={35:JN,42:Na,45:[nm,Na],60:eC,61:nm,95:Na,96:tm,126:tm},UC={38:yv,92:xv},BC={[-5]:Eu,[-4]:Eu,[-3]:Eu,33:gC,38:yv,42:Zc,60:[wN,iC],91:yC,92:[KN,xv],93:_h,95:Zc,96:DN},HC={null:[Zc,IC]},WC={null:[42,95]},VC={null:[]},QC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:WC,contentInitial:_C,disable:VC,document:$C,flow:FC,flowInitial:OC,insideSpan:HC,string:UC,text:BC},Symbol.toStringTag,{value:"Module"}));function qC(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},l=[];let a=[],o=[];const u={attempt:E(A),check:E(k),consume:x,enter:v,exit:b,interrupt:E(k,{interrupt:!0})},c={code:null,containerState:{},defineSkip:g,events:[],now:p,parser:e,previous:null,sliceSerialize:f,sliceStream:m,write:d};let h=t.tokenize.call(c,u);return t.resolveAll&&l.push(t),c;function d(R){return a=nn(a,R),w(),a[a.length-1]!==null?[]:(T(t,0),c.events=Mo(l,c.events,c),c.events)}function f(R,L){return KC(m(R),L)}function m(R){return GC(a,R)}function p(){const{_bufferIndex:R,_index:L,line:M,column:U,offset:D}=r;return{_bufferIndex:R,_index:L,line:M,column:U,offset:D}}function g(R){i[R.line]=R.column,C()}function w(){for(;r._index<a.length;){const R=a[r._index];if(typeof R=="string"){const L=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===L&&r._bufferIndex<R.length;)y(R.charCodeAt(r._bufferIndex))}else y(R)}}function y(R){h=h(R)}function x(R){he(R)?(r.line++,r.column=1,r.offset+=R===-3?2:1,C()):R!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=R}function v(R,L){const M=L||{};return M.type=R,M.start=p(),c.events.push(["enter",M,c]),o.push(M),M}function b(R){const L=o.pop();return L.end=p(),c.events.push(["exit",L,c]),L}function A(R,L){T(R,L.from)}function k(R,L){L.restore()}function E(R,L){return M;function M(U,D,q){let J,B,X,S;return Array.isArray(U)?O(U):"tokenize"in U?O([U]):ae(U);function ae(ce){return Te;function Te(tt){const W=tt!==null&&ce[tt],ge=tt!==null&&ce.null,V=[...Array.isArray(W)?W:W?[W]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return O(V)(tt)}}function O(ce){return J=ce,B=0,ce.length===0?q:N(ce[B])}function N(ce){return Te;function Te(tt){return S=I(),X=ce,ce.partial||(c.currentConstruct=ce),ce.name&&c.parser.constructs.disable.null.includes(ce.name)?Z():ce.tokenize.call(L?Object.assign(Object.create(c),L):c,u,F,Z)(tt)}}function F(ce){return R(X,S),D}function Z(ce){return S.restore(),++B<J.length?N(J[B]):q}}}function T(R,L){R.resolveAll&&!l.includes(R)&&l.push(R),R.resolve&&yn(c.events,L,c.events.length-L,R.resolve(c.events.slice(L),c)),R.resolveTo&&(c.events=R.resolveTo(c.events,c))}function I(){const R=p(),L=c.previous,M=c.currentConstruct,U=c.events.length,D=Array.from(o);return{from:U,restore:q};function q(){r=R,c.previous=L,c.currentConstruct=M,c.events.length=U,o=D,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function GC(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,l=t.end._bufferIndex;let a;if(n===i)a=[e[n].slice(r,l)];else{if(a=e.slice(n,i),r>-1){const o=a[0];typeof o=="string"?a[0]=o.slice(r):a.shift()}l>0&&a.push(e[i].slice(0,l))}return a}function KC(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const l=e[n];let a;if(typeof l=="string")a=l;else switch(l){case-5:{a="\r";break}case-4:{a=`
362
362
  `;break}case-3:{a=`\r
363
363
  `;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&i)continue;a=" ";break}default:a=String.fromCharCode(l)}i=l===-2,r.push(a)}return r.join("")}function YC(e){const r={constructs:hv([QC,...(e||{}).extensions||[]]),content:i(pN),defined:[],document:i(gN),flow:i(LC),lazy:{},string:i(DC),text:i(zC)};return r;function i(l){return a;function a(o){return qC(r,l,o)}}}function JC(e){for(;!vv(e););return e}const rm=/[\0\t\n\r]/g;function XC(){let e=1,t="",n=!0,r;return i;function i(l,a,o){l=t+(typeof l=="string"?l.toString():new TextDecoder(a||void 0).decode(l));const u=[];let c=0;for(t="",n&&(l.charCodeAt(0)===65279&&c++,n=void 0);c<l.length;){rm.lastIndex=c;const h=rm.exec(l),d=h&&h.index!==void 0?h.index:l.length,f=l.charCodeAt(d);if(!h){t=l.slice(c);break}if(f===10&&c===d&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<d&&(u.push(l.slice(c,d)),e+=d-c),f){case 0:{u.push(65533),e++;break}case 9:{const m=Math.ceil(e/4)*4;for(u.push(-2);e++<m;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=d+1}return o&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const ZC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eE(e){return e.replace(ZC,tE)}function tE(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),l=i===120||i===88;return fv(n.slice(l?2:1),l?16:10)}return $h(n)||e}const Cv={}.hasOwnProperty;function nE(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),rE(n)(JC(YC(n).document().write(XC()(e,t,!0))))}function rE(e){const t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Rl),autolinkProtocol:C,autolinkEmail:C,atxHeading:a(ee),blockQuote:a(V),characterEscape:C,characterReference:C,codeFenced:a(de),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(de,o),codeText:a(ve,o),codeTextData:C,data:C,codeFlowValue:C,definition:a(ct),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(Zt),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(Ze,o),htmlFlowData:C,htmlText:a(Ze,o),htmlTextData:C,image:a(zr),label:o,link:a(Rl),listItem:a(Ho),listItemValue:m,listOrdered:a(Ll,f),listUnordered:a(Ll),paragraph:a(zn),reference:F,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ee),strong:a(Mr),thematicBreak:a(ci)},exit:{atxHeading:c(),atxHeadingSequence:k,autolink:c(),autolinkEmail:ge,autolinkProtocol:W,blockQuote:c(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:Te,characterReference:tt,codeFenced:c(y),codeFencedFence:w,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:c(x),codeText:c(q),codeTextData:R,data:R,definition:c(),definitionDestinationString:A,definitionLabelString:v,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(M),hardBreakTrailing:c(M),htmlFlow:c(U),htmlFlowData:R,htmlText:c(D),htmlTextData:R,image:c(B),label:S,labelText:X,lineEnding:L,link:c(J),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:Z,resourceDestinationString:ae,resourceTitleString:O,resource:N,setextHeading:c(I),setextHeadingLineSequence:T,setextHeadingText:E,strong:c(),thematicBreak:c()}};Ev(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(_){let G={type:"root",children:[],position:void 0};const fe={stack:[G],tokenStack:[],config:t,enter:u,exit:h,buffer:o,resume:d,data:n},pe=[],bt=[];let Ee=-1;for(;++Ee<_.length;)if(bt.push(_[Ee]),_[Ee][1].type==="listOrdered"||_[Ee][1].type==="listUnordered")if(_[Ee][0]==="enter")pe.push(bt.length-1);else{const pt=pe.pop();l(bt,pt)}for(_=bt,Ee=-1;++Ee<_.length;){const pt=t[_[Ee][0]];_[Ee][0]==="enter"&&t.beforeEnter.length>0&&i(t.beforeEnter,{...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1]),Cv.call(pt,_[Ee][1].type)&&pt[_[Ee][1].type].call({...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1]),_[Ee][0]==="exit"&&t.afterExit.length>0&&i(t.afterExit,{...fe,sliceSerialize:_[Ee][2].sliceSerialize},_[Ee][1])}if(fe.tokenStack.length>0){const pt=fe.tokenStack[fe.tokenStack.length-1];(pt[1]||sm).call(fe,void 0,pt[0])}for(G.position={start:tr(_.length>0?_[0][1].start:{line:1,column:1,offset:0}),end:tr(_.length>0?_[_.length-2][1].end:{line:1,column:1,offset:0})},Ee=-1;++Ee<t.transforms.length;)G=t.transforms[Ee](G)||G;return G}function i(_,G,fe){let pe=-1;for(;++pe<_.length;)_[pe].call(G,fe)}function l(_,G){const fe=_.length-1;let pe=G-1,bt=-1,Ee=!1,pt,Bt,Xn,$r;const Zn=[];for(;++pe<=fe;){const mt=_[pe];switch(mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{mt[0]==="enter"?bt++:bt--,$r=void 0;break}case"lineEndingBlank":{mt[0]==="enter"&&(pt&&!$r&&!bt&&!Xn&&(Xn=pe),$r=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$r=void 0}if(!bt&&mt[0]==="enter"&&mt[1].type==="listItemPrefix"||bt===-1&&mt[0]==="exit"&&(mt[1].type==="listUnordered"||mt[1].type==="listOrdered")){if(pt){let bn=pe;for(Bt=void 0;bn--;){const cn=_[bn];if(cn[1].type==="lineEnding"||cn[1].type==="lineEndingBlank"){if(cn[0]==="exit")continue;Bt&&(_[Bt][1].type="lineEndingBlank",Ee=!0),cn[1].type="lineEnding",Bt=bn}else if(!(cn[1].type==="linePrefix"||cn[1].type==="blockQuotePrefix"||cn[1].type==="blockQuotePrefixWhitespace"||cn[1].type==="blockQuoteMarker"||cn[1].type==="listItemIndent"))break}Xn&&(!Bt||Xn<Bt)&&(pt._spread=!0),pt.end=Object.assign({},Bt?_[Bt][1].start:mt[1].end),Zn.push({at:Bt||pe,event:["exit",pt,mt[2]]})}if(mt[1].type==="listItemPrefix"){const bn={type:"listItem",_spread:!1,start:Object.assign({},mt[1].start),end:void 0};pt=bn,Zn.push({at:pe,event:["enter",bn,mt[2]]}),Xn=void 0,$r=!0}}}const _r=_.splice(G);let ms=0;for(pe=-1;++pe<_r.length;){for(;ms<Zn.length&&Zn[ms].at===G+pe;)_.push(Zn[ms++].event);_.push(_r[pe])}_[G][1]._spread=Ee}function a(_,G){return fe;function fe(pe){u.call(this,_(pe),pe),G&&G.call(this,pe)}}function o(){this.stack.push({type:"fragment",children:[]})}function u(_,G,fe){this.stack[this.stack.length-1].children.push(_),this.stack.push(_),this.tokenStack.push([G,fe||void 0]),_.position={start:tr(G.start),end:void 0}}function c(_){return G;function G(fe){_&&_.call(this,fe),h.call(this,fe)}}function h(_,G){const fe=this.stack.pop(),pe=this.tokenStack.pop();if(!pe)throw new Error("Cannot close `"+_.type+"` ("+Wi({start:_.start,end:_.end})+"): it’s not open");pe[0].type!==_.type&&(G?G.call(this,_,pe[0]):(pe[1]||sm).call(this,_,pe[0])),fe.position.end=tr(_.end)}function d(){return zo(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m(_){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(_),10),this.data.expectingFirstListItemValue=void 0}}function p(){const _=this.resume(),G=this.stack[this.stack.length-1];G.lang=_}function g(){const _=this.resume(),G=this.stack[this.stack.length-1];G.meta=_}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_.replace(/(\r?\n|\r)$/g,"")}function v(_){const G=this.resume(),fe=this.stack[this.stack.length-1];fe.label=G,fe.identifier=vn(this.sliceSerialize(_)).toLowerCase()}function b(){const _=this.resume(),G=this.stack[this.stack.length-1];G.title=_}function A(){const _=this.resume(),G=this.stack[this.stack.length-1];G.url=_}function k(_){const G=this.stack[this.stack.length-1];if(!G.depth){const fe=this.sliceSerialize(_).length;G.depth=fe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function T(_){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(_).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function C(_){const fe=this.stack[this.stack.length-1].children;let pe=fe[fe.length-1];(!pe||pe.type!=="text")&&(pe=Al(),pe.position={start:tr(_.start),end:void 0},fe.push(pe)),this.stack.push(pe)}function R(_){const G=this.stack.pop();G.value+=this.sliceSerialize(_),G.position.end=tr(_.end)}function L(_){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const fe=G.children[G.children.length-1];fe.position.end=tr(_.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(C.call(this,_),R.call(this,_))}function M(){this.data.atHardBreak=!0}function U(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function D(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function q(){const _=this.resume(),G=this.stack[this.stack.length-1];G.value=_}function J(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=G,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function B(){const _=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";_.type+="Reference",_.referenceType=G,delete _.url,delete _.title}else delete _.identifier,delete _.label;this.data.referenceType=void 0}function X(_){const G=this.sliceSerialize(_),fe=this.stack[this.stack.length-2];fe.label=eE(G),fe.identifier=vn(G).toLowerCase()}function S(){const _=this.stack[this.stack.length-1],G=this.resume(),fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,fe.type==="link"){const pe=_.children;fe.children=pe}else fe.alt=G}function ae(){const _=this.resume(),G=this.stack[this.stack.length-1];G.url=_}function O(){const _=this.resume(),G=this.stack[this.stack.length-1];G.title=_}function N(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function Z(_){const G=this.resume(),fe=this.stack[this.stack.length-1];fe.label=G,fe.identifier=vn(this.sliceSerialize(_)).toLowerCase(),this.data.referenceType="full"}function ce(_){this.data.characterReferenceType=_.type}function Te(_){const G=this.sliceSerialize(_),fe=this.data.characterReferenceType;let pe;fe?(pe=fv(G,fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):pe=$h(G);const bt=this.stack[this.stack.length-1];bt.value+=pe}function tt(_){const G=this.stack.pop();G.position.end=tr(_.end)}function W(_){R.call(this,_);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(_)}function ge(_){R.call(this,_);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(_)}function V(){return{type:"blockquote",children:[],position:void 0}}function de(){return{type:"code",lang:null,meta:null,value:"",position:void 0}}function ve(){return{type:"inlineCode",value:"",position:void 0}}function ct(){return{type:"definition",identifier:"",label:null,title:null,url:"",position:void 0}}function Zt(){return{type:"emphasis",children:[],position:void 0}}function ee(){return{type:"heading",depth:0,children:[],position:void 0}}function Ce(){return{type:"break",position:void 0}}function Ze(){return{type:"html",value:"",position:void 0}}function zr(){return{type:"image",title:null,url:"",alt:null,position:void 0}}function Rl(){return{type:"link",title:null,url:"",children:[],position:void 0}}function Ll(_){return{type:"list",ordered:_.type==="listOrdered",start:null,spread:_._spread,children:[],position:void 0}}function Ho(_){return{type:"listItem",spread:_._spread,checked:null,children:[],position:void 0}}function zn(){return{type:"paragraph",children:[],position:void 0}}function Mr(){return{type:"strong",children:[],position:void 0}}function Al(){return{type:"text",value:"",position:void 0}}function ci(){return{type:"thematicBreak",position:void 0}}}function tr(e){return{line:e.line,column:e.column,offset:e.offset}}function Ev(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ev(e,r):sE(e,r)}}function sE(e,t){let n;for(n in t)if(Cv.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"afterExit":case"beforeEnter":{const r=t[n];r&&e[n].push(r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function sm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wi({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wi({start:t.start,end:t.end})+") is still open")}function iE(e){const t=this;t.parser=n;function n(r){return nE(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function lE(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function aE(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
package/web/index.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Agent Studio (v0.1.8)</title>
6
+ <title>Agent Studio (v0.1.9)</title>
7
7
  <meta name="description" content="QA agents: turn test-case specs into verified Playwright tests." />
8
8
  <meta name="theme-color" content="#1a1135" />
9
9
  <link rel="manifest" href="/manifest.webmanifest" />
@@ -13,7 +13,7 @@
13
13
  <link rel="preconnect" href="https://fonts.googleapis.com" />
14
14
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
15
15
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
16
- <script type="module" crossorigin src="/assets/index-Dqp_mt_p.js"></script>
16
+ <script type="module" crossorigin src="/assets/index-BvXh5Y31.js"></script>
17
17
  <link rel="stylesheet" crossorigin href="/assets/index-BalnEIdq.css">
18
18
  </head>
19
19
  <body>