refactor(ui): build settings, org, task, workflow and dashboard pages from the shared components

This commit is contained in:
sam committed 2026-10-24 12:34:29 +11:00
1 parent 5fdd968fca
commit 0a8465e687
77 files changed
+505 -744

No files matched your search

+1 -1
View File
@@ -1 +1 @@
import{A as e,C as t,Ct as n,D as r,M as i,S as a,Tt as o,Xt as s,_t as c,b as l,dt as u,ir as d,jn as f,k as p,l as m,t as h,x as g,xn as _,y as v}from"./PageHeader.js";import{M as y,at as b,r as x}from"./createLucideIcon.js";import{t as S}from"./input.js";import{F as C,I as w,P as T,g as E,j as D,y as O}from"./index.js";var k={key:0,class:`text-fg-subtle`},A={key:1,role:`alert`,class:`mb-3 text-danger`},j={key:2,class:`mb-3 rounded-lg border border-border p-3`},M={key:3,class:`text-fg-subtle`},N={key:4,class:`divide-y divide-border`,"aria-label":`API tokens`},P={class:`flex-1 truncate text-xs`},F={class:`text-xs text-fg-subtle`},I=i({__name:`PersonalTokensCard`,setup(i){let o=_(!1),h=_([]),v=_(``),b=_(``),C=_(!1);async function w(e){C.value=!0;try{await e(),b.value=``}catch(e){b.value=String(e.message||e)}finally{C.value=!1}}let T=()=>w(async()=>{let e=await x.tokens();o.value=e?.available??!1,h.value=e?.tokens??[]}),O=()=>w(async()=>{v.value=(await x.createToken())?.token??``,await T()}),I=e=>w(async()=>{await x.revokeToken(e),await T()});return u(T),(i,u)=>(c(),g(f(E),{title:`API tokens`,description:o.value?`Send it as Authorization: Bearer <token>.`:void 0},r({default:s(()=>[!o.value&&!C.value&&!b.value?(c(),t(`p`,k,`Personal tokens need a signed-in person.`)):a(``,!0),b.value?(c(),t(`p`,A,d(b.value),1)):a(``,!0),v.value?(c(),t(`div`,j,[u[2]||=l(`p`,{class:`mb-2 text-xs`},`Not shown again.`,-1),e(f(S),{"model-value":v.value,readonly:``,"aria-label":`New token`,onFocus:u[0]||=e=>e.target.select()},null,8,[`model-value`])])):a(``,!0),o.value&&!h.value.length&&!C.value&&!b.value?(c(),t(`p`,M,`No tokens yet.`)):a(``,!0),h.value.length?(c(),t(`ul`,N,[(c(!0),t(m,null,n(h.value,n=>(c(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2`},[l(`code`,P,d(n.id.slice(0,12)),1),l(`span`,F,d(new Date(n.created_at).toLocaleString()),1),e(f(y),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:C.value,onClick:e=>I(n.id)},{default:s(()=>[...u[3]||=[p(`Revoke`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):a(``,!0)]),_:2},[o.value?{name:`action`,fn:s(()=>[e(f(y),{size:`sm`,disabled:C.value,onClick:O},{default:s(()=>[e(f(D),{"data-icon":`inline-start`}),u[1]||=p(`New token`,-1)]),_:1},8,[`disabled`])]),key:`0`}:void 0]),1032,[`description`]))}}),L={class:`mx-auto max-w-[80ch]`},R={class:`text-sm text-fg-muted`},z={key:0,class:`mb-4 rounded-lg border border-border bg-card p-4 text-sm`},B={key:1,role:`alert`,class:`mb-4 text-sm text-danger`},V={key:0,class:`mb-3 divide-y divide-border`},H={class:`min-w-0 flex-1 truncate`},U={key:2,class:`text-fg-muted`},W={key:0,class:`break-all rounded-md border border-border p-3 font-mono`,role:`status`},G={class:`flex justify-end border-t border-border pt-3`},K=i({__name:`AccountPage`,setup(r){let i=_(``),g=()=>q(async()=>{i.value=(await x.recoveryCode()).code}),D=C(),k=_([]),A=_(``),j=_(!1),M=_(``),N=_(``),P=_(``),F=v(()=>T(D.status?.public_url??``));async function K(){try{k.value=(await x.passkeys()).passkeys}catch(e){A.value=String(e.message||e)}}u(K);async function q(e){j.value=!0,A.value=``;try{await e()}catch(e){A.value=String(e.message||e)}finally{j.value=!1}}let J=()=>q(async()=>{await w(!0,M.value),M.value=``,await K()}),Y=e=>q(async()=>{await x.deletePasskey(e),await K()}),X=()=>q(async()=>{await x.changePassword(N.value,P.value),N.value=P.value=``,window.location.assign(`/`)});return(r,u)=>{let _=o(`RouterLink`);return c(),t(`div`,L,[e(h,{title:`Your account`},{default:s(()=>[l(`span`,R,d(f(D).status?.user?.display_name),1)]),_:1}),r.$route.query.welcome?(c(),t(`p`,z,[u[5]||=p(`Your organisation and admin account are ready. Add a passkey below, `,-1),e(_,{class:`underline`,to:`/org/members`},{default:s(()=>[...u[3]||=[p(`add members`,-1)]]),_:1}),u[6]||=p(`, or `,-1),e(_,{class:`underline`,to:`/settings/authentication`},{default:s(()=>[...u[4]||=[p(`configure OIDC`,-1)]]),_:1}),u[7]||=p(`.`,-1)])):a(``,!0),A.value?(c(),t(`p`,B,[p(d(A.value)+` `,1),u[8]||=l(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):a(``,!0),e(f(E),{title:`Passkeys`},{default:s(()=>[k.value.length?(c(),t(`ul`,V,[(c(!0),t(m,null,n(k.value,n=>(c(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2`},[l(`span`,H,d(n.name),1),e(f(y),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:j.value,onClick:e=>Y(n.id)},{default:s(()=>[...u[9]||=[p(`Remove`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):a(``,!0),F.value?(c(),t(`form`,{key:1,class:`flex flex-wrap gap-2`,onSubmit:b(J,[`prevent`])},[e(f(S),{modelValue:M.value,"onUpdate:modelValue":u[0]||=e=>M.value=e,"aria-label":`Passkey name`,placeholder:`Passkey name (optional)`,maxlength:`200`,class:`min-w-40 flex-1`},null,8,[`modelValue`]),e(f(y),{type:`submit`,disabled:j.value},{default:s(()=>[...u[10]||=[p(`Add passkey`,-1)]]),_:1},8,[`disabled`])],32)):(c(),t(`p`,U,[u[12]||=p(`Passkeys need an HTTPS domain or localhost. Set the instance URL in `,-1),e(_,{class:`underline`,to:`/settings/authentication`},{default:s(()=>[...u[1Line truncated
import{A as e,C as t,Ct as n,D as r,M as i,S as a,Tt as o,Xt as s,_t as c,b as l,dt as u,ir as d,jn as f,k as p,l as m,t as h,x as g,xn as _,y as v}from"./PageHeader.js";import{M as y,at as b,r as x}from"./createLucideIcon.js";import{t as S}from"./input.js";import{C,I as w,L as T,N as E,R as D,_ as O,g as k,w as A}from"./index.js";var j={key:0,class:`text-fg-subtle`},M={key:1,role:`alert`,class:`mb-3 text-danger`},N={key:2,class:`mb-3 rounded-lg border border-border p-3`},P={key:3,class:`text-fg-subtle`},F={key:4,class:`divide-y divide-border`,"aria-label":`API tokens`},I={class:`flex-1 truncate text-xs`},L={class:`text-xs text-fg-subtle`},R=i({__name:`PersonalTokensCard`,setup(i){let o=_(!1),h=_([]),v=_(``),b=_(``),C=_(!1);async function w(e){C.value=!0;try{await e(),b.value=``}catch(e){b.value=String(e.message||e)}finally{C.value=!1}}let T=()=>w(async()=>{let e=await x.tokens();o.value=e?.available??!1,h.value=e?.tokens??[]}),D=()=>w(async()=>{v.value=(await x.createToken())?.token??``,await T()}),O=e=>w(async()=>{await x.revokeToken(e),await T()});return u(T),(i,u)=>(c(),g(f(k),{title:`API tokens`,description:o.value?`Send it as Authorization: Bearer <token>.`:void 0},r({default:s(()=>[!o.value&&!C.value&&!b.value?(c(),t(`p`,j,`Personal tokens need a signed-in person.`)):a(``,!0),b.value?(c(),t(`p`,M,d(b.value),1)):a(``,!0),v.value?(c(),t(`div`,N,[u[2]||=l(`p`,{class:`mb-2 text-xs`},`Not shown again.`,-1),e(f(S),{"model-value":v.value,readonly:``,"aria-label":`New token`,onFocus:u[0]||=e=>e.target.select()},null,8,[`model-value`])])):a(``,!0),o.value&&!h.value.length&&!C.value&&!b.value?(c(),t(`p`,P,`No tokens yet.`)):a(``,!0),h.value.length?(c(),t(`ul`,F,[(c(!0),t(m,null,n(h.value,n=>(c(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2`},[l(`code`,I,d(n.id.slice(0,12)),1),l(`span`,L,[e(f(A),{at:n.created_at},null,8,[`at`])]),e(f(y),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:C.value,onClick:e=>O(n.id)},{default:s(()=>[...u[3]||=[p(`Revoke`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):a(``,!0)]),_:2},[o.value?{name:`action`,fn:s(()=>[e(f(y),{size:`sm`,disabled:C.value,onClick:D},{default:s(()=>[e(f(E),{"data-icon":`inline-start`}),u[1]||=p(`New token`,-1)]),_:1},8,[`disabled`])]),key:`0`}:void 0]),1032,[`description`]))}}),z={class:`mx-auto max-w-[80ch]`},B={class:`text-sm text-fg-muted`},V={key:1,role:`alert`,class:`mb-4 text-sm text-danger`},H={key:0,class:`mb-3 divide-y divide-border`},U={class:`min-w-0 flex-1 truncate`},W={key:2,class:`text-fg-muted`},G={key:0,class:`break-all rounded-md border border-border p-3 font-mono`,role:`status`},K={class:`flex justify-end border-t border-border pt-3`},q=i({__name:`AccountPage`,setup(r){let i=_(``),E=()=>J(async()=>{i.value=(await x.recoveryCode()).code}),A=T(),j=_([]),M=_(``),N=_(!1),P=_(``),F=_(``),I=_(``),L=v(()=>w(A.status?.public_url??``));async function q(){try{j.value=(await x.passkeys()).passkeys}catch(e){M.value=String(e.message||e)}}u(q);async function J(e){N.value=!0,M.value=``;try{await e()}catch(e){M.value=String(e.message||e)}finally{N.value=!1}}let Y=()=>J(async()=>{await D(!0,P.value),P.value=``,await q()}),X=e=>J(async()=>{await x.deletePasskey(e),await q()}),Z=()=>J(async()=>{await x.changePassword(F.value,I.value),F.value=I.value=``,window.location.assign(`/`)});return(r,u)=>{let _=o(`RouterLink`);return c(),t(`div`,z,[e(h,{title:`Your account`},{default:s(()=>[l(`span`,B,d(f(A).status?.user?.display_name),1)]),_:1}),r.$route.query.welcome?(c(),g(f(C),{key:0,class:`mb-4`},{default:s(()=>[u[5]||=p(`Your organisation and admin account are ready. Add a passkey below, `,-1),e(_,{class:`underline`,to:`/org/members`},{default:s(()=>[...u[3]||=[p(`add members`,-1)]]),_:1}),u[6]||=p(`, or `,-1),e(_,{class:`underline`,to:`/settings/authentication`},{default:s(()=>[...u[4]||=[p(`configure OIDC`,-1)]]),_:1}),u[7]||=p(`.`,-1)]),_:1})):a(``,!0),M.value?(c(),t(`p`,V,[p(d(M.value)+` `,1),u[8]||=l(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):a(``,!0),e(f(k),{title:`Passkeys`},{default:s(()=>[j.value.length?(c(),t(`ul`,H,[(c(!0),t(m,null,n(j.value,n=>(c(),t(`li`,{key:n.id,class:`flex items-center gap-3 py-2`},[l(`span`,U,d(n.name),1),e(f(y),{variant:`ghost`,size:`sm`,class:`text-danger`,disabled:N.value,onClick:e=>X(n.id)},{default:s(()=>[...u[9]||=[p(`Remove`,-1)]]),_:1},8,[`disabled`,`onClick`])]))),128))])):a(``,!0),L.value?(c(),t(`form`,{key:1,class:`flex flex-wrap gap-2`,onSubmit:b(Y,[`prevent`])},[e(f(S),{modelValue:P.value,"onUpdate:modelValue":u[0]||=e=>P.value=e,"aria-label":`Passkey name`,placeholder:`Passkey name (optional)`,maxlength:`200`,class:`min-w-40 flex-1`},null,8,[`modelValue`]),e(f(y),{type:`submit`,disabled:N.value},{default:s(()=>[...u[10]||=[p(`Add passkey`,-1)]]),_:1},8,[`disabled`])],32)):(c(),t(`p`,W,[u[12]||=p(`Passkeys need an HTTPS domain or localhost. Set the instance URL in `,-1),e(_,{class:`underline`,to:`/settings/authentication`},{default:s(()=>[...u[11]||=[p(`Authentication sett Line truncated
+1 -1
View File
@@ -1 +1 @@
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{M as h,at as g}from"./createLucideIcon.js";import{t as _}from"./input.js";import{S as v,b as y,d as b,f as x,m as S,r as C,x as w,y as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`agent-profiles`,O=n({__name:`AgentProfilesPage`,setup(n){let O=v();s(O.load);let k=m(()=>O.drafts[D]?.value),A=p(``),j=p(``),M=m(()=>O.changesFor(D).length>0),N=m(()=>Object.entries(k.value??{}));function P(){if(M.value)return;let e=A.value.trim();if(!e||k.value?.[e])return;let t=O.drafts[D];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},A.value=``,j.value=String(Object.keys(t.value).indexOf(e)))}function F(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Agent profiles`},{default:i(()=>[e(y,{kinds:[D]},null,8,[`kinds`])]),_:1}),e(w,{kind:D,class:`mb-4`}),l(O).catalogError||l(O).pageErrorFor(D)?(a(),t(`p`,E,c(l(O).catalogError||l(O).pageErrorFor(D)),1)):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:g(P,[`prevent`])},[e(l(_),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`,disabled:M.value},null,8,[`modelValue`,`disabled`]),e(l(h),{type:`submit`,disabled:M.value||!A.value.trim()||!!k.value?.[A.value.trim()]},{default:i(()=>[...s[3]||=[u(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?r(``,!0):(a(),f(l(S),{key:1},{default:i(()=>[e(l(x),null,{default:i(()=>[e(l(b),null,{default:i(()=>[...s[4]||=[u(`No agent profiles`,-1)]]),_:1})]),_:1})]),_:1})),e(C,{open:j.value,"onUpdate:open":s[1]||=e=>j.value=e,items:N.value,title:([e])=>e,"remove-label":`Remove`,mono:``,onRemove:s[2]||=e=>delete k.value[N.value[e][0]]},{default:i(({item:[t,n]})=>[e(l(T),{label:`Image`,for:`${t}-image`},{default:i(()=>[e(l(_),{id:`${t}-image`,modelValue:n.image,"onUpdate:modelValue":e=>n.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(T),{label:`Kit`,for:`${t}-kit`,hint:`Pinned digest. Used only when Image is empty.`},{default:i(()=>[e(l(_),{id:`${t}-kit`,modelValue:n.kit,"onUpdate:modelValue":e=>n.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(T),{label:`Adapter`,for:`${t}-adapter`},{default:i(()=>[e(l(_),{id:`${t}-adapter`,modelValue:n.adapter,"onUpdate:modelValue":e=>n.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(T),{label:`Tools`,for:`${t}-tools`,hint:`Comma-separated tool names.`},{default:i(()=>[e(l(_),{id:`${t}-tools`,"model-value":(n.tools??[]).join(`, `),"onUpdate:modelValue":e=>F(n,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]),_:1},8,[`open`,`items`,`title`])]))}});export{O as default};
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{M as h,at as g}from"./createLucideIcon.js";import{t as _}from"./input.js";import{_ as v,b as y,d as b,f as x,m as S,r as C,v as w,y as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`agent-profiles`,O=n({__name:`AgentProfilesPage`,setup(n){let O=y();s(O.load);let k=m(()=>O.drafts[D]?.value),A=p(``),j=p(``),M=m(()=>O.changesFor(D).length>0),N=m(()=>Object.entries(k.value??{}));function P(){if(M.value)return;let e=A.value.trim();if(!e||k.value?.[e])return;let t=O.drafts[D];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},A.value=``,j.value=String(Object.keys(t.value).indexOf(e)))}function F(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Agent profiles`},{default:i(()=>[e(w,{kinds:[D]},null,8,[`kinds`])]),_:1}),e(T,{kind:D,class:`mb-4`}),l(O).catalogError||l(O).pageErrorFor(D)?(a(),t(`p`,E,c(l(O).catalogError||l(O).pageErrorFor(D)),1)):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:g(P,[`prevent`])},[e(l(_),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`,disabled:M.value},null,8,[`modelValue`,`disabled`]),e(l(h),{type:`submit`,disabled:M.value||!A.value.trim()||!!k.value?.[A.value.trim()]},{default:i(()=>[...s[3]||=[u(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?r(``,!0):(a(),f(l(S),{key:1},{default:i(()=>[e(l(x),null,{default:i(()=>[e(l(b),null,{default:i(()=>[...s[4]||=[u(`No agent profiles`,-1)]]),_:1})]),_:1})]),_:1})),e(C,{open:j.value,"onUpdate:open":s[1]||=e=>j.value=e,items:N.value,title:([e])=>e,"remove-label":`Remove`,mono:``,onRemove:s[2]||=e=>delete k.value[N.value[e][0]]},{default:i(({item:[t,n]})=>[e(l(v),{label:`Image`,for:`${t}-image`},{default:i(()=>[e(l(_),{id:`${t}-image`,modelValue:n.image,"onUpdate:modelValue":e=>n.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(v),{label:`Kit`,for:`${t}-kit`,hint:`Pinned digest. Used only when Image is empty.`},{default:i(()=>[e(l(_),{id:`${t}-kit`,modelValue:n.kit,"onUpdate:modelValue":e=>n.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(v),{label:`Adapter`,for:`${t}-adapter`},{default:i(()=>[e(l(_),{id:`${t}-adapter`,modelValue:n.adapter,"onUpdate:modelValue":e=>n.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(l(v),{label:`Tools`,for:`${t}-tools`,hint:`Comma-separated tool names.`},{default:i(()=>[e(l(_),{id:`${t}-tools`,"model-value":(n.tools??[]).join(`, `),"onUpdate:modelValue":e=>F(n,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]),_:1},8,[`open`,`items`,`title`])]))}});export{O as default};
+1 -1
View File
@@ -1 +1 @@
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{M as h,at as g,r as _}from"./createLucideIcon.js";import{t as v}from"./input.js";import{M as y,N as b,g as x,y as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},w={class:`flex items-center gap-2`},T={class:`min-w-0 flex-1 select-all break-all rounded-md border border-border bg-muted px-2 py-1.5 font-mono text-xs`},E={class:`flex items-center justify-end gap-2 border-t border-border pt-3`},D=n({__name:`AuthenticationPage`,setup(n){let D=p({public_url:``,oidc_issuer:``,oidc_audience:``,oidc_client_id:``}),O=p(!1),k=p(``),A=p(!1),j=p(!1);s(async()=>{try{D.value=await _.authentication(),O.value=!0}catch(e){k.value=String(e.message||e)}});let M=m(()=>`${D.value.public_url.replace(/\/$/,``)}/oauth2/callback`),N=p(!1);async function P(){await navigator.clipboard.writeText(M.value),N.value=!0,setTimeout(()=>N.value=!1,1500)}async function F(){A.value=!0,k.value=``,j.value=!1;try{await _.saveAuthentication(D.value),j.value=!0}catch(e){k.value=String(e.message||e)}finally{A.value=!1}}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Authentication`}),k.value?(a(),t(`p`,C,[u(c(k.value)+` `,1),s[4]||=o(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):r(``,!0),O.value?(a(),t(`form`,{key:1,onSubmit:g(F,[`prevent`])},[e(l(x),{title:`Instance URL`},{default:i(()=>[e(l(S),{label:`Public address`,for:`instance-url`,hint:`Passkeys require HTTPS and a domain name, or localhost. Once passkeys are enrolled, their domain is fixed.`},{default:i(()=>[e(l(v),{id:`instance-url`,modelValue:D.value.public_url,"onUpdate:modelValue":s[0]||=e=>D.value.public_url=e,type:`url`,required:``},null,8,[`modelValue`])]),_:1})]),_:1}),e(l(x),{title:`OpenID Connect`},{default:i(()=>[e(l(S),{label:`Issuer URL`,for:`oidc-issuer`},{default:i(()=>[e(l(v),{id:`oidc-issuer`,modelValue:D.value.oidc_issuer,"onUpdate:modelValue":s[1]||=e=>D.value.oidc_issuer=e,type:`url`,placeholder:`https://identity.example.com`},null,8,[`modelValue`])]),_:1}),e(l(S),{label:`Client ID`,for:`oidc-client`},{default:i(()=>[e(l(v),{id:`oidc-client`,modelValue:D.value.oidc_client_id,"onUpdate:modelValue":s[2]||=e=>D.value.oidc_client_id=e},null,8,[`modelValue`])]),_:1}),e(l(S),{label:`Access token audience`,for:`oidc-audience`},{default:i(()=>[e(l(v),{id:`oidc-audience`,modelValue:D.value.oidc_audience,"onUpdate:modelValue":s[3]||=e=>D.value.oidc_audience=e},null,8,[`modelValue`])]),_:1}),e(l(S),{label:`Redirect URI`,hint:`Add permitted people in Organisation → Members.`},{default:i(()=>[o(`div`,w,[o(`code`,T,c(M.value),1),e(l(h),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy redirect URI`,title:`Copy redirect URI`,onClick:P},{default:i(()=>[N.value?(a(),f(l(b),{key:0})):(a(),f(l(y),{key:1}))]),_:1})])]),_:1}),o(`div`,E,[j.value?(a(),f(l(b),{key:0,role:`status`,"aria-label":`Saved`,class:`size-4 text-fg-muted`})):r(``,!0),e(l(h),{type:`submit`,disabled:A.value},{default:i(()=>[...s[5]||=[u(`Save`,-1)]]),_:1},8,[`disabled`])])]),_:1})],32)):r(``,!0)]))}});export{D as default};
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{M as h,at as g,r as _}from"./createLucideIcon.js";import{t as v}from"./input.js";import{F as y,P as b,_ as x,g as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},w={class:`flex items-center gap-2`},T={class:`min-w-0 flex-1 select-all break-all rounded-md border border-border bg-muted px-2 py-1.5 font-mono text-xs`},E={class:`flex items-center justify-end gap-2 border-t border-border pt-3`},D=n({__name:`AuthenticationPage`,setup(n){let D=p({public_url:``,oidc_issuer:``,oidc_audience:``,oidc_client_id:``}),O=p(!1),k=p(``),A=p(!1),j=p(!1);s(async()=>{try{D.value=await _.authentication(),O.value=!0}catch(e){k.value=String(e.message||e)}});let M=m(()=>`${D.value.public_url.replace(/\/$/,``)}/oauth2/callback`),N=p(!1);async function P(){await navigator.clipboard.writeText(M.value),N.value=!0,setTimeout(()=>N.value=!1,1500)}async function F(){A.value=!0,k.value=``,j.value=!1;try{await _.saveAuthentication(D.value),j.value=!0}catch(e){k.value=String(e.message||e)}finally{A.value=!1}}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Authentication`}),k.value?(a(),t(`p`,C,[u(c(k.value)+` `,1),s[4]||=o(`a`,{class:`underline`,href:`/?reauth=1`},`Sign in again`,-1)])):r(``,!0),O.value?(a(),t(`form`,{key:1,onSubmit:g(F,[`prevent`])},[e(l(S),{title:`Instance URL`},{default:i(()=>[e(l(x),{label:`Public address`,for:`instance-url`,hint:`Passkeys require HTTPS and a domain name, or localhost. Once passkeys are enrolled, their domain is fixed.`},{default:i(()=>[e(l(v),{id:`instance-url`,modelValue:D.value.public_url,"onUpdate:modelValue":s[0]||=e=>D.value.public_url=e,type:`url`,required:``},null,8,[`modelValue`])]),_:1})]),_:1}),e(l(S),{title:`OpenID Connect`},{default:i(()=>[e(l(x),{label:`Issuer URL`,for:`oidc-issuer`},{default:i(()=>[e(l(v),{id:`oidc-issuer`,modelValue:D.value.oidc_issuer,"onUpdate:modelValue":s[1]||=e=>D.value.oidc_issuer=e,type:`url`,placeholder:`https://identity.example.com`},null,8,[`modelValue`])]),_:1}),e(l(x),{label:`Client ID`,for:`oidc-client`},{default:i(()=>[e(l(v),{id:`oidc-client`,modelValue:D.value.oidc_client_id,"onUpdate:modelValue":s[2]||=e=>D.value.oidc_client_id=e},null,8,[`modelValue`])]),_:1}),e(l(x),{label:`Access token audience`,for:`oidc-audience`},{default:i(()=>[e(l(v),{id:`oidc-audience`,modelValue:D.value.oidc_audience,"onUpdate:modelValue":s[3]||=e=>D.value.oidc_audience=e},null,8,[`modelValue`])]),_:1}),e(l(x),{label:`Redirect URI`,hint:`Add permitted people in Organisation → Members.`},{default:i(()=>[o(`div`,w,[o(`code`,T,c(M.value),1),e(l(h),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy redirect URI`,title:`Copy redirect URI`,onClick:P},{default:i(()=>[N.value?(a(),f(l(y),{key:0})):(a(),f(l(b),{key:1}))]),_:1})])]),_:1}),o(`div`,E,[j.value?(a(),f(l(y),{key:0,role:`status`,"aria-label":`Saved`,class:`size-4 text-fg-muted`})):r(``,!0),e(l(h),{type:`submit`,disabled:A.value},{default:i(()=>[...s[5]||=[u(`Save`,-1)]]),_:1},8,[`disabled`])])]),_:1})],32)):r(``,!0)]))}});export{D as default};
+1 -1
View File
@@ -1 +1 @@
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,dt as o,ir as s,jn as c,k as l,t as u,x as d,xn as f,y as p}from"./PageHeader.js";import{M as m}from"./createLucideIcon.js";import{t as h}from"./input.js";import{S as g,b as _,d as v,f as y,h as b,m as x,r as S,x as C,y as w}from"./index.js";var T={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},E=`credential-bindings`,D=n({__name:`CredentialBindingsPage`,setup(n){let D=g();o(D.load);let O=p(()=>D.drafts[E]?.value),k=f(``),A=p(()=>D.changesFor(E).length>0);function j(){if(A.value)return;let e=D.drafts[E];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}),k.value=String(e.value.length-1))}return(n,o)=>(a(),t(`div`,null,[e(u,{title:`Credential bindings`},{default:i(()=>[e(_,{kinds:[E]},null,8,[`kinds`]),e(c(m),{disabled:A.value,onClick:j},{default:i(()=>[...o[2]||=[l(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),e(C,{kind:E,class:`mb-4`}),c(D).catalogError||c(D).pageErrorFor(E)?(a(),t(`p`,T,s(c(D).catalogError||c(D).pageErrorFor(E)),1)):r(``,!0),O.value?.length?r(``,!0):(a(),d(c(x),{key:1},{default:i(()=>[e(c(y),null,{default:i(()=>[e(c(v),null,{default:i(()=>[...o[3]||=[l(`No credential bindings`,-1)]]),_:1})]),_:1})]),_:1})),e(S,{open:k.value,"onUpdate:open":o[0]||=e=>k.value=e,items:O.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:o[1]||=e=>O.value.splice(e,1)},{default:i(({item:t,index:n})=>[e(c(w),{label:`Service`,for:`binding-${n}-service`},{default:i(()=>[e(c(h),{id:`binding-${n}-service`,modelValue:t.service,"onUpdate:modelValue":e=>t.service=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(c(w),{label:`Organisation`,for:`binding-${n}-org`,hint:`Empty uses the default organisation.`},{default:i(()=>[e(c(h),{id:`binding-${n}-org`,modelValue:t.org,"onUpdate:modelValue":e=>t.org=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(c(w),{label:`Secret`},{default:i(()=>[e(b,{modelValue:t.secret,"onUpdate:modelValue":e=>t.secret=e,"id-prefix":`binding-${n}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{D as default};
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,dt as o,ir as s,jn as c,k as l,t as u,x as d,xn as f,y as p}from"./PageHeader.js";import{M as m}from"./createLucideIcon.js";import{t as h}from"./input.js";import{_ as g,b as _,d as v,f as y,h as b,m as x,r as S,v as C,y as w}from"./index.js";var T={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},E=`credential-bindings`,D=n({__name:`CredentialBindingsPage`,setup(n){let D=_();o(D.load);let O=p(()=>D.drafts[E]?.value),k=f(``),A=p(()=>D.changesFor(E).length>0);function j(){if(A.value)return;let e=D.drafts[E];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}),k.value=String(e.value.length-1))}return(n,o)=>(a(),t(`div`,null,[e(u,{title:`Credential bindings`},{default:i(()=>[e(C,{kinds:[E]},null,8,[`kinds`]),e(c(m),{disabled:A.value,onClick:j},{default:i(()=>[...o[2]||=[l(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),e(w,{kind:E,class:`mb-4`}),c(D).catalogError||c(D).pageErrorFor(E)?(a(),t(`p`,T,s(c(D).catalogError||c(D).pageErrorFor(E)),1)):r(``,!0),O.value?.length?r(``,!0):(a(),d(c(x),{key:1},{default:i(()=>[e(c(y),null,{default:i(()=>[e(c(v),null,{default:i(()=>[...o[3]||=[l(`No credential bindings`,-1)]]),_:1})]),_:1})]),_:1})),e(S,{open:k.value,"onUpdate:open":o[0]||=e=>k.value=e,items:O.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:o[1]||=e=>O.value.splice(e,1)},{default:i(({item:t,index:n})=>[e(c(g),{label:`Service`,for:`binding-${n}-service`},{default:i(()=>[e(c(h),{id:`binding-${n}-service`,modelValue:t.service,"onUpdate:modelValue":e=>t.service=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(c(g),{label:`Organisation`,for:`binding-${n}-org`,hint:`Empty uses the default organisation.`},{default:i(()=>[e(c(h),{id:`binding-${n}-org`,modelValue:t.org,"onUpdate:modelValue":e=>t.org=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),e(c(g),{label:`Secret`},{default:i(()=>[e(b,{modelValue:t.secret,"onUpdate:modelValue":e=>t.secret=e,"id-prefix":`binding-${n}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]),_:1},8,[`open`,`items`,`title`])]))}});export{D as default};
+1 -1
View File
@@ -1 +1 @@
import{i as e,n as t,r as n,t as r}from"./alert.js";import{A as i,C as a,Ct as o,M as s,S as c,Xt as l,_t as u,b as d,dt as f,ir as p,jn as m,k as h,l as g,st as _,t as v,x as y,xn as b}from"./PageHeader.js";import{M as x,n as S,r as C}from"./createLucideIcon.js";import{A as w,C as T,D as E,E as D,O,T as k,_ as A,a as j,c as M,d as N,f as ee,i as P,k as F,l as I,m as L,n as R,o as z,s as B,t as V,u as H,v as U}from"./index.js";function W(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function G(e,t,n=80,r=24){let i=t.protocol===`https:`?`wss:`:`ws:`,a=new URLSearchParams({profile:e,cols:String(n),rows:String(r)}).toString();return`${i}//${t.host}/api/harness/terminal?${a}`}var K={class:`flex h-full min-h-0 flex-col gap-2`},q={key:0,class:`text-sm text-fg-muted`,role:`status`},J=s({__name:`SetupTerminal`,props:{profile:{}},setup(e){let t=e,n=b(null),r=b(`connecting`),i=null,o=null,s=null,l=null;function p(){try{s?.fit()}catch{}}return f(()=>{let e=n.value;if(!e)return;i=new R({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),s=new V,i.loadAddon(s),i.open(e),p(),i.focus();let a=new WebSocket(G(t.profile,window.location,i?.cols??80,i?.rows??24));o=a,a.binaryType=`arraybuffer`,a.onopen=()=>{r.value=`open`},a.onmessage=e=>{i&&(typeof e.data==`string`?i.write(e.data):i.write(new Uint8Array(e.data)))},a.onerror=()=>{r.value=`failed`},a.onclose=()=>{r.value=`closed`},i.onData(e=>{a.readyState===WebSocket.OPEN&&a.send(e)}),l=new ResizeObserver(p),l.observe(e)}),_(()=>{l?.disconnect(),l=null,o?.close(),o=null,i?.dispose(),i=null,s=null}),(e,t)=>(u(),a(`div`,K,[r.value===`open`?c(``,!0):(u(),a(`p`,q,[r.value===`connecting`?(u(),a(g,{key:0},[h(`Connecting…`)],64)):r.value===`closed`?(u(),a(g,{key:1},[h(`The terminal session ended.`)],64)):(u(),a(g,{key:2},[h(`Could not open the setup terminal.`)],64))])),d(`div`,{ref_key:`host`,ref:n,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Y={key:1,class:`flex flex-col gap-2`},X={class:`flex flex-col gap-1 text-sm`},Z=s({__name:`HarnessPage`,setup(s){let _=b(null),R=b(!0),V=b(null),G=b(!1),K=b(``),q=b(!1),Z={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};f(Q);async function Q(){R.value=!0,V.value=null,G.value=!1;try{let e=await C.harnessBindings();_.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},K.value=_.value.profiles[0]??``}catch(e){let t=e instanceof S?e.status:void 0;t===501||t===503?G.value=!0:V.value=e instanceof Error?e.message:String(e),_.value=null}finally{R.value=!1}}function te(){_.value?.terminal&&K.value&&(q.value=!0)}function $(e){if(!e)return`–`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function ne(e){return e.scopes?.length?e.scopes.join(`, `):`–`}return(s,f)=>(u(),a(`div`,null,[i(v,{title:`Harness`}),V.value?(u(),y(m(n),{key:0,variant:`destructive`,class:`mb-4`},{default:l(()=>[i(m(r),null,{default:l(()=>[...f[1]||=[h(`Could not load the harness`,-1)]]),_:1}),i(m(t),null,{default:l(()=>[h(p(V.value),1)]),_:1})]),_:1})):c(``,!0),R.value?(u(),a(`div`,Y,[i(m(T),{class:`h-24 w-full`}),i(m(T),{class:`h-40 w-full`})])):G.value?(u(),y(m(L),{key:2},{default:l(()=>[i(m(ee),null,{default:l(()=>[i(m(N),null,{default:l(()=>[...f[2]||=[h(`Harness bindings are not configured`,-1)]]),_:1})]),_:1})]),_:1})):_.value?(u(),a(g,{key:3},[_.value.terminal?(u(),y(m(U),{key:1,class:`mb-4`},{default:l(()=>[i(m(A),{class:`flex flex-wrap items-end gap-3`},{default:l(()=>[d(`div`,X,[i(m(P),{for:`harness-profile`,class:`text-fg-muted`},{default:l(()=>[...f[5]||=[h(`Profile`,-1)]]),_:1}),i(m(w),{modelValue:K.value,"onUpdate:modelValue":f[0]||=e=>K.value=e,disabled:!_.value.profiles.length},{default:l(()=>[i(m(D),{id:`harness-profile`,size:`sm`,class:`min-w-48`},{default:l(()=>[i(m(k),{placeholder:`No profiles configured`})]),_:1}),i(m(F),null,{default:l(()=>[i(m(O),null,{default:l(()=>[(u(!0),a(g,null,o(_.value.profiles,e=>(u(),y(m(E),{key:e,value:e},{default:l(()=>[h(p(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`modelValue`,`disabled`])]),i(m(x),{disabled:!K.value,onClick:te},{default:l(()=>[...f[6]||=[h(`Open setup terminal`,-1)]]),_:1},8,[`disabled`])]),_:1})]),_:1})):(u(),y(m(n),{key:0,class:`mb-4`},{default:l(()=>[i(m(r),null,{default:l(()=>[...f[3]||=[h(`Setup terminal unavailable`,-1)]]),_:1}),i(m(t),null,{default:l(()=>[...f[4]||=[h(`Start the daemon with a container runtime and a harness token to log in to a CLI from here.`,-1)]]),_:1})]),_:1})),q.value&&K.value?(u(),y(m(U),{key:2,class:`mb-4`},{default:l(()=>[i(m(A),{class:`h-96`},Line truncated
import{t as e}from"./badge.js";import{A as t,C as n,Ct as r,M as i,S as a,Xt as o,_t as s,b as c,dt as l,ir as u,jn as d,k as f,l as p,st as m,t as h,x as g,xn as _}from"./PageHeader.js";import{M as v,n as y,r as b}from"./createLucideIcon.js";import{A as x,C as S,D as C,M as w,O as T,S as E,T as D,a as O,c as k,d as A,f as j,g as M,i as N,j as ee,k as P,l as F,m as I,n as L,o as R,s as z,t as B,u as V,w as H,x as U}from"./index.js";function W(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function G(e,t,n=80,r=24){let i=t.protocol===`https:`?`wss:`:`ws:`,a=new URLSearchParams({profile:e,cols:String(n),rows:String(r)}).toString();return`${i}//${t.host}/api/harness/terminal?${a}`}var K={class:`flex h-full min-h-0 flex-col gap-2`},q={key:0,class:`text-sm text-fg-muted`,role:`status`},J=i({__name:`SetupTerminal`,props:{profile:{}},setup(e){let t=e,r=_(null),i=_(`connecting`),o=null,u=null,d=null,h=null;function g(){try{d?.fit()}catch{}}return l(()=>{let e=r.value;if(!e)return;o=new L({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),d=new B,o.loadAddon(d),o.open(e),g(),o.focus();let n=new WebSocket(G(t.profile,window.location,o?.cols??80,o?.rows??24));u=n,n.binaryType=`arraybuffer`,n.onopen=()=>{i.value=`open`},n.onmessage=e=>{o&&(typeof e.data==`string`?o.write(e.data):o.write(new Uint8Array(e.data)))},n.onerror=()=>{i.value=`failed`},n.onclose=()=>{i.value=`closed`},o.onData(e=>{n.readyState===WebSocket.OPEN&&n.send(e)}),h=new ResizeObserver(g),h.observe(e)}),m(()=>{h?.disconnect(),h=null,u?.close(),u=null,o?.dispose(),o=null,d=null}),(e,t)=>(s(),n(`div`,K,[i.value===`open`?a(``,!0):(s(),n(`p`,q,[i.value===`connecting`?(s(),n(p,{key:0},[f(`Connecting…`)],64)):i.value===`closed`?(s(),n(p,{key:1},[f(`The terminal session ended.`)],64)):(s(),n(p,{key:2},[f(`Could not open the setup terminal.`)],64))])),c(`div`,{ref_key:`host`,ref:r,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Y={key:1,class:`flex flex-col gap-2`},X={class:`flex flex-wrap items-end gap-3`},Z={class:`flex flex-col gap-1 text-sm`},Q={class:`h-96`},$=i({__name:`HarnessPage`,setup(i){let m=_(null),L=_(!0),B=_(null),G=_(!1),K=_(``),q=_(!1),$={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};l(te);async function te(){L.value=!0,B.value=null,G.value=!1;try{let e=await b.harnessBindings();m.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},K.value=m.value.profiles[0]??``}catch(e){let t=e instanceof y?e.status:void 0;t===501||t===503?G.value=!0:B.value=e instanceof Error?e.message:String(e),m.value=null}finally{L.value=!1}}function ne(){m.value?.terminal&&K.value&&(q.value=!0)}function re(e){return e.scopes?.length?e.scopes.join(`, `):`–`}return(i,l)=>(s(),n(`div`,null,[t(h,{title:`Harness`}),B.value?(s(),g(d(S),{key:0,variant:`destructive`,class:`mb-4`},{default:o(()=>[t(d(U),null,{default:o(()=>[...l[1]||=[f(`Could not load the harness`,-1)]]),_:1}),t(d(E),null,{default:o(()=>[f(u(B.value),1)]),_:1})]),_:1})):a(``,!0),L.value?(s(),n(`div`,Y,[t(d(D),{class:`h-24 w-full`}),t(d(D),{class:`h-40 w-full`})])):G.value?(s(),g(d(I),{key:2},{default:o(()=>[t(d(j),null,{default:o(()=>[t(d(A),null,{default:o(()=>[...l[2]||=[f(`Harness bindings are not configured`,-1)]]),_:1})]),_:1})]),_:1})):m.value?(s(),n(p,{key:3},[m.value.terminal?(s(),g(d(M),{key:1},{default:o(()=>[c(`div`,X,[c(`div`,Z,[t(d(N),{for:`harness-profile`,class:`text-fg-muted`},{default:o(()=>[...l[5]||=[f(`Profile`,-1)]]),_:1}),t(d(w),{modelValue:K.value,"onUpdate:modelValue":l[0]||=e=>K.value=e,disabled:!m.value.profiles.length},{default:o(()=>[t(d(T),{id:`harness-profile`,size:`sm`,class:`min-w-48`},{default:o(()=>[t(d(C),{placeholder:`No profiles configured`})]),_:1}),t(d(ee),null,{default:o(()=>[t(d(x),null,{default:o(()=>[(s(!0),n(p,null,r(m.value.profiles,e=>(s(),g(d(P),{key:e,value:e},{default:o(()=>[f(u(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`modelValue`,`disabled`])]),t(d(v),{disabled:!K.value,onClick:ne},{default:o(()=>[...l[6]||=[f(`Open setup terminal`,-1)]]),_:1},8,[`disabled`])])]),_:1})):(s(),g(d(S),{key:0,class:`mb-4`},{default:o(()=>[t(d(U),null,{default:o(()=>[...l[3]||=[f(`Setup terminal unavailable`,-1)]]),_:1}),t(d(E),null,{default:o(()=>[...l[4]||=[f(`Start the daemon with a container runtime and a harness token to log in to a CLI from here.`,-1)]]),_:1})]),_:1})),q.value&&K.value?(s(),g(d(M),{key:2},{default:o(()=>[c(`div`,Q,[t(J,{profile:K.value},null,8,[`profile`])])]),_:1})):a(``,!0),t(d(M),null,{default:o(()=>[t(d(V),null,{default:o(()=>[t(d(O),null,{deLine truncated
+1 -1
View File
@@ -1,3 +1,3 @@
function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>S(e)===`[object Map]`,p=e=>S(e)===`[object Set]`,m=e=>S(e)===`[object Date]`,h=e=>S(e)===`[object RegExp]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,T=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,E=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),D=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ee=/-\w/g,O=D(e=>e.replace(ee,e=>e.slice(1).toUpperCase())),te=/\B([A-Z])/g,k=D(e=>e.replace(te,`-$1`).toLowerCase()),A=D(e=>e.charAt(0).toUpperCase()+e.slice(1)),j=D(e=>e?`on${A(e)}`:``),M=(e,t)=>!Object.is(e,t),N=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},P=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ne=e=>{let t=parseFloat(e);return isNaN(t)?e:t},re=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},ie,ae=()=>ie||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},F=e(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function I(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?ce(r):I(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var oe=/;(?![^(]*\))/g,se=/:([^]+)/,L=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function ce(e){let t={};return e.replace(L,e=>e.startsWith(`/*`)?``:e).split(oe).forEach(e=>{if(e){let n=e.split(se);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function le(e){let t=``;if(_(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=le(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ue(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_(t)&&(e.class=le(t)),n&&(e.style=I(n)),e}var de=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,fe=e(de);de+``;function pe(e){return!!e||e===``}function me(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=ve(e[i],t[i],n);return r}function he(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&ve(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function ge(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?he(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!ve(e[r],t[r],n))return!1}return String(e)===String(t)}function _e(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function ve(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?_e(e,t,n,me):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:_e(e,t,n,ge):String(e)===String(t))))}function ye(e,t){return e.findIndex(e=>ve(e,t))}var be=e=>!!(e&&e.__v_isRef===!0),xe=e=>_(e)?e:e==null?``:d(e)||y(e)&&(e.toString===x||!g(e.toString))?be(e)?xe(e.value):JSON.stringify(e,Se,2):String(e),Se=(e,t)=>be(t)?Se(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ce(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ce(e))}:v(t)?Ce(t):y(t)&&!d(t)&&!w(t)?String(t):t,Ce=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e;function we(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var R,Te=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&R&&(R.active?(this.parent=R,this.index=(R.scopes||(R.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=R;try{return R=this,e()}finally{RLine truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(hi(e,0)||ai(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!E(o)||o[0]===`.`||t&&!E(o)||u&&u.includes(o)){if(fi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Kt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Es(x,n,t),h&&cr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Xo(()=>{x&&Es(x,n,t),l&&g.enter(e),h&&cr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Ss(d[t]),g=h.type===es;e?(g&&!u&&t+1<p&&Ss(d[t+1]).type===es&&(l(i(e.data.slice(h.children.length)),r,o(e)),e.data=h.children),e=f(e,h,a,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,hi(r,1)||ai()),n(null,h,r,null,a,s,ci(r),c))}return e},h=(e,t,n,r,i,a)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&li(f)&&f.data===`]`?o(t.anchor=f):(ai(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(_i(e,t)||ai(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,ci(d),a),r&&(r.vnode.el=t.el,lo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&li(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var di=new Set([`src`,`srcset`,`href`,`poster`]);function fi(e,t,n){return di.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var pi=`data-allow-mismatch`,mi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function hi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(pi);)e=e.parentElement;return gi(e&&e.getAttribute(pi),t)}function gi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(mi[t])}}function _i(e,t){return hi(e.parentElement,1)||vi(e)||yi(t)}function vi(e){return e.nodeType===1&&gi(e.getAttribute(pi),1)}function yi({props:e}){let t=e&&e[pi];return typeof t==`string`&&gi(t,1)}var bi=ae().requestIdleCallback||(e=>setTimeout(e,1)),xi=ae().cancelIdleCallback||(e=>clearTimeout(e)),Si=(e=1e4)=>t=>{let n=bi(t,{timeout:e});return()=>xi(n)};function Ci(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var wi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ci(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ti=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ei=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Di(e,t){if(li(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(li(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Oi=e=>!!e.type.__asyncLoader;function ki(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Xr({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Di(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Y;if(Qr(e),u)return()=>Ai(u,e);let t=t=>{l=null,Fn(t,e,13,!r)};if(s&&e.suspense||Is)return p().then(t=>()=>Ai(t,e)).catch(e=>(t(e),()=>r?J(r,{error:e}):null));let a=$t(!1),c=$t(),d=$t(!!i),f,m;return qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&ji(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?l=null:(t(n),c.value=n)}),()=>{if(a.value&&u)return Ai(u,e);if(c.value&&r)return J(r,{error:c.value});if(n&&!d.value Line truncated
`)&&(hi(e,0)||ai(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!E(o)||o[0]===`.`||t&&!E(o)||u&&u.includes(o)){if(fi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Kt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Es(x,n,t),h&&cr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Xo(()=>{x&&Es(x,n,t),l&&g.enter(e),h&&cr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Ss(d[t]),g=h.type===es;e?(g&&!u&&t+1<p&&Ss(d[t+1]).type===es&&(l(i(e.data.slice(h.children.length)),r,o(e)),e.data=h.children),e=f(e,h,a,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,hi(r,1)||ai()),n(null,h,r,null,a,s,ci(r),c))}return e},h=(e,t,n,r,i,a)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&li(f)&&f.data===`]`?o(t.anchor=f):(ai(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(_i(e,t)||ai(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,ci(d),a),r&&(r.vnode.el=t.el,lo(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&li(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var di=new Set([`src`,`srcset`,`href`,`poster`]);function fi(e,t,n){return di.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var pi=`data-allow-mismatch`,mi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function hi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(pi);)e=e.parentElement;return gi(e&&e.getAttribute(pi),t)}function gi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(mi[t])}}function _i(e,t){return hi(e.parentElement,1)||vi(e)||yi(t)}function vi(e){return e.nodeType===1&&gi(e.getAttribute(pi),1)}function yi({props:e}){let t=e&&e[pi];return typeof t==`string`&&gi(t,1)}var bi=ae().requestIdleCallback||(e=>setTimeout(e,1)),xi=ae().cancelIdleCallback||(e=>clearTimeout(e)),Si=(e=1e4)=>t=>{let n=bi(t,{timeout:e});return()=>xi(n)};function Ci(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var wi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ci(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ti=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ei=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Di(e,t){if(li(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(li(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Oi=e=>!!e.type.__asyncLoader;function ki(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Xr({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Di(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=Y;if(Qr(e),u)return()=>Ai(u,e);let t=t=>{l=null,Fn(t,e,13,!r)};if(s&&e.suspense||Is)return p().then(t=>()=>Ai(t,e)).catch(e=>(t(e),()=>r?J(r,{error:e}):null));let a=$t(!1),c=$t(),d=$t(!!i),f,m;return qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&ji(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?l=null:(t(n),c.value=n)}),()=>{if(a.value&&u)return Ai(u,e);if(c.value&&r)return J(r,{error:c.value});if(n&&!d.value Line truncated
+1 -1
View File
@@ -1 +1 @@
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{M as h,at as g}from"./createLucideIcon.js";import{t as _}from"./input.js";import{S as v,b as y,d as b,f as x,m as S,r as C,w,x as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`eda-playbooks`,O=n({__name:`PlaybooksPage`,setup(n){let O=v();s(O.load);let k=m(()=>O.drafts[D]?.value),A=p(``),j=p(``),M=m(()=>O.changesFor(D).length>0);function N(){if(M.value)return;let e=A.value.trim();if(!e||k.value?.playbooks.some(t=>t.id===e))return;let t=O.drafts[D];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),A.value=``,j.value=String(t.value.playbooks.length-1))}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Playbooks`},{default:i(()=>[e(y,{kinds:[D]},null,8,[`kinds`])]),_:1}),e(T,{kind:D,class:`mb-4`}),l(O).catalogError||l(O).pageErrorFor(D)?(a(),t(`p`,E,c(l(O).catalogError||l(O).pageErrorFor(D)),1)):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:g(N,[`prevent`])},[e(l(_),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`,disabled:M.value},null,8,[`modelValue`,`disabled`]),e(l(h),{type:`submit`,disabled:M.value||!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:i(()=>[...s[3]||=[u(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?r(``,!0):(a(),f(l(S),{key:1},{default:i(()=>[e(l(x),null,{default:i(()=>[e(l(b),null,{default:i(()=>[...s[4]||=[u(`No playbooks installed`,-1)]]),_:1})]),_:1})]),_:1})),e(C,{open:j.value,"onUpdate:open":s[1]||=e=>j.value=e,items:k.value?.playbooks??[],title:e=>e.id,"remove-label":`Remove`,mono:``,onRemove:s[2]||=e=>k.value.playbooks.splice(e,1)},{default:i(({item:t,index:n})=>[e(l(w),{id:`playbook-${n}`,modelValue:t.yaml,"onUpdate:modelValue":e=>t.yaml=e,"aria-label":`${t.id} YAML`,class:`mb-3 min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]),_:1},8,[`open`,`items`,`title`])]))}});export{O as default};
import{A as e,C as t,M as n,S as r,Xt as i,_t as a,b as o,dt as s,ir as c,jn as l,k as u,t as d,x as f,xn as p,y as m}from"./PageHeader.js";import{M as h,at as g}from"./createLucideIcon.js";import{t as _}from"./input.js";import{E as v,b as y,d as b,f as x,m as S,r as C,v as w,y as T}from"./index.js";var E={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},D=`eda-playbooks`,O=n({__name:`PlaybooksPage`,setup(n){let O=y();s(O.load);let k=m(()=>O.drafts[D]?.value),A=p(``),j=p(``),M=m(()=>O.changesFor(D).length>0);function N(){if(M.value)return;let e=A.value.trim();if(!e||k.value?.playbooks.some(t=>t.id===e))return;let t=O.drafts[D];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),A.value=``,j.value=String(t.value.playbooks.length-1))}return(n,s)=>(a(),t(`div`,null,[e(d,{title:`Playbooks`},{default:i(()=>[e(w,{kinds:[D]},null,8,[`kinds`])]),_:1}),e(T,{kind:D,class:`mb-4`}),l(O).catalogError||l(O).pageErrorFor(D)?(a(),t(`p`,E,c(l(O).catalogError||l(O).pageErrorFor(D)),1)):r(``,!0),o(`form`,{class:`mb-4 flex flex-wrap gap-2`,onSubmit:g(N,[`prevent`])},[e(l(_),{modelValue:A.value,"onUpdate:modelValue":s[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`,disabled:M.value},null,8,[`modelValue`,`disabled`]),e(l(h),{type:`submit`,disabled:M.value||!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:i(()=>[...s[3]||=[u(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?r(``,!0):(a(),f(l(S),{key:1},{default:i(()=>[e(l(x),null,{default:i(()=>[e(l(b),null,{default:i(()=>[...s[4]||=[u(`No playbooks installed`,-1)]]),_:1})]),_:1})]),_:1})),e(C,{open:j.value,"onUpdate:open":s[1]||=e=>j.value=e,items:k.value?.playbooks??[],title:e=>e.id,"remove-label":`Remove`,mono:``,onRemove:s[2]||=e=>k.value.playbooks.splice(e,1)},{default:i(({item:t,index:n})=>[e(l(v),{id:`playbook-${n}`,modelValue:t.yaml,"onUpdate:modelValue":e=>t.yaml=e,"aria-label":`${t.id} YAML`,class:`mb-3 min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]),_:1},8,[`open`,`items`,`title`])]))}});export{O as default};
-3
View File
@@ -1,3 +0,0 @@
import{$ as e,$t as t,A as n,An as r,At as i,B as a,Bt as o,C as s,Cn as c,Ct as l,D as u,Dn as d,Dt as f,E as p,En as m,Et as h,F as g,Fn as _,Ft as v,G as y,Gt as b,H as x,Ht as S,I as C,It as w,J as T,Jt as E,K as ee,Kt as D,L as O,Lt as te,M as k,Mt as ne,N as re,Nt as ie,O as ae,On as oe,Ot as se,P as ce,Pn as le,Pt as ue,Q as de,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as _e,T as ve,Tn as ye,Tt as be,U as xe,Ut as Se,V as Ce,Vt as we,W as Te,Wt as Ee,X as De,Xt as Oe,Y as ke,Yt as Ae,Z as je,Zt as Me,_ as Ne,_n as Pe,_t as A,a as Fe,an as Ie,ar as Le,at as Re,b as ze,bn as Be,bt as Ve,c as He,cn as Ue,ct as We,d as Ge,dn as Ke,dt as qe,en as Je,er as Ye,et as Xe,f as Ze,fn as Qe,ft as $e,g as et,gn as tt,gt as nt,h as rt,hn as it,ht as at,i as ot,in as st,ir as ct,it as j,j as lt,jn as M,jt as ut,k as dt,kn as N,kt as ft,l as pt,ln as mt,lt as ht,m as gt,mn as _t,mt as vt,n as yt,nn as bt,nr as xt,nt as St,o as Ct,on as wt,ot as Tt,p as Et,pn as Dt,pt as Ot,q as kt,qt as At,r as jt,rn as Mt,rr as Nt,rt as Pt,s as Ft,sn as It,st as Lt,tn as Rt,tt as zt,u as Bt,un as Vt,ut as Ht,v as Ut,vn as Wt,vt as Gt,w as Kt,wn as qt,wt as P,x as F,xn as I,xt as Jt,y as L,yn as Yt,yt as Xt,z as Zt,zt as Qt}from"./PageHeader.js";import{$ as $t,B as en,C as tn,F as nn,G as rn,H as an,I as on,J as sn,K as cn,L as ln,N as un,Q as dn,R as fn,U as pn,V as mn,W as hn,X as gn,Y as _n,Z as vn,at as yn,et as bn,it as xn,nt as Sn,q as Cn,rt as wn,t as Tn,tt as En,z as Dn}from"./createLucideIcon.js";var On=Object.defineProperty,kn=(e,t)=>{let n={};for(var r in e)On(n,r,{get:e[r],enumerable:!0});return t||On(n,Symbol.toStringTag,{value:`Module`}),n},An=kn({BaseTransition:()=>ot,BaseTransitionPropsValidators:()=>Fe,Comment:()=>Ct,DeprecationTypes:()=>null,EffectScope:()=>Rt,ErrorCodes:()=>Ft,ErrorTypeStrings:()=>He,Fragment:()=>pt,KeepAlive:()=>Bt,ReactiveEffect:()=>bt,Static:()=>Ge,Suspense:()=>Ze,Teleport:()=>Et,Text:()=>gt,TrackOpTypes:()=>Mt,Transition:()=>on,TransitionGroup:()=>ln,TriggerOpTypes:()=>st,VueElement:()=>fn,assertNumber:()=>rt,callWithAsyncErrorHandling:()=>et,callWithErrorHandling:()=>Ne,camelize:()=>le,capitalize:()=>_,cloneVNode:()=>Ut,compatUtils:()=>null,compile:()=>jn,computed:()=>L,createApp:()=>Dn,createBlock:()=>F,createCommentVNode:()=>he,createElementBlock:()=>s,createElementVNode:()=>ze,createHydrationRenderer:()=>Kt,createPropsRestProxy:()=>ve,createRenderer:()=>p,createSSRApp:()=>en,createSlots:()=>u,createStaticVNode:()=>ae,createTextVNode:()=>dt,createVNode:()=>n,customRef:()=>Ie,defineAsyncComponent:()=>lt,defineComponent:()=>k,defineCustomElement:()=>mn,defineEmits:()=>re,defineExpose:()=>ce,defineModel:()=>g,defineOptions:()=>C,defineProps:()=>O,defineSSRCustomElement:()=>an,defineSlots:()=>pe,devtools:()=>Zt,effect:()=>wt,effectScope:()=>It,getCurrentInstance:()=>a,getCurrentScope:()=>Ue,getCurrentWatcher:()=>mt,getTransitionRawChildren:()=>Ce,guardReactiveProps:()=>x,h:()=>xe,handleError:()=>Te,hasInjectionContext:()=>y,hydrate:()=>pn,hydrateOnIdle:()=>ee,hydrateOnInteraction:()=>kt,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>ke,initCustomFormatter:()=>De,initDirectivesForSSR:()=>hn,inject:()=>je,isMemoSame:()=>de,isProxy:()=>Vt,isReactive:()=>Ke,isReadonly:()=>Qe,isRef:()=>Dt,isRuntimeOnly:()=>e,isShallow:()=>_t,isVNode:()=>Xe,markRaw:()=>it,mergeDefaults:()=>zt,mergeModels:()=>St,mergeProps:()=>Pt,nextTick:()=>j,nodeOps:()=>rn,normalizeClass:()=>Ye,normalizeProps:()=>xt,normalizeStyle:()=>Nt,onActivated:()=>Re,onBeforeMount:()=>Tt,onBeforeUnmount:()=>Lt,onBeforeUpdate:()=>We,onDeactivated:()=>ht,onErrorCaptured:()=>Ht,onMounted:()=>qe,onRenderTracked:()=>$e,onRenderTriggered:()=>Ot,onScopeDispose:()=>tt,onServerPrefetch:()=>vt,onUnmounted:()=>at,onUpdated:()=>nt,onWatcherCleanup:()=>Pe,openBlock:()=>A,patchProp:()=>cn,popScopeId:()=>Gt,provide:()=>Xt,proxyRefs:()=>Wt,pushScopeId:()=>Ve,queuePostFlushCb:()=>Jt,reactive:()=>Yt,readonly:()=>Be,ref:()=>I,registerRuntimeCompiler:()=>_e,render:()=>Cn,renderList:()=>l,renderSlot:()=>P,resolveComponent:()=>be,resolveDirective:()=>h,resolveDynamicComponent:()=>f,resolveFilter:()=>null,resolveTransitionHooks:()=>se,setBlockTracking:()=>ft,setDevtoolsHook:()=>i,setTransitionHooks:()=>ut,shallowReactive:()=>ge,shallowReadonly:()=>c,shallowRef:()=>qt,ssrContextKey:()=>ne,ssrUtils:()=>ie,stop:()=>ye,toDisplayString:()=>ct,toHandlerKey:()=>Le,toHandlers:()=>ue,toRaw:()=>m,toRef:()=>d,toRefs:()=>oe,toValue:()=>N,transformVNodeArgs:()=>v,triggerRef:()=>r,unref:()=>M,useAttrs:()=>w,useCssModule:()=>sn,useCssVars:()=>_n,useHost:()=>gn,useId:()=>te,useModel:()=>me,useSSRContext:()=>Qt,useShadowRoot:()=>vn,useSlots:()=>o,useTemplateRef:()=>we,useTransitionState:()=>S,vModelCheckbox:()=>dn,vModelDynamic:()=>$t,vModelRadio:()=>bn,vModelSelect:()=>En,vModelText:()=>Sn,vShow:()=>wn,version:()=>Se,warn:()=>Ee,watch:()=>b,watchEffect:()=>D,watchPostEffect:()=>At,watchSyncEffect:()=>E,withAsyncContext:()=>Ae,withCtx:()=>Oe,withDefaults:()=>Me,withDirectives:Line truncated
`)].join(`
`))}return()=>i.value||r.value||s.value?xe(t.default({present:s.value})[0],{ref:e=>{let t=V(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}}),si=`dismissableLayer.pointerDownOutside`,ci=`dismissableLayer.focusOutside`;function li(e){if(typeof e!=`object`||!e)return!1;let t=e.ownerDocument?.defaultView;return typeof Element<`u`&&e instanceof Element||!!t&&e instanceof t.Element}function ui(e,t){if(!li(t))return!1;if(e.contains(t))return!0;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function di(e,t,n=!0){let r=I(!1),i=I(()=>{});return D(a=>{if(!B||!N(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(ui(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){zn(si,e,t)}n.pointerType===`touch`?(o.removeEventListener(`click`,i.value),i.value=r,o.addEventListener(`click`,i.value,{once:!0})):r()}else o.removeEventListener(`click`,i.value);r.value=!1}}},c=window.setTimeout(()=>{o.addEventListener(`pointerdown`,s)},0);a(()=>{window.clearTimeout(c),o.removeEventListener(`pointerdown`,s),o.removeEventListener(`click`,i.value)})}),{onPointerDownCapture:()=>{N(n)&&(r.value=!0)}}}function fi(e,t,n=!0){let r=I(!1);return D(i=>{if(!B||!N(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await j(),await j();let i=n.target;t.value&&i&&!ui(t.value,i)&&n.target&&!r.value&&zn(ci,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{N(n)&&(r.value=!0)},onBlurCapture:()=>{N(n)&&(r.value=!1)}}}var H=Yt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pi=k({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Vr(),o=L(()=>a.value?.ownerDocument??globalThis.document),s=L(()=>H.layersRoot),c=L(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=L(()=>H.layersWithOutsidePointerEventsDisabled.size>0),u=L(()=>{let e=Array.from(s.value),[t]=[...H.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=di(async e=>{let t=[...H.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await j(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=fi(e=>{let t=[...H.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return pr(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),b([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;Tr(t,e),H.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{H.layersWithOutsidePointerEventsDisabled.delete(e),Er(t,e)})}},{immediate:!0}),b([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),D(e=>{e(()=>{a.value&&(s.value.delete(a.value),H.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(A(),F(M(un),{ref:M(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Nt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:M(f).onFocusCapture,onBlurCapture:M(f).onBlurCapture,onPointerdownCapture:M(d).onPointerDownCapture},{default:Oe(()=>[P(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),mi=Hn(()=>I([]));function hi(){let e=mi();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=gi(e.value,t),e.value.unshift(t)},remove(t){e.value=gi(e.value,t),e.value[0]?.resume()}}}function gi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var _i=`focusScope.autoFocusOnMount`,vi=`focusScope.autoFocusOnUnmount`,yi={bubbles:!1,cancelable:!0};function bi(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function xi(e,{select:t=!1}={}){let n=R();for(let r of e)if(U(r,{select:t}),R()!==n)return!0}function Si(e){let t=Ci(e);return[wi(t,e),wi(t.reverse(),e)]}function Ci(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n Line truncated
+3
View File
@@ -0,0 +1,3 @@
import{$ as e,$t as t,A as n,An as r,At as i,B as a,Bt as o,C as s,Cn as c,Ct as l,D as u,Dn as d,Dt as f,E as p,En as m,Et as h,F as g,Fn as _,Ft as v,G as y,Gt as b,H as x,Ht as S,I as C,It as w,J as T,Jt as E,K as ee,Kt as D,L as O,Lt as te,M as k,Mt as ne,N as re,Nt as ie,O as ae,On as oe,Ot as se,P as ce,Pn as le,Pt as ue,Q as de,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as _e,T as ve,Tn as ye,Tt as be,U as xe,Ut as Se,V as Ce,Vt as we,W as Te,Wt as Ee,X as De,Xt as Oe,Y as ke,Yt as Ae,Z as je,Zt as Me,_ as Ne,_n as Pe,_t as A,a as Fe,an as Ie,ar as Le,at as Re,b as ze,bn as Be,bt as Ve,c as He,cn as Ue,ct as We,d as Ge,dn as Ke,dt as qe,en as Je,er as Ye,et as Xe,f as Ze,fn as Qe,ft as $e,g as et,gn as tt,gt as nt,h as rt,hn as it,ht as at,i as ot,in as st,ir as ct,it as j,j as lt,jn as M,jt as ut,k as dt,kn as N,kt as ft,l as pt,ln as mt,lt as ht,m as gt,mn as _t,mt as vt,n as yt,nn as bt,nr as xt,nt as St,o as Ct,on as wt,ot as Tt,p as Et,pn as Dt,pt as Ot,q as kt,qt as At,r as jt,rn as Mt,rr as Nt,rt as Pt,s as Ft,sn as It,st as Lt,tn as Rt,tt as zt,u as Bt,un as Vt,ut as Ht,v as Ut,vn as Wt,vt as Gt,w as Kt,wn as qt,wt as P,x as F,xn as I,xt as Jt,y as L,yn as Yt,yt as Xt,z as Zt,zt as Qt}from"./PageHeader.js";import{$ as $t,B as en,C as tn,F as nn,G as rn,H as an,I as on,J as sn,K as cn,L as ln,N as un,Q as dn,R as fn,U as pn,V as mn,W as hn,X as gn,Y as _n,Z as vn,at as yn,et as bn,it as xn,nt as Sn,q as Cn,rt as wn,t as Tn,tt as En,z as Dn}from"./createLucideIcon.js";var On=Object.defineProperty,kn=(e,t)=>{let n={};for(var r in e)On(n,r,{get:e[r],enumerable:!0});return t||On(n,Symbol.toStringTag,{value:`Module`}),n},An=kn({BaseTransition:()=>ot,BaseTransitionPropsValidators:()=>Fe,Comment:()=>Ct,DeprecationTypes:()=>null,EffectScope:()=>Rt,ErrorCodes:()=>Ft,ErrorTypeStrings:()=>He,Fragment:()=>pt,KeepAlive:()=>Bt,ReactiveEffect:()=>bt,Static:()=>Ge,Suspense:()=>Ze,Teleport:()=>Et,Text:()=>gt,TrackOpTypes:()=>Mt,Transition:()=>on,TransitionGroup:()=>ln,TriggerOpTypes:()=>st,VueElement:()=>fn,assertNumber:()=>rt,callWithAsyncErrorHandling:()=>et,callWithErrorHandling:()=>Ne,camelize:()=>le,capitalize:()=>_,cloneVNode:()=>Ut,compatUtils:()=>null,compile:()=>jn,computed:()=>L,createApp:()=>Dn,createBlock:()=>F,createCommentVNode:()=>he,createElementBlock:()=>s,createElementVNode:()=>ze,createHydrationRenderer:()=>Kt,createPropsRestProxy:()=>ve,createRenderer:()=>p,createSSRApp:()=>en,createSlots:()=>u,createStaticVNode:()=>ae,createTextVNode:()=>dt,createVNode:()=>n,customRef:()=>Ie,defineAsyncComponent:()=>lt,defineComponent:()=>k,defineCustomElement:()=>mn,defineEmits:()=>re,defineExpose:()=>ce,defineModel:()=>g,defineOptions:()=>C,defineProps:()=>O,defineSSRCustomElement:()=>an,defineSlots:()=>pe,devtools:()=>Zt,effect:()=>wt,effectScope:()=>It,getCurrentInstance:()=>a,getCurrentScope:()=>Ue,getCurrentWatcher:()=>mt,getTransitionRawChildren:()=>Ce,guardReactiveProps:()=>x,h:()=>xe,handleError:()=>Te,hasInjectionContext:()=>y,hydrate:()=>pn,hydrateOnIdle:()=>ee,hydrateOnInteraction:()=>kt,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>ke,initCustomFormatter:()=>De,initDirectivesForSSR:()=>hn,inject:()=>je,isMemoSame:()=>de,isProxy:()=>Vt,isReactive:()=>Ke,isReadonly:()=>Qe,isRef:()=>Dt,isRuntimeOnly:()=>e,isShallow:()=>_t,isVNode:()=>Xe,markRaw:()=>it,mergeDefaults:()=>zt,mergeModels:()=>St,mergeProps:()=>Pt,nextTick:()=>j,nodeOps:()=>rn,normalizeClass:()=>Ye,normalizeProps:()=>xt,normalizeStyle:()=>Nt,onActivated:()=>Re,onBeforeMount:()=>Tt,onBeforeUnmount:()=>Lt,onBeforeUpdate:()=>We,onDeactivated:()=>ht,onErrorCaptured:()=>Ht,onMounted:()=>qe,onRenderTracked:()=>$e,onRenderTriggered:()=>Ot,onScopeDispose:()=>tt,onServerPrefetch:()=>vt,onUnmounted:()=>at,onUpdated:()=>nt,onWatcherCleanup:()=>Pe,openBlock:()=>A,patchProp:()=>cn,popScopeId:()=>Gt,provide:()=>Xt,proxyRefs:()=>Wt,pushScopeId:()=>Ve,queuePostFlushCb:()=>Jt,reactive:()=>Yt,readonly:()=>Be,ref:()=>I,registerRuntimeCompiler:()=>_e,render:()=>Cn,renderList:()=>l,renderSlot:()=>P,resolveComponent:()=>be,resolveDirective:()=>h,resolveDynamicComponent:()=>f,resolveFilter:()=>null,resolveTransitionHooks:()=>se,setBlockTracking:()=>ft,setDevtoolsHook:()=>i,setTransitionHooks:()=>ut,shallowReactive:()=>ge,shallowReadonly:()=>c,shallowRef:()=>qt,ssrContextKey:()=>ne,ssrUtils:()=>ie,stop:()=>ye,toDisplayString:()=>ct,toHandlerKey:()=>Le,toHandlers:()=>ue,toRaw:()=>m,toRef:()=>d,toRefs:()=>oe,toValue:()=>N,transformVNodeArgs:()=>v,triggerRef:()=>r,unref:()=>M,useAttrs:()=>w,useCssModule:()=>sn,useCssVars:()=>_n,useHost:()=>gn,useId:()=>te,useModel:()=>me,useSSRContext:()=>Qt,useShadowRoot:()=>vn,useSlots:()=>o,useTemplateRef:()=>we,useTransitionState:()=>S,vModelCheckbox:()=>dn,vModelDynamic:()=>$t,vModelRadio:()=>bn,vModelSelect:()=>En,vModelText:()=>Sn,vShow:()=>wn,version:()=>Se,warn:()=>Ee,watch:()=>b,watchEffect:()=>D,watchPostEffect:()=>At,watchSyncEffect:()=>E,withAsyncContext:()=>Ae,withCtx:()=>Oe,withDefaults:()=>Me,withDirectives:Line truncated
`)].join(`
`))}return()=>i.value||r.value||s.value?xe(t.default({present:s.value})[0],{ref:e=>{let t=H(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?o.value=t.firstElementChild:o.value=t),t}}):null}}),oi=`dismissableLayer.pointerDownOutside`,si=`dismissableLayer.focusOutside`;function ci(e){if(typeof e!=`object`||!e)return!1;let t=e.ownerDocument?.defaultView;return typeof Element<`u`&&e instanceof Element||!!t&&e instanceof t.Element}function li(e,t){if(!ci(t))return!1;if(e.contains(t))return!0;let n=t.closest(`[data-dismissable-layer]`),r=e.dataset.dismissableLayer===``?e:e.querySelector(`[data-dismissable-layer]`),i=Array.from(e.ownerDocument.querySelectorAll(`[data-dismissable-layer]`));return!!(n&&(r===n||i.indexOf(r)<i.indexOf(n)))}function ui(e,t,n=!0){let r=I(!1),i=I(()=>{});return D(a=>{if(!B||!N(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(li(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){zn(oi,e,t)}n.pointerType===`touch`?(o.removeEventListener(`click`,i.value),i.value=r,o.addEventListener(`click`,i.value,{once:!0})):r()}else o.removeEventListener(`click`,i.value);r.value=!1}}},c=window.setTimeout(()=>{o.addEventListener(`pointerdown`,s)},0);a(()=>{window.clearTimeout(c),o.removeEventListener(`pointerdown`,s),o.removeEventListener(`click`,i.value)})}),{onPointerDownCapture:()=>{N(n)&&(r.value=!0)}}}function di(e,t,n=!0){let r=I(!1);return D(i=>{if(!B||!N(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await j(),await j();let i=n.target;t.value&&i&&!li(t.value,i)&&n.target&&!r.value&&zn(si,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{N(n)&&(r.value=!0)},onBlurCapture:()=>{N(n)&&(r.value=!1)}}}var U=Yt({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),fi=k({__name:`DismissableLayer`,props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},present:{type:Boolean,required:!1,default:!0}},emits:[`escapeKeyDown`,`pointerDownOutside`,`focusOutside`,`interactOutside`,`dismiss`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Br(),o=L(()=>a.value?.ownerDocument??globalThis.document),s=L(()=>U.layersRoot),c=L(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=L(()=>U.layersWithOutsidePointerEventsDisabled.size>0),u=L(()=>{let e=Array.from(s.value),[t]=[...U.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=ui(async e=>{let t=[...U.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await j(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=di(e=>{let t=[...U.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return fr(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),b([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;wr(t,e),U.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{U.layersWithOutsidePointerEventsDisabled.delete(e),Tr(t,e)})}},{immediate:!0}),b([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),D(e=>{e(()=>{a.value&&(s.value.delete(a.value),U.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(A(),F(M(un),{ref:M(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Nt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:M(f).onFocusCapture,onBlurCapture:M(f).onBlurCapture,onPointerdownCapture:M(d).onPointerDownCapture},{default:Oe(()=>[P(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),pi=Hn(()=>I([]));function mi(){let e=pi();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=hi(e.value,t),e.value.unshift(t)},remove(t){e.value=hi(e.value,t),e.value[0]?.resume()}}}function hi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var gi=`focusScope.autoFocusOnMount`,_i=`focusScope.autoFocusOnUnmount`,vi={bubbles:!1,cancelable:!0};function yi(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function bi(e,{select:t=!1}={}){let n=R();for(let r of e)if(W(r,{select:t}),R()!==n)return!0}function xi(e){let t=Si(e);return[Ci(t,e),Ci(t.reverse(),e)]}function Si(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n Line truncated
+1 -1
View File
@@ -1,3 +1,3 @@
import{$n as e,A as t,B as n,Bn as r,Cn as i,Dn as a,E as o,En as s,Fn as c,G as l,Gn as u,Gt as d,Hn as f,Ht as p,In as m,Jn as h,Kn as g,Ln as ee,M as _,Mn as v,Nn as y,On as b,Ot as x,Pn as S,Qn as C,Rn as w,U as T,Un as E,V as te,Vn as D,Wn as ne,Xn as re,Xt as ie,Yn as O,Z as ae,Zn as k,_t as oe,a as se,an as ce,bn as le,cn as ue,ct as de,d as fe,dt as pe,er as me,g as he,gn as ge,gt as _e,ht as ve,i as ye,it as be,jn as A,jt as xe,kn as Se,l as Ce,n as we,o as Te,or as Ee,pn as De,qn as j,r as Oe,rt as ke,tr as Ae,v as je,w as Me,wn as Ne,wt as Pe,x as Fe,xn as Ie,xt as Le,y as Re,yn as ze,zn as Be}from"./PageHeader.js";var Ve=void 0,He=typeof window<`u`&&window.trustedTypes;if(He)try{Ve=He.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Ue=Ve?e=>Ve.createHTML(e):e=>e,We=`http://www.w3.org/2000/svg`,Ge=`http://www.w3.org/1998/Math/MathML`,M=typeof document<`u`?document:null,Ke=M&&M.createElement(`template`),qe={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?M.createElementNS(We,e):t===`mathml`?M.createElementNS(Ge,e):n?M.createElement(e,{is:n}):M.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>M.createTextNode(e),createComment:e=>M.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>M.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Ke.innerHTML=Ue(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Ke.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},N=`transition`,P=`animation`,F=Symbol(`_vtc`),Je={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Ye=m({},se,Je),Xe=(e=>(e.displayName=`Transition`,e.props=Ye,e))((e,{slots:t})=>T(ye,Qe(e),t)),I=(e,t=[])=>{D(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ze=e=>e?D(e)?e.some(e=>e.length>1):e.length>1:!1;function Qe(e){let t={};for(let n in e)n in Je||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,h=$e(i),g=h&&h[0],ee=h&&h[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:y,onLeave:b,onLeaveCancelled:x,onBeforeAppear:S=_,onAppear:C=v,onAppearCancelled:w=y}=t,T=(e,t,n,r)=>{e._enterCancelled=r,R(e,t?u:s),R(e,t?l:o),n&&n()},E=(e,t)=>{e._isLeaving=!1,R(e,d),R(e,p),R(e,f),t&&t()},te=e=>(t,n)=>{let i=e?C:v,o=()=>T(t,e,n);I(i,[t,o]),tt(()=>{R(t,e?c:a),L(t,e?u:s),Ze(i)||rt(t,r,g,o)})};return m(t,{onBeforeEnter(e){I(_,[e]),L(e,a),L(e,o)},onBeforeAppear(e){I(S,[e]),L(e,c),L(e,l)},onEnter:te(!1),onAppear:te(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);L(e,d),e._enterCancelled?(L(e,f),st(e)):(st(e),L(e,f)),tt(()=>{e._isLeaving&&(R(e,d),L(e,p),Ze(b)||rt(e,r,ee,n))}),I(b,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),I(y,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),I(w,[e])},onLeaveCancelled(e){E(e),I(x,[e])}})}function $e(e){if(e==null)return null;if(ne(e))return[et(e.enter),et(e.leave)];{let t=et(e);return[t,t]}}function et(e){return Ee(e)}function L(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[F]||(e[F]=new Set)).add(t)}function R(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[F];n&&(n.delete(t),n.size||(e[F]=void 0))}function tt(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var nt=0;function rt(e,t,n,r){let i=e._endId=++nt,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=it(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function it(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${N}Delay`),a=r(`${N}Duration`),o=at(i,a),s=r(`${P}Delay`),c=r(`${P}Duration`),l=at(s,c),u=null,d=0,f=0;t===N?o>0&&(u=N,d=o,f=a.length):t===P?l>0&&(u=P,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?N:P:null,f=u?u===N?a.length:c.length:0);let p=u===N&&/\b(?:transform|all)(?:,|$)/.test(r(`${N}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function at(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((tLine truncated
`))),e[q]=K(i);let a=r||i.props&&i.props.type===`number`;W(e,t?`change`:`input`,t=>{t.target.composing||e[q](rn(e.value,n,a))}),(n||a)&&W(e,`change`,()=>{e.value=rn(e.value,n,a)}),t||(W(e,`compositionstart`,tn),W(e,`compositionend`,nn),W(e,`change`,nn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[J];delete e[J],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[q](rn(e.value,n,r)):e.value=i},beforeUpdate(t,{value:n,oldValue:r,modifiers:{lazy:i,trim:a,number:o}},s){if(t[q]=K(s),t.composing)return;let c=(o||t.type===`number`)&&!/^0\d/.test(t.value)?e(t.value):t.value,l=n??``;if(c===l)return;let u=t.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===t&&t.type!==`range`&&(i&&n===r||a&&t.value.trim()===l)||(t.value=l)}},on={deep:!0,created(e,t,n){e[q]=K(n),W(e,`change`,()=>{let t=e._modelValue,n=Y(e),r=e.checked,i=e[q];if(D(t)){let e=C(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(j(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(fn(e,r))})},mounted:sn,beforeUpdate(e,t,n){e[q]=K(n),sn(e,t,n)}};function sn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(D(t))i=C(t,r.props.value)>-1;else if(j(t))i=t.has(r.props.value);else{if(t===n)return;i=k(t,fn(e,!0))}e.checked!==i&&(e.checked=i)}var cn={created(e,{value:t},n){e.checked=k(t,n.props.value),e[q]=K(n),W(e,`change`,()=>{e[q](Y(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[q]=K(r),t!==n&&(e.checked=k(t,r.props.value))}},ln={deep:!0,created(t,{value:n,modifiers:{number:r}},i){t._modelValue=n,W(t,`change`,()=>{let n=Array.prototype.filter.call(t.options,e=>e.selected).map(t=>r?e(Y(t)):Y(t)),i=t.multiple,a=i?j(t._modelValue)?new Set(n):n:n[0],o=t._pendingValue=[i,i?D(a)?n.slice():n:a];try{t[q](a)}finally{be(()=>{t._pendingValue===o&&(t._pendingValue=void 0)})}}),t[q]=K(i)},mounted(e,{value:t}){dn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[q]=K(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!un(t,n[1],n[0]))&&dn(e,t)}};function un(e,t,n){if(!n||D(e))return k(e,t);if(j(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function dn(e,t){let n=e.multiple,r=D(t);if(!n||r||j(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Y(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):C(t,o)>-1}else a.selected=t.has(o)}else if(k(Y(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Y(e){return`_value`in e?e._value:e.value}function fn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var pn={created(e,t,n){hn(e,t,n,null,`created`)},mounted(e,t,n){hn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){hn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){hn(e,t,n,r,`updated`)}};function mn(e,t){switch(e){case`SELECT`:return ln;case`TEXTAREA`:return an;default:switch(t){case`checkbox`:return on;case`radio`:return cn;default:return an}}}function hn(e,t,n,r,i){let a=mn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function gn(){an.getSSRProps=({value:e})=>({value:e}),cn.getSSRProps=({value:e},t)=>{if(t.props&&k(t.props.value,e))return{checked:!0}},on.getSSRProps=({value:e},t)=>{if(D(e)){if(t.props&&C(e,t.props.value)>-1)return{checked:!0}}else if(j(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},pn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=mn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var _n=[`ctrl`,`shift`,`alt`,`meta`],vn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>_n.some(n=>e[`${n}Key`]&&!t.includes(n))},yn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=vn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},bn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},xn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=w(n.key);if(t.some(e=>e===r||bn[e]===r))return e(n)}))},Sn=m({patchProp:Ft},qe),Cn,wn=!1;function Tn(){return Cn||=o(Sn)}function En(){return Cn=wn?Cn:Me(Sn),wn=!0,Cn}var Dn=((...e)=>{Tn().render(...e)}),On=((...e)=>{En().hydrate(...e)}),kn=((...e)=>{let t=Tn().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Mn(e);if(!r)return;let i=t._component;!f(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,jn(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),An=((...e)=>{let t=En().createApp(...e),{mount:n}=t;retur Line truncated
`))),e[q]=K(i);let a=r||i.props&&i.props.type===`number`;W(e,t?`change`:`input`,t=>{t.target.composing||e[q](rn(e.value,n,a))}),(n||a)&&W(e,`change`,()=>{e.value=rn(e.value,n,a)}),t||(W(e,`compositionstart`,tn),W(e,`compositionend`,nn),W(e,`change`,nn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[J];delete e[J],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[q](rn(e.value,n,r)):e.value=i},beforeUpdate(t,{value:n,oldValue:r,modifiers:{lazy:i,trim:a,number:o}},s){if(t[q]=K(s),t.composing)return;let c=(o||t.type===`number`)&&!/^0\d/.test(t.value)?e(t.value):t.value,l=n??``;if(c===l)return;let u=t.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===t&&t.type!==`range`&&(i&&n===r||a&&t.value.trim()===l)||(t.value=l)}},on={deep:!0,created(e,t,n){e[q]=K(n),W(e,`change`,()=>{let t=e._modelValue,n=Y(e),r=e.checked,i=e[q];if(D(t)){let e=C(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(j(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(fn(e,r))})},mounted:sn,beforeUpdate(e,t,n){e[q]=K(n),sn(e,t,n)}};function sn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(D(t))i=C(t,r.props.value)>-1;else if(j(t))i=t.has(r.props.value);else{if(t===n)return;i=k(t,fn(e,!0))}e.checked!==i&&(e.checked=i)}var cn={created(e,{value:t},n){e.checked=k(t,n.props.value),e[q]=K(n),W(e,`change`,()=>{e[q](Y(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[q]=K(r),t!==n&&(e.checked=k(t,r.props.value))}},ln={deep:!0,created(t,{value:n,modifiers:{number:r}},i){t._modelValue=n,W(t,`change`,()=>{let n=Array.prototype.filter.call(t.options,e=>e.selected).map(t=>r?e(Y(t)):Y(t)),i=t.multiple,a=i?j(t._modelValue)?new Set(n):n:n[0],o=t._pendingValue=[i,i?D(a)?n.slice():n:a];try{t[q](a)}finally{be(()=>{t._pendingValue===o&&(t._pendingValue=void 0)})}}),t[q]=K(i)},mounted(e,{value:t}){dn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[q]=K(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!un(t,n[1],n[0]))&&dn(e,t)}};function un(e,t,n){if(!n||D(e))return k(e,t);if(j(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function dn(e,t){let n=e.multiple,r=D(t);if(!n||r||j(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Y(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):C(t,o)>-1}else a.selected=t.has(o)}else if(k(Y(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Y(e){return`_value`in e?e._value:e.value}function fn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var pn={created(e,t,n){hn(e,t,n,null,`created`)},mounted(e,t,n){hn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){hn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){hn(e,t,n,r,`updated`)}};function mn(e,t){switch(e){case`SELECT`:return ln;case`TEXTAREA`:return an;default:switch(t){case`checkbox`:return on;case`radio`:return cn;default:return an}}}function hn(e,t,n,r,i){let a=mn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function gn(){an.getSSRProps=({value:e})=>({value:e}),cn.getSSRProps=({value:e},t)=>{if(t.props&&k(t.props.value,e))return{checked:!0}},on.getSSRProps=({value:e},t)=>{if(D(e)){if(t.props&&C(e,t.props.value)>-1)return{checked:!0}}else if(j(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},pn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=mn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var _n=[`ctrl`,`shift`,`alt`,`meta`],vn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>_n.some(n=>e[`${n}Key`]&&!t.includes(n))},yn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=vn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},bn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},xn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=w(n.key);if(t.some(e=>e===r||bn[e]===r))return e(n)}))},Sn=m({patchProp:Ft},qe),Cn,wn=!1;function Tn(){return Cn||=o(Sn)}function En(){return Cn=wn?Cn:Me(Sn),wn=!0,Cn}var Dn=((...e)=>{Tn().render(...e)}),On=((...e)=>{En().hydrate(...e)}),kn=((...e)=>{let t=Tn().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Mn(e);if(!r)return;let i=t._component;!f(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,jn(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t}),An=((...e)=>{let t=En().createApp(...e),{mount:n}=t;retur Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Dr;function Or(e){Dr=e}var kr=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Ar(e){let t=e instanceof kr?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function jr(e,t){let n=await fetch(e,t);if(Dr?.(n.status===401),!n.ok)throw new kr(await Er(n),n.status);return n}async function Q(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Tr,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await jr(e,s);return a?await c.json():void 0}var Mr={recoveryCode:()=>Q(`/api/account/recovery`,{method:`POST`,body:{}}),recoverAccount:(e,t,n)=>Q(`/api/auth/recover`,{method:`POST`,body:{email:e,code:t,password:n},parse:!1}),authStatus:()=>Q(`/api/auth/status`),setupAccount:e=>Q(`/api/auth/setup`,{method:`POST`,body:e}),signIn:(e,t)=>Q(`/api/auth/login`,{method:`POST`,body:{email:e,password:t}}),signOut:()=>Q(`/api/auth/logout`,{method:`POST`,body:{},parse:!1}),createAccount:e=>Q(`/api/accounts`,{method:`POST`,body:e}),changePassword:(e,t)=>Q(`/api/account/password`,{method:`POST`,body:{current_password:e,new_password:t},parse:!1}),authentication:()=>Q(`/api/authentication`),saveAuthentication:e=>Q(`/api/authentication`,{method:`PUT`,body:e,parse:!1}),tokens:()=>Q(`/api/tokens`),createToken:()=>Q(`/api/tokens`,{method:`POST`,body:{}}),revokeToken:e=>Q(`/api/tokens/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),passkeys:()=>Q(`/api/account/passkeys`),deletePasskey:e=>Q(`/api/account/passkeys/${encodeURIComponent(e)}`,{method:`DELETE`,body:{},parse:!1}),beginPasskey:e=>Q(e?`/api/account/passkeys/begin`:`/api/auth/passkey/begin`,{method:`POST`,body:{}}),finishPasskey:(e,t,n)=>Q(e?`/api/account/passkeys/finish`:`/api/auth/passkey/finish`,{method:`POST`,body:{credential:t,name:n}}),secretEngines:()=>Q(`/api/secret-engines`),checkSecret:e=>Q(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>Q(`/health/detailed`),services:()=>Q(`/api/services`),policies:()=>Q(`/api/access/policies`),putPolicy:e=>Q(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Q(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>Q(`/api/orgs`),orgCreate:e=>Q(`/api/orgs`,{method:`POST`,body:e}),org:e=>Q(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>Q(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgAgents:e=>Q(`/api/orgs/${encodeURIComponent(e)}/agents`),orgMembers:e=>Q(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>Q(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>Q(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Z({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>Q(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>Q(`/api/alerts`),dismissAlert:e=>Q(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>Q(`/api/identities`),identityCreate:e=>Q(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>Q(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>Q(`/api/summary`),tasks:()=>Q(`/api/tasks`),taskPage:async e=>{let t=await jr(`/api/tasks`+Z(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Tr)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>Q(`/api/task-meta`),task:e=>Q(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Q(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Q(`/api/tasks/${encodeURIComponent(e)}/changes`+Z(t)),taskDebug:(e,t)=>Q(`/api/tasks/${encodeURIComponent(e)}/debug`+Z(t)),taskAction:(e,t,n)=>Q(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Q(`/api/setup`),capabilities:()=>Q(`/api/capabilities`),workflows:()=>Q(`/api/workflows`),workflowEnabled:(e,t)=>Q(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),checkRepository:e=>Q(`/api/control-plane/resources/repository-policies/check`,{method:`POST`,body:e,timeoutMs:35e3}),repositories:()=>Q(`/api/repositories`),workRequest:e=>Q(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Q(`/api/skills`),channels:()=>Q(`/api/channels`),curators:()=>Q(`/api/curators`),channelReload:e=>Q(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Q(`/api/config`),logs:e=>Q(`/api/logs`+Z(e)), Line truncated
+1 -1
View File
@@ -1 +1 @@
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharLine truncated
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharLine truncated
+101 -101
View File
@@ -1,12 +1,12 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/css2.js","assets/css.js","assets/html.js","assets/javascript.js","assets/javascript2.js","assets/AccountPage.js","assets/PageHeader.js","assets/createLucideIcon.js","assets/input.js","assets/AuthenticationPage.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/AgentProfilesPage.js","assets/HarnessPage.js","assets/alert.js","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,L as l,M as u,N as d,O as f,P as p,R as m,S as h,T as g,U as _,V as v,W as y,_ as b,a as x,b as S,c as C,d as w,f as ee,g as T,h as E,i as D,j as O,k as te,l as ne,m as re,n as k,o as ie,p as ae,r as oe,s as se,t as ce,u as le,v as ue,w as de,x as fe,y as pe,z as me}from"./alert.js";import{$t as he,A,B as ge,Bt as _e,C as j,Ct as M,D as ve,Dn as ye,Dt as be,En as xe,G as Se,Gt as N,H as Ce,It as we,Jt as Te,Kt as Ee,Lt as De,M as P,On as Oe,Pt as ke,Q as Ae,Qt as je,Rt as Me,S as F,Sn as Ne,T as Pe,Tt as Fe,U as Ie,Vt as Le,Xt as I,Z as Re,_t as L,an as ze,b as R,bn as Be,cn as Ve,dn as He,dt as Ue,er as z,gn as We,hn as Ge,ht as Ke,ir as B,it as qe,jn as V,k as H,kn as Je,l as U,m as Ye,n as W,nr as Xe,nt as Ze,o as Qe,ot as $e,p as et,pn as tt,r as nt,rr as rt,rt as G,sn as it,st as at,t as ot,tt as st,wn as ct,wt as K,x as q,xn as J,y as Y,yn as lt,yt as ut}from"./PageHeader.js";import{C as dt,D as ft,I as eee,M as X,N as pt,P as mt,a as ht,at as gt,c as tee,i as _t,it as vt,j as yt,n as bt,nt as xt,o as St,r as Z,rt as Ct,s as wt,t as Tt,tt as Et,z as nee}from"./createLucideIcon.js";import{a as Dt,c as ree,d as iee,f as aee,i as oee,l as see,n as Ot,o as cee,p as kt,r as At,s as jt,t as Q,u as Mt}from"./input.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Nt=typeof window<`u`,Pt,Ft=e=>Pt=e,It=Symbol();function Lt(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Rt=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function lee(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function zt(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){uee(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Bt(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Vt(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var Ht=typeof navigator==`object`?navigator:{userAgent:``},Ut=/Macintosh/.test(Ht.userAgent)&&/AppleWebKit/.test(Ht.userAgent)&&!/Safari/.test(Ht.userAgent),uee=Nt?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Ut?dee:`msSaveOrOpenBlob`in Ht?Wt:Gt:()=>{};function dee(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?Vt(r):Bt(r.href)?zt(e,t,n):(r.target=`_blank`,Vt(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Vt(r)},0))}function Wt(e,t=`download`,n){if(typeof e==`string`){if(Bt(e))zt(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){Vt(t)})}}else navigator.msSaveOrOpenBlob(lee(e,n),t)}function Gt(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return zt(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Rt.HTMLElement))||`safari`in Rt,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Ut)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:fee}=Object;function Kt(){let e=it(!0),t=e.run(()=>J({})),n=[],r=[],i=Ge({install(e){Ft(i),i._a=e,e.provide(It,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var qt=()=>{};function Jt(e,t,n,r=qt){e.aLine truncated
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/css2.js","assets/css.js","assets/html.js","assets/javascript.js","assets/javascript2.js","assets/AccountPage.js","assets/PageHeader.js","assets/createLucideIcon.js","assets/input.js","assets/AuthenticationPage.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/AgentProfilesPage.js","assets/HarnessPage.js","assets/badge.js","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{A as e,B as t,C as n,D as r,E as i,F as a,H as o,I as s,L as c,M as l,N as u,O as d,P as f,R as p,S as m,T as h,V as g,_,a as v,b as y,c as b,d as x,f as S,g as C,h as w,i as T,j as ee,k as E,l as D,m as te,n as O,o as ne,p as re,r as ie,s as ae,t as oe,u as se,v as ce,w as le,x as ue,y as de,z as fe}from"./badge.js";import{$t as pe,A as k,B as me,Bt as he,C as A,Ct as j,D as ge,Dn as _e,Dt as ve,En as ye,G as be,Gt as M,H as xe,It as Se,Jt as Ce,Kt as we,Lt as Te,M as N,On as Ee,Pt as De,Q as Oe,Qt as ke,Rt as Ae,S as P,Sn as je,T as Me,Tt as Ne,U as Pe,Vt as Fe,Xt as F,Z as Ie,_t as I,an as Le,b as L,bn as Re,cn as ze,dn as Be,dt as Ve,er as R,gn as He,hn as Ue,ht as We,ir as z,it as Ge,jn as B,k as V,kn as Ke,l as H,m as qe,n as Je,nr as Ye,nt as Xe,o as Ze,ot as Qe,p as $e,pn as et,r as U,rr as tt,rt as W,sn as nt,st as rt,t as it,tt as at,wn as ot,wt as G,x as K,xn as q,y as J,yn as st,yt as ct}from"./PageHeader.js";import{C as lt,D as ut,I as dt,M as Y,N as ft,P as pt,a as eee,at as mt,c as ht,i as gt,it as _t,j as vt,n as yt,nt as tee,o as nee,r as X,rt as bt,s as xt,t as St,tt as ree,z as iee}from"./createLucideIcon.js";import{a as Ct,c as aee,d as oee,f as see,i as cee,l as lee,n as wt,o as Tt,p as Et,r as Dt,s as Ot,t as Z,u as kt}from"./input.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var uee=typeof window<`u`,At,jt=e=>At=e,Mt=Symbol();function Nt(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Pt=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function dee(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function Ft(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){Bt(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function It(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Lt(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var Rt=typeof navigator==`object`?navigator:{userAgent:``},zt=/Macintosh/.test(Rt.userAgent)&&/AppleWebKit/.test(Rt.userAgent)&&!/Safari/.test(Rt.userAgent),Bt=uee?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!zt?Vt:`msSaveOrOpenBlob`in Rt?Ht:Ut:()=>{};function Vt(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?Lt(r):It(r.href)?Ft(e,t,n):(r.target=`_blank`,Lt(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){Lt(r)},0))}function Ht(e,t=`download`,n){if(typeof e==`string`){if(It(e))Ft(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){Lt(t)})}}else navigator.msSaveOrOpenBlob(dee(e,n),t)}function Ut(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return Ft(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Pt.HTMLElement))||`safari`in Pt,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||zt)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:fee}=Object;function Wt(){let e=nt(!0),t=e.run(()=>q({})),n=[],r=[],i=Ue({install(e){jt(i),i._a=e,e.provide(Mt,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var Gt=()=>{};function Kt(e,t,n,r=Gt){e.add(t);let i=()=>{e.deletLine truncated
`);p=n.pop()||``;for(let e of n){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Lu.value=n.session_id),n.type===`delta`&&(o+=n.text,Uu.value=Uu.value?{...Uu.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Uu.value=Uu.value?{...Uu.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Uu.value=Uu.value?{...Uu.value,ask:n.ask}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);Ru.value=!i&&n.trim()===`/new`?[]:[...Ru.value,{from:`assistant`,text:o,tool_calls:a}],Uu.value=null,Bu.value=`Ready`,await $u()}catch(e){let t=e;o&&(Ru.value=[...Ru.value,{from:`assistant`,text:o,tool_calls:a}],a=[]),t.name===`AbortError`&&!c?(Uu.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Bu.value=`Stopped`):(Uu.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Nu(r):void 0,isRetry:i},Bu.value=`Error. Retry available.`)}finally{clearTimeout(l),Pu=null,Zu=null,Vu.value=!1,rd.after?.()}}function ane(){Bu.value=`Stopping…`,Lu.value&&Z.chatCancel(Lu.value).catch(()=>{}),Qu()}function one(){Ue(()=>{$u().catch(e=>{Bu.value=e.message||`Chat unavailable`})}),Ke(()=>{Qu()})}async function ud(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));await ld({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var dd={class:`grid gap-1 p-1`},fd={key:0,class:`text-xs text-fg-subtle`},pd=`__default__`,md=P({__name:`ChatSettings`,setup(e){let t=Y(()=>Gu.value||pd),n=Y(()=>{let e=Wu.value.models_by_provider||{},t=Object.entries(e).filter(([,e])=>e.length);return t.length?t:[[``,Wu.value.models||[]]]});return(e,r)=>(L(),j(`div`,dd,[V(Bu)===`Ready`?F(``,!0):(L(),j(`span`,fd,B(V(Bu)),1)),A(V(Tu),{"model-value":t.value,"onUpdate:modelValue":r[0]||=e=>V(nd)(e===pd?``:String(e??``))},{default:I(()=>[A(V(ku),{size:`sm`,class:`w-full`,"aria-label":`Model`},{default:I(()=>[A(V(Au))]),_:1}),A(V(Eu),null,{default:I(()=>[A(V(Ou),{value:pd},{default:I(()=>[...r[1]||=[H(`Default`,-1)]]),_:1}),(L(!0),j(U,null,M(n.value,([e,t])=>(L(),q(V(Du),{key:e},{default:I(()=>[e?(L(),q(V(zte),{key:0},{default:I(()=>[H(B(e),1)]),_:2},1024)):F(``,!0),(L(!0),j(U,null,M(t,e=>(L(),q(V(Ou),{key:e,value:e},{default:I(()=>[H(B(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[`model-value`])]))}}),hd=P({__name:`ChatSessionActions`,setup(e){let t=J(!1);Zte(t);function n(e){t.value=!1,td(e)}function r(e,n){t.value=!1,ene(e,n)}return(e,i)=>(L(),q(V(Su),{open:t.value,"onUpdate:open":i[5]||=e=>t.value=e},{default:I(()=>[A(V(wu),{"as-child":``},{default:I(()=>[A(V(X),{variant:`ghost`,size:`icon-sm`,class:`flex-none`,"aria-label":`More`,title:`More`},{default:I(()=>[A(V(Kl))]),_:1})]),_:1}),A(V(Cu),{align:`end`,class:`grid w-64 gap-0.5 p-1`},{default:I(()=>[V(Lu)?(L(),j(U,{key:0},[A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[0]||=e=>n(`/retry`)},{default:I(()=>[A(V(Ete),{"data-icon":`inline-start`}),i[6]||=H(`Retry`,-1)]),_:1}),A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[1]||=e=>n(`/undo`)},{default:I(()=>[A(V(_u),{"data-icon":`inline-start`}),i[7]||=H(`Undo`,-1)]),_:1}),A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[2]||=e=>r(`/title`,`Session title`)},{default:I(()=>[A(V(su),{"data-icon":`inline-start`}),i[8]||=H(`Rename`,-1)]),_:1}),A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[3]||=e=>r(`/branch`,`Branch name (optional)`)},{default:I(()=>[A(V(eu),{"data-icon":`inline-start`}),i[9]||=H(`Branch`,-1)]),_:1}),A(V(X),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[4]||=e=>n(`/compress --preview`)},{default:I(()=>[A(V(jte),{"data-icon":`inline-start`}),i[10]||=H(`Preview compression`,-1)]),_:1}),A(V(Lte),{class:`my-1`})],64)):F(``,!0),A(md)]),_:1})]),_:1},8,[`open`]))}}),gd=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`});function _d(e){return e.title||e.branch_name||(e.created_at?gd.format(new Date(e.created_at)):`New chat`)}var vd={class:`min-w-0 flex-1`},yd=P({__name:`ChatSessionList`,setup(e){return(e,t)=>(L(),j(`div`,vd,[A(V(Tu),{"model-value":V(Lu),disabled:!V(Iu).length,"onUpdate:modelValue":t[0]||=e=>V(ed)(String(e))},{default:I(()=>[A(V(ku),{size:`sm`,class:`w-full`,"aria-label":`Conversation`},{default:I(()=>[A(V(Au),{placeholder:`No conversations yet`})]),_:1}),A(V(Eu),null,{default:I(()=>[A(V(Du),null,{default:I(()=>[(L(!0),j(U,null,M(V(Iu),e=>(L(),q(V(Ou),{key:e.session_id,value:e.session_id},{default:I(()=>[H(B(V(_d)(e)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`,`disabled`])]))}}),bd={class:`flex items-center gap-1 border-b px-3 py-2`},xd=P({__name:`ChatBar`,setup(e){return(e,t)=>(L(),j(`div`,bd,[A(yd),A(V(X),{variant:`ghost`,size:`icon-sm`,class:`flex-none`,title:`New chat`, Line truncated
`))],64)):K(n.$slots,`default`,{},void 0,void 0,1)])],10,Kp))}}),Yp=P({__name:`CodeBlockContent`,props:{wrap:{type:Boolean,default:!1},lineNumbers:{type:Boolean,default:!1},startLine:{default:1},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=_e();function r(e){let t=``;for(let n of e)if(n.type!==Qe){if(n.type===Ye)t+=n.children;else if(n.type===U&&Array.isArray(n.children)){let e=r(n.children);if(e===null)return null;t+=e}else return null}return t}function i(){if(!t.lineNumbers)return null;let e=r(n.default?.()??[]);return e===null?null:e.replace(/\n$/,``).split(`
`)}return(n,r)=>(L(),q(V(pt),{as:`pre`,"data-slot":`code-block-content`,"data-wrap":e.wrap||void 0,"data-numbered":e.lineNumbers||void 0,dir:`ltr`,tabindex:`0`,style:rt({counterReset:`line ${e.startLine-1}`}),class:z(V(W)(`px-3 py-3 leading-relaxed group-has-data-[slot=code-block-header]/code-block:pt-2 group-has-data-[slot=code-block-footer]/code-block:pb-2 group-data-[size=sm]/code-block:px-2.5 group-data-[size=sm]/code-block:py-2.5 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto text-start font-mono outline-none data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap`,t.class))},{default:I(()=>[A(V(pt),{as:`code`,"data-slot":`code-block-code`,class:`grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0`},{default:I(()=>[(L(!0),j(U,null,M([i()],(e,t)=>(L(),j(U,{key:t},[e?(L(!0),j(U,{key:0},M(e,(e,t)=>(L(),q(Jp,{key:t},{default:I(()=>[H(B(e),1)]),_:2},1024))),128)):K(n.$slots,`default`,{},void 0,void 0,1)],64))),128))]),_:3})]),_:3},8,[`data-wrap`,`data-numbered`,`style`,`class`]))}}),Xp={"aria-live":`polite`,class:`sr-only`},Zp=P({inheritAttrs:!1,__name:`CodeBlockCopyButton`,props:{asChild:{type:Boolean},as:{default:`button`},value:{},variant:{default:`ghost`},size:{default:`icon-xs`},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,{copy:n,copied:r}=cee({copiedDuring:2e3,legacy:!0});return(i,a)=>(L(),j(U,null,[A(V(X),G(i.$attrs,{"data-slot":`code-block-copy-button`,"data-copied":V(r)||void 0,as:e.as,"as-child":e.asChild,variant:e.variant,size:e.size,"aria-label":V(r)?`Copied`:`Copy`,class:V(W)(``,t.class),onClick:a[0]||=e=>V(n)(t.value)}),{default:I(()=>[V(r)?(L(),q(V(Nl),{key:0})):(L(),q(V(Wl),{key:1}))]),_:1},16,[`data-copied`,`as`,`as-child`,`variant`,`size`,`aria-label`,`class`]),R(`span`,Xp,B(V(r)?`Copied`:``),1)],64))}}),Qp=P({__name:`CodeBlockToken`,props:{token:{}},setup(e){return(t,n)=>(L(),j(`span`,{style:rt(e.token.htmlStyle),class:`text-(--shiki-light) dark:text-(--shiki-dark)`},B(e.token.content),5))}}),$p=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function em(e){return tm(e)}function tm(e){return Array.isArray(e)?nm(e):e instanceof RegExp?e:typeof e==`object`?rm(e):e}function nm(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=tm(e[n]);return t}function rm(e){let t={};for(let n in e)t[n]=tm(e[n]);return t}function im(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function am(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?am(e.substring(0,e.length-1)):e.substr(~t+1)}var om=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,sm=class{static hasCaptures(e){return e!==null&&(om.lastIndex=0,om.test(e))}static replaceCaptures(e,t,n){return e.replace(om,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function cm(e,t){return e<t?-1:+(e>t)}function lm(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=cm(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function um(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function dm(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var fm=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},pm=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(vm(e),t)}static createFromParsedTheme(e,t){return xm(e,t)}_cachedMatchRoot=new fm(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>hm(e.parent,t.parentScopes));return n?new _m(n.fontStyle,n.foreground,n.background):null}},mm=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function hm(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!gm(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function gm Line truncated
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},lh=class{constructor(e,t){this.languageId=e,this.tokenType=t}},uh=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new lh(e,8),this._embeddedLanguagesMatcher=new dh(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new lh(0,0);_getBasicScopeAttributes=new fm(e=>new lh(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},dh=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>dm(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var fh=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function ph(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=mh(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new fh(i,!0);f()}return new fh(i,!1);function f(){let o=hh(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===Ym){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),bh(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof rh){let r=o;bh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof ih){let r=o;bh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(bh(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function mh(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof ih&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=yh(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==Xm){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),bh(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function hh(e,t,n,r,i,a){let o=gh(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=_h(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function gh(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=vh(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function _h(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=vh(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function vh(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function yh(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function bh(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a. Line truncated
`;let a=this.createOnigString(e),o=a.content.length,s=new jh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=ph(this,a,i,0,t,s,!0,r);return Mm(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Dh(e,t){return e=em(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Oh=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=mm.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new mm(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new mm(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Em.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},kh=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Oh.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:Qm(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Oh.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,Zm(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Oh.fromExtension(r,n.contentNameScopesList))}},Ah=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):km(e,wh).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>km(e,wh).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},jh=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._l Line truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(zu.value=n.session_id),n.type===`delta`&&(o+=n.text,Gu.value=Gu.value?{...Gu.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Gu.value=Gu.value?{...Gu.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Gu.value=Gu.value?{...Gu.value,ask:n.ask}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);Bu.value=!i&&n.trim()===`/new`?[]:[...Bu.value,{from:`assistant`,text:o,tool_calls:a}],Gu.value=null,Hu.value=`Ready`,await td()}catch(e){let t=e;o&&(Bu.value=[...Bu.value,{from:`assistant`,text:o,tool_calls:a}],a=[]),t.name===`AbortError`&&!c?(Gu.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Hu.value=`Stopped`):(Gu.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Fu(r):void 0,isRetry:i},Hu.value=`Error. Retry available.`)}finally{clearTimeout(l),Iu=null,$u=null,Uu.value=!1,ad.after?.()}}function fd(){Hu.value=`Stopping…`,zu.value&&X.chatCancel(zu.value).catch(()=>{}),ed()}function pd(){Ve(()=>{td().catch(e=>{Hu.value=e.message||`Chat unavailable`})}),We(()=>{ed()})}async function md(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));await dd({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var hd={class:`grid gap-1 p-1`},gd={key:0,class:`text-xs text-fg-subtle`},_d=`__default__`,vd=N({__name:`ChatSettings`,setup(e){let t=J(()=>qu.value||_d),n=J(()=>{let e=Ku.value.models_by_provider||{},t=Object.entries(e).filter(([,e])=>e.length);return t.length?t:[[``,Ku.value.models||[]]]});return(e,r)=>(I(),A(`div`,hd,[B(Hu)===`Ready`?P(``,!0):(I(),A(`span`,gd,z(B(Hu)),1)),k(B(Du),{"model-value":t.value,"onUpdate:modelValue":r[0]||=e=>B(id)(e===_d?``:String(e??``))},{default:F(()=>[k(B(ju),{size:`sm`,class:`w-full`,"aria-label":`Model`},{default:F(()=>[k(B(Mu))]),_:1}),k(B(Ou),null,{default:F(()=>[k(B(Au),{value:_d},{default:F(()=>[...r[1]||=[V(`Default`,-1)]]),_:1}),(I(!0),A(H,null,j(n.value,([e,t])=>(I(),K(B(ku),{key:e},{default:F(()=>[e?(I(),K(B(Bte),{key:0},{default:F(()=>[V(z(e),1)]),_:2},1024)):P(``,!0),(I(!0),A(H,null,j(t,e=>(I(),K(B(Au),{key:e,value:e},{default:F(()=>[V(z(e),1)]),_:2},1032,[`value`]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[`model-value`])]))}}),yd=N({__name:`ChatSessionActions`,setup(e){let t=q(!1);Qte(t);function n(e){t.value=!1,rd(e)}function r(e,n){t.value=!1,tne(e,n)}return(e,i)=>(I(),K(B(wu),{open:t.value,"onUpdate:open":i[5]||=e=>t.value=e},{default:F(()=>[k(B(Eu),{"as-child":``},{default:F(()=>[k(B(Y),{variant:`ghost`,size:`icon-sm`,class:`flex-none`,"aria-label":`More`,title:`More`},{default:F(()=>[k(B(Yl))]),_:1})]),_:1}),k(B(Tu),{align:`end`,class:`grid w-64 gap-0.5 p-1`},{default:F(()=>[B(zu)?(I(),A(H,{key:0},[k(B(Y),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[0]||=e=>n(`/retry`)},{default:F(()=>[k(B(Ote),{"data-icon":`inline-start`}),i[6]||=V(`Retry`,-1)]),_:1}),k(B(Y),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[1]||=e=>n(`/undo`)},{default:F(()=>[k(B(yu),{"data-icon":`inline-start`}),i[7]||=V(`Undo`,-1)]),_:1}),k(B(Y),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[2]||=e=>r(`/title`,`Session title`)},{default:F(()=>[k(B(lu),{"data-icon":`inline-start`}),i[8]||=V(`Rename`,-1)]),_:1}),k(B(Y),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[3]||=e=>r(`/branch`,`Branch name (optional)`)},{default:F(()=>[k(B(nu),{"data-icon":`inline-start`}),i[9]||=V(`Branch`,-1)]),_:1}),k(B(Y),{variant:`ghost`,size:`sm`,class:`justify-start`,onClick:i[4]||=e=>n(`/compress --preview`)},{default:F(()=>[k(B(Mte),{"data-icon":`inline-start`}),i[10]||=V(`Preview compression`,-1)]),_:1}),k(B(Rte),{class:`my-1`})],64)):P(``,!0),k(vd)]),_:1})]),_:1},8,[`open`]))}}),bd=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`});function xd(e){return e.title||e.branch_name||(e.created_at?bd.format(new Date(e.created_at)):`New chat`)}var Sd={class:`min-w-0 flex-1`},Cd=N({__name:`ChatSessionList`,setup(e){return(e,t)=>(I(),A(`div`,Sd,[k(B(Du),{"model-value":B(zu),disabled:!B(Ru).length,"onUpdate:modelValue":t[0]||=e=>B(nd)(String(e))},{default:F(()=>[k(B(ju),{size:`sm`,class:`w-full`,"aria-label":`Conversation`},{default:F(()=>[k(B(Mu),{placeholder:`No conversations yet`})]),_:1}),k(B(Ou),null,{default:F(()=>[k(B(ku),null,{default:F(()=>[(I(!0),A(H,null,j(B(Ru),e=>(I(),K(B(Au),{key:e.session_id,value:e.session_id},{default:F(()=>[V(z(B(xd)(e)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`,`disabled`])]))}}),wd={class:`flex items-center gap-1 border-b px-3 py-2`},Td=N({__name:`ChatBar`,setup(e){return(e,t)=>(I(),A(`div`,wd,[k(Cd),k(B(Y),{variant:`ghost`,size:`icon-sm`,class:`flex-none`,title:`New chat`,"a Line truncated
`))],64)):G(n.$slots,`default`,{},void 0,void 0,1)])],10,Xp))}}),$p=N({__name:`CodeBlockContent`,props:{wrap:{type:Boolean,default:!1},lineNumbers:{type:Boolean,default:!1},startLine:{default:1},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=he();function r(e){let t=``;for(let n of e)if(n.type!==Ze){if(n.type===qe)t+=n.children;else if(n.type===H&&Array.isArray(n.children)){let e=r(n.children);if(e===null)return null;t+=e}else return null}return t}function i(){if(!t.lineNumbers)return null;let e=r(n.default?.()??[]);return e===null?null:e.replace(/\n$/,``).split(`
`)}return(n,r)=>(I(),K(B(ft),{as:`pre`,"data-slot":`code-block-content`,"data-wrap":e.wrap||void 0,"data-numbered":e.lineNumbers||void 0,dir:`ltr`,tabindex:`0`,style:tt({counterReset:`line ${e.startLine-1}`}),class:R(B(U)(`px-3 py-3 leading-relaxed group-has-data-[slot=code-block-header]/code-block:pt-2 group-has-data-[slot=code-block-footer]/code-block:pb-2 group-data-[size=sm]/code-block:px-2.5 group-data-[size=sm]/code-block:py-2.5 group-data-[size=sm]/code-block:group-has-data-[slot=code-block-header]/code-block:pt-1.5 min-h-0 min-w-0 scroll-fade-x scrollbar-thin overflow-auto text-start font-mono outline-none data-wrap:scroll-fade-y data-wrap:wrap-break-word data-wrap:whitespace-pre-wrap`,t.class))},{default:F(()=>[k(B(ft),{as:`code`,"data-slot":`code-block-code`,class:`grid min-h-lh min-w-max content-start in-data-numbered:grid-cols-[auto_1fr] in-data-wrap:min-w-0`},{default:F(()=>[(I(!0),A(H,null,j([i()],(e,t)=>(I(),A(H,{key:t},[e?(I(!0),A(H,{key:0},j(e,(e,t)=>(I(),K(Qp,{key:t},{default:F(()=>[V(z(e),1)]),_:2},1024))),128)):G(n.$slots,`default`,{},void 0,void 0,1)],64))),128))]),_:3})]),_:3},8,[`data-wrap`,`data-numbered`,`style`,`class`]))}}),em={"aria-live":`polite`,class:`sr-only`},tm=N({inheritAttrs:!1,__name:`CodeBlockCopyButton`,props:{asChild:{type:Boolean},as:{default:`button`},value:{},variant:{default:`ghost`},size:{default:`icon-xs`},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,{copy:n,copied:r}=Tt({copiedDuring:2e3,legacy:!0});return(i,a)=>(I(),A(H,null,[k(B(Y),W(i.$attrs,{"data-slot":`code-block-copy-button`,"data-copied":B(r)||void 0,as:e.as,"as-child":e.asChild,variant:e.variant,size:e.size,"aria-label":B(r)?`Copied`:`Copy`,class:B(U)(``,t.class),onClick:a[0]||=e=>B(n)(t.value)}),{default:F(()=>[B(r)?(I(),K(B(Il),{key:0})):(I(),K(B(ql),{key:1}))]),_:1},16,[`data-copied`,`as`,`as-child`,`variant`,`size`,`aria-label`,`class`]),L(`span`,em,z(B(r)?`Copied`:``),1)],64))}}),nm=N({__name:`CodeBlockToken`,props:{token:{}},setup(e){return(t,n)=>(I(),A(`span`,{style:tt(e.token.htmlStyle),class:`text-(--shiki-light) dark:text-(--shiki-dark)`},z(e.token.content),5))}}),rm=class extends Error{constructor(e){super(e),this.name=`ShikiError`}};function im(e){return am(e)}function am(e){return Array.isArray(e)?om(e):e instanceof RegExp?e:typeof e==`object`?sm(e):e}function om(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=am(e[n]);return t}function sm(e){let t={};for(let n in e)t[n]=am(e[n]);return t}function cm(e,...t){return t.forEach(t=>{for(let n in t)e[n]=t[n]}),e}function lm(e){let t=~e.lastIndexOf(`/`)||~e.lastIndexOf(`\\`);return t===0?e:~t===e.length-1?lm(e.substring(0,e.length-1)):e.substr(~t+1)}var um=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,dm=class{static hasCaptures(e){return e!==null&&(um.lastIndex=0,um.test(e))}static replaceCaptures(e,t,n){return e.replace(um,(e,r,i,a)=>{let o=n[parseInt(r||i,10)];if(o){let e=t.substring(o.start,o.end);for(;e[0]===`.`;)e=e.substring(1);switch(a){case`downcase`:return e.toLowerCase();case`upcase`:return e.toUpperCase();default:return e}}else return e})}};function fm(e,t){return e<t?-1:+(e>t)}function pm(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r<n;r++){let n=fm(e[r],t[r]);if(n!==0)return n}return 0}return n-r}function mm(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function hm(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,`\\$&`)}var gm=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},_m=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Sm(e),t)}static createFromParsedTheme(e,t){return Tm(e,t)}_cachedMatchRoot=new gm(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,n=this._cachedMatchRoot.get(t).find(t=>ym(e.parent,t.parentScopes));return n?new xm(n.fontStyle,n.foreground,n.background):null}},vm=class e{constructor(e,t){this.parent=e,this.scopeName=t}static push(t,n){for(let r of n)t=new e(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new e(n,t[r]);return n}push(t){return new e(this,t)}getSegments(){let e=this,t=[];for(;e;)t.push(e.scopeName),e=e.parent;return t.reverse(),t}toString(){return this.getSegments().join(` `)}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push(n.scopeName),n=n.parent;return n===e?t.reverse():void 0}};function ym(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===`>`){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!bm(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function bm( Line truncated
`)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},ph=class{constructor(e,t){this.languageId=e,this.tokenType=t}},mh=class e{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,t){this._defaultAttributes=new ph(e,8),this._embeddedLanguagesMatcher=new hh(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?e._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new ph(0,0);_getBasicScopeAttributes=new gm(e=>new ph(this._scopeToLanguage(e),this._toStandardTokenType(e)));_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(t){let n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case`comment`:return 1;case`string`:return 2;case`regex`:return 3;case`meta.embedded`:return 0}throw Error(`Unexpected match for standard token type!`)}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},hh=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([e,t])=>hm(e));t.sort(),t.reverse(),this.scopesRegExp=RegExp(`^((${t.join(`)|(`)}))($|\\.)`,``)}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}};typeof process<`u`&&{}.VSCODE_TEXTMATE_DEBUG;var gh=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function _h(e,t,n,r,i,a,o,s){let c=t.content.length,l=!1,u=-1;if(o){let o=vh(e,t,n,r,i,a);i=o.stack,r=o.linePos,n=o.isFirstLine,u=o.anchorPosition}let d=Date.now();for(;!l;){if(s!==0&&Date.now()-d>s)return new gh(i,!0);f()}return new gh(i,!1);function f(){let o=yh(e,t,n,r,i,u);if(!o){a.produce(i,c),l=!0;return}let s=o.captureIndices,d=o.matchedRuleId,f=s&&s.length>0?s[0].end>r:!1;if(d===$m){let o=i.getRule(e);a.produce(i,s[0].start),i=i.withContentNameScopesList(i.nameScopesList),wh(e,t,n,i,a,o.endCaptures,s),a.produce(i,s[0].end);let d=i;if(i=i.parent,u=d.getAnchorPos(),!f&&d.getEnterPos()===r){i=d,a.produce(i,c),l=!0;return}}else{let o=e.getRule(d);a.produce(i,s[0].start);let p=i,m=o.getName(t.content,s),h=i.contentNameScopesList.pushAttributed(m,e);if(i=i.push(d,r,u,s[0].end===c,null,h,h),o instanceof sh){let r=o;wh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.endHasBackReferences&&(i=i.withEndRule(r.getEndWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(o instanceof ch){let r=o;wh(e,t,n,i,a,r.beginCaptures,s),a.produce(i,s[0].end),u=s[0].end;let d=r.getContentName(t.content,s),m=h.pushAttributed(d,e);if(i=i.withContentNameScopesList(m),r.whileHasBackReferences&&(i=i.withEndRule(r.getWhileWithResolvedBackReferences(t.content,s))),!f&&p.hasSameRuleAs(i)){i=i.pop(),a.produce(i,c),l=!0;return}}else if(wh(e,t,n,i,a,o.captures,s),a.produce(i,s[0].end),i=i.pop(),!f){i=i.safePop(),a.produce(i,c),l=!0;return}}s[0].end>r&&(r=s[0].end,n=!1)}}function vh(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1,s=[];for(let t=i;t;t=t.pop()){let n=t.getRule(e);n instanceof ch&&s.push({rule:n,stack:t})}for(let c=s.pop();c;c=s.pop()){let{ruleScanner:s,findOptions:l}=Ch(c.rule,e,c.stack.endRule,n,r===o),u=s.findNextMatchSync(t,r,l);if(u){if(u.ruleId!==eh){i=c.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(a.produce(c.stack,u.captureIndices[0].start),wh(e,t,n,c.stack,a,c.rule.whileCaptures,u.captureIndices),a.produce(c.stack,u.captureIndices[0].end),o=u.captureIndices[0].end,u.captureIndices[0].end>r&&(r=u.captureIndices[0].end,n=!1))}else{i=c.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function yh(e,t,n,r,i,a){let o=bh(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;let c=xh(s,e,t,n,r,i,a);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function bh(e,t,n,r,i,a){let{ruleScanner:o,findOptions:s}=Sh(i.getRule(e),e,i.endRule,n,r===a),c=o.findNextMatchSync(t,r,s);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function xh(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,c=null,l,u=0,d=a.contentNameScopesList.getScopeNames();for(let a=0,f=e.length;a<f;a++){let f=e[a];if(!f.matcher(d))continue;let{ruleScanner:p,findOptions:m}=Sh(t.getRule(f.ruleId),t,null,r,i===o),h=p.findNextMatchSync(n,i,m);if(!h)continue;let g=h.captureIndices[0].start;if(!(g>=s)&&(s=g,c=h.captureIndices,l=h.ruleId,u=f.priority,s===i))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function Sh(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function Ch(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function wh(e,t,n,r,i,a,o){if(a.length===0)return;let s=t.content,c=Math.min(a. Line truncated
`;let a=this.createOnigString(e),o=a.content.length,s=new Fh(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),c=_h(this,a,i,0,t,s,!0,r);return Im(a),{lineLength:o,lineTokens:s,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function jh(e,t){return e=im(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Mh=class e{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static fromExtension(t,n){let r=t,i=t?.scopePath??null;for(let t of n)i=vm.push(i,t.scopeNames),r=new e(r,i,t.encodedTokenAttributes);return r}static createRoot(t,n){return new e(null,new vm(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let i=r.getMetadataForScope(t),a=new vm(null,t),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(n,i,o);return new e(null,a,s)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(` `)}equals(t){return e.equals(this,t)}static equals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}while(1)}static mergeAttributes(e,t,n){let r=-1,i=0,a=0;return n!==null&&(r=n.fontStyle,i=n.foregroundId,a=n.backgroundId),Am.set(e,t.languageId,t.tokenType,null,r,i,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(` `)===-1)return e._pushAttributed(this,t,n);let r=t.split(/ /g),i=this;for(let t of r)i=e._pushAttributed(i,t,n);return i}static _pushAttributed(t,n,r){let i=r.getMetadataForScope(n),a=t.scopePath.push(n),o=r.themeProvider.themeMatch(a),s=e.mergeAttributes(t.tokenAttributes,i,o);return new e(t,a,s)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let t=[],n=this;for(;n&&n!==e;)t.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(n.parent?.scopePath??null)}),n=n.parent;return n===e?t.reverse():void 0}},Nh=class e{constructor(e,t,n,r,i,a,o,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=i,this.endRule=a,this.nameScopesList=o,this.contentNameScopesList=s,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new e(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t!==null&&e._equals(this,t)}static _equals(e,t){return e===t?!0:this._structuralEquals(e,t)?Mh.equals(e.contentNameScopesList,t.contentNameScopesList):!1}static _structuralEquals(e,t){do{if(e===t||!e&&!t)return!0;if(!e||!t||e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}while(1)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){e._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,i,a,o,s){return new e(this,t,n,r,i,a,o,s)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),`[`+e.join(`,`)+`]`}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}toStateStackFrame(){return{ruleId:nh(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){let r=Mh.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new e(t,th(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Mh.fromExtension(r,n.contentNameScopesList))}},Ph=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(e=>e===`*`?(this.allowAny=!0,[]):Nm(e,Oh).map(e=>e.matcher)),this.unbalancedBracketScopes=t.flatMap(e=>Nm(e,Oh).map(e=>e.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Fh=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._l Line truncated
\f\r &/=>`.split(``),`
\f\r "&'/=>\``.split(``)],[`\0
\f\r "&'/<=>`.split(``),`\0
@@ -14,10 +14,10 @@ import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,L as l,M a
\f\r &>`.split(``),`\0
\f\r "&'<=>\``.split(``)],[`\0
\f\r "&'<=>\``.split(``),`\0
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function pv(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=n_);let l=mv(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!ov(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!W_(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function mv(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=hv(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function hv(e,t,n){let r=Qg(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=E_(r.attribute,Object.assign({},e.settings.characterReferences,{subset:fv.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?N_:P_)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=E_(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:fv.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&M_(n,o)>M_(n,e.alternative)&&(o=e.alternative),s=o+E_(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?fv.single:fv.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var gv=[`<`,`&`];function _v(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:E_(e.value,Object.assign({},r.settings.characterReferences,{subset:gv}))}function vv(e,t,n,r){return r.settings.allowDangerousHtml?e.value:_v(e,t,n,r)}function yv(e,t,n,r){return r.all(e)}var bv=i_(`type`,{invalid:xv,unknown:Sv,handlers:{comment:A_,doctype:j_,element:pv,raw:vv,root:yv,text:_v}});function xv(e){throw Error("Expected node, not `"+e+"`")}function Sv(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Cv={},wv={},Tv=[];function Ev(e,t){let n=t||Cv,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Dv,all:Ov,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Sg,characterReferences:n.characterReferences||wv,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?n_:t_,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function Dv(e,t,n){return bv(e,t,n,this)}function Ov(e){let t=[],n=e&&e.children||Tv,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var kv=/\s+/g;function Av(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(kv)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(kv);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function jv(e){let t=Wh(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var Mv=[`color`,`background-color`];function Nv(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Pv(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function Fv(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=Pv(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(rLine truncated
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Rv(a.htmlStyle||Lv(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&ig(m,r),m}function dy(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&bm.Underline||i.fontStyle&bm.Strikethrough));o&&sy.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function fy(e){return e.map(e=>e.flatMap(e=>{if(sy.test(e.content))return e;let t=e.content.match(cy);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function py(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Rv(e.htmlStyle||Lv(e)),i=Rv(n.htmlStyle||Lv(n)),a=e.fontStyle&&(e.fontStyle&bm.Underline||e.fontStyle&bm.Strikethrough),o=n.fontStyle&&(n.fontStyle&bm.Underline||n.fontStyle&bm.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var my=Ev;function hy(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>ly(e,t,n),codeToTokens:(t,n)=>ay(e,t,n)},i=my(ly(e,t,n,r));for(let e of Uv(n))i=e.postprocess?.call(r,i,n)||i;return i}async function gy(e){let t=await ng(e);return{getLastGrammarState:(...e)=>fg(t,...e),codeToTokensBase:(e,n)=>iy(t,e,n),codeToTokensWithThemes:(e,n)=>bg(t,e,n),codeToTokens:(e,n)=>ay(t,e,n),codeToHast:(e,n)=>ly(t,e,n),codeToHtml:(e,n)=>hy(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var _y=4294967295;function vy(e){return!e.sticky&&!e.rawOptions?.strategy}function yy(e,t){return{index:e,captureIndices:t.map(e=>e==null?{start:_y,end:_y,length:0}:{start:e[0],end:e[1],length:e[1]-e[0]})}}var by=class{patterns;options;regexps;lastSearches;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}}),this.lastSearches=this.regexps.map(e=>e&&vy(e)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=typeof e==`string`?0:e.id||0,a=-1,o=0,s=null;for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{let c=i?this.lastSearches[e]:null,l,u;if(c&&c.strId===i&&c.searchedFrom<=t&&(c.matchIndex===-1||c.matchIndex>=t))l=c.matchIndex,u=c.indices;else{n.lastIndex=t;let e=n.exec(r);l=e?e.index:-1,u=e?e.indices:null,c&&(c.strId=i,c.searchedFrom=t,c.matchIndex=l,c.indices=u)}if(l===-1)continue;if(l===t)return yy(e,u);(a===-1||l<o)&&(a=e,o=l,s=u)}catch(e){if(this.options.forgiving)continue;throw e}}return a===-1?null:yy(a,s)}},xy=0;function Sy(e){return{content:e,id:++xy}}function Cy(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function wy(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Ty=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Ey=String.raw;function Dy(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Oy=Ey`\[\^?`,ky=`c.? | C(?:-.?)?|${Ey`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Ey`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Ey`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Ey`o\{[^\}]*\}?`}|${Ey`\d{1,3}`}`,Ay=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,jy=new RegExp(Ey`
\f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function _v(e,t,n,r){let i=r.schema,a=i.space!==`svg`&&r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=o_);let l=vv(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!uv(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!J_(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function vv(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=yv(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function yv(e,t,n){let r=n_(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=A_(r.attribute,Object.assign({},e.settings.characterReferences,{subset:gv.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?L_:R_)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=A_(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:gv.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&I_(n,o)>I_(n,e.alternative)&&(o=e.alternative),s=o+A_(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?gv.single:gv.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var bv=[`<`,`&`];function xv(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:A_(e.value,Object.assign({},r.settings.characterReferences,{subset:bv}))}function Sv(e,t,n,r){return r.settings.allowDangerousHtml?e.value:xv(e,t,n,r)}function Cv(e,t,n,r){return r.all(e)}var wv=c_(`type`,{invalid:Tv,unknown:Ev,handlers:{comment:P_,doctype:F_,element:_v,raw:Sv,root:Cv,text:xv}});function Tv(e){throw Error("Expected node, not `"+e+"`")}function Ev(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var Dv={},Ov={},kv=[];function Av(e,t){let n=t||Dv,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:jv,all:Mv,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Eg,characterReferences:n.characterReferences||Ov,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?o_:a_,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function jv(e,t,n){return wv(e,t,n,this)}function Mv(e){let t=[],n=e&&e.children||kv,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}var Nv=/\s+/g;function Pv(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class==`string`&&(e.properties.class=e.properties.class.split(Nv)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Nv);for(let t of n)t&&!e.properties.class.includes(t)&&e.properties.class.push(t);return e}function Fv(e){let t=Jh(e,!0).map(([e])=>e);function n(n){if(n===e.length)return{line:t.length-1,character:t.at(-1).length};let r=n,i=0;for(let e of t){if(r<e.length)break;r-=e.length,i++}return{line:i,character:r}}function r(e,n){let r=0;for(let n=0;n<e;n++)r+=t[n].length;return r+=n,r}return{lines:t,indexToPos:n,posToIndex:r}}var Iv=[`color`,`background-color`];function Lv(e,t){let n=0,r=[];for(let i of t)i>n&&r.push({...e,content:e.content.slice(n,i),offset:e.offset+n}),n=i;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Rv(e,t){let n=0,r=e.length;for(;n<r;){let i=n+(r-n>>1);e[i]<=t?n=i+1:r=i}return n}function zv(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((e,t)=>e-t);return n.length?e.map(e=>e.flatMap(e=>{let t=e.offset+e.content.length,r=Rv(n,e.offset),i=r;for(;i<n.length&&n[i]<t;)i++;if(r===i)return e;let a=n.slice(rLine truncated
`}));let n={type:`element`,tagName:`span`,properties:{class:`line`},children:[]},r=0;for(let a of e){let e={type:`element`,tagName:`span`,properties:{...a.htmlAttrs},children:[{type:`text`,value:a.content}]},c=Hv(a.htmlStyle||Vv(a));c&&(e.properties.style=c);for(let o of i)e=o?.span?.call(p,e,t+1,r,n,a)||e;s===`inline`?o.children.push(e):s===`classic`&&n.children.push(e),r+=a.content.length}if(s===`classic`){for(let e of i)n=e?.line?.call(p,n,t+1)||n;f.push(n),a.push(n)}else s===`inline`&&f.push(n)}),s===`classic`){for(let e of i)d=e?.code?.call(p,d)||d;u.children.push(d);for(let e of i)u=e?.pre?.call(p,u)||u;o.children.push(u)}else if(s===`inline`){let e=[],t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]};for(let n of o.children)n.type===`element`&&n.tagName===`br`?(e.push(t),t={type:`element`,tagName:`span`,properties:{class:`line`},children:[]}):(n.type===`element`||n.type===`text`)&&t.children.push(n);e.push(t);let n={type:`element`,tagName:`code`,properties:{},children:e};for(let e of i)n=e?.code?.call(p,n)||n;o.children=[];for(let e=0;e<n.children.length;e++){e>0&&o.children.push({type:`element`,tagName:`br`,properties:{},children:[]});let t=n.children[e];t.type===`element`&&o.children.push(...t.children)}}let m=o;for(let e of i)m=e?.root?.call(p,m)||m;return r&&cg(m,r),m}function hy(e){return e.map(e=>{let t=[],n=``,r;return e.forEach((i,a)=>{let o=!(i.fontStyle&&(i.fontStyle&wm.Underline||i.fontStyle&wm.Strikethrough));o&&dy.test(i.content)&&e[a+1]?(r===void 0&&(r=i.offset),n+=i.content):n?(o?t.push({...i,offset:r,content:n+i.content}):t.push({content:n,offset:r},i),r=void 0,n=``):t.push(i)}),t})}function gy(e){return e.map(e=>e.flatMap(e=>{if(dy.test(e.content))return e;let t=e.content.match(fy);if(!t)return e;let[,n,r,i]=t;if(!n&&!i)return e;let a=[{...e,offset:e.offset+n.length,content:r}];return n&&a.unshift({content:n,offset:e.offset}),i&&a.push({content:i,offset:e.offset+n.length+r.length}),a}))}function _y(e){return e.map(e=>{let t=[];for(let n of e){if(t.length===0){t.push({...n});continue}let e=t.at(-1),r=Hv(e.htmlStyle||Vv(e)),i=Hv(n.htmlStyle||Vv(n)),a=e.fontStyle&&(e.fontStyle&wm.Underline||e.fontStyle&wm.Strikethrough),o=n.fontStyle&&(n.fontStyle&wm.Underline||n.fontStyle&wm.Strikethrough);!a&&!o&&r===i?e.content+=n.content:t.push({...n})}return t})}var vy=Av;function yy(e,t,n){let r={meta:{},options:n,codeToHast:(t,n)=>py(e,t,n),codeToTokens:(t,n)=>ly(e,t,n)},i=vy(py(e,t,n,r));for(let e of qv(n))i=e.postprocess?.call(r,i,n)||i;return i}async function by(e){let t=await og(e);return{getLastGrammarState:(...e)=>gg(t,...e),codeToTokensBase:(e,n)=>cy(t,e,n),codeToTokensWithThemes:(e,n)=>wg(t,e,n),codeToTokens:(e,n)=>ly(t,e,n),codeToHast:(e,n)=>py(t,e,n),codeToHtml:(e,n)=>yy(t,e,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}var xy=4294967295;function Sy(e){return!e.sticky&&!e.rawOptions?.strategy}function Cy(e,t){return{index:e,captureIndices:t.map(e=>e==null?{start:xy,end:xy,length:0}:{start:e[0],end:e[1],length:e[1]-e[0]})}}var wy=class{patterns;options;regexps;lastSearches;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:i}=t;if(!i)throw Error("Option `regexConstructor` is not provided");this.regexps=e.map(e=>{if(typeof e!=`string`)return e;let t=r?.get(e);if(t){if(t instanceof RegExp)return t;if(n)return null;throw t}try{let t=i(e);return r?.set(e,t),t}catch(t){if(r?.set(e,t),n)return null;throw t}}),this.lastSearches=this.regexps.map(e=>e&&Sy(e)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){let r=typeof e==`string`?e:e.content,i=typeof e==`string`?0:e.id||0,a=-1,o=0,s=null;for(let e=0;e<this.regexps.length;e++){let n=this.regexps[e];if(n)try{let c=i?this.lastSearches[e]:null,l,u;if(c&&c.strId===i&&c.searchedFrom<=t&&(c.matchIndex===-1||c.matchIndex>=t))l=c.matchIndex,u=c.indices;else{n.lastIndex=t;let e=n.exec(r);l=e?e.index:-1,u=e?e.indices:null,c&&(c.strId=i,c.searchedFrom=t,c.matchIndex=l,c.indices=u)}if(l===-1)continue;if(l===t)return Cy(e,u);(a===-1||l<o)&&(a=e,o=l,s=u)}catch(e){if(this.options.forgiving)continue;throw e}}return a===-1?null:Cy(a,s)}},Ty=0;function Ey(e){return{content:e,id:++Ty}}function Dy(e){if([...e].length!==1)throw Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Oy(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var ky=new Set([`alnum`,`alpha`,`ascii`,`blank`,`cntrl`,`digit`,`graph`,`lower`,`print`,`punct`,`space`,`upper`,`word`,`xdigit`]),Ay=String.raw;function jy(e,t){if(e==null)throw Error(t??`Value expected`);return e}var My=Ay`\[\^?`,Ny=`c.? | C(?:-.?)?|${Ay`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Ay`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Ay`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Ay`o\{[^\}]*\}?`}|${Ay`\d{1,3}`}`,Py=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Fy=new RegExp(Ay`
\\ (?:
${ky}
${Ny}
| [gk]<[^>]*>?
| [gk]'[^']*'?
| .
@@ -34,20 +34,20 @@ import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,L as l,M a
)?
| \*[^\)]*\)?
)?
| (?:${Ay.source})+
| ${Oy}
| (?:${Py.source})+
| ${My}
| .
`.replace(/\s+/g,``),`gsu`),My=new RegExp(Ey`
`.replace(/\s+/g,``),`gsu`),Iy=new RegExp(Ay`
\\ (?:
${ky}
${Ny}
| .
)
| \[:(?:\^?\p{Alpha}+|\^):\]
| ${Oy}
| ${My}
| &&
| .
`.replace(/\s+/g,``),`gsu`);function Ny(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=lb(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(jy.lastIndex=0;s=jy.exec(e);){let t=Py(a,e,s[0],jy.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(jy.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?db(e,u):e).flat(),flags:r}}function Py(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=Fy(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:zy(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:$y(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:By(n)}}if(a===`K`)return{token:qy(`keep`,n)};if(a===`N`||a===`R`)return{token:Ky(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:Ky(`any`,n)};if(a===`X`)return{token:Ky(`text_segment`,n)};let e=Ly(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:ib(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:rb(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:Xy(`group`,n)};if(n===`(?>`)return{token:Xy(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:Xy(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:Xy(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:Xy(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:Yy(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:Ky(`dot`,n)}:n===`^`||n===`$`?{token:zy(e.singleline?{"^":Ey`\A`,$:Ey`\Z`}[n]:n,n)}:n===`|`?{token:Ry(n)}:Ay.test(n)?{tokens:fb(n)}:{token:Vy(Cy(n),n)}}function Fy(e,t,n){let r=[Gy(t[1]===`^`,t)],i=1,a;for(My.lastIndex=n;a=My.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Gy(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Vy(93,e));else if(i--,r.push(Hy(e)),!i)break}else{let t=Iy(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:My.lastIndex||e.length}}function Iy(e){if(e[0]===`\\`)return Ly(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ty.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Ky(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?Uy(e):e===`&&`?Wy(e):Vy(Cy(e),e)}function Ly(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return nb(e);if(`dDhHsSwW`.includes(n))return ob(e);if(e.startsWith(Ey`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return sb(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Vy(Cy(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Vy(ub(e),e);if(tb.has(n))return Vy(tb.get(n),e);if(/\d/.test(n))return Jy(t,e);if(e===`\\`)throw Error(Ey`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Vy(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function Ry(e){return{type:`Alternator`,raw:e}}function zy(e,t){return{type:`Assertion`,kind:e,raw:t}}function By(e){return{type:`Backreference`,raw:e}}function Vy(e,t){return{type:`Character`,value:e,raw:t}}function Hy(e){return{type:`CharacterClassClose`,raw:e}}function Uy(e){return{type:`CharacterClassHyphen`,raw:e}}function Wy(e){return{type:`CharacterClassIntersector`,raw:e}}function Gy(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Ky(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function qy(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:Dy(n.flags),raw:t}}function Jy(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function Yy(e){return{type:`GroupClose`,raw:e}}function Xy(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function Zy(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function Qy(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function $y(e){return{type:`Subroutine`,raw:e}}var eb=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),tb=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function nb(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Vy(Cy(t.toUpperCase())-64,e)}function rb(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=cb(n),o=cb(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),qy(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,Xy(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function ib(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=eb.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`) Line truncated
`.replace(/\s+/g,``),`gsu`);function Ly(e,t={}){let n={flags:``,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!=`string`)throw Error(`String expected as pattern`);let r=pb(n.flags),i=[r.extended],a={captureGroup:n.rules.captureGroup,getCurrentModX(){return i.at(-1)},numOpenGroups:0,popModX(){i.pop()},pushModX(e){i.push(e)},replaceCurrentModX(e){i[i.length-1]=e},singleline:n.rules.singleline},o=[],s;for(Fy.lastIndex=0;s=Fy.exec(e);){let t=Ry(a,e,s[0],Fy.lastIndex);t.tokens?o.push(...t.tokens):t.token&&o.push(t.token),t.lastIndex!==void 0&&(Fy.lastIndex=t.lastIndex)}let c=[],l=0;o.filter(e=>e.type===`GroupOpen`).forEach(e=>{e.kind===`capturing`?e.number=++l:e.raw===`(`&&c.push(e)}),l||c.forEach((e,t)=>{e.kind=`capturing`,e.number=t+1});let u=l||c.length;return{tokens:o.map(e=>e.type===`EscapedNumber`?hb(e,u):e).flat(),flags:r}}function Ry(e,t,n,r){let[i,a]=n;if(n===`[`||n===`[^`){let e=zy(t,n,r);return{tokens:e.tokens,lastIndex:e.lastIndex}}if(i===`\\`){if(`AbBGyYzZ`.includes(a))return{token:Uy(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:rb(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw Error(`Invalid group name "${n}"`);return{token:Wy(n)}}if(a===`K`)return{token:Zy(`keep`,n)};if(a===`N`||a===`R`)return{token:Xy(`newline`,n,{negate:a===`N`})};if(a===`O`)return{token:Xy(`any`,n)};if(a===`X`)return{token:Xy(`text_segment`,n)};let e=Vy(n,{inCharClass:!1});return Array.isArray(e)?{tokens:e}:{token:e}}if(i===`(`){if(a===`*`)return{token:cb(n)};if(n===`(?{`)throw Error(`Unsupported callout "${n}"`);if(n.startsWith(`(?#`)){if(t[r]!==`)`)throw Error(`Unclosed comment group "(?#"`);return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:sb(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n===`(`&&!e.captureGroup||n===`(?:`)return{token:eb(`group`,n)};if(n===`(?>`)return{token:eb(`atomic`,n)};if(n===`(?=`||n===`(?!`||n===`(?<=`||n===`(?<!`)return{token:eb(n[2]===`<`?`lookbehind`:`lookahead`,n,{negate:n.endsWith(`!`)})};if(n===`(`&&e.captureGroup||n.startsWith(`(?<`)&&n.endsWith(`>`)||n.startsWith(`(?'`)&&n.endsWith(`'`))return{token:eb(`capturing`,n,{...n!==`(`&&{name:n.slice(3,-1)}})};if(n.startsWith(`(?~`)){if(n===`(?~|`)throw Error(`Unsupported absence function kind "${n}"`);return{token:eb(`absence_repeater`,n)}}throw Error(n===`(?(`?`Unsupported conditional "${n}"`:`Invalid or unsupported group option "${n}"`)}if(n===`)`){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw Error(`Unmatched ")"`);return{token:$y(n)}}if(e.getCurrentModX()){if(n===`#`){let e=t.indexOf(`
`,r);return{lastIndex:e===-1?t.length:e}}if(/^\s$/.test(n)){let e=/\s+/y;return e.lastIndex=r,{lastIndex:e.exec(t)?e.lastIndex:r}}}return n===`.`?{token:Xy(`dot`,n)}:n===`^`||n===`$`?{token:Uy(e.singleline?{"^":Ay`\A`,$:Ay`\Z`}[n]:n,n)}:n===`|`?{token:Hy(n)}:Py.test(n)?{tokens:gb(n)}:{token:Gy(Dy(n),n)}}function zy(e,t,n){let r=[Yy(t[1]===`^`,t)],i=1,a;for(Iy.lastIndex=n;a=Iy.exec(e);){let e=a[0];if(e[0]===`[`&&e[1]!==`:`)i++,r.push(Yy(e[1]===`^`,e));else if(e===`]`){if(r.at(-1).type===`CharacterClassOpen`)r.push(Gy(93,e));else if(i--,r.push(Ky(e)),!i)break}else{let t=By(e);Array.isArray(t)?r.push(...t):r.push(t)}}return{tokens:r,lastIndex:Iy.lastIndex||e.length}}function By(e){if(e[0]===`\\`)return Vy(e,{inCharClass:!0});if(e[0]===`[`){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!ky.has(t.groups.name))throw Error(`Invalid POSIX class "${e}"`);return Xy(`posix`,e,{value:t.groups.name,negate:!!t.groups.negate})}return e===`-`?qy(e):e===`&&`?Jy(e):Gy(Dy(e),e)}function Vy(e,{inCharClass:t}){let n=e[1];if(n===`c`||n===`C`)return ob(e);if(`dDhHsSwW`.includes(n))return ub(e);if(e.startsWith(Ay`\o{`))throw Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw Error(`Incomplete or invalid Unicode property "${e}"`);return db(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let t=e.split(/\\x/).slice(1).map(e=>parseInt(e,16)),n=new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(t)),r=new TextEncoder;return[...n].map(e=>{let t=[...r.encode(e)].map(e=>`\\x${e.toString(16)}`).join(``);return Gy(Dy(e),t)})}catch{throw Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n===`u`||n===`x`)return Gy(mb(e),e);if(ab.has(n))return Gy(ab.get(n),e);if(/\d/.test(n))return Qy(t,e);if(e===`\\`)throw Error(Ay`Incomplete escape "\"`);if(n===`M`)throw Error(`Unsupported meta "${e}"`);if([...e].length===2)return Gy(e.codePointAt(1),e);throw Error(`Unexpected escape "${e}"`)}function Hy(e){return{type:`Alternator`,raw:e}}function Uy(e,t){return{type:`Assertion`,kind:e,raw:t}}function Wy(e){return{type:`Backreference`,raw:e}}function Gy(e,t){return{type:`Character`,value:e,raw:t}}function Ky(e){return{type:`CharacterClassClose`,raw:e}}function qy(e){return{type:`CharacterClassHyphen`,raw:e}}function Jy(e){return{type:`CharacterClassIntersector`,raw:e}}function Yy(e,t){return{type:`CharacterClassOpen`,negate:e,raw:t}}function Xy(e,t,n={}){return{type:`CharacterSet`,kind:e,...n,raw:t}}function Zy(e,t,n={}){return e===`keep`?{type:`Directive`,kind:e,raw:t}:{type:`Directive`,kind:e,flags:jy(n.flags),raw:t}}function Qy(e,t){return{type:`EscapedNumber`,inCharClass:e,raw:t}}function $y(e){return{type:`GroupClose`,raw:e}}function eb(e,t,n={}){return{type:`GroupOpen`,kind:e,...n,raw:t}}function tb(e,t,n,r){return{type:`NamedCallout`,kind:e,tag:t,arguments:n,raw:r}}function nb(e,t,n,r){return{type:`Quantifier`,kind:e,min:t,max:n,raw:r}}function rb(e){return{type:`Subroutine`,raw:e}}var ib=new Set([`COUNT`,`CMP`,`ERROR`,`FAIL`,`MAX`,`MISMATCH`,`SKIP`,`TOTAL_COUNT`]),ab=new Map([[`a`,7],[`b`,8],[`e`,27],[`f`,12],[`n`,10],[`r`,13],[`t`,9],[`v`,11]]);function ob(e){let t=e[1]===`c`?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw Error(`Unsupported control character "${e}"`);return Gy(Dy(t.toUpperCase())-64,e)}function sb(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??=``;let i=(t.getCurrentModX()||n.includes(`x`))&&!r.includes(`x`),a=fb(n),o=fb(r),s={};if(a&&(s.enable=a),o&&(s.disable=o),e.endsWith(`)`))return t.replaceCurrentModX(i),Zy(`flags`,e,{flags:s});if(e.endsWith(`:`))return t.pushModX(i),t.numOpenGroups++,eb(`group`,e,{...(a||o)&&{flags:s}});throw Error(`Unexpected flag modifier "${e}"`)}function cb(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:i}=t.groups;if(!n)throw Error(`Invalid named callout "${e}"`);if(r===``)throw Error(`Named callout tag with empty value not allowed "${e}"`);let a=i?i.split(`,`).filter(e=>e!==``).map(e=>/^[+-]?\d+$/.test(e)?+e:e):[],[o,s,c]=a,l=ib.has(n)?n.toLowerCase():`custom`;switch(l){case`fail`:case`mismatch`:case`skip`:if(a.length>0)throw Error(`Named callout arguments not allowed "${a}"`);break;case`error`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`);if(typeof o==`string`)throw Error(`Named callout argument must be a number "${o}"`);break;case`max`:if(!a.length||a.length>2)throw Error(`Named callout must have one or two arguments "${a}"`);if(typeof o==`string`&&!/^[A-Za-z_]\w*$/.test(o))throw Error(`Named callout argument one must be a tag or number "${o}"`);if(a.length===2&&(typeof s==`number`||!/^[<>X]$/.test(s)))throw Error(`Named callout optional argument two must be '<', '>', or 'X' "${s}"`);break;case`count`:case`total_count`:if(a.length>1)throw Error(`Named callout allows only one argument "${a}"`) Line truncated
\\(?: \d+
| c[A-Za-z]
| [gk]<[^>]+>
@@ -60,9 +60,9 @@ import{A as e,B as t,C as n,D as r,E as i,F as a,G as o,H as s,I as c,L as l,M a
| [A-Za-z\-]+:
| \(DEFINE\)
))?
| (?<qBase>${px})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
| (?<qBase>${vx})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
| \\?.
`.replace(/\s+/g,``),`gsu`);function hx(e){if(!RegExp(`${px}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(mx.lastIndex=0;o=mx.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=ix(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}mx.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var gx=String.raw,_x=gx`\(\?R=(?<rDepth>[^\)]+)\)|${gx`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,vx=gx`\(\?<(?![=!])(?<captureName>[^>]+)>`,yx=gx`${vx}|(?<unnamed>\()(?!\?)`,bx=new RegExp(gx`${vx}|${_x}|\(\?|\\?.`,`gsu`),xx=`Cannot use multiple overlapping recursions`;function Sx(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(_x,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&lx(e,gx`\(\?\(DEFINE\)`,ax.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=lx(e,gx`\\[1-9]`,ax.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(bx.lastIndex=0;f=bx.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(Cx(m),l)throw Error(xx);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(bx.lastIndex);if(lx(s,_x,ax.DEFAULT))throw Error(xx);let c=m-1;e=wx(t,s,c,!1,n,a,d),i=Dx(i,t,c,a.length,0,d);break}if(h){Cx(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(xx);break}if(!u)throw Error(gx`Recursive \g cannot be used outside the referenced group "${r===`external`?h:gx`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=ux(e,p);if(o&&lx(m,gx`${vx}|\((?!\?)`,ax.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=wx(_,v,b,!0,n,a,d);i=Dx(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,bx.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),bx.lastIndex),s.set(p,bx.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),bx.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Cx(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function wx(e,t,n,r,i,a,o){let s=new Set;r&&sx(e+t,vx,({groups:{captureName:e}})=>{s.add(e)},ax.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Tx(`(?:${e}`,`forward`,...c)}(?:)${Tx(`${t})`,`backward`,...c)}${t}`}function Tx(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=ox(e,gx`${yx}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),Ex(i,n),s?e:`(?<${t}${l}>`}return gx`\k<${c}${l}>`},ax.DEFAULT)}return c}function Ex(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Dx(e,t,n,r,i,a){if(e.size&&r){let o=0;sx(t,yx,()=>o++,ax.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var Ox=String.fromCodePoint,kx=String.raw,Ax={},jx=globalThis.RegExp;Ax.flagGroups=(()=>{try{new jx(`(?i:)`)}catch{return!1}return!0})(),Ax.unicodeSets=(()=>{try{new jx(`[[]]`,`v`)}catch{return!1}return!0})(),Ax.bugFlagVLiteralHyphenIsRange=Ax.unicodeSets?(()=>{try{new jx(kx`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,Ax.bugNestedClassIgnoresNegation=Ax.unicodeSets&&new jx(`[[^a]]`,`v`).test(`a`);function Mx(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Nx(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Px(e,t){return Ix[e]>=Ix[t]}function Fx(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Ix={ES2025:2025,ES2024:2024,ES2018:2018},Lx={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function Rx(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Lx[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`aLine truncated
`.replace(/\s+/g,``),`gsu`);function bx(e){if(!RegExp(`${vx}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,i=``,a=0,o;for(yx.lastIndex=0;o=yx.exec(e);){let{0:s,index:c,groups:{qBase:l,qMod:u,invalidQ:d}}=o;if(s===`[`)a||(r=c),a++;else if(s===`]`)a?a--:r=null;else if(!a){if(u===`+`&&i&&!i.startsWith(`(`)){if(d)throw Error(`Invalid quantifier "${s}"`);let t=-1;if(/^\{\d+\}$/.test(l))e=lx(e,c+l.length,u,``);else{if(i===`)`||i===`]`){let t=i===`)`?n:r;if(t===null)throw Error(`Invalid unmatched "${i}"`);e=`${e.slice(0,t)}(?>${e.slice(t,c)}${l})${e.slice(c+s.length)}`}else e=`${e.slice(0,c-i.length)}(?>${i}${l})${e.slice(c+s.length)}`;t+=4}yx.lastIndex+=t}else s[0]===`(`?t.push(c):s===`)`&&(n=t.length?t.pop():null)}i=s}return{pattern:e}}var xx=String.raw,Sx=xx`\(\?R=(?<rDepth>[^\)]+)\)|${xx`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`}`,Cx=xx`\(\?<(?![=!])(?<captureName>[^>]+)>`,wx=xx`${Cx}|(?<unnamed>\()(?!\?)`,Tx=new RegExp(xx`${Cx}|${Sx}|\(\?|\\?.`,`gsu`),Ex=`Cannot use multiple overlapping recursions`;function Dx(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:`plugin`,...t},i=t?.captureTransfers??new Map;if(!new RegExp(Sx,`su`).test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};if(r===`plugin`&&mx(e,xx`\(\?\(DEFINE\)`,ux.DEFAULT))throw Error(`DEFINE groups cannot be used with recursion`);let a=[],o=mx(e,xx`\\[1-9]`,ux.DEFAULT),s=new Map,c=[],l=!1,u=0,d=0,f;for(Tx.lastIndex=0;f=Tx.exec(e);){let{0:t,groups:{captureName:p,rDepth:m,gRNameOrNum:h,gRDepth:g}}=f;if(t===`[`)u++;else if(u)t===`]`&&u--;else{if(m){if(Ox(m),l)throw Error(Ex);if(o)throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with global recursion`);let t=e.slice(0,f.index),s=e.slice(Tx.lastIndex);if(mx(s,Sx,ux.DEFAULT))throw Error(Ex);let c=m-1;e=kx(t,s,c,!1,n,a,d),i=Mx(i,t,c,a.length,0,d);break}if(h){Ox(g);let u=!1;for(let e of c)if(e.name===h||e.num===+h){if(u=!0,e.hasRecursedWithin)throw Error(Ex);break}if(!u)throw Error(xx`Recursive \g cannot be used outside the referenced group "${r===`external`?h:xx`\g<${h}&R=${g}>`}"`);let p=s.get(h),m=hx(e,p);if(o&&mx(m,xx`${Cx}|\((?!\?)`,ux.DEFAULT))throw Error(`${r===`external`?`Backrefs`:`Numbered backrefs`} cannot be used with recursion of capturing groups`);let _=e.slice(p,f.index),v=m.slice(_.length+t.length),y=a.length,b=g-1,x=kx(_,v,b,!0,n,a,d);i=Mx(i,_,b,a.length-y,y,d),e=`${e.slice(0,p)}${x}${e.slice(p+m.length)}`,Tx.lastIndex+=x.length-t.length-_.length-v.length,c.forEach(e=>e.hasRecursedWithin=!0),l=!0}else if(p)d++,s.set(String(d),Tx.lastIndex),s.set(p,Tx.lastIndex),c.push({num:d,name:p});else if(t[0]===`(`){let e=t===`(`;e&&(d++,s.set(String(d),Tx.lastIndex)),c.push(e?{num:d}:{})}else t===`)`&&c.pop()}}return n.push(...a),{pattern:e,captureTransfers:i,hiddenCaptures:n}}function Ox(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e)||(e=+e,e<2||e>100))throw Error(t)}function kx(e,t,n,r,i,a,o){let s=new Set;r&&fx(e+t,Cx,({groups:{captureName:e}})=>{s.add(e)},ux.DEFAULT);let c=[n,r?s:null,i,a,o];return`${e}${Ax(`(?:${e}`,`forward`,...c)}(?:)${Ax(`${t})`,`backward`,...c)}${t}`}function Ax(e,t,n,r,i,a,o){let s=e=>t===`forward`?e+2:n-e+2-1,c=``;for(let t=0;t<n;t++){let n=s(t);c+=dx(e,xx`${wx}|\\k<(?<backref>[^>]+)>`,({0:e,groups:{captureName:t,unnamed:s,backref:c}})=>{if(c&&r&&!r.has(c))return e;let l=`_$${n}`;if(s||t){let n=o+a.length+1;return a.push(n),jx(i,n),s?e:`(?<${t}${l}>`}return xx`\k<${c}${l}>`},ux.DEFAULT)}return c}function jx(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Mx(e,t,n,r,i,a){if(e.size&&r){let o=0;fx(t,wx,()=>o++,ux.DEFAULT);let s=a-o+i,c=new Map;return e.forEach((e,t)=>{let i=(r-o*n)/n,a=o*n,l=t>s+o?t+r:t,u=[];for(let t of e)if(t<=s)u.push(t);else if(t>s+o+i)u.push(t+r);else if(t<=s+o)for(let e=0;e<=n;e++)u.push(t+o*e);else for(let e=0;e<=n;e++)u.push(t+a+i*e);c.set(l,u)}),c}return e}var Nx=String.fromCodePoint,Px=String.raw,Fx={},Ix=globalThis.RegExp;Fx.flagGroups=(()=>{try{new Ix(`(?i:)`)}catch{return!1}return!0})(),Fx.unicodeSets=(()=>{try{new Ix(`[[]]`,`v`)}catch{return!1}return!0})(),Fx.bugFlagVLiteralHyphenIsRange=Fx.unicodeSets?(()=>{try{new Ix(Px`[\d\-a]`,`v`)}catch{return!0}return!1})():!1,Fx.bugNestedClassIgnoresNegation=Fx.unicodeSets&&new Ix(`[[^a]]`,`v`).test(`a`);function Lx(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Rx(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function zx(e,t){return Vx[e]>=Vx[t]}function Bx(e,t){if(e==null)throw Error(t??`Value expected`);return e}var Vx={ES2025:2025,ES2024:2024,ES2018:2018},Hx={auto:`auto`,ES2025:`ES2025`,ES2024:`ES2024`,ES2018:`ES2018`};function Ux(e={}){if({}.toString.call(e)!==`[object Object]`)throw Error(`Unexpected options`);if(e.target!==void 0&&!Hx[e.target])throw Error(`Unexpected target "${e.target}"`);let t={accuracy:`default`,avoidSubclass:!1,flags:``,global:!1,hasIndices:!1,lazyCompileLength:1/0,target:`aLine truncated
Cc Control cntrl
Cf Format
Cn Unassigned
@@ -152,87 +152,87 @@ Uppercase Upper
Variation_Selector VS
White_Space space
XID_Continue XIDC
XID_Start XIDS`.split(/\s/).map(e=>[Xb(e),e])),Wx=new Map([[`s`,Ox(383)],[Ox(383),`s`]]),Gx=new Map([[Ox(223),Ox(7838)],[Ox(107),Ox(8490)],[Ox(229),Ox(8491)],[Ox(969),Ox(8486)]]),Kx=new Map([Yx(453),Yx(456),Yx(459),Yx(498),...Xx(8072,8079),...Xx(8088,8095),...Xx(8104,8111),Yx(8124),Yx(8140),Yx(8188)]),qx=new Map([[`alnum`,kx`[\p{Alpha}\p{Nd}]`],[`alpha`,kx`\p{Alpha}`],[`ascii`,kx`\p{ASCII}`],[`blank`,kx`[\p{Zs}\t]`],[`cntrl`,kx`\p{Cc}`],[`digit`,kx`\p{Nd}`],[`graph`,kx`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,kx`\p{Lower}`],[`print`,kx`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,kx`[\p{P}\p{S}]`],[`space`,kx`\p{space}`],[`upper`,kx`\p{Upper}`],[`word`,kx`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,kx`\p{AHex}`]]);function Jx(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Yx(e){let t=Ox(e);return[t.toLowerCase(),t]}function Xx(e,t){return Jx(e,t).map(e=>Yx(e))}var Zx=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function Qx(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};nS(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Px(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};$b(e,$x,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return $b(e,eS,a),$b(e,tS,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var $x={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Ib();e.body[0].body.push(Lb({negate:!0,body:r}),Ub(`Any`));let i=Ib();i.body[0].body.push(Bb(`greedy`,0,1/0,e)),n(xS(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];Nx(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=lS(t.get(e));if(n){let t=Ib({flags:n});t.body[0].body=e.body,e.body=[xS(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(xS(Lb({body:[Eb({body:[Db(`string_end`)]}),Eb({body:[Ab(10)]})]}),t));else if(c===`line_start`)o(xS(vS(kx`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&hS(e))o(xS(Lb({negate:!0}),t));else if(d)throw Error(kx`Uses "\G" in a way that requires a subclass`);else o(bS(Db(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(xS(vS(kx`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Vx})(?!${Vx})|(?<!${Vx})(?=${Vx}))`,n=`(?:(?<=${Vx})(?=${Vx})|(?<!${Vx})(?!${Vx}))`;o(xS(vS(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!_S(n)&&(n=cS(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!_S(r)&&(r=cS(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(xS(jb({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`))n(bS(Nb(`digit`,{negate:l}),t));else if(o&&(c===`space`||u===`space`))n(xS(yS(vS(zx),l),t));else if(s&&(c===`word`||u===`word`))n(bS(Nb(`word`,{negate:l}),t));else if(c===`any`)n(bS(Ub(`Any`),t));else if(c===`digit`)n(bS(Ub(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(kx`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=kx`\p{RI}{2}|${e}(?:\u200D${e})*`;n(xS(vS(kx`(?>\r\n|${i?kx`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(bS(Ub(`AHex`,{negate:l}),t));else if(c===`newline`)n(xS(vS(l?`[^
XID_Start XIDS`.split(/\s/).map(e=>[tx(e),e])),Yx=new Map([[`s`,Nx(383)],[Nx(383),`s`]]),Xx=new Map([[Nx(223),Nx(7838)],[Nx(107),Nx(8490)],[Nx(229),Nx(8491)],[Nx(969),Nx(8486)]]),Zx=new Map([eS(453),eS(456),eS(459),eS(498),...tS(8072,8079),...tS(8088,8095),...tS(8104,8111),eS(8124),eS(8140),eS(8188)]),Qx=new Map([[`alnum`,Px`[\p{Alpha}\p{Nd}]`],[`alpha`,Px`\p{Alpha}`],[`ascii`,Px`\p{ASCII}`],[`blank`,Px`[\p{Zs}\t]`],[`cntrl`,Px`\p{Cc}`],[`digit`,Px`\p{Nd}`],[`graph`,Px`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],[`lower`,Px`\p{Lower}`],[`print`,Px`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],[`punct`,Px`[\p{P}\p{S}]`],[`space`,Px`\p{space}`],[`upper`,Px`\p{Upper}`],[`word`,Px`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],[`xdigit`,Px`\p{AHex}`]]);function $x(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function eS(e){let t=Nx(e);return[t.toLowerCase(),t]}function tS(e,t){return $x(e,t).map(e=>eS(e))}var nS=new Set([`Lower`,`Lowercase`,`Upper`,`Uppercase`,`Ll`,`Lowercase_Letter`,`Lt`,`Titlecase_Letter`,`Lu`,`Uppercase_Letter`]);function rS(e,t){let n={accuracy:`default`,asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:`ES2025`,...t};sS(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:zx(n.bestEffortTarget,`ES2024`),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};ix(e,iS,r);let i={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},a={currentFlags:i,prevFlags:null,globalFlags:i,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};return ix(e,aS,a),ix(e,oS,{groupsByName:a.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:a.reffedNodesByReferencer}),e._originMap=a.groupOriginByCopy,e._strategy=r.strategy,e}var iS={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:i}=e;if(i===`repeater`){let e=Bb();e.body[0].body.push(Vb({negate:!0,body:r}),qb(`Any`));let i=Bb();i.body[0].body.push(Wb(`greedy`,0,1/0,e)),n(ES(i,t),{traverse:!0})}else throw Error(`Unsupported absence function "(?~|"`)},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let i=e.body.filter(e=>e.kind===`flags`);for(let e=n+1;e<t.body.length;e++){let n=t.body[e];Rx(r,n,[]).push(...i)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=mS(t.get(e));if(n){let t=Bb({flags:n});t.body[0].body=e.body,e.body=[ES(t,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:i,remove:a,replaceWith:o},s){let{kind:c,negate:l}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:p}=s;if(c===`text_segment_boundary`)throw Error(`Unsupported text segment boundary "\\${l?`Y`:`y`}"`);if(c===`line_end`)o(ES(Vb({body:[Ab({body:[jb(`string_end`)]}),Ab({body:[Pb(10)]})]}),t));else if(c===`line_start`)o(ES(CS(Px`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(c===`search_start`){if(f.has(e))i.flags.sticky=!0,a();else{let e=r[n-1];if(e&&bS(e))o(ES(Vb({negate:!0}),t));else if(d)throw Error(Px`Uses "\G" in a way that requires a subclass`);else o(TS(jb(`string_start`),t)),s.strategy=`clip_search`}}else if(c!==`string_end`&&c!==`string_start`){if(c===`string_end_newline`)o(ES(CS(Px`(?=\n?\z)`),t));else if(c===`word_boundary`){if(!p&&!u){let e=`(?:(?<=${Kx})(?!${Kx})|(?<!${Kx})(?=${Kx}))`,n=`(?:(?<=${Kx})(?=${Kx})|(?<!${Kx})(?!${Kx}))`;o(ES(CS(l?n:e),t))}}else throw Error(`Unexpected assertion kind "${c}"`)}},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!SS(n)&&(n=pS(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!SS(r)&&(r=pS(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){t.kind===`intersection`&&n(ES(Fb({body:[e]}),t),{traverse:!0})},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:i,digitIsAscii:a,spaceIsAscii:o,wordIsAscii:s}){let{kind:c,negate:l,value:u}=e;if(a&&(c===`digit`||u===`digit`))n(TS(Lb(`digit`,{negate:l}),t));else if(o&&(c===`space`||u===`space`))n(ES(wS(CS(Wx),l),t));else if(s&&(c===`word`||u===`word`))n(TS(Lb(`word`,{negate:l}),t));else if(c===`any`)n(TS(qb(`Any`),t));else if(c===`digit`)n(TS(qb(`Nd`,{negate:l}),t));else if(c!==`dot`){if(c===`text_segment`){if(r===`strict`)throw Error(Px`Use of "\X" requires non-strict accuracy`);let e=`\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?`,a=Px`\p{RI}{2}|${e}(?:\u200D${e})*`;n(ES(CS(Px`(?>\r\n|${i?Px`\p{RGI_Emoji}`:a}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(c===`hex`)n(TS(qb(`AHex`,{negate:l}),t));else if(c===`newline`)n(ES(CS(l?`[^
]`:`(?>\r
?|[
\v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Ox(e.codePointAt(0)-1)}${Ox(e.codePointAt(2)+1)}-\u{10FFFF}`),n(xS(vS(`[${e}]`),t))}else n(xS(yS(vS(qx.get(u)),l),t))}else if(c===`property`)Ux.has(Xb(u))||(e.key=`sc`);else if(c===`space`)n(bS(Ub(`space`,{negate:l}),t));else if(c===`word`)n(xS(yS(vS(Vx),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=Ib({flags:c});e.body[0].body=o(),i(xS(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&pb(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(kx`Uses "\K" in a way that's unsupported`);let o=Lb({behind:!0});o.body[0].body=a(),i(xS(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(xS(Lb({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Ib();t.body[0].body.push(e.body),e.body=xS(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=fS(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(kx`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!_S(n)&&(n=cS(n,t),e.ref=n)}},eS={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=bS(oS(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Nx(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=Nx(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Mx(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?oS(0):aS(o,r.groupOriginByCopy,null),l=c;if(!s){let e=lS(sS(o,e=>e.type===`Group`&&!!e.flags)),t=e?Mx(r.globalFlags,e):r.globalFlags;rS(t,r.currentFlags)||(l=Ib({flags:uS(t)}),l.body[0].body.push(c))}n(xS(l,t),{traverse:!s})}},tS={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>iS(t,e));i.length?i.length>1?n(xS(Ib({atomic:!0,body:i.reverse().map(e=>Eb({body:[Ob(e.number)]}))}),t)):e.ref=i[0].number:n(xS(Lb({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=kb();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByR Line truncated
`).flatMap(e=>i(e)):i(e);return{lines:a.map(e=>e.map(e=>({content:e.content,htmlStyle:e.htmlStyle}))),state:n.getLastGrammarState(a)}}}}function aC(e,t){let n=ct(null);N(()=>Je(t),(e,t,r)=>{if(typeof window>`u`)return;let i=!1;r(()=>i=!0),n.value=null,iC(e).then(e=>{i||(n.value=e)}).catch(()=>{})},{immediate:!0});let r={highlighter:null,text:``,lines:[]};return Y(()=>{let t=Je(e),i=t.endsWith(`
\v\f…\u2028\u2029])`),t));else if(c===`posix`){if(!i&&(u===`graph`||u===`print`)){if(r===`strict`)throw Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let e={graph:`!-~`,print:` -~`}[u];l&&(e=`\0-${Nx(e.codePointAt(0)-1)}${Nx(e.codePointAt(2)+1)}-\u{10FFFF}`),n(ES(CS(`[${e}]`),t))}else n(ES(wS(CS(Qx.get(u)),l),t))}else if(c===`property`)Jx.has(tx(u))||(e.key=`sc`);else if(c===`space`)n(TS(qb(`space`,{negate:l}),t));else if(c===`word`)n(ES(wS(CS(Kx),l),t));else throw Error(`Unexpected character set kind "${c}"`)}},Directive({node:e,parent:t,root:n,remove:r,replaceWith:i,removeAllPrevSiblings:a,removeAllNextSiblings:o}){let{kind:s,flags:c}=e;if(s===`flags`){if(!c.enable&&!c.disable)r();else{let e=Bb({flags:c});e.body[0].body=o(),i(ES(e,t),{traverse:!0})}}else if(s===`keep`){let e=n.body[0],r=n.body.length===1&&_b(e,{type:`Group`})&&e.body[0].body.length===1?e.body[0]:n;if(t.parent!==r||r.body.length>1)throw Error(Px`Uses "\K" in a way that's unsupported`);let o=Vb({behind:!0});o.body[0].body=a(),i(ES(o,t))}else throw Error(`Unexpected directive kind "${s}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw Error(`Unsupported flag "P"`);if(e.textSegmentMode===`word`)throw Error(`Unsupported flag "y{w}"`);[`digitIsAscii`,`extended`,`posixIsAscii`,`spaceIsAscii`,`wordIsAscii`,`textSegmentMode`].forEach(t=>delete e[t]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n===`lookbehind`&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r===`fail`)n(ES(Vb({negate:!0}),t));else throw Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type===`Quantifier`){let t=Bb();t.body[0].body.push(e.body),e.body=ES(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,i=!1;for(let t of e.body)if(t.body.length===1&&t.body[0].kind===`search_start`)t.body.pop();else{let e=_S(t.body);e?(r=!0,Array.isArray(e)?n.push(...e):n.push(e)):i=!0}r&&!i&&n.forEach(e=>t.add(e))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t===`strict`&&n&&r)throw Error(Px`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n==`string`&&!SS(n)&&(n=pS(n,t),e.ref=n)}},aS={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:i}=e;r||n.set(e,[...t.get(i).map(({node:e})=>e)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:i,groupsByName:a,multiplexCapturesToLeftByRef:o,openRefs:s,reffedNodesByReferencer:c}){let l=i.get(e);if(l&&s.has(e.number)){let r=TS(dS(e.number),t);c.set(r,s.get(e.number)),n(r);return}s.set(e.number,e),o.set(e.number,[]),e.name&&Rx(o,e.name,[]);let u=o.get(e.name??e.number);for(let t=0;t<u.length;t++){let n=u[t];if(l===n.node||l&&l===n.origin||e===n.origin){u.splice(t,1);break}}if(o.get(e.number).push({node:e,origin:l}),e.name&&o.get(e.name).push({node:e,origin:l}),e.name){let t=Rx(a,e.name,new Map),n=!1;if(l)n=!0;else for(let e of t.values())if(!e.hasDuplicateNameToRemove){n=!0;break}a.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:n})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Lx(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:i,ref:a}=e;if(i){let n=t;for(;(n=n.parent)&&(n.type!==`CapturingGroup`||n.name!==a&&n.number!==a););r.reffedNodesByReferencer.set(e,n);return}let o=r.subroutineRefMap.get(a),s=a===0,c=s?dS(0):uS(o,r.groupOriginByCopy,null),l=c;if(!s){let e=mS(fS(o,e=>e.type===`Group`&&!!e.flags)),t=e?Lx(r.globalFlags,e):r.globalFlags;cS(t,r.currentFlags)||(l=Bb({flags:hS(t)}),l.body[0].body.push(c))}n(ES(l,t),{traverse:!s})}},oS={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let i=r.reffedNodesByReferencer.get(e).filter(t=>lS(t,e));i.length?i.length>1?n(ES(Bb({atomic:!0,body:i.reverse().map(e=>Ab({body:[Mb(e.number)]}))}),t)):e.ref=i[0].number:n(ES(Vb({negate:!0}),t))},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let t=0;t<n;t++){let t=Nb();e.body.at(-1).body.push(t)}}},Subroutine({node:e},t){e.isRecursive&&e.ref!==0&&(e.ref=t.reffedNodesByR Line truncated
`).flatMap(e=>i(e)):i(e);return{lines:a.map(e=>e.map(e=>({content:e.content,htmlStyle:e.htmlStyle}))),state:n.getLastGrammarState(a)}}}}function uC(e,t){let n=ot(null);M(()=>Ke(t),(e,t,r)=>{if(typeof window>`u`)return;let i=!1;r(()=>i=!0),n.value=null,lC(e).then(e=>{i||(n.value=e)}).catch(()=>{})},{immediate:!0});let r={highlighter:null,text:``,lines:[]};return J(()=>{let t=Ke(e),i=t.endsWith(`
`)?t.slice(0,-1):t,a=n.value;if(!a)return i.split(`
`).map(e=>e?[{content:e}]:[]);(r.highlighter!==a||!i.startsWith(r.text))&&(r={highlighter:a,text:``,lines:[]});let o=i.lastIndexOf(`
`)+1;if(o>r.text.length){let e=a.highlight(i.slice(r.text.length,o-1),r.state);r={highlighter:a,text:i.slice(0,o),lines:[...r.lines,...e.lines],state:e.state}}let s=a.highlight(i.slice(o),r.state).lines[0]??[];return[...r.lines,s]})}var oC=nt(`rounded-lg text-sm data-[size=sm]:text-xs has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/50 group/code-block relative flex w-full min-w-0 flex-col overflow-hidden`,{variants:{variant:{default:`border border-input text-foreground dark:bg-input/30 has-[>[data-slot=code-block-content]:focus-visible]:border-ring`,destructive:`border border-destructive/30 text-destructive dark:border-destructive/40`}},defaultVariants:{variant:`default`}}),sC=nt(`-mx-3 px-3 in-data-numbered:gap-x-3 before:min-w-6 before:text-end before:text-muted-foreground after:start-1 after:text-muted-foreground group-data-[size=sm]/code-block:-mx-2.5 group-data-[size=sm]/code-block:px-2.5 relative block min-h-lh after:absolute after:top-0 after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']`,{variants:{variant:{default:``,added:`bg-muted after:content-['+']`,removed:`bg-destructive/10 after:text-destructive after:content-['−']`,highlighted:`bg-muted`}},defaultVariants:{variant:`default`}}),cC=P({__name:`Message`,props:{class:{type:[Boolean,null,String,Object,Array]},align:{default:`start`},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(L(),q(V(pt),{"data-slot":`message`,"data-align":e.align,as:e.as,"as-child":e.asChild,class:z(V(W)(`text-sm gap-2 group/message relative flex w-full min-w-0 data-[align=end]:flex-row-reverse`,t.class))},{default:I(()=>[K(n.$slots,`default`)]),_:3},8,[`data-align`,`as`,`as-child`,`class`]))}}),lC=P({__name:`MessageContent`,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(L(),q(V(pt),{"data-slot":`message-content`,as:e.as,"as-child":e.asChild,class:z(V(W)(`gap-2.5 group-data-[align=end]/message:*:data-slot:self-end flex w-full min-w-0 flex-col wrap-break-word`,t.class))},{default:I(()=>[K(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),uC=P({__name:`MessageFooter`,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(L(),q(V(pt),{"data-slot":`message-footer`,as:e.as,"as-child":e.asChild,class:z(V(W)(`text-xs font-medium text-muted-foreground px-3 group-has-data-[variant=ghost]/message:px-0 flex max-w-full min-w-0 items-center group-data-[align=end]/message:justify-end`,t.class))},{default:I(()=>[K(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}});function dC(e){switch(e.type){case`image`:return`[photo]`;case`video`:return`[video]`;case`audio`:return`[audio]`;case`document`:return e.file_name?`[document: ${e.file_name}]`:`[document]`;default:return`[${e.type||`attachment`}]`}}function fC(e){let t=[];return e.mime_type&&t.push(e.mime_type),e.file_name&&t.push(e.file_name),e.file_size!==void 0&&t.push(`${e.file_size} bytes`),e.width&&e.height&&t.push(`${e.width}×${e.height}`),e.duration!==void 0&&t.push(`${e.duration} s`),t.join(` · `)}var pC={class:`truncate`},mC=P({__name:`ChatAttachment`,props:{attachment:{}},setup(e){return(t,n)=>(L(),q(be(e.attachment.url?`a`:`span`),{href:e.attachment.url,target:e.attachment.url?`_blank`:void 0,rel:e.attachment.url?`noopener noreferrer`:void 0,title:V(fC)(e.attachment),class:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted px-2.5 py-1 text-xs font-medium text-fg-muted`},{default:I(()=>[A(V(Ste),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),R(`span`,pC,B(V(dC)(e.attachment)),1)]),_:1},8,[`href`,`target`,`rel`,`title`]))}}),hC=P({__name:`CodeView`,props:{code:{},lang:{},class:{}},setup(e){let t=e,n=aC(()=>t.code,()=>t.lang||`text`);return(r,i)=>(L(),q(V(Wp),{class:z(V(W)(`bg-muted`,t.class))},{default:I(()=>[A(V(Gp),null,{default:I(()=>[A(V(Zp),{value:e.code},null,8,[`value`])]),_:1}),A(V(Yp),{wrap:``,class:`max-h-[60vh] pe-10 text-xs`},{default:I(()=>[(L(!0),j(U,null,M(V(n),(e,t)=>(L(),q(V(Jp),{key:t},{default:I(()=>[(L(!0),j(U,null,M(e,(e,t)=>(L(),q(V(Qp),{key:t,token:e},null,8,[`token`]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[`class`]))}}),gC=[`src`,`alt`],_C={key:1},vC={key:2},yC={key:3,class:`rounded bg-foreground/10 px-1 py-0.5 font-mono text-[0.9em]`},bC=[`href`],xC={key:5},SC=P({__name:`ChatInline`,props:{inline:{}},setup(e){return(t,n)=>(L(!0),j(U,null,M(e.inline,(e,t)=>(L(),j(U,{key:t},[e.kind===`image`?(L(),j(`img`,{key:0,src:e.src,alt:e.alt,loading:`lazy`,class:`my-1 block max-h-96 max-w-full cursor-pointer rounded-md border border-border bgLine truncated
`),r=[],i=null,a=null,o=``,s=()=>{r.length&&(t.push({kind:`p`,inline:wC(r.join(` `))}),r=[])},c=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>wC(e))}),null)};for(let e=0;e<n.length;e++){let l=n[e];if(l.startsWith("```")){s(),c(),a?(t.push({kind:`pre`,code:a.join(`
`),lang:o}),a=null):(a=[],o=l.slice(3).trim().split(/\s/)[0]);continue}if(a){a.push(l);continue}let u=EC(l),d=e+1<n.length?EC(n[e+1]):null;if(u&&d&&DC(d)&&u.length===d.length){s(),c();let r=[];for(e+=2;e<n.length;e++){let t=EC(n[e]);if(!t||t.length!==u.length){e--;break}r.push(t)}t.push({kind:`table`,head:u.map(e=>wC(e)),rows:r.map(e=>e.map(e=>wC(e)))});continue}if(!l.trim()){s(),c();continue}let f=l.match(/^(#{1,3})\s+(.+)$/);if(f){s(),c(),t.push({kind:`h${f[1].length}`,inline:wC(f[2])});continue}let p=l.match(/^\s*[-*]\s+(.+)$/),m=l.match(/^\s*\d+[.)]\s+(.+)$/);if(p||m){s();let e=m?`ol`:`ul`;(!i||i.tag!==e)&&(c(),i={tag:e,items:[]}),i.items.push((p||m)[1])}else l.startsWith(`>`)?(s(),c(),t.push({kind:`blockquote`,inline:wC(l.replace(/^>\s?/,``))})):r.push(l)}return s(),c(),a&&t.push({kind:`pre`,code:a.join(`
`),lang:o}),t}function EC(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function DC(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var OC={class:`[overflow-wrap:anywhere]`},kC={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},AC={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},jC={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},MC={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},NC={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},PC={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},FC={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},IC={key:8,class:`mb-2.5 last:mb-0`},LC=P({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>TC(t.text));return(e,t)=>(L(),j(`div`,OC,[(L(!0),j(U,null,M(n.value,(e,t)=>(L(),j(U,{key:t},[e.kind===`pre`?(L(),q(hC,{key:0,code:e.code,lang:e.lang,class:`my-2`},null,8,[`code`,`lang`])):e.kind===`table`?(L(),j(`table`,kC,[R(`thead`,null,[R(`tr`,null,[(L(!0),j(U,null,M(e.head,(e,t)=>(L(),j(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[A(SC,{inline:e},null,8,[`inline`])]))),128))])]),R(`tbody`,null,[(L(!0),j(U,null,M(e.rows,(e,t)=>(L(),j(`tr`,{key:t},[(L(!0),j(U,null,M(e,(e,t)=>(L(),j(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[A(SC,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(L(),j(`blockquote`,AC,[A(SC,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(L(),j(`h1`,jC,[A(SC,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(L(),j(`h2`,MC,[A(SC,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(L(),j(`h3`,NC,[A(SC,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(L(),j(`ul`,PC,[(L(!0),j(U,null,M(e.items,(e,t)=>(L(),j(`li`,{key:t},[A(SC,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(L(),j(`ol`,FC,[(L(!0),j(U,null,M(e.items,(e,t)=>(L(),j(`li`,{key:t},[A(SC,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(L(),j(`p`,IC,[A(SC,{inline:e.inline},null,8,[`inline`])])):F(``,!0)],64))),128))]))}}),cne={class:`truncate`},lne=P({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Fe(`RouterLink`);return L(),q(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:I(()=>[A(V(wl),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),R(`span`,cne,B(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),RC=P({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||``),o=Y(()=>!a.value&&!i.value&&!!t.streaming),s=Y(()=>[r.value&&`> ${r.value}`,a.value].filter(Boolean).join(`
`)+1;if(o>r.text.length){let e=a.highlight(i.slice(r.text.length,o-1),r.state);r={highlighter:a,text:i.slice(0,o),lines:[...r.lines,...e.lines],state:e.state}}let s=a.highlight(i.slice(o),r.state).lines[0]??[];return[...r.lines,s]})}var dC=Je(`rounded-lg text-sm data-[size=sm]:text-xs has-[>[data-slot=code-block-content]:focus-visible]:ring-3 has-[>[data-slot=code-block-content]:focus-visible]:ring-ring/50 group/code-block relative flex w-full min-w-0 flex-col overflow-hidden`,{variants:{variant:{default:`border border-input text-foreground dark:bg-input/30 has-[>[data-slot=code-block-content]:focus-visible]:border-ring`,destructive:`border border-destructive/30 text-destructive dark:border-destructive/40`}},defaultVariants:{variant:`default`}}),fC=Je(`-mx-3 px-3 in-data-numbered:gap-x-3 before:min-w-6 before:text-end before:text-muted-foreground after:start-1 after:text-muted-foreground group-data-[size=sm]/code-block:-mx-2.5 group-data-[size=sm]/code-block:px-2.5 relative block min-h-lh after:absolute after:top-0 after:select-none in-data-numbered:col-span-2 in-data-numbered:grid in-data-numbered:grid-cols-subgrid in-data-numbered:[counter-increment:line] in-data-numbered:before:content-[counter(line)] in-data-numbered:before:select-none in-data-numbered:supports-[content:counter(line)_/_'']:before:content-[counter(line)_/_'']`,{variants:{variant:{default:``,added:`bg-muted after:content-['+']`,removed:`bg-destructive/10 after:text-destructive after:content-['−']`,highlighted:`bg-muted`}},defaultVariants:{variant:`default`}}),pC=N({__name:`Message`,props:{class:{type:[Boolean,null,String,Object,Array]},align:{default:`start`},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(I(),K(B(ft),{"data-slot":`message`,"data-align":e.align,as:e.as,"as-child":e.asChild,class:R(B(U)(`text-sm gap-2 group/message relative flex w-full min-w-0 data-[align=end]:flex-row-reverse`,t.class))},{default:F(()=>[G(n.$slots,`default`)]),_:3},8,[`data-align`,`as`,`as-child`,`class`]))}}),mC=N({__name:`MessageContent`,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(I(),K(B(ft),{"data-slot":`message-content`,as:e.as,"as-child":e.asChild,class:R(B(U)(`gap-2.5 group-data-[align=end]/message:*:data-slot:self-end flex w-full min-w-0 flex-col wrap-break-word`,t.class))},{default:F(()=>[G(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}}),hC=N({__name:`MessageFooter`,props:{class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:`div`}},setup(e){let t=e;return(n,r)=>(I(),K(B(ft),{"data-slot":`message-footer`,as:e.as,"as-child":e.asChild,class:R(B(U)(`text-xs font-medium text-muted-foreground px-3 group-has-data-[variant=ghost]/message:px-0 flex max-w-full min-w-0 items-center group-data-[align=end]/message:justify-end`,t.class))},{default:F(()=>[G(n.$slots,`default`)]),_:3},8,[`as`,`as-child`,`class`]))}});function gC(e){switch(e.type){case`image`:return`[photo]`;case`video`:return`[video]`;case`audio`:return`[audio]`;case`document`:return e.file_name?`[document: ${e.file_name}]`:`[document]`;default:return`[${e.type||`attachment`}]`}}function _C(e){let t=[];return e.mime_type&&t.push(e.mime_type),e.file_name&&t.push(e.file_name),e.file_size!==void 0&&t.push(`${e.file_size} bytes`),e.width&&e.height&&t.push(`${e.width}×${e.height}`),e.duration!==void 0&&t.push(`${e.duration} s`),t.join(` · `)}var vC={class:`truncate`},yC=N({__name:`ChatAttachment`,props:{attachment:{}},setup(e){return(t,n)=>(I(),K(ve(e.attachment.url?`a`:`span`),{href:e.attachment.url,target:e.attachment.url?`_blank`:void 0,rel:e.attachment.url?`noopener noreferrer`:void 0,title:B(_C)(e.attachment),class:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted px-2.5 py-1 text-xs font-medium text-fg-muted`},{default:F(()=>[k(B(wte),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),L(`span`,vC,z(B(gC)(e.attachment)),1)]),_:1},8,[`href`,`target`,`rel`,`title`]))}}),bC=N({__name:`CodeView`,props:{code:{},lang:{},class:{}},setup(e){let t=e,n=uC(()=>t.code,()=>t.lang||`text`);return(r,i)=>(I(),K(B(Jp),{class:R(B(U)(`bg-muted`,t.class))},{default:F(()=>[k(B(Yp),null,{default:F(()=>[k(B(tm),{value:e.code},null,8,[`value`])]),_:1}),k(B($p),{wrap:``,class:`max-h-[60vh] pe-10 text-xs`},{default:F(()=>[(I(!0),A(H,null,j(B(n),(e,t)=>(I(),K(B(Qp),{key:t},{default:F(()=>[(I(!0),A(H,null,j(e,(e,t)=>(I(),K(B(nm),{key:t,token:e},null,8,[`token`]))),128))]),_:2},1024))),128))]),_:1})]),_:1},8,[`class`]))}}),xC=[`src`,`alt`],SC={key:1},CC={key:2},wC={key:3,class:`rounded bg-foreground/10 px-1 py-0.5 font-mono text-[0.9em]`},TC=[`href`],EC={key:5},DC=N({__name:`ChatInline`,props:{inline:{}},setup(e){return(t,n)=>(I(!0),A(H,null,j(e.inline,(e,t)=>(I(),A(H,{key:t},[e.kind===`image`?(I(),A(`img`,{key:0,src:e.src,alt:e.alt,loading:`lazy`,class:`my-1 block max-h-96 max-w-full cursor-pointer rounded-md border border-border bgLine truncated
`),r=[],i=null,a=null,o=``,s=()=>{r.length&&(t.push({kind:`p`,inline:kC(r.join(` `))}),r=[])},c=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>kC(e))}),null)};for(let e=0;e<n.length;e++){let l=n[e];if(l.startsWith("```")){s(),c(),a?(t.push({kind:`pre`,code:a.join(`
`),lang:o}),a=null):(a=[],o=l.slice(3).trim().split(/\s/)[0]);continue}if(a){a.push(l);continue}let u=jC(l),d=e+1<n.length?jC(n[e+1]):null;if(u&&d&&MC(d)&&u.length===d.length){s(),c();let r=[];for(e+=2;e<n.length;e++){let t=jC(n[e]);if(!t||t.length!==u.length){e--;break}r.push(t)}t.push({kind:`table`,head:u.map(e=>kC(e)),rows:r.map(e=>e.map(e=>kC(e)))});continue}if(!l.trim()){s(),c();continue}let f=l.match(/^(#{1,3})\s+(.+)$/);if(f){s(),c(),t.push({kind:`h${f[1].length}`,inline:kC(f[2])});continue}let p=l.match(/^\s*[-*]\s+(.+)$/),m=l.match(/^\s*\d+[.)]\s+(.+)$/);if(p||m){s();let e=m?`ol`:`ul`;(!i||i.tag!==e)&&(c(),i={tag:e,items:[]}),i.items.push((p||m)[1])}else l.startsWith(`>`)?(s(),c(),t.push({kind:`blockquote`,inline:kC(l.replace(/^>\s?/,``))})):r.push(l)}return s(),c(),a&&t.push({kind:`pre`,code:a.join(`
`),lang:o}),t}function jC(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function MC(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var NC={class:`[overflow-wrap:anywhere]`},PC={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},FC={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},IC={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},LC={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},RC={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},zC={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},BC={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},VC={key:8,class:`mb-2.5 last:mb-0`},HC=N({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=J(()=>AC(t.text));return(e,t)=>(I(),A(`div`,NC,[(I(!0),A(H,null,j(n.value,(e,t)=>(I(),A(H,{key:t},[e.kind===`pre`?(I(),K(bC,{key:0,code:e.code,lang:e.lang,class:`my-2`},null,8,[`code`,`lang`])):e.kind===`table`?(I(),A(`table`,PC,[L(`thead`,null,[L(`tr`,null,[(I(!0),A(H,null,j(e.head,(e,t)=>(I(),A(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[k(DC,{inline:e},null,8,[`inline`])]))),128))])]),L(`tbody`,null,[(I(!0),A(H,null,j(e.rows,(e,t)=>(I(),A(`tr`,{key:t},[(I(!0),A(H,null,j(e,(e,t)=>(I(),A(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[k(DC,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(I(),A(`blockquote`,FC,[k(DC,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(I(),A(`h1`,IC,[k(DC,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(I(),A(`h2`,LC,[k(DC,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(I(),A(`h3`,RC,[k(DC,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(I(),A(`ul`,zC,[(I(!0),A(H,null,j(e.items,(e,t)=>(I(),A(`li`,{key:t},[k(DC,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(I(),A(`ol`,BC,[(I(!0),A(H,null,j(e.items,(e,t)=>(I(),A(`li`,{key:t},[k(DC,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(I(),A(`p`,VC,[k(DC,{inline:e.inline},null,8,[`inline`])])):P(``,!0)],64))),128))]))}}),UC={class:`truncate`},one=N({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Ne(`RouterLink`);return I(),K(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-md border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:F(()=>[k(B(Dl),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),L(`span`,UC,z(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),WC=N({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=J(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=J(()=>t.tool.parameters||t.tool.Parameters||``),i=J(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=J(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||``),o=J(()=>!a.value&&!i.value&&!!t.streaming),s=J(()=>[r.value&&`> ${r.value}`,a.value].filter(Boolean).join(`
`));return(t,r)=>e.tool.path?(L(),q(lne,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):s.value?(L(),q(V(Ip),{key:1,"default-open":i.value},{default:I(()=>[A(V(zp),null,{default:I(()=>[A(V(Vp),{status:i.value?`error`:o.value?`running`:void 0},{default:I(()=>[A(V(Rp),null,{default:I(()=>[A(V(yu))]),_:1}),A(V(Hp),null,{default:I(()=>[H(B(n.value),1)]),_:1})]),_:1},8,[`status`])]),_:1}),A(V(Lp),null,{default:I(()=>[A(V(Wp),{size:`sm`},{default:I(()=>[A(V(Yp),{wrap:``,class:`max-h-64`},{default:I(()=>[H(B(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1},8,[`default-open`])):(L(),q(V(Vp),{key:2,status:i.value?`error`:o.value?`running`:void 0},{default:I(()=>[A(V(Rp),null,{default:I(()=>[A(V(yu))]),_:1}),A(V(Hp),null,{default:I(()=>[H(B(n.value),1)]),_:1})]),_:1},8,[`status`]))}}),une={class:`flex flex-col gap-2`},dne=P({__name:`ChatToolGroup`,props:{tools:{},streaming:{type:Boolean}},setup(e){let t=e,n=e=>e.name||e.Name||e.tool||`tool`,r=e=>!!(e.err||e.Err||e.failed),i=Y(()=>{let e=new Map;for(let r of t.tools)e.set(n(r),(e.get(n(r))??0)+1);return[...e].map(([e,t])=>`${e} ×${t}`).join(`, `)}),a=Y(()=>t.tools.some(r));return(t,n)=>(L(),q(V(Ip),{"default-open":a.value},{default:I(()=>[A(V(zp),null,{default:I(()=>[A(V(Vp),{status:a.value?`error`:void 0},{default:I(()=>[A(V(Rp),null,{default:I(()=>[A(V(yu))]),_:1}),A(V(Hp),{class:`truncate`},{default:I(()=>[H(B(i.value),1)]),_:1})]),_:1},8,[`status`])]),_:1}),A(V(Lp),null,{default:I(()=>[R(`div`,une,[(L(!0),j(U,null,M(e.tools,(t,n)=>(L(),q(RC,{key:n,tool:t,streaming:e.streaming&&n===e.tools.length-1},null,8,[`tool`,`streaming`]))),128))])]),_:1})]),_:1},8,[`default-open`]))}}),fne={key:1,class:`mb-2 flex flex-wrap gap-1.5`},pne={key:3,class:`whitespace-pre-wrap`},mne=P({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){let t=e,n=Y(()=>{let e=[],n=!1;for(let r of t.tools)r.path?(e.push([r]),n=!1):n?e[e.length-1].push(r):(e.push([r]),n=!0);return e});return(t,r)=>(L(),q(V(cC),{align:e.assistant?`start`:`end`},{default:I(()=>[A(V(lC),null,{default:I(()=>[A(V(kp),{variant:e.assistant?`muted`:`tinted`,class:`max-w-[min(78ch,92%)]`},{default:I(()=>[A(V(Ap),{class:`[overflow-wrap:anywhere]`},{default:I(()=>[e.assistant&&e.tools.length?(L(),q(V(Mp),{key:0,class:`mb-2`},{default:I(()=>[(L(!0),j(U,null,M(n.value,(t,n)=>(L(),j(U,{key:n},[t.length>1?(L(),q(dne,{key:0,tools:t,streaming:e.streaming},null,8,[`tools`,`streaming`])):(L(),q(RC,{key:1,tool:t[0],streaming:e.streaming},null,8,[`tool`,`streaming`]))],64))),128))]),_:1})):F(``,!0),e.media.length?(L(),j(`div`,fne,[(L(!0),j(U,null,M(e.media,(e,t)=>(L(),q(mC,{key:t,attachment:e},null,8,[`attachment`]))),128))])):F(``,!0),e.assistant?(L(),q(LC,{key:2,text:e.text},null,8,[`text`])):(L(),j(`div`,pne,B(e.text),1)),K(t.$slots,`default`)]),_:3})]),_:3},8,[`variant`]),e.assistant&&!e.streaming&&e.text?(L(),q(V(uC),{key:0,class:`px-0 transition-opacity focus-within:opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/message:opacity-100`},{default:I(()=>[A(V(Zp),{value:e.text},null,8,[`value`])]),_:1})):F(``,!0)]),_:3})]),_:3},8,[`align`]))}}),hne={class:`text-sm`},gne={key:0,class:`mt-1 text-fg-muted`},_ne={key:1,class:`mt-2 flex flex-wrap gap-2`},vne=P({__name:`ChatChooseCard`,props:{choose:{}},setup(e){let t=Y(()=>Wu.value.models??[]);return(e,n)=>(L(),j(`div`,hne,[n[0]||=R(`p`,{class:`font-medium`},`Choose a model`,-1),t.value.length?(L(),j(`div`,_ne,[(L(!0),j(U,null,M(t.value,e=>(L(),q(V(X),{key:e,size:`sm`,variant:e===V(Wu).active_model?`default`:`outline`,class:`font-mono`,onClick:t=>void V(nd)(e)},{default:I(()=>[H(B(e),1)]),_:2},1032,[`variant`,`onClick`]))),128))])):(L(),j(`p`,gne,`None configured.`))]))}}),yne={class:`text-sm`},bne={key:0},xne={class:`mt-1 space-y-0.5`},Sne={class:`font-mono`},Cne=[`href`],wne={key:0,class:`mt-3 flex gap-2`},Tne={key:1,class:`mt-2 text-fg-muted`},Ene={key:2,class:`mt-2 text-fg-muted`},Dne={key:3,class:`mt-2 text-ok`},One={key:4,class:`mt-2 text-danger`},kne={key:5,class:`mt-2 text-xs text-fg-muted`},Ane=P({__name:`ChatUpdateCard`,props:{update:{}},setup(e){let t=e,n=Y(()=>t.update.available??[]),r=J(`idle`),i=J(``);async function a(){r.value=`installing`;try{let e=(await Z.updateInstall(t.update.snapshot)).result?.installed;i.value=e?Object.entries(e).map(([e,t])=>`${e} → ${t}`).join(`, `)+`. Archie restarts to apply it.`:`Update finished.`,r.value=`done`}catch(e){i.value=e.message,r.value=`failed`}}async function o(){try{await Z.updateDefer(t.update.snapshot),r.value=`deferred`}catch(e){i.value=e.message,r.value=`failed`}}return(t,s)=>(L(),j(`div`,yne,[n.value.length?(L(),j(U,{key:1},[s[2]||=R(`p`,{class:`font-medium`},`An update is available`,-1),R(`ul`,xne,[(L(!0),j(U,null,M(n.value,e=>(L(),j(`li`,{key:e.ID},[H(B(e.Label||e.ID)+`: `,1),R(`span`,Sne,B(e.Installed||`?`)+` → `+B(e.Available),1),e.Changelog?(L(),j(`a`,{key:0,href:e. Line truncated
`).map(e=>e.trim()).find(Boolean)||``,i=r.length>pT?`${r.slice(0,pT).trimEnd()}…`:r;return{text:i,full:n,truncated:i!==n}}function Fie(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function hT(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return``;if(t<1e3)return`under 1 s`;let n=t/1e3;if(n<60)return`${n.toFixed(+(n<10))} s`;let r=Math.round(n),i=Math.floor(r/60),a=r%60;if(i<60)return a===0?`${i} min`:`${i} min ${a} s`;let o=Math.floor(i/60),s=i-o*60;return s===0?`${o} h`:`${o} h ${s} min`}function gT(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function _T(e){return typeof e==`string`?e:``}function vT(e={}){let t=e.data||{},n=e.stage||`unknown stage`,r=e.workflow?`${e.workflow} workflow`:``;if(e.kind===`stage_start`)return{title:`Started stage: ${n}`,detail:r};if(e.kind===`stage_finish`){let e=[r,hT(t.duration_ms)].filter(Boolean).join(` · `);return{title:t.interrupted?`Stage interrupted: ${n}`:t.skipped?`Skipped stage: ${n}`:t.error?`Stage failed: ${n}`:`Finished stage: ${n}`,detail:[e,_T(t.error),_T(t.when)].filter(Boolean).join(` · `)}}if(e.kind===`task_retried`){let n=Number(t.retry_count);return{title:Number.isFinite(n)&&n>0?`Retry ${n}`:`Retry requested`,detail:[_T(t.previous_stage)&&`after ${_T(t.previous_stage)}`,_T(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=gT(t.iterations),i=gT(t.tokens),a=Number(t.cached_tokens)||0,o=gT((Number(t.prompt_tokens)||0)-a),s=gT(t.completion_tokens),c=gT(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,_T(t.model)].filter(Boolean);return{title:`Agent ${_T(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=_T(t.author);return{title:`Remediation ${_T(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${_T(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=_T(t.pr_number);return{title:`Pull request approved`,detail:[_T(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${_T(t.attempt)} of ${_T(t.of)} failed: ${e.stage||`step`}`,detail:_T(t.error),tone:`warn`};if(e.kind===`config_captured`)return{title:`Configuration captured`,detail:`The effective task-runtime configuration for this run.`};if(e.kind===`binding_started`){let e=_T(t.source),n=_T(t.capture_id),r=[{label:`binding ${_T(t.binding_name)||_T(t.binding_id)}`,to:`/events?tab=bindings`},...n?[{label:`captured event`,to:`/events?tab=inspector&capture=${encodeURIComponent(n)}`}]:[]];return t.unsigned===!0?{title:`Started by an unsigned event`,detail:e?`source ${e}`:``,tone:`warn`,links:r}:{title:`Started by an event`,detail:e?`source ${e}`:``,links:r}}if(e.kind===`changes_captured`){let e=t.totals??{},n=Number(e.files);return{title:`Change capture recorded`,detail:[Number.isFinite(n)&&n>0?`${n} file${n===1?``:`s`} changed`:``,t.captured_after?`captured after ${_T(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:Fie(e.kind||e.type),detail:e.detail||``}}var Iie=[`title`],yT=P({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=fT();n.watchIdentities();let r=e,i=t,a=nT(),o=Y(()=>a.taskIDFor(r.event)),s=Y(()=>mT(r.event,n.identityName));function c(){o.value>0&&i(`open`,o.value)}let l=Y(()=>r.event.at?BC(r.event.at):`–`);return(e,t)=>(L(),q(V(cT),{class:z(o.value>0?`cursor-pointer`:``),role:o.value>0?`link`:void 0,tabindex:o.value>0?0:void 0,title:o.value>0?`Open task details`:void 0,onClick:c,onKeydown:[vt(gt(c,[`prevent`]),[`enter`]),vt(gt(c,[`prevent`]),[`space`])]},{default:I(()=>[A(V(sT),{class:`font-medium`},{default:I(()=>[H(B(V(vT)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),A(V(sT),{class:`font-mono`},{default:I(()=>[H(B(o.value>0?`#${o.value}`:`–`),1)]),_:1}),A(V(sT),{class:`w-[55%] max-w-0`},{default:I(()=>[R(`span`,{class:`block truncate`,title:s.value.truncated?s.value.full:void 0},B(s.value.text),9,Iie)]),_:1}),A(V(sT),null,{default:I(()=>[H(B(l.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Lie=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function bT(e){return(Number(e?.task_id)||0)>0}function Rie(e,t){return t===`tasks`?bT(e):t!==`system`||!bT(e)}function zie(e,t){return e.filter(e=>Rie(e,t))}function Bie(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function Vie(e,t){return`${e}:${t??0}`}function Hie(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=Vie(mT(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var Uie={key:0,class:`font-normal text-fg-subtle`},Wie={role:`region`,"aria-label":`Activity`,"aria- Line truncated
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}function SE(e){return(e?.merged||0)+(e?.completed||0)}function CE(e){return Object.entries(e?.inputs??{}).map(([e,t])=>({name:e,type:t.type,required:t.required===!0})).sort((e,t)=>e.name.localeCompare(t.name))}function wE(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function TE(e,t){switch(t){case`number`:{let t=e.trim();return t!==``&&!Number.isNaN(Number(t))?Number(t):e}case`bool`:return e===`true`||e!==`false`&&e;case`string`:return e;default:try{return JSON.parse(e)}catch{return e}}}function EE(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=TE(e,r.type))}return n}var DE=[`onKeydown`],OE={key:0,class:`text-sm text-danger`,role:`alert`},kE={key:1,class:`grid gap-1.5`},AE=[`for`],jE={key:0,class:`font-normal text-fg-subtle`},ME=[`id`],NE=[`value`],PE={key:0,class:`text-xs text-fg-subtle`},FE={key:2,class:`grid gap-1.5`},IE=[`id`],LE={class:`block truncate text-label font-medium`},RE={class:`block text-xs text-fg-subtle`},zE={key:0,class:`text-xs text-fg-subtle`},BE={key:3,class:`grid gap-3`},VE=[`for`],HE={class:`font-mono`},UE={key:0,class:`text-fg-subtle`},WE={class:`grid gap-1.5`},GE=[`for`],KE={class:`grid gap-1.5`},qE=[`for`],JE={key:4,class:`text-sm text-danger`,role:`alert`},YE={class:`flex items-center gap-2 border-t border-border pt-4`},XE={class:`mr-auto text-xs text-fg-subtle`},ZE=P({__name:`NewTaskForm`,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[`started`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=De(),a=J([]),o=J([]),s=J([]),c=J(``);Ue(async()=>{try{let[e,t]=await Promise.all([Z.workflows(),Z.repositories()]);a.value=(e?.definitions??[]).filter(e=>e.enabled),o.value=e?.workflows??[],s.value=(t??[]).map(e=>`${e.owner}/${e.name}`)}catch(e){c.value=String(e.message||e)}});let l=J(``),u=J(n.workflow??n.initialWorkflow??``),d=J(n.initialInstructions??``),f=J(xE(d.value)),p=J({});Ee(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=Y(()=>a.value.find(e=>e.id===u.value)),h=Y(()=>CE(m.value)),g=Y(()=>wE(h.value,p.value)),_=Y(()=>m.value?.repository??`required`),v=Y(()=>_.value!==`optional`&&_.value!==`none`),y=e=>o.value.find(t=>t.workflow===e),b=J(!1),x=J(``),S=Y(()=>!(!l.value.trim()&&v.value||!u.value||!f.value.trim())&&g.value.length===0);async function C(){if(S.value&&!b.value){b.value=!0,x.value=``;try{let e=await Z.workRequest({repository:_.value===`none`?``:l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:EE(h.value,p.value),...n.draft?{draft:n.draft}:{}});r(`started`,e.task_id)}catch(e){x.value=String(e.message||e)}finally{b.value=!1}}}return(e,t)=>(L(),j(`form`,{class:`grid gap-5`,onSubmit:gt(C,[`prevent`]),onKeydown:[vt(gt(C,[`meta`,`prevent`]),[`enter`]),vt(gt(C,[`ctrl`,`prevent`]),[`enter`])]},[c.value?(L(),j(`p`,OE,B(c.value),1)):F(``,!0),_.value===`none`?F(``,!0):(L(),j(`div`,kE,[R(`label`,{for:`${V(i)}-repo`,class:`text-label font-medium`},[t[5]||=H(`Repository`,-1),v.value?F(``,!0):(L(),j(`span`,jE,` (optional)`))],8,AE),A(V(Q),{id:`${V(i)}-repo`,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class:`font-mono`,placeholder:`owner/repository`,list:`${V(i)}-repos`,required:v.value},null,8,[`id`,`modelValue`,`list`,`required`]),R(`datalist`,{id:`${V(i)}-repos`},[(L(!0),j(U,null,M(s.value,e=>(L(),j(`option`,{key:e,value:e},null,8,NE))),128))],8,ME),s.value.length?(L(),j(`p`,PE,[t[6]||=H(`Configured: `,-1),(L(!0),j(U,null,M(s.value,e=>(L(),q(V(X),{key:e,type:`button`,variant:`link`,size:`xs`,class:`h-auto px-1 font-mono text-fg-subtle`,onClick:t=>l.value=e},{default:I(()=>[H(B(e),1)]),_:2},1032,[`onClick`]))),128))])):F(``,!0)])),n.workflow?F(``,!0):(L(),j(`div`,FE,[R(`span`,{id:`${V(i)}-wf`,class:`text-label font-medium`},`Workflow`,8,IE),A(V(Es),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby":`${V(i)}-wf`,class:`grid grid-cols-1 gap-2 sm:grid-cols-3`,loop:``},{default:I(()=>[(L(!0),j(U,null,M(a.value,e=>(L(),q(V(Os),{key:e.id,value:e.id,class:`rounded-md border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-secondary focus-visible:outline-2 focus-visible:outline-ring data-[state=checked]:border-primary data-[state=checked]:bg-secondary`},{default:I(()=>[R(`span`,LE,B(e.name||e.id),1),R(`span`,RE,[H(B(y(e.id)?.runs||0)+` runs`,1),y(e.id)?.runs?(L(),j(U,{key:0},[H(` · `+B(Math.round(V(SE)(y(e.id))/(y(e.id)?.runs||1)*100))+`% delivered`,1)],64)):F(``,!0)])]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`,`aria-labelledby`]),!a.value.length&&!c.value?(L(),j(`p`,zE,`No enabled workflows.`)):F(``,!0)])),h.value.length?(L(),j(`div`,BE,[(L(!0),j(U,null,M(h.value,e=>(L(),j(`div`,{key:e.name,class:`grid gap-1.5`},[R(`label`,{for:`${V(i)}-input-${e.name}`,class:`text-label font-medium`},[R(`span`,HE,B(e.name),1),e.required?(L(),j(`span`,UE,` · required`)):F(``,!0)],8,VE),A(V(Q),{id:`${V(i)}-input-${e.name}`,"model-value":p.value[e.name Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function pD(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function mD(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function hD(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function gD(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var _D=J([]),vD=J([]),yD=J(!0),bD=J(null),xD=J(!0),SD=J(null),CD=J(!1),wD=J(null);async function TD(){try{let e=await Z.eventTypes(dD().workspace);yD.value=e.enabled!==!1,_D.value=e.event_types||[],vD.value=e.proposals||[],bD.value=null}catch(e){bD.value=e.message||String(e)}finally{xD.value=!1}}function ED(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function DD(e){wD.value=null,SD.value=e}function OD(e){let t=ID.value.find(t=>String(t.id)===e.sample_id);DD({mode:`proposal`,id:null,source:e.source,name:``,rule:ED(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function kD(e=``){DD({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function AD(e){DD({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:ED(e.rule),headersText:``,body:``,exampleHeaders:{}})}function jD(){SD.value=null}async function MD(){let e=SD.value;if(e){CD.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:gD(e.rule)});else{let t=e.mode===`paste`?fD(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:gD(e.rule),example:{headers:t,body:e.body}})}SD.value=null,await TD()}catch(e){wD.value=e.message||String(e)}finally{CD.value=!1}}}var ND=J(null);async function PD(){let e=ND.value;if(ND.value=null,e)try{await Z.eventTypeDelete(e.id),await TD()}catch(e){bD.value=e.message||String(e)}}var FD=100,ID=J([]),LD=J(!0),RD=J(null),zD=J(!0),BD=J(null);async function VD(){try{let e=await Z.captures(FD);LD.value=e.enabled!==!1,ID.value=e.captures||[],RD.value=null}catch(e){RD.value=e.message||String(e)}finally{zD.value=!1}}function HD(e){let t=ID.value.find(t=>t.id===e);return t&&(BD.value=t),!!t}function UD(){ID.value.length&&(BD.value=ID.value[0])}function WD(){UC(`captures`,()=>{VD(),TD()})}var GD=P({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=dt(n,`class`),a=ue(i,r);return(e,t)=>(L(),q(V(xc),G({"data-slot":`tabs`,"data-orientation":V(a).orientation||`horizontal`},V(a),{class:V(W)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:I(t=>[K(e.$slots,`default`,Xe(Ce(t)))]),_:3},16,[`data-orientation`,`class`]))}}),KD=P({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=dt(t,`class`);return(e,r)=>(L(),q(V(wc),G({"data-slot":`tabs-content`,class:V(W)(`text-sm flex-1 outline-none`,t.class)},V(n)),{default:I(()=>[K(e.$slots,`default`)]),_:3},16,[`class`]))}}),qD=P({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=dt(t,`class`,`variant`);return(r,i)=>(L(),q(V(Tc),G({"data-slot":`tabs-list`,"data-variant":e.variant},V(n),{class:V(W)(V(YD)({variant:e.variant}),t.class)}),{default:I(()=>[K(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),JD=P({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=dt(t,`class`),r=pe(n);return(e,n)=>(L(),q(V(Ec),G({"data-slot":`tabs-trigger`,class:V(W)(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visibleLine truncated
`));return(t,r)=>e.tool.path?(I(),K(one,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):s.value?(I(),K(B(Bp),{key:1,"default-open":i.value},{default:F(()=>[k(B(Up),null,{default:F(()=>[k(B(Gp),{status:i.value?`error`:o.value?`running`:void 0},{default:F(()=>[k(B(Hp),null,{default:F(()=>[k(B(xu))]),_:1}),k(B(Kp),null,{default:F(()=>[V(z(n.value),1)]),_:1})]),_:1},8,[`status`])]),_:1}),k(B(Vp),null,{default:F(()=>[k(B(Jp),{size:`sm`},{default:F(()=>[k(B($p),{wrap:``,class:`max-h-64`},{default:F(()=>[V(z(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1},8,[`default-open`])):(I(),K(B(Gp),{key:2,status:i.value?`error`:o.value?`running`:void 0},{default:F(()=>[k(B(Hp),null,{default:F(()=>[k(B(xu))]),_:1}),k(B(Kp),null,{default:F(()=>[V(z(n.value),1)]),_:1})]),_:1},8,[`status`]))}}),sne={class:`flex flex-col gap-2`},cne=N({__name:`ChatToolGroup`,props:{tools:{},streaming:{type:Boolean}},setup(e){let t=e,n=e=>e.name||e.Name||e.tool||`tool`,r=e=>!!(e.err||e.Err||e.failed),i=J(()=>{let e=new Map;for(let r of t.tools)e.set(n(r),(e.get(n(r))??0)+1);return[...e].map(([e,t])=>`${e} ×${t}`).join(`, `)}),a=J(()=>t.tools.some(r));return(t,n)=>(I(),K(B(Bp),{"default-open":a.value},{default:F(()=>[k(B(Up),null,{default:F(()=>[k(B(Gp),{status:a.value?`error`:void 0},{default:F(()=>[k(B(Hp),null,{default:F(()=>[k(B(xu))]),_:1}),k(B(Kp),{class:`truncate`},{default:F(()=>[V(z(i.value),1)]),_:1})]),_:1},8,[`status`])]),_:1}),k(B(Vp),null,{default:F(()=>[L(`div`,sne,[(I(!0),A(H,null,j(e.tools,(t,n)=>(I(),K(WC,{key:n,tool:t,streaming:e.streaming&&n===e.tools.length-1},null,8,[`tool`,`streaming`]))),128))])]),_:1})]),_:1},8,[`default-open`]))}}),lne={key:1,class:`mb-2 flex flex-wrap gap-1.5`},une={key:3,class:`whitespace-pre-wrap`},dne=N({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){let t=e,n=J(()=>{let e=[],n=!1;for(let r of t.tools)r.path?(e.push([r]),n=!1):n?e[e.length-1].push(r):(e.push([r]),n=!0);return e});return(t,r)=>(I(),K(B(pC),{align:e.assistant?`start`:`end`},{default:F(()=>[k(B(mC),null,{default:F(()=>[k(B(Np),{variant:e.assistant?`muted`:`tinted`,class:`max-w-[min(78ch,92%)]`},{default:F(()=>[k(B(Pp),{class:`[overflow-wrap:anywhere]`},{default:F(()=>[e.assistant&&e.tools.length?(I(),K(B(Ip),{key:0,class:`mb-2`},{default:F(()=>[(I(!0),A(H,null,j(n.value,(t,n)=>(I(),A(H,{key:n},[t.length>1?(I(),K(cne,{key:0,tools:t,streaming:e.streaming},null,8,[`tools`,`streaming`])):(I(),K(WC,{key:1,tool:t[0],streaming:e.streaming},null,8,[`tool`,`streaming`]))],64))),128))]),_:1})):P(``,!0),e.media.length?(I(),A(`div`,lne,[(I(!0),A(H,null,j(e.media,(e,t)=>(I(),K(yC,{key:t,attachment:e},null,8,[`attachment`]))),128))])):P(``,!0),e.assistant?(I(),K(HC,{key:2,text:e.text},null,8,[`text`])):(I(),A(`div`,une,z(e.text),1)),G(t.$slots,`default`)]),_:3})]),_:3},8,[`variant`]),e.assistant&&!e.streaming&&e.text?(I(),K(B(hC),{key:0,class:`px-0 transition-opacity focus-within:opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/message:opacity-100`},{default:F(()=>[k(B(tm),{value:e.text},null,8,[`value`])]),_:1})):P(``,!0)]),_:3})]),_:3},8,[`align`]))}}),fne={class:`text-sm`},pne={key:0,class:`mt-1 text-fg-muted`},mne={key:1,class:`mt-2 flex flex-wrap gap-2`},hne=N({__name:`ChatChooseCard`,props:{choose:{}},setup(e){let t=J(()=>Ku.value.models??[]);return(e,n)=>(I(),A(`div`,fne,[n[0]||=L(`p`,{class:`font-medium`},`Choose a model`,-1),t.value.length?(I(),A(`div`,mne,[(I(!0),A(H,null,j(t.value,e=>(I(),K(B(Y),{key:e,size:`sm`,variant:e===B(Ku).active_model?`default`:`outline`,class:`font-mono`,onClick:t=>void B(id)(e)},{default:F(()=>[V(z(e),1)]),_:2},1032,[`variant`,`onClick`]))),128))])):(I(),A(`p`,pne,`None configured.`))]))}}),gne={class:`text-sm`},_ne={key:0},vne={class:`mt-1 space-y-0.5`},yne={class:`font-mono`},bne=[`href`],xne={key:0,class:`mt-3 flex gap-2`},Sne={key:1,class:`mt-2 text-fg-muted`},Cne={key:2,class:`mt-2 text-fg-muted`},wne={key:3,class:`mt-2 text-ok`},Tne={key:4,class:`mt-2 text-danger`},Ene={key:5,class:`mt-2 text-xs text-fg-muted`},Dne=N({__name:`ChatUpdateCard`,props:{update:{}},setup(e){let t=e,n=J(()=>t.update.available??[]),r=q(`idle`),i=q(``);async function a(){r.value=`installing`;try{let e=(await X.updateInstall(t.update.snapshot)).result?.installed;i.value=e?Object.entries(e).map(([e,t])=>`${e} → ${t}`).join(`, `)+`. Archie restarts to apply it.`:`Update finished.`,r.value=`done`}catch(e){i.value=e.message,r.value=`failed`}}async function o(){try{await X.updateDefer(t.update.snapshot),r.value=`deferred`}catch(e){i.value=e.message,r.value=`failed`}}return(t,s)=>(I(),A(`div`,gne,[n.value.length?(I(),A(H,{key:1},[s[2]||=L(`p`,{class:`font-medium`},`An update is available`,-1),L(`ul`,vne,[(I(!0),A(H,null,j(n.value,e=>(I(),A(`li`,{key:e.ID},[V(z(e.Label||e.ID)+`: `,1),L(`span`,yne,z(e.Installed||`?`)+` → `+z(e.Available),1),e.Changelog?(I(),A(`a`,{key:0,href:e. Line truncated
`).map(e=>e.trim()).find(Boolean)||``,i=r.length>_T?`${r.slice(0,_T).trimEnd()}…`:r;return{text:i,full:n,truncated:i!==n}}function Eie(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function yT(e){let t=Number(e);if(!Number.isFinite(t)||t<0)return``;if(t<1e3)return`under 1 s`;let n=t/1e3;if(n<60)return`${n.toFixed(+(n<10))} s`;let r=Math.round(n),i=Math.floor(r/60),a=r%60;if(i<60)return a===0?`${i} min`:`${i} min ${a} s`;let o=Math.floor(i/60),s=i-o*60;return s===0?`${o} h`:`${o} h ${s} min`}function bT(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function xT(e){return typeof e==`string`?e:``}function ST(e={}){let t=e.data||{},n=e.stage||`unknown stage`,r=e.workflow?`${e.workflow} workflow`:``;if(e.kind===`stage_start`)return{title:`Started stage: ${n}`,detail:r};if(e.kind===`stage_finish`){let e=[r,yT(t.duration_ms)].filter(Boolean).join(` · `);return{title:t.interrupted?`Stage interrupted: ${n}`:t.skipped?`Skipped stage: ${n}`:t.error?`Stage failed: ${n}`:`Finished stage: ${n}`,detail:[e,xT(t.error),xT(t.when)].filter(Boolean).join(` · `)}}if(e.kind===`task_retried`){let n=Number(t.retry_count);return{title:Number.isFinite(n)&&n>0?`Retry ${n}`:`Retry requested`,detail:[xT(t.previous_stage)&&`after ${xT(t.previous_stage)}`,xT(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=bT(t.iterations),i=bT(t.tokens),a=Number(t.cached_tokens)||0,o=bT((Number(t.prompt_tokens)||0)-a),s=bT(t.completion_tokens),c=bT(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,xT(t.model)].filter(Boolean);return{title:`Agent ${xT(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=xT(t.author);return{title:`Remediation ${xT(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${xT(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=xT(t.pr_number);return{title:`Pull request approved`,detail:[xT(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${xT(t.attempt)} of ${xT(t.of)} failed: ${e.stage||`step`}`,detail:xT(t.error),tone:`warn`};if(e.kind===`config_captured`)return{title:`Configuration captured`,detail:`The effective task-runtime configuration for this run.`};if(e.kind===`binding_started`){let e=xT(t.source),n=xT(t.capture_id),r=[{label:`binding ${xT(t.binding_name)||xT(t.binding_id)}`,to:`/events?tab=bindings`},...n?[{label:`captured event`,to:`/events?tab=inspector&capture=${encodeURIComponent(n)}`}]:[]];return t.unsigned===!0?{title:`Started by an unsigned event`,detail:e?`source ${e}`:``,tone:`warn`,links:r}:{title:`Started by an event`,detail:e?`source ${e}`:``,links:r}}if(e.kind===`changes_captured`){let e=t.totals??{},n=Number(e.files);return{title:`Change capture recorded`,detail:[Number.isFinite(n)&&n>0?`${n} file${n===1?``:`s`} changed`:``,t.captured_after?`captured after ${xT(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:Eie(e.kind||e.type),detail:e.detail||``}}var Die=[`title`],CT=N({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=gT();n.watchIdentities();let r=e,i=t,a=oT(),o=J(()=>a.taskIDFor(r.event)),s=J(()=>vT(r.event,n.identityName));function c(){o.value>0&&i(`open`,o.value)}return(t,n)=>(I(),K(B(fT),{class:R(o.value>0?`cursor-pointer`:``),role:o.value>0?`link`:void 0,tabindex:o.value>0?0:void 0,title:o.value>0?`Open task details`:void 0,onClick:c,onKeydown:[_t(mt(c,[`prevent`]),[`enter`]),_t(mt(c,[`prevent`]),[`space`])]},{default:F(()=>[k(B(Q),{class:`font-medium`},{default:F(()=>[V(z(B(ST)({...r.event,at:void 0,detail:void 0}).title),1)]),_:1}),k(B(Q),{class:`font-mono`},{default:F(()=>[V(z(o.value>0?`#${o.value}`:`–`),1)]),_:1}),k(B(Q),{class:`w-[55%] max-w-0`},{default:F(()=>[L(`span`,{class:`block truncate`,title:s.value.truncated?s.value.full:void 0},z(s.value.text),9,Die)]),_:1}),k(B(Q),null,{default:F(()=>[k(B(JC),{at:e.event.at},null,8,[`at`])]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Oie=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function wT(e){return(Number(e?.task_id)||0)>0}function kie(e,t){return t===`tasks`?wT(e):t!==`system`||!wT(e)}function Aie(e,t){return e.filter(e=>kie(e,t))}function jie(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function Mie(e,t){return`${e}:${t??0}`}function Nie(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=Mie(vT(n).text,r),a=t[t.length-1];a&&a.key===i?(a.count+=1,a.events.push(n)):t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var Pie={role:`region`,"aria-label":`Activity`,"aria-live":`polite`},Fie={class:`max-h-[28rem] overflow-y-auto`},Iie={class:`iLine truncated
`,1)[0]??``;return t.length>80?`${t.slice(0,79)}…`:t}function CE(e){return(e?.merged||0)+(e?.completed||0)}function wE(e){return Object.entries(e?.inputs??{}).map(([e,t])=>({name:e,type:t.type,required:t.required===!0})).sort((e,t)=>e.name.localeCompare(t.name))}function TE(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function EE(e,t){switch(t){case`number`:{let t=e.trim();return t!==``&&!Number.isNaN(Number(t))?Number(t):e}case`bool`:return e===`true`||e!==`false`&&e;case`string`:return e;default:try{return JSON.parse(e)}catch{return e}}}function DE(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=EE(e,r.type))}return n}var OE=[`onKeydown`],kE={key:0,class:`text-sm text-danger`,role:`alert`},AE={key:1,class:`grid gap-1.5`},jE=[`for`],ME={key:0,class:`font-normal text-fg-subtle`},NE=[`id`],PE=[`value`],FE={key:0,class:`text-xs text-fg-subtle`},IE={key:2,class:`grid gap-1.5`},LE=[`id`],RE={class:`block truncate text-label font-medium`},zE={class:`block text-xs text-fg-subtle`},BE={key:0,class:`text-xs text-fg-subtle`},VE={key:3,class:`grid gap-3`},HE=[`for`],UE={class:`font-mono`},WE={key:0,class:`text-fg-subtle`},GE={class:`grid gap-1.5`},KE=[`for`],qE={class:`grid gap-1.5`},JE=[`for`],YE={key:4,class:`text-sm text-danger`,role:`alert`},XE={class:`flex items-center gap-2 border-t border-border pt-4`},ZE={class:`mr-auto text-xs text-fg-subtle`},QE=N({__name:`NewTaskForm`,props:{workflow:{},draft:{},initialWorkflow:{},initialInstructions:{}},emits:[`started`,`cancel`],setup(e,{emit:t}){let n=e,r=t,i=Te(),a=q([]),o=q([]),s=q([]),c=q(``);Ve(async()=>{try{let[e,t]=await Promise.all([X.workflows(),X.repositories()]);a.value=(e?.definitions??[]).filter(e=>e.enabled),o.value=e?.workflows??[],s.value=(t??[]).map(e=>`${e.owner}/${e.name}`)}catch(e){c.value=String(e.message||e)}});let l=q(``),u=q(n.workflow??n.initialWorkflow??``),d=q(n.initialInstructions??``),f=q(SE(d.value)),p=q({});we(()=>{!u.value&&a.value[0]&&(u.value=a.value[0].id)});let m=J(()=>a.value.find(e=>e.id===u.value)),h=J(()=>wE(m.value)),g=J(()=>TE(h.value,p.value)),_=J(()=>m.value?.repository??`required`),v=J(()=>_.value!==`optional`&&_.value!==`none`),y=e=>o.value.find(t=>t.workflow===e),b=q(!1),x=q(``),S=J(()=>!(!l.value.trim()&&v.value||!u.value||!f.value.trim())&&g.value.length===0);async function C(){if(S.value&&!b.value){b.value=!0,x.value=``;try{let e=await X.workRequest({repository:_.value===`none`?``:l.value.trim(),workflow:u.value,title:f.value.trim(),instructions:d.value,inputs:DE(h.value,p.value),...n.draft?{draft:n.draft}:{}});r(`started`,e.task_id)}catch(e){x.value=String(e.message||e)}finally{b.value=!1}}}return(e,t)=>(I(),A(`form`,{class:`grid gap-5`,onSubmit:mt(C,[`prevent`]),onKeydown:[_t(mt(C,[`meta`,`prevent`]),[`enter`]),_t(mt(C,[`ctrl`,`prevent`]),[`enter`])]},[c.value?(I(),A(`p`,kE,z(c.value),1)):P(``,!0),_.value===`none`?P(``,!0):(I(),A(`div`,AE,[L(`label`,{for:`${B(i)}-repo`,class:`text-label font-medium`},[t[5]||=V(`Repository`,-1),v.value?P(``,!0):(I(),A(`span`,ME,` (optional)`))],8,jE),k(B(Z),{id:`${B(i)}-repo`,modelValue:l.value,"onUpdate:modelValue":t[0]||=e=>l.value=e,class:`font-mono`,placeholder:`owner/repository`,list:`${B(i)}-repos`,required:v.value},null,8,[`id`,`modelValue`,`list`,`required`]),L(`datalist`,{id:`${B(i)}-repos`},[(I(!0),A(H,null,j(s.value,e=>(I(),A(`option`,{key:e,value:e},null,8,PE))),128))],8,NE),s.value.length?(I(),A(`p`,FE,[t[6]||=V(`Configured: `,-1),(I(!0),A(H,null,j(s.value,e=>(I(),K(B(Y),{key:e,type:`button`,variant:`link`,size:`xs`,class:`h-auto px-1 font-mono text-fg-subtle`,onClick:t=>l.value=e},{default:F(()=>[V(z(e),1)]),_:2},1032,[`onClick`]))),128))])):P(``,!0)])),n.workflow?P(``,!0):(I(),A(`div`,IE,[L(`span`,{id:`${B(i)}-wf`,class:`text-label font-medium`},`Workflow`,8,LE),k(B(As),{modelValue:u.value,"onUpdate:modelValue":t[1]||=e=>u.value=e,"aria-labelledby":`${B(i)}-wf`,class:`grid grid-cols-1 gap-2 sm:grid-cols-3`,loop:``},{default:F(()=>[(I(!0),A(H,null,j(a.value,e=>(I(),K(B(Ms),{key:e.id,value:e.id,class:`rounded-md border border-border bg-card px-3 py-2.5 text-left transition-colors hover:bg-secondary focus-visible:outline-2 focus-visible:outline-ring data-[state=checked]:border-primary data-[state=checked]:bg-secondary`},{default:F(()=>[L(`span`,RE,z(e.name||e.id),1),L(`span`,zE,[V(z(y(e.id)?.runs||0)+` runs`,1),y(e.id)?.runs?(I(),A(H,{key:0},[V(` · `+z(Math.round(B(CE)(y(e.id))/(y(e.id)?.runs||1)*100))+`% delivered`,1)],64)):P(``,!0)])]),_:2},1032,[`value`]))),128))]),_:1},8,[`modelValue`,`aria-labelledby`]),!a.value.length&&!c.value?(I(),A(`p`,BE,`No enabled workflows.`)):P(``,!0)])),h.value.length?(I(),A(`div`,VE,[(I(!0),A(H,null,j(h.value,e=>(I(),A(`div`,{key:e.name,class:`grid gap-1.5`},[L(`label`,{for:`${B(i)}-input-${e.name}`,class:`text-label font-medium`},[L(`span`,UE,z(e.name),1),e.required?(I(),A(`span`,WE,` · required`)):P(``,!0)],8,HE),k(B(Z),{id:`${B(i)}-input-${e.name}`,"model-value":p.value[e.name Line truncated
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function mD(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function hD(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function gD(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function _D(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var vD=q([]),yD=q([]),bD=q(!0),xD=q(null),SD=q(!0),CD=q(null),wD=q(!1),TD=q(null);async function ED(){try{let e=await X.eventTypes(fD().workspace);bD.value=e.enabled!==!1,vD.value=e.event_types||[],yD.value=e.proposals||[],xD.value=null}catch(e){xD.value=e.message||String(e)}finally{SD.value=!1}}function DD(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function OD(e){TD.value=null,CD.value=e}function kD(e){let t=LD.value.find(t=>String(t.id)===e.sample_id);OD({mode:`proposal`,id:null,source:e.source,name:``,rule:DD(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function AD(e=``){OD({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function jD(e){OD({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:DD(e.rule),headersText:``,body:``,exampleHeaders:{}})}function MD(){CD.value=null}async function ND(){let e=CD.value;if(e){wD.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:_D(e.rule)});else{let t=e.mode===`paste`?pD(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:_D(e.rule),example:{headers:t,body:e.body}})}CD.value=null,await ED()}catch(e){TD.value=e.message||String(e)}finally{wD.value=!1}}}var PD=q(null);async function FD(){let e=PD.value;if(PD.value=null,e)try{await X.eventTypeDelete(e.id),await ED()}catch(e){xD.value=e.message||String(e)}}var ID=100,LD=q([]),RD=q(!0),zD=q(null),BD=q(!0),VD=q(null);async function HD(){try{let e=await X.captures(ID);RD.value=e.enabled!==!1,LD.value=e.captures||[],zD.value=null}catch(e){zD.value=e.message||String(e)}finally{BD.value=!1}}function UD(e){let t=LD.value.find(t=>t.id===e);return t&&(VD.value=t),!!t}function WD(){LD.value.length&&(VD.value=LD.value[0])}function GD(){XC(`captures`,()=>{HD(),ED()})}var KD=N({__name:`Tabs`,props:{defaultValue:{},orientation:{},dir:{},activationMode:{},modelValue:{},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,i=lt(n,`class`),a=w(i,r);return(e,t)=>(I(),K(B(Tc),W({"data-slot":`tabs`,"data-orientation":B(a).orientation||`horizontal`},B(a),{class:B(U)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:F(t=>[G(e.$slots,`default`,Ye(xe(t)))]),_:3},16,[`data-orientation`,`class`]))}}),qD=N({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=lt(t,`class`);return(e,r)=>(I(),K(B(Oc),W({"data-slot":`tabs-content`,class:B(U)(`text-sm flex-1 outline-none`,t.class)},B(n)),{default:F(()=>[G(e.$slots,`default`)]),_:3},16,[`class`]))}}),JD=N({__name:`TabsList`,props:{loop:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]},variant:{default:`default`}},setup(e){let t=e,n=lt(t,`class`,`variant`);return(r,i)=>(I(),K(B(kc),W({"data-slot":`tabs-list`,"data-variant":e.variant},B(n),{class:B(U)(B(XD)({variant:e.variant}),t.class)}),{default:F(()=>[G(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),YD=N({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=lt(t,`class`),r=C(n);return(e,n)=>(I(),K(B(Ac),W({"data-slot":`tabs-trigger`,class:B(U)(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*=size-])]:size-4 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:oLine truncated
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var CB=lB(`CharSizeService`),wB=lB(`CoreBrowserService`),TB=lB(`MouseService`),EB=lB(`RenderService`),DB=lB(`SelectionService`),OB=lB(`CharacterJoinerService`),kB=lB(`ThemeService`),AB=lB(`LinkProviderService`),jB=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?LB.isErrorNoTelemetry(e)?new LB(e.message+`
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var cB=Jz(`CharSizeService`),lB=Jz(`CoreBrowserService`),uB=Jz(`MouseService`),dB=Jz(`RenderService`),fB=Jz(`SelectionService`),pB=Jz(`CharacterJoinerService`),mB=Jz(`ThemeService`),hB=Jz(`LinkProviderService`),gB=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?SB.isErrorNoTelemetry(e)?new SB(e.message+`
`+e.stack):Error(e.message+`
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function MB(e){PB(e)||jB.onUnexpectedError(e)}var NB=`Canceled`;function PB(e){return e instanceof FB||e instanceof Error&&e.name===NB&&e.message===NB}var FB=class extends Error{constructor(){super(NB),this.name=this.message}};function IB(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var LB=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},RB=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function zB(e,t=0){return e[e.length-(1+t)]}var BB;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(BB||={});var VB=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||BB.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};VB.empty=new VB(e=>{});function HB(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var UB;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(UB||={});var WB=null;function GB(e){return WB?.trackDisposable(e),e}function KB(e){WB?.markAsDisposed(e)}function qB(e,t){WB?.setParent(e,t)}function JB(e){return WB?.markAsSingleton(e),e}function YB(e){if(UB.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function XB(...e){return ZB(()=>YB(e))}function ZB(e){let t=GB({dispose:HB(()=>{KB(t),e()})});return t}var QB=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,GB(this)}dispose(){this._isDisposed||(KB(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{YB(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return qB(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),qB(e,null))}};QB.DISABLE_DISPOSED_WARNING=!1;var $B=QB,eV=class{constructor(){this._store=new $B,GB(this),qB(this._store,this)}dispose(){KB(thi Line truncated
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function _B(e){yB(e)||gB.onUnexpectedError(e)}var vB=`Canceled`;function yB(e){return e instanceof bB||e instanceof Error&&e.name===vB&&e.message===vB}var bB=class extends Error{constructor(){super(vB),this.name=this.message}};function xB(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var SB=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},CB=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function wB(e,t=0){return e[e.length-(1+t)]}var TB;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(TB||={});var EB=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||TB.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};EB.empty=new EB(e=>{});function DB(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var OB;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(OB||={});var kB=null;function AB(e){return kB?.trackDisposable(e),e}function jB(e){kB?.markAsDisposed(e)}function MB(e,t){kB?.setParent(e,t)}function NB(e){return kB?.markAsSingleton(e),e}function PB(e){if(OB.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function FB(...e){return IB(()=>PB(e))}function IB(e){let t=AB({dispose:DB(()=>{jB(t),e()})});return t}var LB=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,AB(this)}dispose(){this._isDisposed||(jB(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{PB(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return MB(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),MB(e,null))}};LB.DISABLE_DISPOSED_WARNING=!1;var RB=LB,zB=class{constructor(){this._store=new RB,AB(this),MB(this._store,this)}dispose(){jB(thi Line truncated
`).slice(2).join(`
`))}},hV=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},gV=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},_V=0,vV=class{constructor(e){this.value=e,this.id=_V++}},yV=2,bV=class{constructor(e){this._size=0,this._options=e,this._leakageMon=dV>0||this._options?.leakWarningThreshold?new pV(e?.onListenerError??MB,this._options?.leakWarningThreshold??dV):void 0,this._perfMon=this._options?._profName?new uV(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new gV(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||MB)(n),eV.None}if(this._disposed)return eV.None;t&&(e=e.bind(t));let r=new vV(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=mV.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof vV?(this._deliveryQueue??=new xV,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=ZB(()=>{i?.(),this._removeListener(r)});return n instanceof $B?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*yV<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||MB;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof vV)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},xV=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},SV=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new bV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new bV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};SV.INSTANCE=new SV;var CV=SV;function wV(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}CV.INSTANCE.onDidChangeZoomLevel;function TV(e){return CV.INSTANCE.getZoomFactor(e)}CV.INSTANCE.onDidChangeFullscreen;var EV=typeof navigator==`object`?navigator.userAgent:``,DV=EV.indexOf(`Firefox`)>=0,OV=EV.indexOf(`AppleWebKit`)>=0,kV=EV.indexOf(`Chrome`)>=0,AV=!kV&&EV.indexOf(`Safari`)>=0;EV.indexOf(`Electron/`),EV.indexOf(`Android`);var jV=!1;if(typeof nV.matchMedia==`function`){let e=nV.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=nV.matchMedia(`(display-mode: fullscreen)`);jV=e.matches,wV(nV,e,({matches:e})=>{jV&&t.matches||(jV=e)} Line truncated
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};DU=Lz([Rz(2,dB),Rz(3,wB),Rz(4,fB),Rz(5,kB),Rz(6,_B),Rz(7,EB)],DU);var OU=class extends eV{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(ZB(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderLine truncated
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))($||={});var PU;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(PU||={});var FU;(e=>e.ST=`${$.ESC}\\`)(FU||={});var IU=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${$.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};IU=Lz([Rz(2,dB),Rz(3,_B),Rz(4,pB),Rz(5,EB)],IU);var LU=0,RU=0,zU=0,BU=0,VU={css:`#00000000`,rgba:0},HU;(e=>{function t(e,t,n,r){return r===void 0?`#${qU(e)}${qU(t)}${qU(n)}`:`#${qU(e)}${qU(t)}${qU(n)}${qU(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(HU||={});var UU;(e=>{function t(e,t){if(BU=(t.rgba&255)/255,BU===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return LU=a+Math.round((n-a)*BU),RU=o+Math.round((r-o)*BU),zU=s+Math.round((i-s)*BU),{css:HU.toCss(LU,RU,zU),rgba:HU.toRgba(LU,RU,zU)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=KU.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return HU.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[LU,RU,zU]=KU.toChannels(t),{css:HU.toCss(LU,RU,zU),rgba:t}}e.opaque=i;function a(e,t){return BU=Math.round(t*255),[LU,RU,zU]=KU.toChannels(e.rgba),{css:HU.toCss(LU,RU,zU,BU),rgba:HU.toRgba(LU,RU,zU,BU)}}e.opacity=a;function o(e,t){return BU=e.rgba&255,a(e,BU*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.r Line truncated
`))}},eV=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},tV=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},nV=0,rV=class{constructor(e){this.value=e,this.id=nV++}},iV=2,aV=class{constructor(e){this._size=0,this._options=e,this._leakageMon=XB>0||this._options?.leakWarningThreshold?new QB(e?.onListenerError??_B,this._options?.leakWarningThreshold??XB):void 0,this._perfMon=this._options?._profName?new YB(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new tV(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||_B)(n),zB.None}if(this._disposed)return zB.None;t&&(e=e.bind(t));let r=new rV(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=$B.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof rV?(this._deliveryQueue??=new oV,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=IB(()=>{i?.(),this._removeListener(r)});return n instanceof RB?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*iV<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||_B;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof rV)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},oV=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},sV=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new aV,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new aV,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};sV.INSTANCE=new sV;var cV=sV;function lV(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}cV.INSTANCE.onDidChangeZoomLevel;function uV(e){return cV.INSTANCE.getZoomFactor(e)}cV.INSTANCE.onDidChangeFullscreen;var dV=typeof navigator==`object`?navigator.userAgent:``,fV=dV.indexOf(`Firefox`)>=0,pV=dV.indexOf(`AppleWebKit`)>=0,mV=dV.indexOf(`Chrome`)>=0,hV=!mV&&dV.indexOf(`Safari`)>=0;dV.indexOf(`Electron/`),dV.indexOf(`Android`);var gV=!1;if(typeof VB.matchMedia==`function`){let e=VB.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=VB.matchMedia(`(display-mode: fullscreen)`);gV=e.matches,lV(VB,e,({matches:e})=>{gV&&t.matches||(gV=e)} Line truncated
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};fU=Sz([Cz(2,Xz),Cz(3,lB),Cz(4,Zz),Cz(5,mB),Cz(6,nB),Cz(7,dB)],fU);var pU=class extends zB{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(IB(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderLine truncated
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))($||={});var yU;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(yU||={});var bU;(e=>e.ST=`${$.ESC}\\`)(bU||={});var xU=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${$.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};xU=Sz([Cz(2,Xz),Cz(3,nB),Cz(4,Qz),Cz(5,dB)],xU);var SU=0,CU=0,wU=0,TU=0,EU={css:`#00000000`,rgba:0},DU;(e=>{function t(e,t,n,r){return r===void 0?`#${MU(e)}${MU(t)}${MU(n)}`:`#${MU(e)}${MU(t)}${MU(n)}${MU(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(DU||={});var OU;(e=>{function t(e,t){if(TU=(t.rgba&255)/255,TU===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return SU=a+Math.round((n-a)*TU),CU=o+Math.round((r-o)*TU),wU=s+Math.round((i-s)*TU),{css:DU.toCss(SU,CU,wU),rgba:DU.toRgba(SU,CU,wU)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=jU.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return DU.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[SU,CU,wU]=jU.toChannels(t),{css:DU.toCss(SU,CU,wU),rgba:t}}e.opaque=i;function a(e,t){return TU=Math.round(t*255),[SU,CU,wU]=jU.toChannels(e.rgba),{css:DU.toCss(SU,CU,wU,TU),rgba:DU.toRgba(SU,CU,wU,TU)}}e.opacity=a;function o(e,t){return TU=e.rgba&255,a(e,TU*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.r Line truncated
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),RW&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=sG(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=SW(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-cG),cG),t/=cG,t/Math.abs(t)+Math.round(t*(lG-1)))}shouldForceSelection(e){return PW?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),uG)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(PW&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._active Line truncated
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(LH(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ZB(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<uq+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===uq+1&&(this._liveRegion.textContent+=Hz.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let Line truncated
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Bz.get()},set promptLabel(e){Bz.set(e)},get tooMuchOutput(){return Hz.get()},set tooMuchOutput(e){Hz.set(e)}}}_verifyIntegers(...e){for(Cq of e)if(Cq===1/0||isNaN(Cq)||Cq%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(Cq of e)if(Cq&&(Cq===1/0||isNaN(Cq)||Cq%1!=0||Cq<0))throw Error(`This API only accepts positive integers`)}},Tq=2,Eq=1,Dq=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Tq,Math.floor(u/e.css.cell.width)),rows:Math.max(Eq,Math.floor(l/e.css.cell.height))}}},Oq={class:`flex h-[32rem] min-h-0 flex-col gap-2`},kq={key:0,class:`text-sm text-fg-muted`,role:`status`},Aq=P({__name:`SandboxView`,props:{taskId:{},attempt:{}},setup(e){let t=e,n=J(null),r=J(`connecting`),i=null,a=null,o=null,s=null;function c(){try{o?.fit()}catch{}}return Ue(()=>{let e=n.value;if(!e)return;i=new wq({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`}}),o=new Dq,i.loadAddon(o),i.open(e),c();let l=window.location.protocol===`https:`?`wss:`:`ws:`,u=new URLSearchParams({attempt:String(t.attempt)}),d=new WebSocket(`${l}//${window.location.host}/api/tasks/${encodeURIComponent(t.taskId)}/sandbox?${u}`);a=d,d.binaryType=`arraybuffer`,d.onopen=()=>{r.value=`open`},d.onmessage=e=>{i&&(typeof e.data==`string`&&(r.value=`failed`),i.write(typeof e.data==`string`?e.data:new Uint8Array(e.data)))},d.onerror=()=>{r.value=`failed`},d.onclose=()=>{r.value!==`failed`&&(r.value=`closed`)},s=new ResizeObserver(c),s.observe(e)}),at(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(L(),j(`div`,Oq,[r.value===`open`?F(``,!0):(L(),j(`p`,kq,[r.value===`connecting`?(L(),j(U,{key:0},[H(`Connecting…`)],64)):r.value===`closed`?(L(),j(U,{key:1},[H(`The sandbox ended.`)],64)):(L(),j(U,{key:2},[H(`Sandbox unavailable.`)],64))])),R(`div`,{ref_key:`host`,ref:n,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),jq={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},Mq={class:`inline-flex items-center gap-2`},Nq={class:`inline-flex items-center gap-2`},Pq=`__all__`,Fq=P({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>Kj.map(e=>({value:e.value||Pq,label:e.label}))),a=Y(()=>n.filters.level||Pq),o=Y(()=>n.filters.stage||Pq);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===Pq?``:String(e)})}function l(e){s({stage:String(e)===Pq?``:String(e)})}return(t,n)=>(L(),j(`div`,jq,[R(`div`,Mq,[A(V(Tu),{"model-value":a.value,"onUpdate:modelValue":c},{default:I(()=>[A(V(ku),{size:`sm`,"aria-label":`Filter log entries by level`},{default:I(()=>[A(V(Au))]),_:1}),A(V(Eu),null,{default:I(()=>[A(V(Du),null,{default:I(()=>[(L(!0),j(U,null,M(i.value,e=>(L(),q(V(Ou),{key:e.value,value:e.value},{default:I(()=>[H(B(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),R(`div`,Nq,[A(V(Tu),{"model-value":o.value,"onUpdate:modelValue":l},{default:I(()=>[A(V(ku),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:I(()=>[A(V(Au))]),_:1}),A(V(Eu),null,{default:I(()=>[A(V(Du),null,{default:I(()=>[A(V(Ou),{value:Pq},{default:I(()=>[...n[0]||=[H(`All stages`,-1)]]),_:1}),(L(!0),j(U,null,M(e.stages,e=>(L(),q(V(Ou),{key:e,value:e},{default:I(()=>[H(B(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),Iq={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},Lq={key:2,class:`flex flex-col items-start gap-2 py-3`},Rq={key:0,class:`mt-2 flex flex-wrap items-cent Line truncated
`)}};HQ.defaultYaml={explicit:!1,version:`1.2`},HQ.defaultTags={"!!":`tag:yaml.org,2002:`};function UQ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function WQ(e){let t=new Set;return FQ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function GQ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function KQ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=WQ(e);let a=GQ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(DQ(t.node)||kQ(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function qQ(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=qQ(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=qQ(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=qQ(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=qQ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function JQ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>JQ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!jQ(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var YQ=class{constructor(e){Object.defineProperty(this,SQ,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!wQ(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=JQ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?qQ(i,{"":o},``,o):o}},XQ=class extends YQ{constructor(e){super(gQ),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],FQ(e,{Node:(e,t)=>{(CQ(t)||jQ(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(JQ(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ZQ(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(UQ(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function ZQ(e,t,n){if(CQ(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(kQ(t)){let r=0;for(let i of t.items){let t=ZQ(e,i,n);t>r&&(r=t)}return r}if(EQ(t)){let r=ZQ(e,t.key,n),i=ZQ(e,t.value,n);return Math.max(r,i)}return 1}var QQ=e=>!e||typeof e!=`function`&&typeof e!=`object`,$Q=class extends YQ{constructor(e){super(bQ),this.value=e}toJSON(e,t){return t?.keep?this.value:JQ(this.value,e,t)}toString(){return String(this.value)}};$Q.BLOCK_FOLDED=`BLOCK_FOLDED`,$Q.BLOCK_LITERAL=`BLOCK_LITERAL`,$Q.PLAIN=`PLAIN`,$Q.QUOTE_DOUBLE=`QUOTE_DOUBLE`,$Q.QUOTE_SINGLE=`QUOTE_SINGLE`;var e$=`tag:yaml.org,2002:`;function t$(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function n$(e,t,n){if(wQ(e)&&(e=e.contents),AQ(e))return e;if(EQ(e)){let t=n.schema[vQ].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new XQ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=e$+t.slice(2));let l=t$(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new $Q(e);return c&&(c.node=t),t Line truncated
`)?s$(n,t):n.includes(`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),CW&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=KW(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=sW(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-qW),qW),t/=qW,t/Math.abs(t)+Math.round(t*(JW-1)))}shouldForceSelection(e){return yW?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),YW)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(yW&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._active Line truncated
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(SH(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(IB(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<YK+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===YK+1&&(this._liveRegion.textContent+=Dz.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let Line truncated
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return Tz.get()},set promptLabel(e){Tz.set(e)},get tooMuchOutput(){return Dz.get()},set tooMuchOutput(e){Dz.set(e)}}}_verifyIntegers(...e){for(cq of e)if(cq===1/0||isNaN(cq)||cq%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(cq of e)if(cq&&(cq===1/0||isNaN(cq)||cq%1!=0||cq<0))throw Error(`This API only accepts positive integers`)}},uq=2,dq=1,fq=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(uq,Math.floor(u/e.css.cell.width)),rows:Math.max(dq,Math.floor(l/e.css.cell.height))}}},pq={class:`flex h-[32rem] min-h-0 flex-col gap-2`},mq={key:0,class:`text-sm text-fg-muted`,role:`status`},hq=N({__name:`SandboxView`,props:{taskId:{},attempt:{}},setup(e){let t=e,n=q(null),r=q(`connecting`),i=null,a=null,o=null,s=null;function c(){try{o?.fit()}catch{}}return Ve(()=>{let e=n.value;if(!e)return;i=new lq({convertEol:!0,disableStdin:!0,cursorBlink:!1,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`}}),o=new fq,i.loadAddon(o),i.open(e),c();let l=window.location.protocol===`https:`?`wss:`:`ws:`,u=new URLSearchParams({attempt:String(t.attempt)}),d=new WebSocket(`${l}//${window.location.host}/api/tasks/${encodeURIComponent(t.taskId)}/sandbox?${u}`);a=d,d.binaryType=`arraybuffer`,d.onopen=()=>{r.value=`open`},d.onmessage=e=>{i&&(typeof e.data==`string`&&(r.value=`failed`),i.write(typeof e.data==`string`?e.data:new Uint8Array(e.data)))},d.onerror=()=>{r.value=`failed`},d.onclose=()=>{r.value!==`failed`&&(r.value=`closed`)},s=new ResizeObserver(c),s.observe(e)}),rt(()=>{s?.disconnect(),s=null,a?.close(),a=null,i?.dispose(),i=null,o=null}),(e,t)=>(I(),A(`div`,pq,[r.value===`open`?P(``,!0):(I(),A(`p`,mq,[r.value===`connecting`?(I(),A(H,{key:0},[V(`Connecting…`)],64)):r.value===`closed`?(I(),A(H,{key:1},[V(`The sandbox ended.`)],64)):(I(),A(H,{key:2},[V(`Sandbox unavailable.`)],64))])),L(`div`,{ref_key:`host`,ref:n,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),gq={class:`flex flex-wrap items-center gap-3 border-b border-border pb-3`},_q={class:`inline-flex items-center gap-2`},vq={class:`inline-flex items-center gap-2`},yq=`__all__`,bq=N({__name:`TaskLogFilters`,props:{filters:{},stages:{}},emits:[`filter`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>Jj.map(e=>({value:e.value||yq,label:e.label}))),a=J(()=>n.filters.level||yq),o=J(()=>n.filters.stage||yq);function s(e){r(`filter`,{...n.filters,...e})}function c(e){s({level:String(e)===yq?``:String(e)})}function l(e){s({stage:String(e)===yq?``:String(e)})}return(t,n)=>(I(),A(`div`,gq,[L(`div`,_q,[k(B(Du),{"model-value":a.value,"onUpdate:modelValue":c},{default:F(()=>[k(B(ju),{size:`sm`,"aria-label":`Filter log entries by level`},{default:F(()=>[k(B(Mu))]),_:1}),k(B(Ou),null,{default:F(()=>[k(B(ku),null,{default:F(()=>[(I(!0),A(H,null,j(i.value,e=>(I(),K(B(Au),{key:e.value,value:e.value},{default:F(()=>[V(z(e.label),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])]),L(`div`,vq,[k(B(Du),{"model-value":o.value,"onUpdate:modelValue":l},{default:F(()=>[k(B(ju),{size:`sm`,"aria-label":`Filter log entries by stage`},{default:F(()=>[k(B(Mu))]),_:1}),k(B(Ou),null,{default:F(()=>[k(B(ku),null,{default:F(()=>[k(B(Au),{value:yq},{default:F(()=>[...n[0]||=[V(`All stages`,-1)]]),_:1}),(I(!0),A(H,null,j(e.stages,e=>(I(),K(B(Au),{key:e,value:e},{default:F(()=>[V(z(e),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1})]),_:1},8,[`model-value`])])]))}}),xq={class:`sr-only`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`},Sq={key:2,class:`flex flex-col items-start gap-2 py-3`},Cq={key:0,class:`mt-2 flex flex-wrap items-cent Line truncated
`)}};CQ.defaultYaml={explicit:!1,version:`1.2`},CQ.defaultTags={"!!":`tag:yaml.org,2002:`};function wQ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function TQ(e){let t=new Set;return gQ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function EQ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function DQ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=TQ(e);let a=EQ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(cQ(t.node)||uQ(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function OQ(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=OQ(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=OQ(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=OQ(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=OQ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function kQ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>kQ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!fQ(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var AQ=class{constructor(e){Object.defineProperty(this,rQ,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!aQ(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=kQ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?OQ(i,{"":o},``,o):o}},jQ=class extends AQ{constructor(e){super(ZZ),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],gQ(e,{Node:(e,t)=>{(iQ(t)||fQ(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(kQ(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=MQ(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(wQ(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function MQ(e,t,n){if(iQ(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(uQ(t)){let r=0;for(let i of t.items){let t=MQ(e,i,n);t>r&&(r=t)}return r}if(sQ(t)){let r=MQ(e,t.key,n),i=MQ(e,t.value,n);return Math.max(r,i)}return 1}var NQ=e=>!e||typeof e!=`function`&&typeof e!=`object`,PQ=class extends AQ{constructor(e){super(tQ),this.value=e}toJSON(e,t){return t?.keep?this.value:kQ(this.value,e,t)}toString(){return String(this.value)}};PQ.BLOCK_FOLDED=`BLOCK_FOLDED`,PQ.BLOCK_LITERAL=`BLOCK_LITERAL`,PQ.PLAIN=`PLAIN`,PQ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,PQ.QUOTE_SINGLE=`QUOTE_SINGLE`;var FQ=`tag:yaml.org,2002:`;function sae(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function IQ(e,t,n){if(aQ(e)&&(e=e.contents),dQ(e))return e;if(sQ(e)){let t=n.schema[$Z].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new jQ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=FQ+t.slice(2));let l=sae(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new PQ(e);return c&&(c.node=t) Line truncated
`)?VQ(n,t):n.includes(`
`)?`
`+s$(n,t):(e.endsWith(` `)?``:` `)+n,l$=`flow`,u$=`block`,d$=`quoted`;function f$(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=p$(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=p$(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+VQ(n,t):(e.endsWith(` `)?``:` `)+n,UQ=`flow`,WQ=`block`,GQ=`quoted`;function KQ(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=qQ(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
`)n===`block`&&(h=qQ(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function p$(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var m$=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),h$=e=>/^(%|---|\.\.\.)/m.test(e);function g$(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function _$(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(h$(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function qQ(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
`);r=t,i=t+1,a=e[i]}return r}var JQ=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),YQ=e=>/^(%|---|\.\.\.)/m.test(e);function XQ(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function ZQ(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(YQ(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:f$(o,a,d$,m$(t,!1))}function v$(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return _$(e,t);let n=t.indent||(h$(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:f$(r,n,l$,m$(t,!1))}function y$(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=_$;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?v$:i&&!t?_$:n?v$:_$}return r(e,t)}var b$;try{b$=RegExp(`(^|(?<!
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:KQ(o,a,GQ,JQ(t,!1))}function QQ(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return ZQ(e,t);let n=t.indent||(YQ(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:KQ(r,n,UQ,JQ(t,!1))}function $Q(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=ZQ;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?QQ:i&&!t?ZQ:n?QQ:ZQ}return r(e,t)}var e$;try{e$=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{b$=/\n+(?!\n|$)/g}function x$({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return y$(n,r);let l=r.indent||(r.forceBlockIndent||h$(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===$Q.BLOCK_FOLDED?!1:t===$Q.BLOCK_LITERAL||!g$(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{e$=/\n+(?!\n|$)/g}function t$({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return $Q(n,r);let l=r.indent||(r.forceBlockIndent||YQ(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===PQ.BLOCK_FOLDED?!1:t===PQ.BLOCK_LITERAL||!XQ(n,c,l.length);if(!n)return u?`|
`:`>
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
`&&(p=p.slice(0,-1)),p.replace(b$,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`&&(p=p.slice(0,-1)),p.replace(e$,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=m$(r,!0);o!==`folded`&&t!==$Q.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=f$(`${v}${e}${p}`,l,u$,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function S$(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return y$(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?y$(a,t):x$(e,t,n,r);if(!s&&!u&&i!==$Q.PLAIN&&a.includes(`
`))return x$(e,t,n,r);if(h$(a)){if(c===``)return t.forceBlockIndent=!0,x$(e,t,n,r);if(s&&c===l)return y$(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return y$(a,t)}return s?d:f$(d,c,l$,m$(t,!1))}function C$(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==$Q.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=$Q.QUOTE_DOUBLE);let c=e=>{switch(e){case $Q.BLOCK_FOLDED:case $Q.BLOCK_LITERAL:return i||a?y$(o.value,t):x$(o,t,n,r);case $Q.QUOTE_DOUBLE:return _$(o.value,t);case $Q.QUOTE_SINGLE:return v$(o.value,t);case $Q.PLAIN:return S$(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function w$(e,t){let n=Object.assign({blockQuote:!0,commentString:o$,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function T$(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(DQ(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function E$(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(DQ(e)||kQ(e))&&e.anchor;a&&UQ(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function D$(e,t,n,r){if(EQ(e))return e.toString(t,n,r);if(CQ(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=AQ(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=T$(t.doc.schema.tags,a);let o=E$(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):DQ(a)?C$(a,t,n,r):a.toString(t,n,r);return o?DQ(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function O$({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=AQ(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(kQ(e)||!AQ(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||kQ(e)||(DQ(e)?e.type===$Q.BLOCK_FOLDED||e.type===$Q.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=D$(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=c$(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=c$(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=c$(g,n.indent,l(f))));let _,v,y;AQ(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&DQ(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&OQ(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=D$(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${s$(e,n.indent)}`}x===``&&!n.inFlow?S===`
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=JQ(r,!0);o!==`folded`&&t!==PQ.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=KQ(`${v}${e}${p}`,l,WQ,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function n$(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
`)||u&&/[[\]{},]/.test(a))return $Q(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?$Q(a,t):t$(e,t,n,r);if(!s&&!u&&i!==PQ.PLAIN&&a.includes(`
`))return t$(e,t,n,r);if(YQ(a)){if(c===``)return t.forceBlockIndent=!0,t$(e,t,n,r);if(s&&c===l)return $Q(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return $Q(a,t)}return s?d:KQ(d,c,UQ,JQ(t,!1))}function r$(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==PQ.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=PQ.QUOTE_DOUBLE);let c=e=>{switch(e){case PQ.BLOCK_FOLDED:case PQ.BLOCK_LITERAL:return i||a?$Q(o.value,t):t$(o,t,n,r);case PQ.QUOTE_DOUBLE:return ZQ(o.value,t);case PQ.QUOTE_SINGLE:return QQ(o.value,t);case PQ.PLAIN:return n$(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function i$(e,t){let n=Object.assign({blockQuote:!0,commentString:BQ,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function a$(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(cQ(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function o$(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(cQ(e)||uQ(e))&&e.anchor;a&&wQ(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function s$(e,t,n,r){if(sQ(e))return e.toString(t,n,r);if(iQ(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=dQ(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=a$(t.doc.schema.tags,a);let o=o$(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):cQ(a)?r$(a,t,n,r):a.toString(t,n,r);return o?cQ(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function c$({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=dQ(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(uQ(e)||!dQ(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||uQ(e)||(cQ(e)?e.type===PQ.BLOCK_FOLDED||e.type===PQ.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=s$(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=HQ(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=HQ(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=HQ(g,n.indent,l(f))));let _,v,y;dQ(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&cQ(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&lQ(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=s$(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${VQ(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&kQ(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&uQ(t)){let e=x[0],r=x.indexOf(`
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=c$(g,n.indent,l(y)):h&&i&&i(),g}function k$(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var A$=`<<`,j$={identify:e=>e===A$||typeof e==`symbol`&&e.description===A$,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new $Q(Symbol(A$)),{addToJSMap:N$}),stringify:()=>A$},M$=(e,t)=>(j$.identify(t)||DQ(t)&&(!t.type||t.type===$Q.PLAIN)&&j$.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===j$.tag&&e.default);function N$(e,t,n){let r=F$(e,n);if(OQ(r))for(let n of r.items)P$(e,t,n);else if(Array.isArray(r))for(let n of r)P$(e,t,n);else P$(e,t,r)}function P$(e,t,n){let r=F$(e,n);if(!TQ(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function F$(e,t){return e&&CQ(t)?t.resolve(e.doc,e):t}function I$(e,t,{key:n,value:r}){if(AQ(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(M$(e,n))N$(e,t,r);else{let i=JQ(n,``,e);if(t instanceof Map)t.set(i,JQ(r,i,e));else if(t instanceof Set)t.add(i);else{let a=L$(n,i,e),o=JQ(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function L$(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(AQ(e)&&n?.doc){let t=w$(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),k$(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function R$(e,t,n){return new z$(n$(e,void 0,n),n$(t,void 0,n))}var z$=class e{constructor(e,t=null){Object.defineProperty(this,SQ,{value:yQ}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return AQ(n)&&(n=n.clone(t)),AQ(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return I$(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?O$(this,e,t,n):JSON.stringify(this)}};function B$(e,t,n){return(t.inFlow??e.flow?H$:V$)(e,t,n)}function V$({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(AQ(i))!d&&i.spaceBefore&&f.push(``),U$(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(EQ(i)){let e=AQ(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),U$(n,f,e.commentBefore,d))}d=!1;let s=D$(i,u,()=>o=null,()=>d=!0);o&&(s+=c$(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=HQ(g,n.indent,l(y)):h&&i&&i(),g}function l$(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var u$=`<<`,d$={identify:e=>e===u$||typeof e==`symbol`&&e.description===u$,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new PQ(Symbol(u$)),{addToJSMap:p$}),stringify:()=>u$},f$=(e,t)=>(d$.identify(t)||cQ(t)&&(!t.type||t.type===PQ.PLAIN)&&d$.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===d$.tag&&e.default);function p$(e,t,n){let r=h$(e,n);if(lQ(r))for(let n of r.items)m$(e,t,n);else if(Array.isArray(r))for(let n of r)m$(e,t,n);else m$(e,t,r)}function m$(e,t,n){let r=h$(e,n);if(!oQ(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function h$(e,t){return e&&iQ(t)?t.resolve(e.doc,e):t}function g$(e,t,{key:n,value:r}){if(dQ(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(f$(e,n))p$(e,t,r);else{let i=kQ(n,``,e);if(t instanceof Map)t.set(i,kQ(r,i,e));else if(t instanceof Set)t.add(i);else{let a=_$(n,i,e),o=kQ(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function _$(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(dQ(e)&&n?.doc){let t=i$(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),l$(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function v$(e,t,n){return new y$(IQ(e,void 0,n),IQ(t,void 0,n))}var y$=class e{constructor(e,t=null){Object.defineProperty(this,rQ,{value:eQ}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return dQ(n)&&(n=n.clone(t)),dQ(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return g$(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?c$(this,e,t,n):JSON.stringify(this)}};function b$(e,t,n){return(t.inFlow??e.flow?S$:x$)(e,t,n)}function x$({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(dQ(i))!d&&i.spaceBefore&&f.push(``),C$(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(sQ(i)){let e=dQ(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),C$(n,f,e.commentBefore,d))}d=!1;let s=s$(i,u,()=>o=null,()=>d=!0);o&&(s+=HQ(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
`}}return e?(p+=`
`+s$(l(e),c),s&&s()):d&&o&&o(),p}function H$({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(AQ(i))i.spaceBefore&&d.push(``),U$(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(EQ(i)){let e=AQ(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),U$(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=AQ(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=D$(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=c$(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function U$({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=s$(t(r),e);n.push(i.trimStart())}}function W$(e,t){let n=DQ(t)?t.value:t;for(let r of e)if(EQ(r)&&(r.key===t||r.key===n||DQ(r.key)&&r.key.value===n))return r}var G$=class extends a${static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(vQ,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(R$(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=EQ(e)?e:!e||typeof e!=`object`||!(`key`in e)?new z$(e,e?.value):new z$(e.key,e.value);let r=W$(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);DQ(r.value)&&QQ(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=W$(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=W$(this.items,e)?.value;return(!t&&DQ(n)?n.value:n)??void 0}has(e){return!!W$(this.items,e)}set(e,t){this.add(new z$(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)I$(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!EQ(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),B$(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},K$={collection:`map`,default:!0,nodeClass:G$,tag:`tag:yaml.org,2002:map`,resolve(e,t){return TQ(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>G$.from(e,t,n)},q$=class extends a${static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(xQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=J$(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=J$(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&DQ(r)?r.value:r}has(e){let t=J$(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=J$(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];DQ(r)&&QQ(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(JQ(e,String(r++),t));return n}toString(e,t,n){return e?B$(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(n$(a,void 0,n))}}return i}};function J$(e){let t=DQ(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var Y$={collection:`seq`,default:!0,nodeClass:q$,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return OQ(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>q$.from(e,t,n)},X$={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),C$(e,t,n,r)}},Z$={identify:e=>e==null,createNode:()=>new $Q(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $Q(null),stringify:({source:e},t)=>typeof e==`string`&&Z$.test.test(e)?e:t.options.nullStr},Q$={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new $Q(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&Q$.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function $$({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var e1={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:$$},t1={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return C$({comment:e,type:t,value:s},r,i,a)}};function h1(e,t){if(OQ(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!EQ(r)){if(TQ(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new z$(new $Q(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=EQ(r)?r:new z$(r)}}else t(`Expected a sequence for this tag`);return e}function g1(e,t,n){let{replacer:r}=n,i=new q$(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(R$(o,s,n))}return i}var _1={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:h1,createNode:g1},v1=class e extends q${constructor(){super(),this.add=G$.prototype.add.bind(this),this.delete=G$.prototype.delete.bind(this),this.get=G$.prototype.get.bind(this),this.has=G$.prototype.has.bind(this),this.set=G$.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(EQ(e)?(r=JQ(e.key,``,t),i=JQ(e.value,r,t)):r=JQ(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=g1(e,t,n),i=new this;return i.items=r.items,i}};v1.tag=`tag:yaml.org,2002:omap`;var y1={collection:`seq`,identify:e=>e instanceof Map,nodeClass:v1,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=h1(e,t),r=[];for(let{key:e}of n.items)DQ(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new v1,n)},createNode:(e,t,n)=>v1.from(e,t,n)};function b1({value:e,source:t},n){return t&&(e?x1:S1).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var x1={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $Q(!0),stringify:b1},S1={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $Q(!1),stringify:b1},C1={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:$$},w1={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():$$(e)}},T1={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new $Q(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:$$},E1=e=>typeof e==`bigint`||Number.isInteger(e);function D1(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function O1(e,t,n){let{value:r}=e;if(E1(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return $$(e)}var k1={identify:E1,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>D1(e,2,2,n),stringify:e=>O1(e,2,`0b`)},A1={identify:E1,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>D1(e,1,8,n),stringify:e=>O1(e,8,`0`)},j1={identify:E1,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>D1(e,0,10,n),stringify:$$},M1={identify:E1,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>D1(e,2,16,n),stringify:e=>O1(e,16,`0x`)},N1=class e extends G${constructor(t){super(t),this.tag=e.tag}add(e){let t;t=EQ(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new z$(e.key,null):new z$(e,null),W$(this.items,t.key)||this.items.push(t)}get(e,t){let n=W$(this.items,e);return!t&&EQ(n)?DQ(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=W$(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new z$(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s Line truncated
`)?(n.push(`...`),n.push(s$(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(s$(a(t),``)))}return n.join(`
`+VQ(l(e),c),s&&s()):d&&o&&o(),p}function S$({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(dQ(i))i.spaceBefore&&d.push(``),C$(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(sQ(i)){let e=dQ(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),C$(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=dQ(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=s$(i,c,()=>a=null);l||=d.length>u||o.includes(`
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=HQ(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function C$({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=VQ(t(r),e);n.push(i.trimStart())}}function w$(e,t){let n=cQ(t)?t.value:t;for(let r of e)if(sQ(r)&&(r.key===t||r.key===n||cQ(r.key)&&r.key.value===n))return r}var T$=class extends zQ{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super($Z,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(v$(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=sQ(e)?e:!e||typeof e!=`object`||!(`key`in e)?new y$(e,e?.value):new y$(e.key,e.value);let r=w$(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);cQ(r.value)&&NQ(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=w$(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=w$(this.items,e)?.value;return(!t&&cQ(n)?n.value:n)??void 0}has(e){return!!w$(this.items,e)}set(e,t){this.add(new y$(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)g$(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!sQ(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),b$(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},E$={collection:`map`,default:!0,nodeClass:T$,tag:`tag:yaml.org,2002:map`,resolve(e,t){return oQ(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>T$.from(e,t,n)},D$=class extends zQ{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(nQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=O$(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=O$(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&cQ(r)?r.value:r}has(e){let t=O$(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=O$(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];cQ(r)&&NQ(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(kQ(e,String(r++),t));return n}toString(e,t,n){return e?b$(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(IQ(a,void 0,n))}}return i}};function O$(e){let t=cQ(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var k$={collection:`seq`,default:!0,nodeClass:D$,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return lQ(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>D$.from(e,t,n)},A$={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),r$(e,t,n,r)}},j$={identify:e=>e==null,createNode:()=>new PQ(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new PQ(null),stringify:({source:e},t)=>typeof e==`string`&&j$.test.test(e)?e:t.options.nullStr},M$={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new PQ(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&M$.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function N$({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var P$={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:N$},F$={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string Line truncated
`:` `)}return r$({comment:e,type:t,value:s},r,i,a)}};function Y$(e,t){if(lQ(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!sQ(r)){if(oQ(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new y$(new PQ(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=sQ(r)?r:new y$(r)}}else t(`Expected a sequence for this tag`);return e}function X$(e,t,n){let{replacer:r}=n,i=new D$(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(v$(o,s,n))}return i}var Z$={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Y$,createNode:X$},Q$=class e extends D${constructor(){super(),this.add=T$.prototype.add.bind(this),this.delete=T$.prototype.delete.bind(this),this.get=T$.prototype.get.bind(this),this.has=T$.prototype.has.bind(this),this.set=T$.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(sQ(e)?(r=kQ(e.key,``,t),i=kQ(e.value,r,t)):r=kQ(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=X$(e,t,n),i=new this;return i.items=r.items,i}};Q$.tag=`tag:yaml.org,2002:omap`;var $$={collection:`seq`,identify:e=>e instanceof Map,nodeClass:Q$,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Y$(e,t),r=[];for(let{key:e}of n.items)cQ(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new Q$,n)},createNode:(e,t,n)=>Q$.from(e,t,n)};function e1({value:e,source:t},n){return t&&(e?t1:n1).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var t1={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new PQ(!0),stringify:e1},n1={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new PQ(!1),stringify:e1},r1={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:N$},i1={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():N$(e)}},a1={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new PQ(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:N$},o1=e=>typeof e==`bigint`||Number.isInteger(e);function s1(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function c1(e,t,n){let{value:r}=e;if(o1(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return N$(e)}var l1={identify:o1,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>s1(e,2,2,n),stringify:e=>c1(e,2,`0b`)},u1={identify:o1,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>s1(e,1,8,n),stringify:e=>c1(e,8,`0`)},d1={identify:o1,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>s1(e,0,10,n),stringify:N$},f1={identify:o1,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>s1(e,2,16,n),stringify:e=>c1(e,16,`0x`)},p1=class e extends T${constructor(t){super(t),this.tag=e.tag}add(e){let t;t=sQ(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new y$(e.key,null):new y$(e,null),w$(this.items,t.key)||this.items.push(t)}get(e,t){let n=w$(this.items,e);return!t&&sQ(n)?cQ(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=w$(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new y$(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s Line truncated
`)?(n.push(`...`),n.push(VQ(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(VQ(a(t),``)))}return n.join(`
`)+`
`}var J1=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,SQ,{value:_Q});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new HQ({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[SQ]:{value:_Q}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=AQ(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Y1(this.contents)&&this.contents.add(e)}addIn(e,t){Y1(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=WQ(this);e.anchor=!t||n.has(t)?GQ(t||`a`,n):t}return new XQ(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=KQ(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=n$(e,l,p);return o&&kQ(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new z$(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Y1(this.contents)?this.contents.delete(e):!1}deleteIn(e){return i$(e)?this.contents!=null&&(this.contents=null,!0):Y1(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return kQ(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return i$(e)?!t&&DQ(this.contents)?this.contents.value:this.contents:kQ(this.contents)?this.contents.getIn(e,t):void 0}has(e){return kQ(this.contents)?this.contents.has(e):!1}hasIn(e){return i$(e)?this.contents!==void 0:kQ(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=r$(this.schema,[e],t):Y1(this.contents)&&this.contents.set(e,t)}setIn(e,t){i$(e)?this.contents=t:this.contents==null?this.contents=r$(this.schema,Array.from(e),t):Y1(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new HQ({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new HQ({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new K1(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=JQ(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?qQ(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return q1(this,e)}};function Y1(e){if(kQ(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var X1=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Z1=class extends X1{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Q1=class extends X1{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},$1=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function e0(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function t0(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(t0(t.key)||t0(t.value))return!0}return!1;default:return!0}}function n0(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&t0(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function r0(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||DQ(e)&&DQ(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var i0=`All mapping items must start at the same column`;function a0({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??G$)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=e0(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,i0)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||t0(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,i0);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&n0(r.indent,u,i),n.atKey=!1,r0(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=e0(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&n0(r.indent,f,i),s=c.range[2];let l=new z$(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new z$(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function o0({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??q$)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=e0(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&n0(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function s0(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var c0=`Block collections are not allowed within flow collections`,l0=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function u0({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?G$:q$))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=e0(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&t0(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];EQ(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],l0(m)&&i(r.range,`BLOCK_IN_FLOW`,c0)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);l0(f)&&i(g.range,`BLOCK_IN_FLOW`,c0),n.atKey=!1;let _=e0(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?l0(m)&&i(v.range,`BLOCK_IN_FLOW`,c0):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new z$(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;r0(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new G$(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=s0(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function d0(e,t,n,r,i,a){let o=n.type===`block-map`?a0(e,t,n,r,a):n.type===`block-seq`?o0(e,t,n,r,a):u0(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function f0(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===G$.tagName&&s===`map`||o===q$.tagName&&s===`seq`)return d0(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),d0(e,t,n,i,o)}let l=d0(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=AQ(u)?u:new $Q(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function p0(e,t,n){let r=t.offset,i=m0(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?$Q.BLOCK_FOLDED:$Q.BLOCK_LITERAL,o=t.source?h0(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`}var O1=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,rQ,{value:QZ});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new CQ({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[rQ]:{value:QZ}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=dQ(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){k1(this.contents)&&this.contents.add(e)}addIn(e,t){k1(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=TQ(this);e.anchor=!t||n.has(t)?EQ(t||`a`,n):t}return new jQ(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=DQ(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=IQ(e,l,p);return o&&uQ(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new y$(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return k1(this.contents)?this.contents.delete(e):!1}deleteIn(e){return RQ(e)?this.contents!=null&&(this.contents=null,!0):k1(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return uQ(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return RQ(e)?!t&&cQ(this.contents)?this.contents.value:this.contents:uQ(this.contents)?this.contents.getIn(e,t):void 0}has(e){return uQ(this.contents)?this.contents.has(e):!1}hasIn(e){return RQ(e)?this.contents!==void 0:uQ(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=LQ(this.schema,[e],t):k1(this.contents)&&this.contents.set(e,t)}setIn(e,t){RQ(e)?this.contents=t:this.contents==null?this.contents=LQ(this.schema,Array.from(e),t):k1(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new CQ({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new CQ({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new E1(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=kQ(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?OQ(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return D1(this,e)}};function k1(e){if(uQ(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var A1=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},j1=class extends A1{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},M1=class extends A1{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},N1=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function P1(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function F1(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(F1(t.key)||F1(t.value))return!0}return!1;default:return!0}}function I1(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&F1(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function L1(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||cQ(e)&&cQ(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var R1=`All mapping items must start at the same column`;function z1({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??T$)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=P1(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,R1)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||F1(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,R1);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&I1(r.indent,u,i),n.atKey=!1,L1(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=P1(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&I1(r.indent,f,i),s=c.range[2];let l=new y$(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let e=new y$(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function B1({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??D$)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=P1(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&I1(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function V1(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var H1=`Block collections are not allowed within flow collections`,U1=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function W1({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?T$:D$))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=P1(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&F1(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];sQ(t)&&(t=t.value??t.key),t.comment?t.comment+=`
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],U1(m)&&i(r.range,`BLOCK_IN_FLOW`,H1)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);U1(f)&&i(g.range,`BLOCK_IN_FLOW`,H1),n.atKey=!1;let _=P1(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?U1(m)&&i(v.range,`BLOCK_IN_FLOW`,H1):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new y$(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;L1(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new T$(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=V1(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function G1(e,t,n,r,i,a){let o=n.type===`block-map`?z1(e,t,n,r,a):n.type===`block-seq`?B1(e,t,n,r,a):W1(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function K1(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===T$.tagName&&s===`map`||o===D$.tagName&&s===`seq`)return G1(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),G1(e,t,n,i,o)}let l=G1(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=dQ(u)?u:new PQ(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function q1(e,t,n){let r=t.offset,i=J1(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?PQ.BLOCK_FOLDED:PQ.BLOCK_LITERAL,o=t.source?Y1(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===$Q.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===PQ.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -245,59 +245,59 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
`+o[e][0].slice(c);d[d.length-1]!==`
`&&(d+=`
`);break;default:d+=`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function m0({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function h0(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function g0(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=$Q.PLAIN,c=_0(a,l);break;case`single-quoted-scalar`:s=$Q.QUOTE_SINGLE,c=v0(a,l);break;case`double-quoted-scalar`:s=$Q.QUOTE_DOUBLE,c=b0(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=s0(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function _0(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),y0(e)}function v0(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),y0(e.slice(1,-1)).replace(/''/g,`'`)}function y0(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function J1({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function Y1(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function X1(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=PQ.PLAIN,c=Z1(a,l);break;case`single-quoted-scalar`:s=PQ.QUOTE_SINGLE,c=Q1(a,l);break;case`double-quoted-scalar`:s=PQ.QUOTE_DOUBLE,c=e0(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=V1(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function Z1(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),$1(e)}function Q1(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),$1(e.slice(1,-1)).replace(/''/g,`'`)}function $1(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
`?a+=o:o=`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function b0(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function e0(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
`){if(i===`
`){let{fold:t,offset:i}=x0(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=S0[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=t0(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=n0[i];if(a)n+=a;else if(i===`
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=C0(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=r0(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
`&&(a!==`\r`||e[r+2]!==`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function x0(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function t0(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
`);)r===`
`&&(n+=`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var S0={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function C0(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function w0(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?p0(e,t,r):g0(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[bQ]:c?T0(e.schema,i,c,n,r):t.type===`scalar`?E0(e,i,t,r):e.schema[bQ];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=DQ(a)?a:new $Q(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new $Q(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function T0(e,t,n,r,i){if(n===`!`)return e[bQ];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[bQ])}function E0({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[bQ];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[bQ];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function D0(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var O0={composeNode:k0,composeEmptyNode:A0};function k0(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=j0(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=w0(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=f0(O0,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=A0(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!DQ(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function A0(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=w0(e,{type:`scalar`,offset:D0(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function j0({options:e},{offset:t,source:n,end:r},i){let a=new XQ(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=s0(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function M0(e,t,{offset:n,start:r,value:i,end:a},o){let s=new J1(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=e0(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?k0(c,i,l,o):A0(c,l.end,r,null,l,o);let u=s.contents.range[2],d=s0(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function N0(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function P0(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var n0={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function r0(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function i0(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?q1(e,t,r):X1(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[tQ]:c?a0(e.schema,i,c,n,r):t.type===`scalar`?o0(e,i,t,r):e.schema[tQ];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=cQ(a)?a:new PQ(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new PQ(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function a0(e,t,n,r,i){if(n===`!`)return e[tQ];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[tQ])}function o0({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[tQ];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[tQ];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function s0(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var c0={composeNode:l0,composeEmptyNode:u0};function l0(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=d0(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=i0(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=K1(c0,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=u0(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!cQ(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function u0(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=i0(e,{type:`scalar`,offset:s0(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function d0({options:e},{offset:t,source:n,end:r},i){let a=new jQ(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=V1(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function f0(e,t,{offset:n,start:r,value:i,end:a},o){let s=new O1(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=P1(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?l0(c,i,l,o):u0(c,l.end,r,null,l,o);let u=s.contents.range[2],d=V1(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function p0(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function m0(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
`:`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var F0=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=N0(e);r?this.warnings.push(new Q1(i,t,n)):this.errors.push(new Z1(i,t,n))},this.directives=new HQ({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=P0(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(kQ(i)&&!i.flow&&i.items.length>0){let e=i.items[0];EQ(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:P0(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=N0(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=M0(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new Z1(N0(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new Z1(N0(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=s0(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Z1(N0(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new J1(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},I0=Symbol(`break visit`),L0=Symbol(`skip children`),R0=Symbol(`remove item`);function z0(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),B0(Object.freeze([]),e,t)}z0.BREAK=I0,z0.SKIP=L0,z0.REMOVE=R0,z0.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},z0.parentCollection=(e,t)=>{let n=z0.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function B0(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=B0(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===I0)return I0;else r===R0&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function V0(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var h0=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=p0(e);r?this.warnings.push(new M1(i,t,n)):this.errors.push(new j1(i,t,n))},this.directives=new CQ({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=m0(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(uQ(i)&&!i.flow&&i.items.length>0){let e=i.items[0];sQ(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:m0(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=p0(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=f0(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new j1(p0(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new j1(p0(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=V1(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new j1(p0(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new O1(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},g0=Symbol(`break visit`),_0=Symbol(`skip children`),v0=Symbol(`remove item`);function y0(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),b0(Object.freeze([]),e,t)}y0.BREAK=g0,y0.SKIP=_0,y0.REMOVE=v0,y0.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},y0.parentCollection=(e,t)=>{let n=y0.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function b0(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=b0(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===g0)return g0;else r===v0&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function x0(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
`:case`\r
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function H0(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var U0=new Set(`0123456789ABCDEFabcdef`),W0=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),G0=new Set(`,[]{}`),K0=new Set(` ,[]{}
\r `),q0=e=>!e||K0.has(e),J0=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function S0(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var C0=new Set(`0123456789ABCDEFabcdef`),w0=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),T0=new Set(`,[]{}`),E0=new Set(` ,[]{}
\r `),D0=e=>!e||E0.has(e),O0=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
`||t===`\r`&&this.buffer[e+1]===`
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
`||!t&&!this.atEnd)return e+n+1}return t===`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&H0(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&H0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!H0(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&H0(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(q0),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&H0(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(q0),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||H0(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&S0(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&S0(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!S0(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&S0(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(D0),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&S0(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(D0),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||S0(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>H0(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>S0(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(H0(r)||e&&G0.has(r))break;t=n}else if(H0(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(S0(r)||e&&T0.has(r))break;t=n}else if(S0(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&G0.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&G0.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(q0),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(H0(n)||t&&G0.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!H0(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(W0.has(t))t=this.buffer[++e];else if(t===`%`&&U0.has(this.buffer[e+1])&&U0.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&T0.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&T0.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(D0),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(S0(n)||t&&T0.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!S0(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(w0.has(t))t=this.buffer[++e];else if(t===`%`&&C0.has(this.buffer[e+1])&&C0.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},Y0=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function X0(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function Z0(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function Q0(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function $0(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function e2(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function t2(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function n2(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!X0(t.start,`explicit-key-ind`)&&!X0(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,Q0(t.value)?t.value.end?t2(t.value.end,t.sep):t.value.end=t.sep:t2(t.start,t.sep),delete t.sep)}var r2=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new J0,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=V0(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&n2(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&Z0(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.in Line truncated
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},k0=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function A0(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function j0(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function M0(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function N0(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function P0(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function F0(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function I0(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!A0(t.start,`explicit-key-ind`)&&!A0(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,M0(t.value)?t.value.end?F0(t.value.end,t.sep):t.value.end=t.sep:F0(t.start,t.sep),delete t.sep)}var L0=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new O0,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=x0(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source})}else{if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&I0(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&j0(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.in Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){t2(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(X0(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=e2(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(X0(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Q0(t.key)&&!X0(t.sep,`newline`)){let e=e2(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):X0(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!X0(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){t2(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||X0(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite Line truncated
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){F0(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(A0(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=P0(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(A0(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(M0(t.key)&&!A0(t.sep,`newline`)){let e=P0(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):A0(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!A0(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){F0(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||A0(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite Line truncated
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=e2($0(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=e2($0(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function i2(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Y0||null,prettyErrors:t}}function a2(e,t={}){let{lineCounter:n,prettyErrors:r}=i2(t),i=new r2(n?.addNewLine),a=new F0(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new Z1(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach($1(e,n)),o.warnings.forEach($1(e,n))),o}function o2(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=a2(e,n);if(!i)return null;if(i.warnings.forEach(e=>k$(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function s2(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return wQ(e)&&!r?e.toString(n):new J1(e,r,n).toString(n)}var c2=e=>typeof e==`object`&&!!e&&!Array.isArray(e),l2=e=>c2(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function u2(e){if(c2(e)){if(c2(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:l2(e.parallel)};if(c2(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:l2(e.switch.cases)}}}function d2(e){return e.slice(2).includes(`parallel`)}function f2(e,t){let n=a2(e).getIn(t,!0);if(TQ(n))return n.toJSON()}function p2(e,t,n){let r=a2(e);return r.setIn(t,r.createNode(T2(n))),r.toString()}function m2(e,t,n){let r=a2(e),i=t.slice(0,-1),a=d2(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(OQ(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!OQ(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function h2(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function g2(e,t){let n=e.getIn(t,!0),r=u2(TQ(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!TQ(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function _2(e,t,n){let r=a2(e),{kind:i,branches:a}=g2(r,t);if(h2(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function v2(e,t,n,r){let i=a2(e),{kind:a,branches:o}=g2(i,t);if(h2(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>DQ(e.key)&&e.key.value===n);if(!s||!DQ(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function y2(e,t,n){let r=a2(e),{kind:i,branches:a}=g2(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return Line truncated
`).find(e=>e.trim())?.trim()}}function B2(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(I2)].map(e=>e[1]))]}function V2(e){let t=a2(e).toJS(),n=L2(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=L2(e)?e:{},p=u2(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=L2(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,name:g||void 0,title:g||F2(m),type:m,step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:R2(m,h),summary:z2(h),when:typeof d.when==`string`?d.when:void 0,retry:L2(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of B2([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=u2(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*M2,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=L2(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=Math.max(1,...o.map(([,e])=>e.length)),v=e=>(e-(h-1)/2)*N2,y=(e,t,n)=>r.push({id:e,type:`lane`,position:{x:t-12,y:u*M2-40},style:{width:`264px`,height:`${(_+1)*M2-24}px`},zIndex:-1,data:{kind:`step`,key:n,title:n,type:``,detail:``,lane:i}}),b=(u+_)*M2;if(o.forEach(([t,n],o)=>{let s=v(o),l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*M2,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]});let h=`add-${e}-${t}`;r.push({id:h,type:`add`,position:{x:s+104,y:b},data:{kind:`step`,key:h,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,h),g.push(h),y(`lane-${e}-${t}`,s,t)}),f){let t=v(h-1),n=`pass-${e}`;r.push({id:n,type:`add`,position:{x:t+104,y:b},data:{kind:`step`,key:n,title:``,type:``,detail:``,lane:i}}),s.add(c),m([c],n),s.delete(c),g.push(n),y(`pass-lane-${e}`,t,`default`)}l=g,u+=_+1;continue}let i=p(t,String(e+1),0,u*M2,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*M2-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var H2={class:`truncate`},U2=`\0`,W2=P({inheritAttrs:!1,__name:`OptionSelect`,props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},size:{},class:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,r)=>(L(),q(V(Tu),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?U2:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===U2?``:String(e))},{default:I(()=>[A(V(ku),G({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:I(()=>[A(V(Au),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),A(V(Eu),{position:`popper`,class:`max-w-[min(var(--reka-select-content-available-width),20rem)]`},{default:I(()=>[(L(!0),j(U,null,M(e.options,e=>(L(),q(V(Ou),{key:e.value,value:e.value===``?U2:e.value,disabled:e.disabled,title:e.label,class:`*:[span]:last:min-w-0`},{default:I(()=>[R(`span`,H2,B(e.label),1)]),_:2},1032,[`value`,`disabled`,`title`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),G2=[`id`],K2=[`value`],q2=P({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{},class:{},editable:{type:Boolean}},emits:[`pick`],setup(e,{emit:t}){let n=De(),r=t;return(t,i)=>e.editable?(L(),j(U,{key:0},[A(V(Q),{"model-value":e.value,list:V(n),"aria-label":e.label,class:z(t.$props.class),placeholder:`Workflow id or {{ reference }}`,"onUpdate:modelValue":i[0]||=e=>r(`pick`,String(e))},null,8,[`model-value`,`list`,`aria-label`,`class`]),R(`datalist`,{id:V(n)},[(L(!0),j(U,null,M(e.workflows,e=>(L(),j(`option`,{key:e.id,value:e.id},null,8,K2))),128))],8,G2)],64)):(L(),q(V(Tu),{key:1,"model-value":e.value||void 0,"onUpdate:modelValue":i[1]||=e=>r(`pick`,String(e))},{default:I(()=>[A(V(ku),{"aria-label":e.label,class:z(t.$props.class)},{default:I(()=>[A(V(Au),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`,`class`]),A(V(Eu),null,{default:I(()=>[e.value& Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:s4(e)}))}var a4=/^(\s*)(-\s+)?/,o4=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function s4(e){let{code:t,comment:n}=c4(e),r=l4(t);return n&&r.push({text:n,kind:`comment`}),r}function c4(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t=``);else if(r===`"`||r===`'`)t=r;else if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function l4(e){if(!e)return[];let t=[],n=a4.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=o4.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...u4(i[4]??``)]):[...t,...u4(r)]}function u4(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function d4(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function f4(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function p4(e){return typeof e==`string`&&e.trim()!==``}var m4={class:`space-y-4 px-3 py-3`},h4={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},g4={key:1,class:`space-y-3`},_4={key:0,class:`block space-y-1.5`},v4=[`id`],y4=[`value`],b4={class:`text-xs font-medium text-fg-muted`},x4={class:`flex items-center gap-2`},S4={key:1,role:`alert`,class:`text-xs text-danger`},C4={key:2,class:`space-y-1.5`},w4=[`title`],T4={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},E4={key:0,class:`divide-y divide-border rounded-md border border-border`},D4=[`title`],O4={key:0,class:`space-y-3`},k4={class:`text-label`},A4={key:0,class:`text-danger`},j4={class:`ml-2 text-xs text-fg-subtle`},M4={key:1,class:`space-y-3`},N4={class:`text-label`},P4={class:`ml-2 text-xs text-fg-subtle`},F4=[`title`],I4={key:0,class:`text-xs text-danger`},L4={class:`space-y-1.5`},R4={key:0,role:`alert`,class:`text-xs text-danger`},z4={class:`divide-y divide-border rounded-md border border-border`},B4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},V4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},H4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},U4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},W4=[`for`],G4=P({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=De(),r=e,i=t,a=Y(()=>f2(r.yaml,r.path)??{}),o=Y(()=>u2(a.value)),s=Y(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=Y(()=>o.value?.branches.map(([e])=>e)??[]),l=Y(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,p2(r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=J(``),f=J(``);function p(e,t,n=``){try{let a=e===`add`?_2(r.yaml,r.path,t):e===`rename`?v2(r.yaml,r.path,t,n):y2(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=Y(()=>r.vocabulary.find(e=>e.name===s.value)),h=Y(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=Y(()=>w2(r.yaml,r.path)),_=Y(()=>e4(a.value)),v=Y(()=>m.value?.settings&&a.value.settings?n4(a.value.settings,m.value.settings,`settings`):``),y=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],b=/mission|body|detail|plan|rules/;function x(e,t){return[`workflow.call`,`workflow.handoff`].includes(s.value)&&e===`workflow`||s.value===`human.approve`&&e===`then`?`workflow`:s.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:b.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let S=Y(()=>{let e=Object.entries(m.value?.settings?.properties??{}).filter(([e])=>s.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:x(e,t),options:s.value===`agent.run`&&e===`model`?r.modelAliases:t.enum??[]})),t=e.filter(e=>y.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>y.indexOf(e.key)-y.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}}),C=J(!S.value.lead&&!o.value),w=e=>[{value:``,label:`Default`},...e.map(e=>({value:e,label:e}))];function ee(e){let{id:t,type:n,...a}=e;i(`update:yaml`,p2(r.yaml,r.path,{id:t,type:n,...a}))}function T(e,t){ee({...a.value,[e]:t})}function E(e){let t={...a.value.retry,...e};T(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function D(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,ee({...a.value,settings:n})}function O(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),ee({...a.value,settings:n})}let te=Y(()=>r.workflows.find(e=>e.id===h.value.workflow)),ne=Y(()=>Object.entries(E2(te.value?.yaml??``,`inputs`)??{})),re=Y(()=>Object.entries(E2(te.value?.yaml??``,`outputs`)??{})),k=Y(()=>Object.entries(E2(r.yaml,`inputs`)??{})),ae=Y(()=>Object.entries(E2(r.yaml,`outputs`)??{})),oe=Y(()=>h.value.inputs??{}),se=Y(()=>h.value.outputs??{}),ce=e=>typeof e==`string`&&e.startsWith(`inputs.`),le=e=>[`object`,`array`].includes(e.type??``),ue=e=>oe.value[e]===void 0?``:String(oe.value[e]);function de(e,t,n){D(`inputs`,{...oe.value,[e]:t===``?void 0:ce(t)?t:TE(t,n??`string`)})}let fe=(e,t,n)=>e.filter(([,e])=>e.type===t.type||e.type===`any`||t.type===`any`).map(([e])=>({value:`${n}.${e}`,label:e})),pe=J(null);function me(e){let t=pe.value??S.value.lead?.key;if(!t)return;let n=typeof h.value[t]==`string`?h.value[t]:``,r=`{{ steps.${e}.summary }}`;D(t,n?`${n.trimEnd()} ${r}`:r)}let he=J({});function ge(e,t){try{D(e,t.trim()?o2(t):void 0),he.value={...he.value,[e]:``}}catch(t){he.value={...he.value,[e]:String(t.me Line truncated
`)[0]}}}let _e=e=>e===void 0?``:s2(e).trimEnd(),ve=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),ye=e=>typeof h.value[e]==`string`?h.value[e]:``,be=[{value:``,label:`Park the task`},{value:`continue`,label:`Continue`}];return(t,r)=>(L(),j(`div`,m4,[v.value?(L(),j(`p`,h4,B(v.value),1)):F(``,!0),o.value?(L(),j(`section`,g4,[s.value===`switch`?(L(),j(`label`,_4,[r[15]||=R(`span`,{class:`text-xs font-medium text-fg-muted`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),A(V(Q),{"model-value":o.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`${V(n)}-switch-on`,onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[`model-value`,`list`]),R(`datalist`,{id:`${V(n)}-switch-on`},[(L(!0),j(U,null,M(g.value,e=>(L(),j(`option`,{key:e,value:`steps.${e}.result.`},null,8,y4))),128))],8,v4)])):F(``,!0),R(`div`,b4,B(s.value===`switch`?`Cases`:`Branches`),1),(L(!0),j(U,null,M(c.value,e=>(L(),j(`div`,{key:e,class:`flex items-center gap-2`},[A(V(Q),{"model-value":e,class:z(s.value===`switch`&&`font-mono`),"aria-label":`${s.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>p(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),A(V(X),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:c.value.length<=l.value,onClick:t=>p(`delete`,e)},{default:I(()=>[A(V(hu))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),R(`div`,x4,[A(V(Q),{modelValue:d.value,"onUpdate:modelValue":r[1]||=e=>d.value=e,"aria-label":s.value===`switch`?`New case value`:`New branch name`,placeholder:s.value===`switch`?`Value, or default`:`Branch name`,onKeydown:r[2]||=vt(gt(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),A(V(X),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":s.value===`switch`?`Add case`:`Add branch`,disabled:!d.value.trim(),onClick:r[3]||=e=>p(`add`,d.value.trim())},{default:I(()=>[A(V(lu))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(L(),j(`p`,S4,B(f.value),1)):F(``,!0)])):F(``,!0),S.value.lead?(L(),j(`section`,C4,[R(`div`,{class:`flex items-center gap-1 text-xs font-medium text-fg-muted`,title:S.value.lead.schema.description},[H(B(ve(S.value.lead.key,S.value.lead.schema))+` `,1),S.value.lead.schema.description?(L(),q(V(Rl),{key:0,class:`size-3 text-fg-subtle`})):F(``,!0)],8,w4),S.value.lead.kind===`workflow`?(L(),q(q2,{key:0,editable:s.value!==`workflow.call`,value:ye(S.value.lead.key),workflows:e.workflows,label:ve(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>O(S.value.lead.key,e)},null,8,[`editable`,`value`,`workflows`,`label`])):S.value.lead.kind===`select`?(L(),q(W2,{key:1,class:`w-full`,"model-value":ye(S.value.lead.key),options:w(S.value.lead.options),"aria-label":ve(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>D(S.value.lead.key,e||void 0)},null,8,[`model-value`,`options`,`aria-label`])):S.value.lead.kind===`text`?(L(),q(V(Sd),{key:2,"model-value":ye(S.value.lead.key),class:`min-h-32 text-label leading-relaxed`,onFocus:r[6]||=e=>pe.value=S.value.lead.key,"onUpdate:modelValue":r[7]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])):(L(),q(V(Q),{key:3,"model-value":ye(S.value.lead.key),onFocus:r[8]||=e=>pe.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&S.value.lead.kind!==`select`?(L(),j(`div`,T4,[r[16]||=R(`span`,{class:`text-caption text-fg-subtle`},`Insert`,-1),(L(!0),j(U,null,M(g.value,e=>(L(),q(V(X),{key:e,type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,title:`{{ steps.${e}.summary }}`,onClick:t=>me(e)},{default:I(()=>[H(B(e),1)]),_:2},1032,[`title`,`onClick`]))),128))])):F(``,!0)])):F(``,!0),A(V(X),{type:`button`,variant:`ghost`,size:`xs`,class:`-ml-2 text-fg-muted aria-expanded:bg-transparent`,"aria-expanded":C.value,onClick:r[10]||=e=>C.value=!C.value},{default:I(()=>[A(V(ie),{"data-icon":`inline-start`,class:z([`transition-transform`,!C.value&&`-rotate-90`])},null,8,[`class`]),r[17]||=H(`More `,-1)]),_:1},8,[`aria-expanded`]),C.value?(L(),j(U,{key:3},[S.value.compact.length?(L(),j(`section`,E4,[(L(!0),j(U,null,M(S.value.compact,t=>(L(),j(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[R(`span`,{class:`flex flex-1 items-center gap-1 text-label`,title:t.schema.description},[H(B(ve(t.key,t.schema))+` `,1),t.schema.description?(L(),q(V(Rl),{key:0,class:`size-3 text-fg-subtle`})):F(``,!0)],8,D4),t.kind===`workflow`?(L(),q(q2,{key:0,editable:s.value!==`workflow.call`,class:`max-w-48`,value:ye(t.key),workflows:e.workflows,label:ve(t.key,t.schema),onPick:e=>O(t.key,e)},null,8,[`editable`,`value`,`workflows`,`label`,`onPick`])):t.kind===`boolean`?(L(),q(V(Nw),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>D(t.key,e||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):t.kind===`select`?(L(),q(W2,{key:2,class:`w-40`,"model-val Line truncated
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=P0(N0(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=P0(N0(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function R0(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new k0||null,prettyErrors:t}}function z0(e,t={}){let{lineCounter:n,prettyErrors:r}=R0(t),i=new L0(n?.addNewLine),a=new h0(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new j1(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(N1(e,n)),o.warnings.forEach(N1(e,n))),o}function B0(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=z0(e,n);if(!i)return null;if(i.warnings.forEach(e=>l$(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function V0(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return aQ(e)&&!r?e.toString(n):new O1(e,r,n).toString(n)}var H0=e=>typeof e==`object`&&!!e&&!Array.isArray(e),U0=e=>H0(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function W0(e){if(H0(e)){if(H0(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:U0(e.parallel)};if(H0(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:U0(e.switch.cases)}}}function G0(e){return e.slice(2).includes(`parallel`)}function K0(e,t){let n=z0(e).getIn(t,!0);if(oQ(n))return n.toJSON()}function q0(e,t,n){let r=z0(e);return r.setIn(t,r.createNode(a2(n))),r.toString()}function J0(e,t,n){let r=z0(e),i=t.slice(0,-1),a=G0(i);if(a&&![`agent.run`,`workflow.call`].includes(n))throw Error(`Branches allow only read-only agents and workflow calls.`);let o=r.getIn(i,!0);if(lQ(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!lQ(o))return{source:e,path:[]};let s=Math.min(Math.max(Number(t.at(-1))+1,0),o.items.length),c=n===`parallel`?{parallel:{"branch-1":[],"branch-2":[]}}:n===`switch`?{switch:{on:``,cases:{true:[],default:[]}}}:{type:n,...a&&n===`agent.run`?{settings:{read_only:!0}}:{}};return o.items.splice(s,0,r.createNode(c)),{source:r.toString(),path:[...i,s]}}function Y0(e,t){if(t===`switch`){if(!e||e.includes(`/`))throw Error(`A case is the value it matches, without a slash.`)}else if(!/^[a-z][a-z0-9]*(?:[.-][a-z0-9]+)*$/.test(e))throw Error(`Use a lowercase branch name with letters, digits, dots or dashes.`)}function X0(e,t){let n=e.getIn(t,!0),r=W0(oQ(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!oQ(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function Z0(e,t,n){let r=z0(e),{kind:i,branches:a}=X0(r,t);if(Y0(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function Q0(e,t,n,r){let i=z0(e),{kind:a,branches:o}=X0(i,t);if(Y0(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>cQ(e.key)&&e.key.value===n);if(!s||!cQ(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function $0(e,t,n){let r=z0(e),{kind:i,branches:a}=X0(r,t);if(i===`parallel`&&a.items.length<=2)throw Error(`Parallel needs at least two branches.`);if(a.items.length<=1)throw Error(`A switch needs at least one case.`);return Line truncated
`).find(e=>e.trim())?.trim()}}function b2(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(g2)].map(e=>e[1]))]}function x2(e){let t=z0(e).toJS(),n=_2(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=new Set,c=`start`;r.push({id:c,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let l=[c],u=1,d=new Map,f=e=>{let t=d.get(e)??0;return d.set(e,t+1),t},p=(e,t,n,i,s,c,l,u)=>{let d=_2(e)?e:{},p=W0(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=_2(d.settings)?d.settings:{},g=typeof d.id==`string`?d.id:``,_=`step-${t}`,v=s?`${s}/${g||m}`:g||m;r.push({id:_,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:g||t,name:g||void 0,title:g||h2(m),type:m,step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:v2(m,h),summary:y2(h),when:typeof d.when==`string`?d.when:void 0,retry:_2(d.retry)&&typeof d.retry.attempts==`number`?d.retry.attempts:void 0,continues:d.on_failure===`continue`,branch:s,lane:u,path:l,stage:v,occurrence:f(v),...c?{resume:c}:{}}}),g&&a.set(g,_);let y=p?.on?`{{ ${p.on} }}`:``;for(let e of b2([d.settings,y],d.when))o.push({from:e,to:_});return _},m=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,...s.has(r)?{otherwise:!0}:{},insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){let n=W0(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*f2,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=_2(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=Math.max(1,...o.map(([,e])=>e.length)),v=e=>(e-(h-1)/2)*p2,y=(e,t,n)=>r.push({id:e,type:`lane`,position:{x:t-12,y:u*f2-40},style:{width:`264px`,height:`${(_+1)*f2-24}px`},zIndex:-1,data:{kind:`step`,key:n,title:n,type:``,detail:``,lane:i}}),b=(u+_)*f2;if(o.forEach(([t,n],o)=>{let s=v(o),l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*f2,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]});let h=`add-${e}-${t}`;r.push({id:h,type:`add`,position:{x:s+104,y:b},data:{kind:`step`,key:h,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,h),g.push(h),y(`lane-${e}-${t}`,s,t)}),f){let t=v(h-1),n=`pass-${e}`;r.push({id:n,type:`add`,position:{x:t+104,y:b},data:{kind:`step`,key:n,title:``,type:``,detail:``,lane:i}}),s.add(c),m([c],n),s.delete(c),g.push(n),y(`pass-lane-${e}`,t,`default`)}l=g,u+=_+1;continue}let i=p(t,String(e+1),0,u*f2,void 0,void 0,[`steps`,e]);m(l,i,[`steps`,e-1]),l=[i],u++}r.push({id:`add-end`,type:`add`,position:{x:104,y:u*f2-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``,insertAfter:[`steps`,n.length-1]}}),m(l,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var S2={class:`truncate`},C2=`\0`,w2=N({inheritAttrs:!1,__name:`OptionSelect`,props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},size:{},class:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,r)=>(I(),K(B(Du),{"model-value":e.modelValue===``&&e.options.some(e=>e.value===``)?C2:e.modelValue||void 0,disabled:e.disabled,"onUpdate:modelValue":r[0]||=e=>n(`update:modelValue`,e===C2?``:String(e))},{default:F(()=>[k(B(ju),W({size:e.size??`sm`,class:t.$props.class},t.$attrs),{default:F(()=>[k(B(Mu),{placeholder:e.placeholder},null,8,[`placeholder`])]),_:1},16,[`size`,`class`]),k(B(Ou),{position:`popper`,class:`max-w-[min(var(--reka-select-content-available-width),20rem)]`},{default:F(()=>[(I(!0),A(H,null,j(e.options,e=>(I(),K(B(Au),{key:e.value,value:e.value===``?C2:e.value,disabled:e.disabled,title:e.label,class:`*:[span]:last:min-w-0`},{default:F(()=>[L(`span`,S2,z(e.label),1)]),_:2},1032,[`value`,`disabled`,`title`]))),128))]),_:1})]),_:1},8,[`model-value`,`disabled`]))}}),T2=[`id`],E2=[`value`],D2=N({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{},class:{},editable:{type:Boolean}},emits:[`pick`],setup(e,{emit:t}){let n=Te(),r=t;return(t,i)=>e.editable?(I(),A(H,{key:0},[k(B(Z),{"model-value":e.value,list:B(n),"aria-label":e.label,class:R(t.$props.class),placeholder:`Workflow id or {{ reference }}`,"onUpdate:modelValue":i[0]||=e=>r(`pick`,String(e))},null,8,[`model-value`,`list`,`aria-label`,`class`]),L(`datalist`,{id:B(n)},[(I(!0),A(H,null,j(e.workflows,e=>(I(),A(`option`,{key:e.id,value:e.id},null,8,E2))),128))],8,T2)],64)):(I(),K(B(Du),{key:1,"model-value":e.value||void 0,"onUpdate:modelValue":i[1]||=e=>r(`pick`,String(e))},{default:F(()=>[k(B(ju),{"aria-label":e.label,class:R(t.$props.class)},{default:F(()=>[k(B(Mu),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`,`class`]),k(B(Ou),null,{default:F(()=>[e.value& Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:V2(e)}))}var z2=/^(\s*)(-\s+)?/,B2=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function V2(e){let{code:t,comment:n}=H2(e),r=U2(t);return n&&r.push({text:n,kind:`comment`}),r}function H2(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t)r===t&&(t=``);else if(r===`"`||r===`'`)t=r;else if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function U2(e){if(!e)return[];let t=[],n=z2.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=B2.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...W2(i[4]??``)]):[...t,...W2(r)]}function W2(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function G2(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function K2(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q2(e){return typeof e==`string`&&e.trim()!==``}var J2={class:`space-y-4 px-3 py-3`},Y2={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},X2={key:1,class:`space-y-3`},Z2={key:0,class:`block space-y-1.5`},Q2=[`id`],$2=[`value`],e4={class:`text-xs font-medium text-fg-muted`},t4={class:`flex items-center gap-2`},n4={key:1,role:`alert`,class:`text-xs text-danger`},r4={key:2,class:`space-y-1.5`},i4=[`title`],a4={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},o4={key:0,class:`divide-y divide-border rounded-md border border-border`},s4=[`title`],c4={key:0,class:`space-y-3`},l4={class:`text-label`},u4={key:0,class:`text-danger`},d4={class:`ml-2 text-xs text-fg-subtle`},f4={key:1,class:`space-y-3`},p4={class:`text-label`},m4={class:`ml-2 text-xs text-fg-subtle`},h4=[`title`],g4={key:0,class:`text-xs text-danger`},_4={class:`space-y-1.5`},v4={key:0,role:`alert`,class:`text-xs text-danger`},y4={class:`divide-y divide-border rounded-md border border-border`},b4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},x4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},S4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},C4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},w4=[`for`],T4=N({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=Te(),r=e,i=t,a=J(()=>K0(r.yaml,r.path)??{}),o=J(()=>W0(a.value)),s=J(()=>o.value?.kind??(typeof a.value.type==`string`?a.value.type:``)),c=J(()=>o.value?.branches.map(([e])=>e)??[]),l=J(()=>s.value===`parallel`?2:1);function u(e){i(`update:yaml`,q0(r.yaml,r.path,{...a.value,switch:{...a.value.switch,on:e}}))}let d=q(``),f=q(``);function p(e,t,n=``){try{let a=e===`add`?Z0(r.yaml,r.path,t):e===`rename`?Q0(r.yaml,r.path,t,n):$0(r.yaml,r.path,t);i(`update:yaml`,a),d.value=``,f.value=``}catch(e){f.value=String(e.message)}}let m=J(()=>r.vocabulary.find(e=>e.name===s.value)),h=J(()=>typeof a.value.settings==`object`&&a.value.settings!==null?a.value.settings:{}),g=J(()=>i2(r.yaml,r.path)),_=J(()=>P2(a.value)),v=J(()=>m.value?.settings&&a.value.settings?I2(a.value.settings,m.value.settings,`settings`):``),y=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],b=/mission|body|detail|plan|rules/;function x(e,t){return[`workflow.call`,`workflow.handoff`].includes(s.value)&&e===`workflow`||s.value===`human.approve`&&e===`then`?`workflow`:s.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:b.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let S=J(()=>{let e=Object.entries(m.value?.settings?.properties??{}).filter(([e])=>s.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:x(e,t),options:s.value===`agent.run`&&e===`model`?r.modelAliases:t.enum??[]})),t=e.filter(e=>y.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>y.indexOf(e.key)-y.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}}),C=q(!S.value.lead&&!o.value),w=e=>[{value:``,label:`Default`},...e.map(e=>({value:e,label:e}))];function T(e){let{id:t,type:n,...a}=e;i(`update:yaml`,q0(r.yaml,r.path,{id:t,type:n,...a}))}function ee(e,t){T({...a.value,[e]:t})}function E(e){let t={...a.value.retry,...e};ee(`retry`,t.attempts===void 0&&!t.backoff?void 0:{...t,attempts:t.attempts??1})}function D(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,T({...a.value,settings:n})}function te(e,t){let n={...h.value,[e]:t};s.value===`workflow.call`&&t!==h.value[e]&&(delete n.inputs,delete n.outputs),T({...a.value,settings:n})}let O=J(()=>r.workflows.find(e=>e.id===h.value.workflow)),ne=J(()=>Object.entries(o2(O.value?.yaml??``,`inputs`)??{})),re=J(()=>Object.entries(o2(O.value?.yaml??``,`outputs`)??{})),ae=J(()=>Object.entries(o2(r.yaml,`inputs`)??{})),oe=J(()=>Object.entries(o2(r.yaml,`outputs`)??{})),se=J(()=>h.value.inputs??{}),ce=J(()=>h.value.outputs??{}),le=e=>typeof e==`string`&&e.startsWith(`inputs.`),ue=e=>[`object`,`array`].includes(e.type??``),de=e=>se.value[e]===void 0?``:String(se.value[e]);function fe(e,t,n){D(`inputs`,{...se.value,[e]:t===``?void 0:le(t)?t:EE(t,n??`string`)})}let pe=(e,t,n)=>e.filter(([,e])=>e.type===t.type||e.type===`any`||t.type===`any`).map(([e])=>({value:`${n}.${e}`,label:e})),me=q(null);function he(e){let t=me.value??S.value.lead?.key;if(!t)return;let n=typeof h.value[t]==`string`?h.value[t]:``,r=`{{ steps.${e}.summary }}`;D(t,n?`${n.trimEnd()} ${r}`:r)}let ge=q({});function _e(e,t){try{D(e,t.trim()?B0(t):void 0),ge.value={...ge.value,[e]:``}}catch(t){ge.value={...ge.value,[e]:String(t.messa Line truncated
`)[0]}}}let ve=e=>e===void 0?``:V0(e).trimEnd(),ye=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),be=e=>typeof h.value[e]==`string`?h.value[e]:``,M=[{value:``,label:`Park the task`},{value:`continue`,label:`Continue`}];return(t,r)=>(I(),A(`div`,J2,[v.value?(I(),A(`p`,Y2,z(v.value),1)):P(``,!0),o.value?(I(),A(`section`,X2,[s.value===`switch`?(I(),A(`label`,Z2,[r[15]||=L(`span`,{class:`text-xs font-medium text-fg-muted`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),k(B(Z),{"model-value":o.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`${B(n)}-switch-on`,onChange:r[0]||=e=>u(e.target.value.trim())},null,8,[`model-value`,`list`]),L(`datalist`,{id:`${B(n)}-switch-on`},[(I(!0),A(H,null,j(g.value,e=>(I(),A(`option`,{key:e,value:`steps.${e}.result.`},null,8,$2))),128))],8,Q2)])):P(``,!0),L(`div`,e4,z(s.value===`switch`?`Cases`:`Branches`),1),(I(!0),A(H,null,j(c.value,e=>(I(),A(`div`,{key:e,class:`flex items-center gap-2`},[k(B(Z),{"model-value":e,class:R(s.value===`switch`&&`font-mono`),"aria-label":`${s.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>p(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),k(B(Y),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:c.value.length<=l.value,onClick:t=>p(`delete`,e)},{default:F(()=>[k(B(_u))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),L(`div`,t4,[k(B(Z),{modelValue:d.value,"onUpdate:modelValue":r[1]||=e=>d.value=e,"aria-label":s.value===`switch`?`New case value`:`New branch name`,placeholder:s.value===`switch`?`Value, or default`:`Branch name`,onKeydown:r[2]||=_t(mt(e=>p(`add`,d.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),k(B(Y),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":s.value===`switch`?`Add case`:`Add branch`,disabled:!d.value.trim(),onClick:r[3]||=e=>p(`add`,d.value.trim())},{default:F(()=>[k(B(du))]),_:1},8,[`aria-label`,`disabled`])]),f.value?(I(),A(`p`,n4,z(f.value),1)):P(``,!0)])):P(``,!0),S.value.lead?(I(),A(`section`,r4,[L(`div`,{class:`flex items-center gap-1 text-xs font-medium text-fg-muted`,title:S.value.lead.schema.description},[V(z(ye(S.value.lead.key,S.value.lead.schema))+` `,1),S.value.lead.schema.description?(I(),K(B(Vl),{key:0,class:`size-3 text-fg-subtle`})):P(``,!0)],8,i4),S.value.lead.kind===`workflow`?(I(),K(D2,{key:0,editable:s.value!==`workflow.call`,value:be(S.value.lead.key),workflows:e.workflows,label:ye(S.value.lead.key,S.value.lead.schema),onPick:r[4]||=e=>te(S.value.lead.key,e)},null,8,[`editable`,`value`,`workflows`,`label`])):S.value.lead.kind===`select`?(I(),K(w2,{key:1,class:`w-full`,"model-value":be(S.value.lead.key),options:w(S.value.lead.options),"aria-label":ye(S.value.lead.key,S.value.lead.schema),"onUpdate:modelValue":r[5]||=e=>D(S.value.lead.key,e||void 0)},null,8,[`model-value`,`options`,`aria-label`])):S.value.lead.kind===`text`?(I(),K(B(Ed),{key:2,"model-value":be(S.value.lead.key),class:`min-h-32 text-label leading-relaxed`,onFocus:r[6]||=e=>me.value=S.value.lead.key,"onUpdate:modelValue":r[7]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])):(I(),K(B(Z),{key:3,"model-value":be(S.value.lead.key),onFocus:r[8]||=e=>me.value=S.value.lead.key,"onUpdate:modelValue":r[9]||=e=>D(S.value.lead.key,String(e))},null,8,[`model-value`])),g.value.length&&S.value.lead.kind!==`select`?(I(),A(`div`,a4,[r[16]||=L(`span`,{class:`text-caption text-fg-subtle`},`Insert`,-1),(I(!0),A(H,null,j(g.value,e=>(I(),K(B(Y),{key:e,type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,title:`{{ steps.${e}.summary }}`,onClick:t=>he(e)},{default:F(()=>[V(z(e),1)]),_:2},1032,[`title`,`onClick`]))),128))])):P(``,!0)])):P(``,!0),k(B(Y),{type:`button`,variant:`ghost`,size:`xs`,class:`-ml-2 text-fg-muted aria-expanded:bg-transparent`,"aria-expanded":C.value,onClick:r[10]||=e=>C.value=!C.value},{default:F(()=>[k(B(ie),{"data-icon":`inline-start`,class:R([`transition-transform`,!C.value&&`-rotate-90`])},null,8,[`class`]),r[17]||=V(`More `,-1)]),_:1},8,[`aria-expanded`]),C.value?(I(),A(H,{key:3},[S.value.compact.length?(I(),A(`section`,o4,[(I(!0),A(H,null,j(S.value.compact,t=>(I(),A(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[L(`span`,{class:`flex flex-1 items-center gap-1 text-label`,title:t.schema.description},[V(z(ye(t.key,t.schema))+` `,1),t.schema.description?(I(),K(B(Vl),{key:0,class:`size-3 text-fg-subtle`})):P(``,!0)],8,s4),t.kind===`workflow`?(I(),K(D2,{key:0,editable:s.value!==`workflow.call`,class:`max-w-48`,value:be(t.key),workflows:e.workflows,label:ye(t.key,t.schema),onPick:e=>te(t.key,e)},null,8,[`editable`,`value`,`workflows`,`label`,`onPick`])):t.kind===`boolean`?(I(),K(B(Uw),{key:1,"model-value":h.value[t.key]===!0,"onUpdate:modelValue":e=>D(t.key,e||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):t.kind===`select`?(I(),K(w2,{key:2,class:`w-40`,"model-va Line truncated
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>D(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(L(),j(U,{key:2},[A(V(Sd),{"model-value":_e(h.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>ge(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),he.value[e.key]?(L(),j(`span`,I4,B(he.value[e.key]),1)):F(``,!0)],64))]))),128)),R(`section`,L4,[_.value?(L(),j(`p`,R4,B(_.value),1)):F(``,!0),R(`div`,z4,[R(`label`,B4,[r[20]||=R(`span`,{class:`flex-1 text-label`,title:`Empty always runs. A field such as inputs.enabled, !inputs.skip, or steps.plan.result.ready == true`},`Run only when`,-1),A(V(Q),{class:`h-8 w-48 font-mono text-xs`,placeholder:`inputs.enabled`,"aria-invalid":_.value&&_.value.startsWith(`when`)?!0:void 0,"model-value":a.value.when??``,"onUpdate:modelValue":r[11]||=e=>T(`when`,String(e))},null,8,[`aria-invalid`,`model-value`])]),R(`label`,V4,[r[21]||=R(`span`,{class:`flex-1 text-label`},`If it fails`,-1),A(W2,{class:`w-36`,"aria-label":`If it fails`,"model-value":a.value.on_failure??``,options:be,"onUpdate:modelValue":r[12]||=e=>T(`on_failure`,e||void 0)},null,8,[`model-value`])]),R(`label`,H4,[r[22]||=R(`span`,{class:`flex-1 text-label`},`Attempts`,-1),A(V(Q),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-8 w-20 text-right text-label`,"model-value":a.value.retry?.attempts??``,"onUpdate:modelValue":r[13]||=e=>E({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),R(`div`,U4,[R(`label`,{for:`${V(n)}-backoff`,class:`flex-1 text-label`},`Retry backoff`,8,W4),A(V(Ew),{id:`${V(n)}-backoff`,"model-value":a.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":r[14]||=e=>E({backoff:e||void 0})},null,8,[`id`,`model-value`])])])])],64)):F(``,!0)]))}}),K4={class:`space-y-1.5`},q4={class:`flex items-center text-xs font-medium text-fg-muted`},J4={key:0,class:`divide-y divide-border rounded-md border border-border`},Y4=P({__name:`SpecList`,props:{yaml:{},field:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=[`string`,`number`,`bool`,`object`,`array`,`any`].map(e=>({value:e,label:e})),a=Y(()=>Object.entries(E2(n.yaml,n.field)??{}));function o(e){r(`update:yaml`,D2(n.yaml,n.field,Object.fromEntries(e.filter(([e])=>e))))}function s(e,t,n){o(a.value.map((r,i)=>i===e?[t,n]:r))}function c(){let e=n.field.slice(0,-1),t=a.value.length+1;for(;a.value.some(([n])=>n===`${e}_${t}`);)t++;o([...a.value,[`${e}_${t}`,{type:`string`}]])}return(t,n)=>(L(),j(`section`,K4,[R(`div`,q4,[H(B(e.field===`inputs`?`Inputs`:`Outputs`)+` `,1),A(V(X),{type:`button`,variant:`ghost`,size:`xs`,class:`ml-auto`,onClick:c},{default:I(()=>[A(V(lu),{"data-icon":`inline-start`}),n[0]||=H(`Add`,-1)]),_:1})]),a.value.length?(L(),j(`div`,J4,[(L(!0),j(U,null,M(a.value,([t,n],r)=>(L(),j(`div`,{key:r,class:`flex items-center gap-2 px-2 py-1.5`},[A(V(Q),{"model-value":t,class:`h-8 min-w-0 flex-1 font-mono text-xs`,"aria-label":`${e.field} name`,onChange:e=>s(r,e.target.value.trim(),n)},null,8,[`model-value`,`aria-label`,`onChange`]),A(W2,{"model-value":n.type??`string`,options:V(i),class:`w-24`,"aria-label":`${t} type`,"onUpdate:modelValue":e=>s(r,t,{...n,type:e})},null,8,[`model-value`,`options`,`aria-label`,`onUpdate:modelValue`]),A(V(Nw),{"model-value":n.required===!0,title:n.required?`Required`:`Optional`,"aria-label":`${t} required`,"onUpdate:modelValue":e=>s(r,t,{...n,required:e||void 0})},null,8,[`model-value`,`title`,`aria-label`,`onUpdate:modelValue`]),A(V(X),{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:I(()=>[A(V(hu))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):F(``,!0)]))}}),X4={class:`space-y-4 px-3 py-3`},Z4={class:`divide-y divide-border rounded-md border border-border`},Q4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},$4={key:0,role:`alert`,class:`px-3 py-2 text-xs text-danger`},e3={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},t3={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},n3={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},r3={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},i3={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},a3={class:`space-y-1.5`},o3=`6f129e29-0e26-5246-99bd-74cb4496203b`,s3=P({__name:`WorkflowSettings`,props:{yaml:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=E2(n.yaml,e);return typeof t==`string`?t:``};function a(e,t){r(`update:yaml`,D2(n.yaml,e,t))}let o=fT(),s=J([]),c=J(!0),l=J(``);async function u(){c.value=!0,l.value=``,s.value=[];try{await o.loadOrg();let e=await Z.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle===`active`),!i(`identity`)&&s.value.some(e=>e.id===o3)&&a(`identity`,o3)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}Ue(u);let d=Y(()=>{let e=i(`identity`),t=s.value.map(e=>({value:e.id,label:e.display_name}));return e&&!c.value&&!s.value.some(t=>t.id===e)?[{value:e,label:`${e} (unknown)`,disabled:!0},...t]:t}),f=Sw(),p=Y(()=>{let e=Object.keys(f.stateFor(`agent-profiles`Line truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(I(),A(H,{key:2},[k(B(Ed),{"model-value":ve(h.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>_e(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),ge.value[e.key]?(I(),A(`span`,g4,z(ge.value[e.key]),1)):P(``,!0)],64))]))),128)),L(`section`,_4,[_.value?(I(),A(`p`,v4,z(_.value),1)):P(``,!0),L(`div`,y4,[L(`label`,b4,[r[20]||=L(`span`,{class:`flex-1 text-label`,title:`Empty always runs. A field such as inputs.enabled, !inputs.skip, or steps.plan.result.ready == true`},`Run only when`,-1),k(B(Z),{class:`h-8 w-48 font-mono text-xs`,placeholder:`inputs.enabled`,"aria-invalid":_.value&&_.value.startsWith(`when`)?!0:void 0,"model-value":a.value.when??``,"onUpdate:modelValue":r[11]||=e=>ee(`when`,String(e))},null,8,[`aria-invalid`,`model-value`])]),L(`label`,x4,[r[21]||=L(`span`,{class:`flex-1 text-label`},`If it fails`,-1),k(w2,{class:`w-36`,"aria-label":`If it fails`,"model-value":a.value.on_failure??``,options:M,"onUpdate:modelValue":r[12]||=e=>ee(`on_failure`,e||void 0)},null,8,[`model-value`])]),L(`label`,S4,[r[22]||=L(`span`,{class:`flex-1 text-label`},`Attempts`,-1),k(B(Z),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-8 w-20 text-right text-label`,"model-value":a.value.retry?.attempts??``,"onUpdate:modelValue":r[13]||=e=>E({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),L(`div`,C4,[L(`label`,{for:`${B(n)}-backoff`,class:`flex-1 text-label`},`Retry backoff`,8,w4),k(B(Iw),{id:`${B(n)}-backoff`,"model-value":a.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":r[14]||=e=>E({backoff:e||void 0})},null,8,[`id`,`model-value`])])])])],64)):P(``,!0)]))}}),E4={class:`space-y-1.5`},D4={class:`flex items-center text-xs font-medium text-fg-muted`},O4={key:0,class:`divide-y divide-border rounded-md border border-border`},k4=N({__name:`SpecList`,props:{yaml:{},field:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=[`string`,`number`,`bool`,`object`,`array`,`any`].map(e=>({value:e,label:e})),a=J(()=>Object.entries(o2(n.yaml,n.field)??{}));function o(e){r(`update:yaml`,s2(n.yaml,n.field,Object.fromEntries(e.filter(([e])=>e))))}function s(e,t,n){o(a.value.map((r,i)=>i===e?[t,n]:r))}function c(){let e=n.field.slice(0,-1),t=a.value.length+1;for(;a.value.some(([n])=>n===`${e}_${t}`);)t++;o([...a.value,[`${e}_${t}`,{type:`string`}]])}return(t,n)=>(I(),A(`section`,E4,[L(`div`,D4,[V(z(e.field===`inputs`?`Inputs`:`Outputs`)+` `,1),k(B(Y),{type:`button`,variant:`ghost`,size:`xs`,class:`ml-auto`,onClick:c},{default:F(()=>[k(B(du),{"data-icon":`inline-start`}),n[0]||=V(`Add`,-1)]),_:1})]),a.value.length?(I(),A(`div`,O4,[(I(!0),A(H,null,j(a.value,([t,n],r)=>(I(),A(`div`,{key:r,class:`flex items-center gap-2 px-2 py-1.5`},[k(B(Z),{"model-value":t,class:`h-8 min-w-0 flex-1 font-mono text-xs`,"aria-label":`${e.field} name`,onChange:e=>s(r,e.target.value.trim(),n)},null,8,[`model-value`,`aria-label`,`onChange`]),k(w2,{"model-value":n.type??`string`,options:B(i),class:`w-24`,"aria-label":`${t} type`,"onUpdate:modelValue":e=>s(r,t,{...n,type:e})},null,8,[`model-value`,`options`,`aria-label`,`onUpdate:modelValue`]),k(B(Uw),{"model-value":n.required===!0,title:n.required?`Required`:`Optional`,"aria-label":`${t} required`,"onUpdate:modelValue":e=>s(r,t,{...n,required:e||void 0})},null,8,[`model-value`,`title`,`aria-label`,`onUpdate:modelValue`]),k(B(Y),{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Remove ${t}`,onClick:e=>o(a.value.filter((e,t)=>t!==r))},{default:F(()=>[k(B(_u))]),_:1},8,[`aria-label`,`onClick`])]))),128))])):P(``,!0)]))}}),A4={class:`space-y-4 px-3 py-3`},j4={class:`divide-y divide-border rounded-md border border-border`},M4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},N4={key:0,role:`alert`,class:`px-3 py-2 text-xs text-danger`},P4={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},F4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},I4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},L4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},R4={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},z4={class:`space-y-1.5`},B4=`6f129e29-0e26-5246-99bd-74cb4496203b`,V4=N({__name:`WorkflowSettings`,props:{yaml:{}},emits:[`update:yaml`],setup(e,{emit:t}){let n=e,r=t,i=e=>{let t=o2(n.yaml,e);return typeof t==`string`?t:``};function a(e,t){r(`update:yaml`,s2(n.yaml,e,t))}let o=gT(),s=q([]),c=q(!0),l=q(``);async function u(){c.value=!0,l.value=``,s.value=[];try{await o.loadOrg();let e=await X.orgAgents(o.homeOrg);s.value=e.agents.filter(e=>e.lifecycle===`active`),!i(`identity`)&&s.value.some(e=>e.id===B4)&&a(`identity`,B4)}catch(e){l.value=String(e.message||e)}finally{c.value=!1}}Ve(u);let d=J(()=>{let e=i(`identity`),t=s.value.map(e=>({value:e.id,label:e.display_name}));return e&&!c.value&&!s.value.some(t=>t.id===e)?[{value:e,label:`${e} (unknown)`,disabled:!0},...t]:t}),f=Mw(),p=J(()=>{let e=Object.keys(f.stateFor(`agent-profilesLine truncated
`).replace(`
`,`
+`).split(`
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function xle(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Sle(n.code,e);return Array.isArray(e)?e.some(e=>w5(n[r],e,t,n.type===`keyup`)):w5(n[r],e,t,n.type===`keyup`)}}function Sle(e,t){return t.includes(e)?`code`:`key`}function T5(e,t){let n=Y(()=>Je(t?.target)??yle),r=ct(Je(e)===!0),i=!1,a=new Set,o=c(Je(e));N(()=>Je(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),o6([`blur`,`contextmenu`],s),s6((...e)=>o(...e),e=>{let n=Je(t?.actInsideInputWithModifier)??!0,a=Je(t?.preventDefault)??!1;if(i=ble(e),(!i||i&&!n)&&C5(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),s6((...e)=>o(...e),e=>{let n=Je(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&C5(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=Je(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?xle(e,a):e}return r}var E5=`vue-flow__node-desc`,D5=`vue-flow__edge-desc`,Cle=`vue-flow__aria-live`,O5=[`Enter`,` `,`Escape`],k5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function A5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function j5(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function M5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function N5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function P5(e,t){return{x:N5(e.x,t[0][0],t[1][0]),y:N5(e.y,t[0][1],t[1][1])}}function F5(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function I5(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function L5(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!I5(e)}function R5(e){return L5(e)&&`computedPosition`in e}function z5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function wle(e){return z5(e.width)&&z5(e.height)&&z5(e.x)&&z5(e.y)}function Tle(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:Ge({width:0,height:0}),computedPosition:Ge({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:N7(e.data)?e.data:{},events:Ge(N7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function B5(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:N7(e.data)?e.data:{},events:Ge(N7(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function V5(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function Ele(...e){if(e.length===3){let[t,n,r]=e;return V5(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>I5(e)&&e.source===r).map(e=>n.find(t=>L5(t)&&t.id===e.target))}function Dle(...e){if(e.length===3){let[t,n,r]=e;return V5(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>I5(e)&&e.target===r).map(e=>n.find(t=>L5(t)&&t.id===e.source))}function H5({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function Ole(e,t){return t.some(t=>I5(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function U5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function W5({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?C7(s,o):s}function kle(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function G5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function Ale({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function K5(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=kle(t,G5({...r.computedPosition,...r.dimensions}))}return Ale(t)}function q5(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...W5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectabl Line truncated
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function qce(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=Jce(n.code,e);return Array.isArray(e)?e.some(e=>C5(n[r],e,t,n.type===`keyup`)):C5(n[r],e,t,n.type===`keyup`)}}function Jce(e,t){return t.includes(e)?`code`:`key`}function w5(e,t){let n=J(()=>Ke(t?.target)??Gce),r=ot(Ke(e)===!0),i=!1,a=new Set,o=c(Ke(e));M(()=>Ke(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),i6([`blur`,`contextmenu`],s),o6((...e)=>o(...e),e=>{let n=Ke(t?.actInsideInputWithModifier)??!0,a=Ke(t?.preventDefault)??!1;if(i=Kce(e),(!i||i&&!n)&&S5(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),o6((...e)=>o(...e),e=>{let n=Ke(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&S5(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=Ke(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?qce(e,a):e}return r}var T5=`vue-flow__node-desc`,E5=`vue-flow__edge-desc`,Yce=`vue-flow__aria-live`,D5=[`Enter`,` `,`Escape`],O5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function k5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function A5(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function j5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function M5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function N5(e,t){return{x:M5(e.x,t[0][0],t[1][0]),y:M5(e.y,t[0][1],t[1][1])}}function P5(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function F5(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function I5(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!F5(e)}function L5(e){return I5(e)&&`computedPosition`in e}function R5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function Xce(e){return R5(e.width)&&R5(e.height)&&R5(e.x)&&R5(e.y)}function Zce(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:Ue({width:0,height:0}),computedPosition:Ue({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:M7(e.data)?e.data:{},events:Ue(M7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function z5(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:M7(e.data)?e.data:{},events:Ue(M7(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function B5(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function Qce(...e){if(e.length===3){let[t,n,r]=e;return B5(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>F5(e)&&e.source===r).map(e=>n.find(t=>I5(t)&&t.id===e.target))}function $ce(...e){if(e.length===3){let[t,n,r]=e;return B5(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>F5(e)&&e.target===r).map(e=>n.find(t=>I5(t)&&t.id===e.source))}function V5({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function ele(e,t){return t.some(t=>F5(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function H5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function U5({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?S7(s,o):s}function tle(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function W5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function nle({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function G5(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=tle(t,W5({...r.computedPosition,...r.dimensions}))}return nle(t)}function K5(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...U5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectabl Line truncated
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
Node: ${e}
@@ -317,7 +317,7 @@ Edge: ${e}
Source: ${t}
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},y7=class extends Error{constructor(e,...t){super(v7[e]?.call(v7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function b7(e){return`clientX`in e}function Ble(e){return`sourceEvent`in e}function x7(e,t){let n=b7(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var S7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Vle(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function C7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Hle=()=>!0;function w7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Ule(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())j5(i,A5(e))>0&&r.push(e);return r}var Wle=250;function Gle(e,t,n,r){let i=[],a=1/0,o=Ule(e,n,t+Wle);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=h7(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function T7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Hle},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=x7(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=E7(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===b5.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=D7(t,e,a,p,n,!0)}return b}function E7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Kle(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function qle(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function D7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===b5.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...h7(o,c,c.position,!0)}:c}var O7={[_5.Left]:_5.Right,[_5.Right]:_5.Left,[_5.Top]:_5.Bottom,[_5.Bottom]:_5.Top},Jle=[`production`,`prod`];function k7(e,...t){A7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function A7(){return!Jle.includes(`production`)}function j7(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...M5(t)}}):null}function M7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),qe(()=>{o.blur()})):n([e])}function N7(e){return V(e)!==void 0}function Yle(e,t,n,r){if(!e||!e.source||!e.target)return n(new y7(_7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=I5(e)?e:{...e,id:H5(e)},i=B5(i,void 0,r),!Ole(i,t)&&i}function Xle(e,t,n,r,i){if(!t.source||!t.target)return i(new y7(_7.EDGE_INVALID,e.id)),!1;if(!n)return i(new y7(_7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?H5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function P7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!L5(o)){n(new y7(_7.NODE_INVALID,o?.id));continue}let s=Tle(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new y7(_7.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function F7(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function I7(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;F7(`sourcLine truncated
`)},B(e.data.summary||e.data.detail),9,Rde)):F(``,!0),e.data.when||e.data.retry||e.data.continues?(L(),j(`div`,zde,[e.data.when?(L(),j(`span`,{key:0,class:`flex max-w-full min-w-0 items-center gap-0.5 rounded bg-secondary px-1 font-mono`,title:`Runs only when ${e.data.when}`},[A(V(Ql),{class:`size-3 shrink-0`,"aria-hidden":`true`}),R(`span`,Vde,B(e.data.when),1)],8,Bde)):F(``,!0),e.data.retry?(L(),j(`span`,{key:1,class:`flex items-center gap-0.5 rounded bg-secondary px-1`,title:`Up to ${e.data.retry} attempts`},[A(V(wte),{class:`size-3`,"aria-hidden":`true`}),H(`×`+B(e.data.retry),1)],8,Hde)):F(``,!0),e.data.continues?(L(),j(`span`,Ude,[A(V(Mte),{class:`size-3`,"aria-hidden":`true`}),r[10]||=H(`continues`,-1)])):F(``,!0)])):F(``,!0),e.data.run?.error?(L(),j(`p`,{key:4,class:`mt-1 line-clamp-2 text-caption text-danger`,title:e.data.run.error},B(e.data.run.error),9,Wde)):F(``,!0)],64))]),A(eee,{"enter-from-class":`opacity-0 -translate-y-1`,"enter-active-class":`transition duration-200`,"leave-to-class":`opacity-0`,"leave-active-class":`transition duration-100`},{default:I(()=>[e.data.expanded?(L(),j(`div`,{key:0,class:`nodrag nopan nowheel cursor-auto border-t border-border`,onClick:r[6]||=gt(()=>{},[`stop`])},[K(t.$slots,`default`)])):F(``,!0)]),_:3}),A(V(Q7),{type:`source`,position:V(_5).Bottom},null,8,[`position`]),A(V(Q7),{id:`data-out`,type:`source`,position:V(_5).Right,class:`!opacity-0`},null,8,[`position`]),e.data.type===`switch`?(L(),q(V(Q7),{key:1,id:`otherwise`,type:`source`,position:V(_5).Right,class:`!opacity-0`},null,8,[`position`])):F(``,!0)],2))}}),Kde={class:`pointer-events-none size-full rounded-xl border border-dashed border-border bg-muted/30`},qde={class:`flex items-center gap-1 px-2.5 pt-1.5 text-caption text-fg-subtle`},Jde={key:0},Yde={key:1,class:`font-mono`},Xde=P({__name:`LaneNode`,props:{data:{}},setup(e){return(t,n)=>(L(),j(`div`,Kde,[R(`div`,qde,[e.data.lane===`switch`?(L(),j(U,{key:0},[A(V(pu),{class:`size-3`,"aria-hidden":`true`}),e.data.title==="default"?(L(),j(`span`,Jde,`otherwise`)):(L(),j(`span`,Yde,`= `+B(e.data.title),1))],64)):(L(),j(U,{key:1},[A(V(eu),{class:`size-3`,"aria-hidden":`true`}),H(B(e.data.title),1)],64))])]))}}),Zde={class:`flex shrink-0 items-center justify-center gap-1 border-t border-border bg-card p-1`},S9=240,Qde=416,C9=-140,$de=72,efe=.9,w9=P({__name:`WorkflowCanvas`,props:{yaml:{},stages:{},open:{},triggers:{},types:{},readonly:{type:Boolean},restartable:{type:Boolean},marks:{},problems:{},title:{},summary:{}},emits:[`toggle`,`insert`,`duplicate`,`move`,`remove`,`rename`,`restart`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>!!n.types?.length&&!n.readonly),a=Y(()=>[...n.types??[],`parallel`,`switch`]),o=Y(()=>a.value.filter(e=>[`agent.run`,`workflow.call`].includes(e))),s=e=>e&&d2(e)?o.value:a.value,c=e=>e.kind===`step`?JSON.stringify(e.path??null):e.kind,l=J(null),u=J(null),d=see(`(max-width: 767px)`),f=Y(()=>{let e=A2(V2(n.yaml),n.stages??[]);return n.types?.length?{nodes:[{id:`workflow`,type:`step`,position:{x:0,y:C9},data:{kind:`workflow`,key:`workflow`,title:n.title||`Workflow`,type:``,detail:n.summary??``}},...e.nodes],edges:[{id:`flow-workflow-start`,source:`workflow`,target:`start`,kind:`flow`},...e.edges]}:e}),p=Y(()=>f.value.nodes.filter(e=>e.data.path?.length===2).length),m=J({}),h=J({}),g=Y(()=>f.value.nodes.find(e=>e.type===`step`&&c(e.data)===n.open));function _(e,t){m.value={...m.value,[e]:t},g.value?.id!==e&&(h.value={...h.value,[e]:t})}let v=Y(()=>{let e=d.value?void 0:g.value?.id;return e&&m.value[e]?Math.max(0,m.value[e]-(h.value[e]??m.value[e])):0}),y=Mt(),b=aee(v,{duration:Y(()=>y.value===`reduce`?0:200)}),x=Y(()=>{let e=new Map;for(let t of f.value.nodes){if(t.type!==`step`)continue;let n=(t.id===g.value?.id?h.value[t.id]:void 0)??m.value[t.id];n!==void 0&&e.set(t.position.y,Math.max(e.get(t.position.y)??-72,n-$de))}return[...e]}),S=e=>x.value.reduce((t,[n,r])=>n<e?t+r:t,0);function C(e){let t=e.data,a=c(t),o=t.path,s={triggers:t.kind===`start`?n.triggers??[]:t.triggers,expanded:!d.value&&a===n.open,editable:i.value,problem:o?n.problems?.[a]:void 0,onResize:t=>_(e.id,t)};return n.types?.length&&(s.onToggle=()=>r(`toggle`,a)),i.value&&o&&(s.onRename=e=>r(`rename`,o,e),s.onDuplicate=()=>r(`duplicate`,o),s.onRemove=()=>r(`remove`,o)),{...e,data:{...t,...s}}}let w=e=>{let t=g.value;return d.value||!t||!e.style?.width?!1:e.position.x<=t.position.x&&e.position.x+parseFloat(String(e.style.width))>=t.position.x+S9};function ee(e){let t=g.value;if(d.value||!t)return 0;if(e.id===t.id||w(e))return-88;let n=t.position.x+S9/2,r=e.style?.width?parseFloat(String(e.style.width)):e.type===`step`?S9:32,i=e.position.x+r/2;return Math.abs(i-n)<S9/2?0:i<n?-88:88}let T=Y(()=>{let e=g.value;return f.value.nodes.map(t=>{let a=t;t.type===`add`?t={...t,data:{...t.data,types:s(t.data.insertAfter),editable:i.value,onInsert:e=>r(`insert`,t.data.insertAfter,e)}}:t.type===`step`&&(t=C(t));let o=n.marks?.[t.id];o&&(t={...t,data:{...t.data,mark:o}});let c=t.positio Line truncated
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},v7=class extends Error{constructor(e,...t){super(_7[e]?.call(_7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function y7(e){return`clientX`in e}function fle(e){return`sourceEvent`in e}function b7(e,t){let n=y7(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var x7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function ple(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function S7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var mle=()=>!0;function C7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function hle(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())A5(i,k5(e))>0&&r.push(e);return r}var gle=250;function _le(e,t,n,r){let i=[],a=1/0,o=hle(e,n,t+gle);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=m7(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function w7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=mle},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=b7(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=T7(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===y5.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=E7(t,e,a,p,n,!0)}return b}function T7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function vle(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function yle(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function E7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===y5.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...m7(o,c,c.position,!0)}:c}var D7={[g5.Left]:g5.Right,[g5.Right]:g5.Left,[g5.Top]:g5.Bottom,[g5.Bottom]:g5.Top},ble=[`production`,`prod`];function O7(e,...t){k7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function k7(){return!ble.includes(`production`)}function A7(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...j5(t)}}):null}function j7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),Ge(()=>{o.blur()})):n([e])}function M7(e){return B(e)!==void 0}function xle(e,t,n,r){if(!e||!e.source||!e.target)return n(new v7(g7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=F5(e)?e:{...e,id:V5(e)},i=z5(i,void 0,r),!ele(i,t)&&i}function Sle(e,t,n,r,i){if(!t.source||!t.target)return i(new v7(g7.EDGE_INVALID,e.id)),!1;if(!n)return i(new v7(g7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?V5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function N7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!I5(o)){n(new v7(g7.NODE_INVALID,o?.id));continue}let s=Zce(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new v7(g7.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function P7(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function F7(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;P7(`sourcLine truncated
`)},z(e.data.summary||e.data.detail),9,lde)):P(``,!0),e.data.when||e.data.retry||e.data.continues?(I(),A(`div`,ude,[e.data.when?(I(),A(`span`,{key:0,class:`flex max-w-full min-w-0 items-center gap-0.5 rounded bg-secondary px-1 font-mono`,title:`Runs only when ${e.data.when}`},[k(B(tu),{class:`size-3 shrink-0`,"aria-hidden":`true`}),L(`span`,fde,z(e.data.when),1)],8,dde)):P(``,!0),e.data.retry?(I(),A(`span`,{key:1,class:`flex items-center gap-0.5 rounded bg-secondary px-1`,title:`Up to ${e.data.retry} attempts`},[k(B(Ete),{class:`size-3`,"aria-hidden":`true`}),V(`×`+z(e.data.retry),1)],8,pde)):P(``,!0),e.data.continues?(I(),A(`span`,mde,[k(B(Nte),{class:`size-3`,"aria-hidden":`true`}),r[10]||=V(`continues`,-1)])):P(``,!0)])):P(``,!0),e.data.run?.error?(I(),A(`p`,{key:4,class:`mt-1 line-clamp-2 text-caption text-danger`,title:e.data.run.error},z(e.data.run.error),9,hde)):P(``,!0)],64))]),k(dt,{"enter-from-class":`opacity-0 -translate-y-1`,"enter-active-class":`transition duration-200`,"leave-to-class":`opacity-0`,"leave-active-class":`transition duration-100`},{default:F(()=>[e.data.expanded?(I(),A(`div`,{key:0,class:`nodrag nopan nowheel cursor-auto border-t border-border`,onClick:r[6]||=mt(()=>{},[`stop`])},[G(t.$slots,`default`)])):P(``,!0)]),_:3}),k(B(Z7),{type:`source`,position:B(g5).Bottom},null,8,[`position`]),k(B(Z7),{id:`data-out`,type:`source`,position:B(g5).Right,class:`!opacity-0`},null,8,[`position`]),e.data.type===`switch`?(I(),K(B(Z7),{key:1,id:`otherwise`,type:`source`,position:B(g5).Right,class:`!opacity-0`},null,8,[`position`])):P(``,!0)],2))}}),_de={class:`pointer-events-none size-full rounded-xl border border-dashed border-border bg-muted/30`},vde={class:`flex items-center gap-1 px-2.5 pt-1.5 text-caption text-fg-subtle`},yde={key:0},bde={key:1,class:`font-mono`},xde=N({__name:`LaneNode`,props:{data:{}},setup(e){return(t,n)=>(I(),A(`div`,_de,[L(`div`,vde,[e.data.lane===`switch`?(I(),A(H,{key:0},[k(B(hu),{class:`size-3`,"aria-hidden":`true`}),e.data.title==="default"?(I(),A(`span`,yde,`otherwise`)):(I(),A(`span`,bde,`= `+z(e.data.title),1))],64)):(I(),A(H,{key:1},[k(B(nu),{class:`size-3`,"aria-hidden":`true`}),V(z(e.data.title),1)],64))])]))}}),Sde={class:`flex shrink-0 items-center justify-center gap-1 border-t border-border bg-card p-1`},S9=240,Cde=416,C9=-140,wde=72,Tde=.9,w9=N({__name:`WorkflowCanvas`,props:{yaml:{},stages:{},open:{},triggers:{},types:{},readonly:{type:Boolean},restartable:{type:Boolean},marks:{},problems:{},title:{},summary:{}},emits:[`toggle`,`insert`,`duplicate`,`move`,`remove`,`rename`,`restart`],setup(e,{emit:t}){let n=e,r=t,i=J(()=>!!n.types?.length&&!n.readonly),a=J(()=>[...n.types??[],`parallel`,`switch`]),o=J(()=>a.value.filter(e=>[`agent.run`,`workflow.call`].includes(e))),s=e=>e&&G0(e)?o.value:a.value,c=e=>e.kind===`step`?JSON.stringify(e.path??null):e.kind,l=q(null),u=q(null),d=lee(`(max-width: 767px)`),f=J(()=>{let e=u2(x2(n.yaml),n.stages??[]);return n.types?.length?{nodes:[{id:`workflow`,type:`step`,position:{x:0,y:C9},data:{kind:`workflow`,key:`workflow`,title:n.title||`Workflow`,type:``,detail:n.summary??``}},...e.nodes],edges:[{id:`flow-workflow-start`,source:`workflow`,target:`start`,kind:`flow`},...e.edges]}:e}),p=J(()=>f.value.nodes.filter(e=>e.data.path?.length===2).length),m=q({}),h=q({}),g=J(()=>f.value.nodes.find(e=>e.type===`step`&&c(e.data)===n.open));function _(e,t){m.value={...m.value,[e]:t},g.value?.id!==e&&(h.value={...h.value,[e]:t})}let v=J(()=>{let e=d.value?void 0:g.value?.id;return e&&m.value[e]?Math.max(0,m.value[e]-(h.value[e]??m.value[e])):0}),y=kt(),b=see(v,{duration:J(()=>y.value===`reduce`?0:200)}),x=J(()=>{let e=new Map;for(let t of f.value.nodes){if(t.type!==`step`)continue;let n=(t.id===g.value?.id?h.value[t.id]:void 0)??m.value[t.id];n!==void 0&&e.set(t.position.y,Math.max(e.get(t.position.y)??-72,n-wde))}return[...e]}),S=e=>x.value.reduce((t,[n,r])=>n<e?t+r:t,0);function C(e){let t=e.data,a=c(t),o=t.path,s={triggers:t.kind===`start`?n.triggers??[]:t.triggers,expanded:!d.value&&a===n.open,editable:i.value,problem:o?n.problems?.[a]:void 0,onResize:t=>_(e.id,t)};return n.types?.length&&(s.onToggle=()=>r(`toggle`,a)),i.value&&o&&(s.onRename=e=>r(`rename`,o,e),s.onDuplicate=()=>r(`duplicate`,o),s.onRemove=()=>r(`remove`,o)),{...e,data:{...t,...s}}}let w=e=>{let t=g.value;return d.value||!t||!e.style?.width?!1:e.position.x<=t.position.x&&e.position.x+parseFloat(String(e.style.width))>=t.position.x+S9};function T(e){let t=g.value;if(d.value||!t)return 0;if(e.id===t.id||w(e))return-88;let n=t.position.x+S9/2,r=e.style?.width?parseFloat(String(e.style.width)):e.type===`step`?S9:32,i=e.position.x+r/2;return Math.abs(i-n)<S9/2?0:i<n?-88:88}let ee=J(()=>{let e=g.value;return f.value.nodes.map(t=>{let a=t;t.type===`add`?t={...t,data:{...t.data,types:s(t.data.insertAfter),editable:i.value,onInsert:e=>r(`insert`,t.data.insertAfter,e)}}:t.type===`step`&&(t=C(t));let o=n.marks?.[t.id];o&&(t={...t,data:{...t.data,mark:o}});let c=t.position Line truncated
`),r=t.split(`
`),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind:`same`,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind:`del`,text:n[o++]}):a.push({kind:`add`,text:r[s++]});for(;o<n.length;)a.push({kind:`del`,text:n[o++]});for(;s<r.length;)a.push({kind:`add`,text:r[s++]});return a}function T9(e){let t=a2(e).toJS(),n=new Map;for(let r of V2(e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!==`step`||e!==`step`||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set(`${a}#${o??0}`,{node:r.id,signature:JSON.stringify(s??null)})}return n}function E9(e,t,n){let r=T9(e),i=T9(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]=`changed`):a[t.node]=n}return a}var afe={class:`flex flex-col gap-3 md:grid md:h-[calc(100dvh-17rem)] md:min-h-[26rem] md:grid-cols-[18rem_1fr]`},ofe=[`aria-current`,`onClick`],sfe={class:`flex items-center gap-2 text-sm`},cfe={class:`font-mono text-xs text-fg-subtle`},lfe=[`title`],ufe={key:0,class:`px-3 py-2 text-sm text-fg-muted`},dfe={key:1,class:`flex min-h-0 flex-col gap-2`},ffe={class:`flex items-center gap-2 max-md:flex-wrap`},pfe={key:0,class:`rounded-lg border border-border p-4 text-sm text-fg-muted`},mfe={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border pt-2 pb-[calc(0.5rem+var(--code-overscroll))] font-mono text-label leading-6`},hfe={class:`inline-block w-4 select-none text-fg-subtle`},gfe={key:2,class:`grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2`},_fe={class:`flex min-h-0 flex-col gap-1`},vfe={class:`text-xs font-medium text-fg-muted`},yfe={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},bfe={class:`flex min-h-0 flex-col gap-1`},xfe={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Sfe=P({__name:`WorkflowHistory`,props:Ze({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:Ze([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Me(e,`selected`),a=Me(e,`mode`);N(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=Y(()=>n.revisions.find(e=>e.version===i.value)),s=Y(()=>o.value?.yaml??null),c=Y(()=>s.value===null?[]:ife(s.value,n.current)),l=Y(()=>s.value!==null&&s.value===n.current),u=Y(()=>s.value===null?{}:E9(s.value,n.current,`removed`)),d=Y(()=>s.value===null?{}:E9(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(L(),j(`div`,afe,[R(`ol`,{class:z(V(W)(`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,e.revisions.length&&`max-md:hidden`)),"aria-label":`Revisions`},[(L(!0),j(U,null,M(e.revisions,e=>(L(),j(`li`,{key:e.version},[R(`button`,{type:`button`,class:z([`block w-full px-3 py-2 text-left hover:bg-secondary`,e.version===i.value&&`bg-secondary`]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[R(`span`,sfe,[R(`span`,cfe,`v`+B(e.version),1),A(V(D),{variant:f[e.change]},{default:I(()=>[H(B(e.change),1)]),_:2},1032,[`variant`])]),R(`span`,{class:`mt-0.5 block truncate text-xs text-fg-muted`,title:e.at},B(e.actor||`unknown`)+` · `+B(e.source||`unknown`)+` · `+B(V(BC)(e.at)),9,lfe)],10,ofe)]))),128)),e.revisions.length?F(``,!0):(L(),j(`li`,ufe,B(e.error||`No recorded changes`),1))],2),e.revisions.length?(L(),q(V(Tu),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:I(()=>[A(V(ku),{class:`w-full md:hidden`,"aria-label":`Revision`},{default:I(()=>[A(V(Au))]),_:1}),A(V(Eu),null,{default:I(()=>[(L(!0),j(U,null,M(e.revisions,e=>(L(),q(V(Ou),{key:e.version,value:String(e.version)},{default:I(()=>[H(`v`+B(e.version)+` · `+B(e.change)+` · `+B(e.actor||`unknown`)+` · `+B(V(BC)(e.at)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])):F(``,!0),o.value?(L(),j(`div`,dfe,[R(`div`,ffe,[A(V(GD),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:I(()=>[A(V(qD),null,{default:I(()=>[A(V(JD),{value:`yaml`},{default:I(()=>[...n[3]||=[H(`YAML`,-1)]]),_:1}),A(V(JD),{value:`canvas`},{default:I(()=>[...n[4]||=[H(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),A(V(X),{type:`button`,size:`sm`,variant:`outline`,class:`ml-auto`,disabled:s.value===null||l.value,title:s.value===null?`Workflow removed`:void 0,onClick:n[2]||=e=>r(`restore`,s.value)},{default:I(()=>[A(V(uu),{"data-icon":`inline-start`}),n[5]||=H(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(L(),j(`p`,pfe,`Workflow removed in this revision.`)):a.value===`yaml`?(L(),j(`pre`,mfe,[R(`code`,null,[(L(!0),j(U,null,M(c.value,(e,t)=>(L(),j(`span`,{key:t,class:z([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text- Line truncated
`),i=Array.from({length:n.length+1},()=>Array(r.length+1).fill(0));for(let e=n.length-1;e>=0;e--)for(let t=r.length-1;t>=0;t--)i[e][t]=n[e]===r[t]?i[e+1][t+1]+1:Math.max(i[e+1][t],i[e][t+1]);let a=[],o=0,s=0;for(;o<n.length&&s<r.length;)n[o]===r[s]?(a.push({kind:`same`,text:n[o++]}),s++):i[o+1][s]>=i[o][s+1]?a.push({kind:`del`,text:n[o++]}):a.push({kind:`add`,text:r[s++]});for(;o<n.length;)a.push({kind:`del`,text:n[o++]});for(;s<r.length;)a.push({kind:`add`,text:r[s++]});return a}function T9(e){let t=z0(e).toJS(),n=new Map;for(let r of x2(e).nodes){let{kind:e,path:i,stage:a,occurrence:o}=r.data;if(r.type!==`step`||e!==`step`||!i||a===void 0)continue;let s=t;for(let e of i)s=s?.[e];n.set(`${a}#${o??0}`,{node:r.id,signature:JSON.stringify(s??null)})}return n}function E9(e,t,n){let r=T9(e),i=T9(t),a={};for(let[e,t]of r){let r=i.get(e);r?r.signature!==t.signature&&(a[t.node]=`changed`):a[t.node]=n}return a}var Ade={class:`flex flex-col gap-3 md:grid md:h-[calc(100dvh-17rem)] md:min-h-[26rem] md:grid-cols-[18rem_1fr]`},jde=[`aria-current`,`onClick`],Mde={class:`flex items-center gap-2 text-sm`},Nde={class:`font-mono text-xs text-fg-subtle`},Pde=[`title`],Fde={key:0,class:`px-3 py-2 text-sm text-fg-muted`},Ide={key:1,class:`flex min-h-0 flex-col gap-2`},Lde={class:`flex items-center gap-2 max-md:flex-wrap`},Rde={key:0,class:`rounded-lg border border-border p-4 text-sm text-fg-muted`},zde={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border pt-2 pb-[calc(0.5rem+var(--code-overscroll))] font-mono text-label leading-6`},Bde={class:`inline-block w-4 select-none text-fg-subtle`},Vde={key:2,class:`grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2`},Hde={class:`flex min-h-0 flex-col gap-1`},Ude={class:`text-caption font-medium uppercase text-fg-muted`},Wde={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},Gde={class:`flex min-h-0 flex-col gap-1`},Kde={class:`min-h-0 flex-1 max-md:h-72 max-md:flex-none`},qde=N({__name:`WorkflowHistory`,props:Xe({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:Xe([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Ae(e,`selected`),a=Ae(e,`mode`);M(()=>n.revisions,e=>{e.some(e=>e.version===i.value)||(i.value=(e.find(e=>e.yaml!==n.current)??e[0])?.version??0)},{immediate:!0});let o=J(()=>n.revisions.find(e=>e.version===i.value)),s=J(()=>o.value?.yaml??null),c=J(()=>s.value===null?[]:kde(s.value,n.current)),l=J(()=>s.value!==null&&s.value===n.current),u=J(()=>s.value===null?{}:E9(s.value,n.current,`removed`)),d=J(()=>s.value===null?{}:E9(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(I(),A(`div`,Ade,[L(`ol`,{class:R(B(U)(`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,e.revisions.length&&`max-md:hidden`)),"aria-label":`Revisions`},[(I(!0),A(H,null,j(e.revisions,e=>(I(),A(`li`,{key:e.version},[L(`button`,{type:`button`,class:R([`block w-full px-3 py-2 text-left hover:bg-secondary`,e.version===i.value&&`bg-secondary`]),"aria-current":e.version===i.value,onClick:t=>i.value=e.version},[L(`span`,Mde,[L(`span`,Nde,`v`+z(e.version),1),k(B(oe),{variant:f[e.change]},{default:F(()=>[V(z(e.change),1)]),_:2},1032,[`variant`])]),L(`span`,{class:`mt-0.5 block truncate text-xs text-fg-muted`,title:e.at},[V(z(e.actor||`unknown`)+` · `+z(e.source||`unknown`)+` · `,1),k(B(JC),{at:e.at},null,8,[`at`])],8,Pde)],10,jde)]))),128)),e.revisions.length?P(``,!0):(I(),A(`li`,Fde,z(e.error||`No recorded changes`),1))],2),e.revisions.length?(I(),K(B(Du),{key:0,"model-value":String(i.value),"onUpdate:modelValue":n[0]||=e=>i.value=Number(e)},{default:F(()=>[k(B(ju),{class:`w-full md:hidden`,"aria-label":`Revision`},{default:F(()=>[k(B(Mu))]),_:1}),k(B(Ou),null,{default:F(()=>[(I(!0),A(H,null,j(e.revisions,e=>(I(),K(B(Au),{key:e.version,value:String(e.version)},{default:F(()=>[V(`v`+z(e.version)+` · `+z(e.change)+` · `+z(e.actor||`unknown`)+` · `+z(B(KC)(e.at)),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`])):P(``,!0),o.value?(I(),A(`div`,Ide,[L(`div`,Lde,[k(B(KD),{modelValue:a.value,"onUpdate:modelValue":n[1]||=e=>a.value=e},{default:F(()=>[k(B(JD),null,{default:F(()=>[k(B(YD),{value:`yaml`},{default:F(()=>[...n[3]||=[V(`YAML`,-1)]]),_:1}),k(B(YD),{value:`canvas`},{default:F(()=>[...n[4]||=[V(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),k(B(Y),{type:`button`,size:`sm`,variant:`outline`,class:`ml-auto`,disabled:s.value===null||l.value,title:s.value===null?`Workflow removed`:void 0,onClick:n[2]||=e=>r(`restore`,s.value)},{default:F(()=>[k(B(fu),{"data-icon":`inline-start`}),n[5]||=V(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(I(),A(`p`,Rde,`Workflow removed in this revision.`)):a.value===`yaml`?(I(),A(`pre`,zde,[L(`code`,null,[(I(!0),A(H,null,j(c.value,(e,t)=>(I(),A(`span`,{key:t,class:R([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg- Line truncated
+1 -1
View File
@@ -1 +1 @@
import{B as e,C as t,Cn as n,En as r,G as i,Gt as a,Kt as o,M as s,Qt as c,_t as l,dt as u,er as d,gt as f,it as p,jn as m,kn as h,n as g,pn as _,wn as v,xn as y,y as b}from"./PageHeader.js";import{A as x,E as S,O as C,S as w,T,_ as E,b as D,d as O,f as k,g as A,h as j,k as M,l as N,m as P,nt as ee,p as F,u as te,v as ne,w as I,x as re,y as ie}from"./createLucideIcon.js";function ae(e={}){let{inheritAttrs:t=!0,name:n=`ReusableTemplate`}=e,r=v(),i=s({name:`${n}.define`,setup(e,{slots:t}){return()=>{r.value=t.default}}}),a=s({inheritAttrs:t,name:`${n}.reuse`,props:e.props,setup(n,{attrs:i,slots:a}){return()=>{if(!r.value)throw Error(`[VueUse] Failed to find the definition of reusable template`);let o=r.value?.call(r,{...e.props==null?L(i):n,$slots:a});return t&&o?.length===1?o[0]:o}}});return ie({define:i,reuse:a},[i,a])}function L(e){let t={};for(let n in e)t[N(n)]=e[n];return t}var R=j?window:void 0;j&&window.document;var z=j?window.navigator:void 0;j&&window.location;function B(e){let t=h(e);return t?.$el??t}function V(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=b(()=>{let t=I(h(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return M(()=>[n.value?.map(e=>B(e))??[R].filter(e=>e!=null),I(h(n.value?e[1]:e[0])),I(m(n.value?e[2]:e[1])),h(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=ne(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}var H=!1;function oe(e,t,n={}){let{window:r=R,ignore:i=[],capture:a=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:D,cancel:D,trigger:D}:D;if(E&&!H){H=!0;let e={passive:!0};Array.from(r.document.body.children).forEach(t=>t.addEventListener(`click`,D,e)),r.document.documentElement.addEventListener(`click`,D,e)}let c=!0,l=e=>h(i).some(t=>{if(typeof t==`string`)return Array.from(r.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{let n=B(t);return n&&(e.target===n||e.composedPath().includes(n))}});function u(e){let t=h(e);return t&&t.$.subTree.shapeFlag===16}function d(e,t){let n=h(e),r=n.$.subTree&&n.$.subTree.children;return r==null||!Array.isArray(r)?!1:r.some(e=>e.el===t.target||t.composedPath().includes(e.el))}let f=n=>{let r=B(e);n.target!=null&&(!(r instanceof Element)&&u(e)&&d(e,n)||r&&r!==n.target&&!n.composedPath().includes(r)&&(`detail`in n&&n.detail===0&&(c=!l(n)),c?t(n):c=!0))},p=!1,m=[V(r,`click`,e=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(e))},{passive:!0,capture:a}),V(r,`pointerdown`,t=>{let n=B(e);c=!l(t)&&!(!n||t.composedPath().includes(n))},{passive:!0}),o&&V(r,`blur`,n=>{setTimeout(()=>{let i=B(e),a=r.document.activeElement;for(;a?.shadowRoot;)a=a.shadowRoot.activeElement;a?.tagName===`IFRAME`&&!i?.contains(r.document.activeElement)&&t(n)},0)},{passive:!0})].filter(Boolean),g=()=>m.forEach(e=>e());return s?{stop:g,cancel:()=>{c=!1},trigger:e=>{c=!0,f(e),c=!1}}:g}function se(){let t=v(!1),n=e();return n&&u(()=>{t.value=!0},n),t}function U(e){let t=se();return b(()=>(t.value,!!e()))}var ce=Symbol(`vueuse-ssr-width`);function W(){let e=i()?P(ce,null):null;return typeof e==`number`?e:void 0}function G(e,t={}){let{window:n=R,ssrWidth:r=W()}=t,i=U(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=v(typeof r==`number`),s=v(),c=v(!1);return o(()=>{if(a.value){a.value=!i.value;let t=h(e).split(`,`);c.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=w(n[1])),i&&a&&(a=r<=w(i[1])),t?!a:a})}else i.value&&(s.value=n.matchMedia(h(e)),c.value=s.value.matches)}),V(s,`change`,e=>{c.value=e.matches},{passive:!0}),b(()=>c.value)}var le={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function ue(e,t={}){function n(t,n){let r=h(e[h(t)]);return n!=null&&(r=F(r,n)),typeof r==`number`&&(r=`${r}px`),r}let{window:r=R,strategy:i=`min-width`,ssrWidth:a=W()}=t,o=typeof a==`number`,s=o?v(!1):{value:!0};o&&T(()=>s.value=!!r);function c(e,t){return!s.value&&o?e===`min`?a>=w(t):a<=w(t):r?r.matchMedia(`(${e}-width: ${t})`).matches:!1}let l=e=>G(()=>`(min-width: ${n(e)})`,t),u=e=>G(()=>`(max-width: ${n(e)})`,t),d=Object.keys(e).reduce((e,t)=>(Object.defineProperty(e,t,{get:()=>i===`min-width`?l(t):u(t),enumerable:!0,configurable:!0}),e),{});function f(){let t=Object.keys(e).map(e=>[e,d[e],w(n(e))]).sort((e,t)=>e[2]-t[2]);return b(()=>t.filter(([,e])=>e.value).map(([e])=>e))}return Object.assign(d,{greaterOrEqual:l,smallerOrEqual:u,greater(e){return G(()=>`(min-width: ${n(e,.1)})`,t)},smaller(e){return G(()=>`(max-width: ${n(e,-.1)})`,t)},between(e,r){return G(()=>`(min-width: ${n(e)}) and (max-width: ${n(r,-.1)})`,t)},isGreater(e){return c(`min`,n(e,.1))},isGreaterOrEqual(e){return c(`min`,n(e))},isSmaller(e){return c(`max`,n(e,-.1))},isSmallerOrEqual(e){return c(`max`,n(e))},isInBetween(e,t){return c(`min`,n(e))&&c(`max`,n(t,-.1))},current:f,Line truncated
import{B as e,C as t,Cn as n,En as r,G as i,Gt as a,Kt as o,M as s,Qt as c,_t as l,dt as u,er as d,gt as f,it as p,jn as m,kn as h,pn as g,r as _,wn as v,xn as y,y as b}from"./PageHeader.js";import{A as x,E as S,O as C,S as w,T,_ as E,b as D,d as O,f as k,g as A,h as j,k as M,l as N,m as P,nt as ee,p as F,u as te,v as ne,w as I,x as re,y as ie}from"./createLucideIcon.js";function ae(e={}){let{inheritAttrs:t=!0,name:n=`ReusableTemplate`}=e,r=v(),i=s({name:`${n}.define`,setup(e,{slots:t}){return()=>{r.value=t.default}}}),a=s({inheritAttrs:t,name:`${n}.reuse`,props:e.props,setup(n,{attrs:i,slots:a}){return()=>{if(!r.value)throw Error(`[VueUse] Failed to find the definition of reusable template`);let o=r.value?.call(r,{...e.props==null?L(i):n,$slots:a});return t&&o?.length===1?o[0]:o}}});return ie({define:i,reuse:a},[i,a])}function L(e){let t={};for(let n in e)t[N(n)]=e[n];return t}var R=j?window:void 0;j&&window.document;var z=j?window.navigator:void 0;j&&window.location;function B(e){let t=h(e);return t?.$el??t}function V(...e){let t=(e,t,n,r)=>(e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)),n=b(()=>{let t=I(h(e[0])).filter(e=>e!=null);return t.every(e=>typeof e!=`string`)?t:void 0});return M(()=>[n.value?.map(e=>B(e))??[R].filter(e=>e!=null),I(h(n.value?e[1]:e[0])),I(m(n.value?e[2]:e[1])),h(n.value?e[3]:e[2])],([e,n,r,i],a,o)=>{if(!e?.length||!n?.length||!r?.length)return;let s=ne(i)?{...i}:i,c=e.flatMap(e=>n.flatMap(n=>r.map(r=>t(e,n,r,s))));o(()=>{c.forEach(e=>e())})},{flush:`post`})}var H=!1;function oe(e,t,n={}){let{window:r=R,ignore:i=[],capture:a=!0,detectIframe:o=!1,controls:s=!1}=n;if(!r)return s?{stop:D,cancel:D,trigger:D}:D;if(E&&!H){H=!0;let e={passive:!0};Array.from(r.document.body.children).forEach(t=>t.addEventListener(`click`,D,e)),r.document.documentElement.addEventListener(`click`,D,e)}let c=!0,l=e=>h(i).some(t=>{if(typeof t==`string`)return Array.from(r.document.querySelectorAll(t)).some(t=>t===e.target||e.composedPath().includes(t));{let n=B(t);return n&&(e.target===n||e.composedPath().includes(n))}});function u(e){let t=h(e);return t&&t.$.subTree.shapeFlag===16}function d(e,t){let n=h(e),r=n.$.subTree&&n.$.subTree.children;return r==null||!Array.isArray(r)?!1:r.some(e=>e.el===t.target||t.composedPath().includes(e.el))}let f=n=>{let r=B(e);n.target!=null&&(!(r instanceof Element)&&u(e)&&d(e,n)||r&&r!==n.target&&!n.composedPath().includes(r)&&(`detail`in n&&n.detail===0&&(c=!l(n)),c?t(n):c=!0))},p=!1,m=[V(r,`click`,e=>{p||(p=!0,setTimeout(()=>{p=!1},0),f(e))},{passive:!0,capture:a}),V(r,`pointerdown`,t=>{let n=B(e);c=!l(t)&&!(!n||t.composedPath().includes(n))},{passive:!0}),o&&V(r,`blur`,n=>{setTimeout(()=>{let i=B(e),a=r.document.activeElement;for(;a?.shadowRoot;)a=a.shadowRoot.activeElement;a?.tagName===`IFRAME`&&!i?.contains(r.document.activeElement)&&t(n)},0)},{passive:!0})].filter(Boolean),g=()=>m.forEach(e=>e());return s?{stop:g,cancel:()=>{c=!1},trigger:e=>{c=!0,f(e),c=!1}}:g}function se(){let t=v(!1),n=e();return n&&u(()=>{t.value=!0},n),t}function U(e){let t=se();return b(()=>(t.value,!!e()))}var ce=Symbol(`vueuse-ssr-width`);function W(){let e=i()?P(ce,null):null;return typeof e==`number`?e:void 0}function G(e,t={}){let{window:n=R,ssrWidth:r=W()}=t,i=U(()=>n&&`matchMedia`in n&&typeof n.matchMedia==`function`),a=v(typeof r==`number`),s=v(),c=v(!1);return o(()=>{if(a.value){a.value=!i.value;let t=h(e).split(`,`);c.value=t.some(e=>{let t=e.includes(`not all`),n=e.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),i=e.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),a=!!(n||i);return n&&a&&(a=r>=w(n[1])),i&&a&&(a=r<=w(i[1])),t?!a:a})}else i.value&&(s.value=n.matchMedia(h(e)),c.value=s.value.matches)}),V(s,`change`,e=>{c.value=e.matches},{passive:!0}),b(()=>c.value)}var le={sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function ue(e,t={}){function n(t,n){let r=h(e[h(t)]);return n!=null&&(r=F(r,n)),typeof r==`number`&&(r=`${r}px`),r}let{window:r=R,strategy:i=`min-width`,ssrWidth:a=W()}=t,o=typeof a==`number`,s=o?v(!1):{value:!0};o&&T(()=>s.value=!!r);function c(e,t){return!s.value&&o?e===`min`?a>=w(t):a<=w(t):r?r.matchMedia(`(${e}-width: ${t})`).matches:!1}let l=e=>G(()=>`(min-width: ${n(e)})`,t),u=e=>G(()=>`(max-width: ${n(e)})`,t),d=Object.keys(e).reduce((e,t)=>(Object.defineProperty(e,t,{get:()=>i===`min-width`?l(t):u(t),enumerable:!0,configurable:!0}),e),{});function f(){let t=Object.keys(e).map(e=>[e,d[e],w(n(e))]).sort((e,t)=>e[2]-t[2]);return b(()=>t.filter(([,e])=>e.value).map(([e])=>e))}return Object.assign(d,{greaterOrEqual:l,smallerOrEqual:u,greater(e){return G(()=>`(min-width: ${n(e,.1)})`,t)},smaller(e){return G(()=>`(max-width: ${n(e,-.1)})`,t)},between(e,r){return G(()=>`(min-width: ${n(e)}) and (max-width: ${n(r,-.1)})`,t)},isGreater(e){return c(`min`,n(e,.1))},isGreaterOrEqual(e){return c(`min`,n(e))},isSmaller(e){return c(`max`,n(e,-.1))},isSmallerOrEqual(e){return c(`max`,n(e))},isInBetween(e,t){return c(`min`,n(e))&&c(`max`,n(t,-.1))},current:f,Line truncated
+1 -1
View File
@@ -35,7 +35,7 @@
<script type="module" crossorigin src="/assets/index.js"></script>
<link rel="modulepreload" crossorigin href="/assets/PageHeader.js">
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon.js">
<link rel="modulepreload" crossorigin href="/assets/alert.js">
<link rel="modulepreload" crossorigin href="/assets/badge.js">
<link rel="modulepreload" crossorigin href="/assets/input.js">
<link rel="stylesheet" crossorigin href="/assets/index.css">
</head>
+3 -2
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { computed, ref } from "vue";
import { Card } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { api } from "@/lib/api";
@@ -26,7 +27,7 @@ async function signInPasskey(){busy.value=true;error.value="";try{await usePassk
</script>
<template>
<main class="mx-auto flex min-h-[90dvh] max-w-md flex-col justify-center px-5 py-10">
<div class="rounded-xl border border-border bg-card p-6 shadow-sm">
<Card class="gap-0 py-6 px-6 shadow-sm">
<p class="mb-2 text-xs font-medium tracking-widest text-fg-muted">ARCHIE</p>
<h1 class="text-2xl font-medium">{{setup?(step===1?'Set up your organisation':'Create your admin account'):recovery?'Recover your account':'Sign in'}}</h1>
<form class="mt-6 space-y-4" @submit.prevent="submit">
@@ -51,6 +52,6 @@ async function signInPasskey(){busy.value=true;error.value="";try{await usePassk
<Button v-if="accounts.status?.oidc" variant="outline" as-child><a href="/oauth2/login">Sign in with OIDC</a></Button>
</div>
<Button v-if="!setup" variant="link" class="mt-3" :disabled="busy" @click="recovery=!recovery;error=''">{{recovery?'Back to sign in':'Use a recovery code'}}</Button>
</div>
</Card>
</main>
</template>
+2 -1
View File
@@ -2,6 +2,7 @@
import { computed, onMounted, ref } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import PersonalTokensCard from "@/accounts/PersonalTokensCard.vue";
import { Alert } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
@@ -22,7 +23,7 @@ const change=()=>run(async()=>{await api.changePassword(current.value,next.value
<template>
<div class="mx-auto max-w-[80ch]">
<PageHeader title="Your account"><span class="text-sm text-fg-muted">{{accounts.status?.user?.display_name}}</span></PageHeader>
<p v-if="$route.query.welcome" class="mb-4 rounded-lg border border-border bg-card p-4 text-sm">Your organisation and admin account are ready. Add a passkey below, <RouterLink class="underline" to="/org/members">add members</RouterLink>, or <RouterLink class="underline" to="/settings/authentication">configure OIDC</RouterLink>.</p>
<Alert v-if="$route.query.welcome" class="mb-4">Your organisation and admin account are ready. Add a passkey below, <RouterLink class="underline" to="/org/members">add members</RouterLink>, or <RouterLink class="underline" to="/settings/authentication">configure OIDC</RouterLink>.</Alert>
<p v-if="error" role="alert" class="mb-4 text-sm text-danger">{{error}} <a class="underline" href="/?reauth=1">Sign in again</a></p>
<Section title="Passkeys">
<ul v-if="keys.length" class="mb-3 divide-y divide-border"><li v-for="key in keys" :key="key.id" class="flex items-center gap-3 py-2"><span class="min-w-0 flex-1 truncate">{{key.name}}</span><Button variant="ghost" size="sm" class="text-danger" :disabled="busy" @click="remove(key.id)">Remove</Button></li></ul>
+4 -4
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { ref } from "vue";
import { Input } from "@/components/ui/input";
import { Section } from "@/components/ui/section";
import { Button } from "@/components/ui/button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { api } from "@/lib/api";
@@ -12,9 +13,8 @@ const name=ref("");const email=ref("");const password=ref("");const role=ref("vi
async function create(){busy.value=true;error.value="";try{await api.createAccount({display_name:name.value,email:email.value,password:password.value,role:role.value});name.value=email.value=password.value="";emit("created")}catch(cause){error.value=String((cause as Error).message||cause)}finally{busy.value=false}}
</script>
<template>
<section class="mt-6 max-w-md rounded-lg border border-border bg-card p-5">
<h2 class="text-sm font-medium">Create a local account</h2>
<form class="mt-4 space-y-3" @submit.prevent="create">
<Section title="Create a local account" class="max-w-md">
<form class="space-y-3" @submit.prevent="create">
<label for="new-account-name" class="block space-y-1 text-sm">Name<Input id="new-account-name" v-model="name" required maxlength="200" autocomplete="off" /></label>
<label for="new-account-email" class="block space-y-1 text-sm">Email<Input id="new-account-email" v-model="email" type="email" required autocomplete="off" :spellcheck="false" /></label>
<label for="new-account-password" class="block space-y-1 text-sm">Initial password<Input id="new-account-password" v-model="password" type="password" required minlength="15" maxlength="1024" autocomplete="new-password" /></label>
@@ -22,5 +22,5 @@ async function create(){busy.value=true;error.value="";try{await api.createAccou
<p v-if="error" role="alert" class="text-sm text-danger">{{error}} <a class="underline" href="/?reauth=1">Sign in again</a></p>
<Button type="submit" :disabled="busy">Create account</Button>
</form>
</section>
</Section>
</template>
+2 -1
View File
@@ -6,6 +6,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { api } from "@/lib/api";
import { Section } from "@/components/ui/section";
import { Timestamp } from "@/components/ui/timestamp";
interface PersonalToken {
id: string;
@@ -67,7 +68,7 @@ onMounted(load);
<ul v-if="tokens.length" class="divide-y divide-border" aria-label="API tokens">
<li v-for="token in tokens" :key="token.id" class="flex items-center gap-3 py-2">
<code class="flex-1 truncate text-xs">{{ token.id.slice(0, 12) }}</code>
<span class="text-xs text-fg-subtle">{{ new Date(token.created_at).toLocaleString() }}</span>
<span class="text-xs text-fg-subtle"><Timestamp :at="token.created_at" /></span>
<Button variant="ghost" size="sm" class="text-danger" :disabled="busy" @click="revoke(token.id)">Revoke</Button>
</li>
</ul>
+4 -9
View File
@@ -6,7 +6,7 @@ import { RouterLink } from "vue-router";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
import { groupBySeverity, type AlertSeverity, type OperatorAlert } from "./alerts";
import { useAlerts } from "./use-alerts";
@@ -53,7 +53,7 @@ function failedDeliveries(alert: OperatorAlert): number {
<CheckCheck class="size-4" aria-hidden="true" />
</Button>
<section v-for="group in groups" :key="group.severity" class="border-b p-3 last:border-b-0">
<h3 class="mb-2 text-sm font-semibold">{{ group.label }}</h3>
<h3 class="mb-2 text-caption font-semibold text-fg-subtle">{{ group.label }}</h3>
<ul class="grid gap-4">
<li v-for="alert in group.alerts" :key="alert.id" class="flex items-start justify-between gap-2">
<component
@@ -63,16 +63,11 @@ function failedDeliveries(alert: OperatorAlert): number {
:class="alert.link && 'group'"
@click="alert.link && (open = false)"
>
<span class="text-sm font-medium group-hover:underline">{{ alert.title }}</span>
<span class="text-label font-medium group-hover:underline">{{ alert.title }}</span>
<span v-if="alert.body" class="text-label leading-snug text-fg-muted">{{ alert.body }}</span>
<span v-if="failedDeliveries(alert)" class="text-xs text-warn">Webhook delivery failed.</span>
</component>
<time
class="mt-0.5 shrink-0 text-xs whitespace-nowrap text-fg-subtle"
:datetime="alert.first_raised"
:title="new Date(alert.first_raised).toLocaleString()"
>{{ ago(alert.first_raised) }}</time
>
<Timestamp :at="alert.first_raised" class="mt-0.5 shrink-0 text-xs whitespace-nowrap text-fg-subtle" />
<Button variant="ghost" size="icon-sm" class="-mr-2 shrink-0" :aria-label="`Dismiss ${alert.title}`" title="Dismiss" @click="dismiss(alert)"><X /></Button>
</li>
</ul>
+1 -1
View File
@@ -307,7 +307,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
</FieldGroup>
<section v-if="props.binding" class="mt-4 flex flex-col gap-2">
<h3 class="text-sm font-medium">Recent dispatches</h3>
<h3 class="text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Recent dispatches</h3>
<DispatchLinks kind="bindings" :id="props.binding.id" />
</section>
+15 -25
View File
@@ -4,6 +4,8 @@ import { Check, Pause, Pencil, Play, Trash2 } from "@lucide/vue";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { MoreMenu } from "@/components/ui/more-menu";
import { TableCell, TableRow } from "@/components/ui/table";
import BindingStatusBadge from "./BindingStatusBadge.vue";
import { eventTypeLabel, type EventType } from "@/captures/event-types";
@@ -90,31 +92,19 @@ const emit = defineEmits<{
>
<Check data-icon="inline-start" />
Approve</Button>
<Button
v-if="props.binding.status === 'armed'"
variant="outline"
size="sm"
@click="emit('pause', props.binding)"
>
<Pause data-icon="inline-start" />
Pause</Button>
<!-- Resuming returns the binding to pending approval, so it is
approved again before it fires. -->
<Button
v-if="props.binding.status === 'paused'"
variant="outline"
size="sm"
@click="emit('resume', props.binding)"
>
<Play data-icon="inline-start" />
Resume</Button>
<Button
variant="outline"
size="sm"
@click="emit('delete', props.binding)"
>
<Trash2 data-icon="inline-start" />
Delete</Button>
<MoreMenu :label="`More actions for ${props.binding.name}`">
<DropdownMenuItem
v-if="props.binding.status === 'armed'"
@select="emit('pause', props.binding)"
><Pause />Pause</DropdownMenuItem>
<!-- Resuming returns the binding to pending approval, so it is
approved again before it fires. -->
<DropdownMenuItem
v-if="props.binding.status === 'paused'"
@select="emit('resume', props.binding)"
><Play />Resume</DropdownMenuItem>
<DropdownMenuItem variant="destructive" @select="emit('delete', props.binding)"><Trash2 />Delete</DropdownMenuItem>
</MoreMenu>
</div>
</TableCell>
</TableRow>
+3 -5
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from "vue";
import { Card, CardContent } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import {
Empty,
EmptyDescription,
@@ -65,8 +65,7 @@ const failureTitle = computed(() =>
</EmptyHeader>
</Empty>
<Card v-else>
<CardContent>
<Section v-else>
<Table>
<TableHeader>
<TableRow>
@@ -103,6 +102,5 @@ const failureTitle = computed(() =>
</template>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
</template>
+2 -2
View File
@@ -2,7 +2,7 @@
import { ref, watch } from "vue";
import { api } from "@/lib/api";
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
/**
* The dispatch ledger rows for one binding, capture or task, each linking the
@@ -76,7 +76,7 @@ const captureLink = (id: string) => ({
>
<span v-else>{{ d.reason || "claimed, no task recorded" }}</span>
</template>
<span>{{ ago(d.dispatched_at) }}</span>
<Timestamp :at="d.dispatched_at" />
</li>
</ul>
<p v-else-if="props.kind !== 'tasks'" class="text-xs text-fg-muted">No dispatches yet.</p>
+4 -10
View File
@@ -10,7 +10,7 @@ import {
CardTitle,
} from "@/components/ui/card";
import { Badge } from "@/components/ui/badge";
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
import { captureSignature } from "./capture-signature";
import CapturePayload from "./CapturePayload.vue";
import DispatchLinks from "@/bindings/DispatchLinks.vue";
@@ -54,13 +54,7 @@ const signature = computed(() =>
const meta = computed(() => {
const capture = selected.value;
if (!capture) return "";
return [
ago(capture.received_at),
capture.content_type || "no content type",
capture.remote_addr,
]
.filter(Boolean)
.join(" · ");
return [capture.content_type || "no content type", capture.remote_addr].filter(Boolean).join(" · ");
});
watch(selected, () => {
@@ -79,7 +73,7 @@ watch(selected, () => {
signature.label
}}</Badge>
</CardTitle>
<CardDescription>{{ meta }}</CardDescription>
<CardDescription><Timestamp :at="selected.received_at" /> · {{ meta }}</CardDescription>
</CardHeader>
<!-- Stacked there is no sibling to be bound by, so the panel caps itself
the way the task log does rather than letting one large payload
@@ -92,7 +86,7 @@ watch(selected, () => {
<CapturePayload label="Payload" :raw="selected.body" />
<CapturePayload label="Headers" :raw="selected.headers" />
<section class="flex flex-col gap-2">
<h3 class="text-sm font-medium">Dispatches</h3>
<h3 class="text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Dispatches</h3>
<DispatchLinks kind="captures" :id="selected.id" />
</section>
</div>
+1 -1
View File
@@ -16,7 +16,7 @@ const text = computed(() => prettyPrint(props.raw));
<template>
<section class="min-w-0">
<h3
class="mb-2 text-xs font-semibold tracking-[0.05em] text-fg-subtle uppercase"
class="mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase"
>
{{ label }}
</h3>
+2 -4
View File
@@ -4,7 +4,7 @@ import { computed } from "vue";
import { Badge } from "@/components/ui/badge";
import { TableCell, TableRow } from "@/components/ui/table";
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
import { eventTypes } from "./event-type-state";
import { captureIdentity } from "./event-types";
import { captureSignature } from "./capture-signature";
@@ -52,9 +52,7 @@ function open(): void {
<TableCell class="font-mono">{{
props.capture.source || "(unknown)"
}}</TableCell>
<TableCell :title="props.capture.received_at || ''">{{
ago(props.capture.received_at)
}}</TableCell>
<TableCell><Timestamp :at="props.capture.received_at" /></TableCell>
<!-- An unidentified capture is never dispatched. -->
<TableCell>
<div class="flex items-center gap-1">
+4 -15
View File
@@ -1,11 +1,5 @@
<script setup lang="ts">
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import CapturesList from "./CapturesList.vue";
/** The captured events panel, with the note that qualifies everything inside
@@ -17,12 +11,7 @@ import CapturesList from "./CapturesList.vue";
</script>
<template>
<Card>
<CardHeader>
<CardTitle>Recent captures</CardTitle>
</CardHeader>
<CardContent>
<CapturesList />
</CardContent>
</Card>
<Section title="Recent captures" class="mb-0">
<CapturesList />
</Section>
</template>
+10 -19
View File
@@ -24,13 +24,7 @@ import {
EmptyHeader,
EmptyTitle,
} from "@/components/ui/empty";
import {
Card,
CardAction,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import {
Table,
TableBody,
@@ -65,16 +59,13 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
</script>
<template>
<Card v-if="eventTypesEnabled">
<CardHeader>
<CardTitle>Event types</CardTitle>
<CardAction>
<Button variant="outline" size="sm" @click="pasteExample()"
><ClipboardPaste />From payload</Button
>
</CardAction>
</CardHeader>
<CardContent class="flex flex-col gap-6">
<Section v-if="eventTypesEnabled" title="Event types" class="mb-0">
<template #action>
<Button variant="outline" size="sm" @click="pasteExample()"
><ClipboardPaste />From payload</Button
>
</template>
<div class="flex flex-col gap-6">
<Alert v-if="eventTypesError" variant="destructive">
<TriangleAlert />
<AlertTitle>Event types</AlertTitle>
@@ -167,8 +158,8 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
<EmptyTitle>No event types yet</EmptyTitle>
</EmptyHeader>
</Empty>
</CardContent>
</Card>
</div>
</Section>
<EventTypeDialog />
<AlertDialog
:open="pendingDelete !== null"
+25 -44
View File
@@ -3,7 +3,6 @@ import ApplyStatusRows from "@/settings/ApplyStatusRows.vue";
import HistoryLink from "@/settings/HistoryLink.vue";
import { computed, onMounted, reactive, ref } from "vue";
import { storeToRefs } from "pinia";
import { Send } from "@lucide/vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
@@ -93,7 +92,7 @@ const opened = reactive({ telegram: false });
const shown = (id: keyof typeof opened) => configured.value[id] || opened[id];
const channels = [
{ id: "telegram", title: "Telegram", icon: Send },
{ id: "telegram", title: "Telegram" },
] as const;
const allowedUsers = computed({
@@ -123,49 +122,32 @@ const models = computed({
</p>
<template v-if="chat">
<section
v-for="channel in channels"
:key="channel.id"
class="mb-4 rounded-lg border border-border bg-card"
:aria-labelledby="`ch-${channel.id}`"
>
<header class="flex items-center gap-3 px-5 py-4">
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-fg-muted">
<component :is="channel.icon" class="size-4" aria-hidden="true" />
</span>
<div class="min-w-0 flex-1">
<h2 :id="`ch-${channel.id}`" class="text-title font-medium">{{ channel.title }}</h2>
<Section v-for="channel in channels" :key="channel.id" :title="channel.title" :class="!shown(channel.id) && 'gap-0'">
<template #action>
<div class="flex items-center gap-2">
<Badge v-if="configured[channel.id] && statusOf(channel.id)" :variant="statusOf(channel.id)!.tone">{{
statusOf(channel.id)!.label
}}</Badge>
<Button v-if="!configured[channel.id] && !opened[channel.id]" variant="outline" size="sm" @click="opened[channel.id] = true">Set up</Button>
</div>
<Badge v-if="configured[channel.id] && statusOf(channel.id)" :variant="statusOf(channel.id)!.tone">{{
statusOf(channel.id)!.label
}}</Badge>
<template v-if="!configured[channel.id]">
<Button v-if="!opened[channel.id]" variant="outline" size="sm" @click="opened[channel.id] = true">Set up</Button>
</template>
</header>
</template>
<template v-if="shown(channel.id) && channel.id === 'telegram'">
<SettingRow label="Bot token" hint="Empty disables Telegram.">
<SecretRefField v-model="chat.telegram.token_ref" id-prefix="tg-token" />
</SettingRow>
<SettingRow label="Allowed users" hint="Everyone else is ignored.">
<TagsInput v-model="allowedUsers" aria-label="Allowed users" class="font-mono">
<TagsInputItem v-for="id in allowedUsers" :key="id" :value="id">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add user ID" />
</TagsInput>
</SettingRow>
</template>
</Section>
<div v-if="shown(channel.id)" class="px-5 pb-2">
<template v-if="channel.id === 'telegram'">
<SettingRow label="Bot token" hint="Empty disables Telegram.">
<SecretRefField
v-model="chat.telegram.token_ref"
id-prefix="tg-token"
/>
</SettingRow>
<SettingRow label="Allowed users" hint="Everyone else is ignored.">
<TagsInput v-model="allowedUsers" aria-label="Allowed users" class="font-mono">
<TagsInputItem v-for="id in allowedUsers" :key="id" :value="id">
<TagsInputItemText />
<TagsInputItemDelete />
</TagsInputItem>
<TagsInputInput placeholder="Add user ID" />
</TagsInput>
</SettingRow>
</template>
</div>
</section>
<Section class="mt-8" title="Chat session defaults">
<Section title="Chat session defaults">
<SettingRow label="Workspace" for="cs-workspace" hint="Empty disables file tools.">
<Input id="cs-workspace" v-model="chat.workspace" class="max-w-md font-mono" />
</SettingRow>
@@ -212,6 +194,5 @@ const models = computed({
</SettingRow>
</Section>
</template>
</div>
</template>
+2 -5
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { storeToRefs } from "pinia";
import { StatusDot } from "@/components/ui/status-dot";
import { useSessionStore } from "@/stores/session";
// Silent while the stream is live or opening for the first time; only a lost
@@ -15,11 +16,7 @@ const { streamState } = storeToRefs(useSessionStore());
class="inline-flex items-center gap-1.5 px-1 text-xs max-sm:hidden"
:class="streamState === 'unavailable' ? 'text-danger' : 'text-warn'"
>
<span
class="size-1.5 rounded-full"
:class="streamState === 'unavailable' ? 'bg-danger' : 'bg-warn'"
aria-hidden="true"
/>
<StatusDot :tone="streamState === 'unavailable' ? 'danger' : 'warn'" />
{{ streamState === "unavailable" ? "Disconnected" : "Reconnecting" }}
</span>
</template>
+1 -1
View File
@@ -38,7 +38,7 @@ watch(activePath, revealActive, { flush: "post" });
:to="entry.path"
:aria-current="activePath === entry.path ? 'page' : undefined"
:data-current="activePath === entry.path ? '' : undefined"
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center rounded-md px-2.5 text-sm font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 inline-flex h-8 shrink-0 items-center rounded-md px-2.5 text-label font-medium whitespace-nowrap transition-colors outline-none focus-visible:ring-[3px]"
>{{ entry.label }}</RouterLink
>
</nav>
+1 -1
View File
@@ -57,7 +57,7 @@ watch(() => route.path, () => (open.value = false));
:to="entry.path"
:aria-current="activePath === entry.path ? 'page' : undefined"
:data-current="activePath === entry.path ? '' : undefined"
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 flex h-11 items-center gap-3 rounded-md px-3 text-sm font-medium transition-colors outline-none focus-visible:ring-[3px]"
class="text-fg-muted hover:text-foreground hover:bg-accent data-current:text-foreground data-current:bg-accent focus-visible:ring-ring/50 flex h-11 items-center gap-3 rounded-md px-3 text-label font-medium transition-colors outline-none focus-visible:ring-[3px]"
><component :is="icons[entry.path]" v-if="icons[entry.path]" class="size-4" aria-hidden="true" />{{ entry.label }}</RouterLink
>
</nav>
+2 -2
View File
@@ -9,7 +9,7 @@ export interface CuratorActionEntry {
</script>
<script setup lang="ts">
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
const props = defineProps<{ action: CuratorActionEntry }>();
</script>
@@ -20,7 +20,7 @@ const props = defineProps<{ action: CuratorActionEntry }>();
<span class="text-sm font-medium">{{
props.action.type || "action"
}}</span>
<span class="text-xs text-fg-subtle">{{ ago(props.action.at) }}</span>
<span class="text-xs text-fg-subtle"><Timestamp :at="props.action.at" /></span>
</div>
<p v-if="props.action.detail" class="mt-1 text-sm text-fg-muted">
{{ props.action.detail }}
+12 -22
View File
@@ -14,15 +14,9 @@ export interface Curator {
<script setup lang="ts">
import { Badge } from "@/components/ui/badge";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { Timestamp } from "@/components/ui/timestamp";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { ago } from "@/lib/format";
import CuratorAction from "./CuratorAction.vue";
const props = defineProps<{ curator: Curator }>();
@@ -42,21 +36,18 @@ function healthKind(status: string | undefined): StatusKind {
</script>
<template>
<Card>
<CardHeader>
<CardTitle>{{ props.curator.name }}</CardTitle>
<CardDescription>
{{
props.curator.last_run_at
? `Last ran ${ago(props.curator.last_run_at)} · ${props.curator.last_run_actions} action${props.curator.last_run_actions === 1 ? "" : "s"}`
: "Has not run yet"
}}
</CardDescription>
<Section :title="props.curator.name" class="mb-0">
<template #action>
<Badge :variant="healthKind(props.curator.health?.status)">
{{ props.curator.health?.status || "unknown" }}
</Badge>
</CardHeader>
<CardContent>
</template>
<p class="mb-3 text-xs text-fg-subtle">
<template v-if="props.curator.last_run_at">
Last ran <Timestamp :at="props.curator.last_run_at" /> · {{ props.curator.last_run_actions }} action{{ props.curator.last_run_actions === 1 ? "" : "s" }}
</template>
<template v-else>Has not run yet</template>
</p>
<p
v-if="props.curator.health?.message"
class="mb-3 text-sm text-fg-muted"
@@ -78,6 +69,5 @@ function healthKind(status: string | undefined): StatusKind {
<EmptyTitle>No activity</EmptyTitle>
</EmptyHeader>
</Empty>
</CardContent>
</Card>
</Section>
</template>
+4 -3
View File
@@ -6,6 +6,7 @@ import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { Switch } from "@/components/ui/switch";
import { DurationInput } from "@/components/ui/duration-input";
import { Section } from "@/components/ui/section";
import { SettingRow } from "@/components/ui/setting-row";
import { useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "@/settings/ApplyStatusRows.vue";
@@ -73,8 +74,8 @@ onMounted(load);
<div v-if="editing" class="mb-6">
<form class="mb-4 flex gap-2" @submit.prevent="add"><Input v-model="newName" aria-label="Curator name" placeholder="Curator name" class="max-w-xs" /><Button type="submit" :disabled="!newName.trim() || definitions?.some(def => def.name === newName.trim())">Add curator</Button></form>
<Empty v-if="!definitions?.length"><EmptyHeader><EmptyTitle>No custom curator definitions</EmptyTitle></EmptyHeader></Empty>
<section v-for="(def, index) in definitions" :key="index" class="mb-6 border-t pt-4">
<div class="flex items-center justify-between"><h2 class="font-mono text-sm">{{ def.name }}</h2><Button variant="ghost" size="sm" @click="definitions!.splice(index, 1)">Remove curator</Button></div>
<Section v-for="(def, index) in definitions" :key="index" :title="def.name">
<template #action><Button variant="ghost" size="sm" @click="definitions!.splice(index, 1)">Remove curator</Button></template>
<SettingRow label="Enabled"><Switch v-model="def.enabled" :aria-label="`${def.name} enabled`" /></SettingRow>
<SettingRow label="Instructions" :for="`curator-${index}-instructions`"><Textarea :id="`curator-${index}-instructions`" v-model="def.instructions" /></SettingRow>
<SettingRow label="Interval"><DurationInput v-model="def.interval" :units="['s', 'm', 'h']" /></SettingRow>
@@ -85,7 +86,7 @@ onMounted(load);
<SettingRow label="Memory engine" :for="`curator-${index}-memory`"><Input :id="`curator-${index}-memory`" v-model="def.memory_engine" /></SettingRow>
<SettingRow label="Conversations"><Switch v-model="def.conversations" :aria-label="`${def.name} conversations`" /></SettingRow>
<SettingRow label="Model" :for="`curator-${index}-model`"><Input :id="`curator-${index}-model`" v-model="def.model" placeholder="Default model" /></SettingRow>
</section>
</Section>
</div>
<div
+2 -6
View File
@@ -2,7 +2,7 @@
import { computed } from "vue";
import { TableCell, TableRow } from "@/components/ui/table";
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
import { useOrgStore } from "@/stores/org";
import { activityDetail } from "./activity-detail";
import { describeTimelineEvent } from "@/tasks/timeline-event";
@@ -30,10 +30,6 @@ function open() {
if (taskID.value > 0) emit("open", taskID.value);
}
// A missing timestamp gets a dash, not a call to ago(): substituting
// Date.now() would render "just now" for an event whose time the daemon never
// recorded -- a claim the row cannot back.
const when = computed(() => (props.event.at ? ago(props.event.at) : "\u2013"));
</script>
<template>
@@ -59,6 +55,6 @@ const when = computed(() => (props.event.at ? ago(props.event.at) : "\u2013"));
>{{ detail.text }}</span
>
</TableCell>
<TableCell>{{ when }}</TableCell>
<TableCell><Timestamp :at="event.at" /></TableCell>
</TableRow>
</template>
+10 -24
View File
@@ -5,13 +5,9 @@ import { useRouter } from "vue-router";
import { ChevronDown, ChevronRight } from "@lucide/vue";
import { Badge } from "@/components/ui/badge";
import {
Card,
CardAction,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { StatusDot } from "@/components/ui/status-dot";
import { Timestamp } from "@/components/ui/timestamp";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import {
@@ -22,7 +18,6 @@ import {
TableHeader,
TableRow,
} from "@/components/ui/table";
import { ago } from "@/lib/format";
import { useSessionStore } from "@/stores/session";
import { useTasksStore } from "@/stores/tasks";
import { useAlerts } from "@/alerts/use-alerts";
@@ -89,26 +84,18 @@ function groupDetail(group: ActivityGroup) {
return activityDetail(group.representative, identities.identityName);
}
function groupWhen(group: ActivityGroup) {
return group.representative.at ? ago(group.representative.at) : "\u2013";
}
function openTask(taskID: number) {
void router.push(`/tasks?task=${encodeURIComponent(taskID)}`);
}
</script>
<template>
<Card>
<CardHeader>
<CardTitle>Activity<span v-if="running" class="font-normal text-fg-subtle"> · {{ running }} running</span></CardTitle>
<CardAction class="flex items-center gap-2">
<Section :title="running ? `Activity · ${running} running` : 'Activity'" class="mb-0">
<template #action>
<ToggleGroup type="single" variant="outline" size="sm" :model-value="filter" aria-label="Filter activity" @update:model-value="(value) => { if (value) filter = value as typeof filter; }">
<ToggleGroupItem v-for="option in ACTIVITY_FILTERS" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
</ToggleGroup>
</CardAction>
</CardHeader>
<CardContent>
</template>
<!--
role="region" names the table for landmark navigation; aria-live is
polite, not assertive, because rows arrive constantly while the stream
@@ -138,7 +125,7 @@ function openTask(taskID: number) {
<TableRow v-for="alert in pinned" :key="`alert:${alert.id}`">
<TableCell class="font-medium">
<span class="inline-flex items-center gap-1.5">
<span class="size-1.5 rounded-full bg-warn" aria-hidden="true" />Alert
<StatusDot tone="warn" />Alert
<Badge v-if="alert.count > 1" variant="idle">×{{ alert.count }}</Badge>
</span>
</TableCell>
@@ -149,7 +136,7 @@ function openTask(taskID: number) {
<RouterLink v-if="alert.link" :to="alert.link" class="shrink-0 text-warn hover:underline">Fix →</RouterLink>
</span>
</TableCell>
<TableCell>{{ ago(alert.last_seen) }}</TableCell>
<TableCell><Timestamp :at="alert.last_seen" /></TableCell>
</TableRow>
<TableRow v-if="!shown.length && !pinned.length">
<TableCell colspan="4">
@@ -225,7 +212,7 @@ function openTask(taskID: number) {
>{{ groupDetail(group).text }}</span
>
</TableCell>
<TableCell>{{ groupWhen(group) }}</TableCell>
<TableCell><Timestamp :at="group.representative.at" /></TableCell>
</TableRow>
<template v-if="isOpen(group)">
<ActivityRow
@@ -242,6 +229,5 @@ function openTask(taskID: number) {
</Table>
</div>
</div>
</CardContent>
</Card>
</Section>
</template>
+8 -13
View File
@@ -4,7 +4,7 @@ import { computed } from "vue";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { attentionStatusIds, statusLabel } from "@/lib/task-meta";
import TaskRowActions from "@/tasks/TaskRowActions.vue";
import type { Task } from "@/tasks/TaskRow.vue";
@@ -28,15 +28,11 @@ function meta(task: AttentionTask): string {
</script>
<template>
<Card v-if="waiting.length">
<CardHeader>
<CardTitle>Needs attention</CardTitle>
<CardAction>
<Button variant="ghost" size="sm" as-child><RouterLink to="/tasks?status=needs_you">All tasks</RouterLink></Button>
</CardAction>
</CardHeader>
<CardContent>
<ul class="divide-y divide-border">
<Section v-if="waiting.length" title="Needs attention" class="mb-0">
<template #action>
<Button variant="ghost" size="sm" as-child><RouterLink to="/tasks?status=needs_you">All tasks</RouterLink></Button>
</template>
<ul class="divide-y divide-border">
<li v-for="task in waiting" :key="task.id" class="flex flex-wrap items-center gap-3 py-2">
<Badge variant="warn">{{ statusLabel(task.status ?? "") }}</Badge>
<div class="min-w-0 flex-1">
@@ -47,7 +43,6 @@ function meta(task: AttentionTask): string {
</div>
<TaskRowActions :task="task" @done="loadDashboard" />
</li>
</ul>
</CardContent>
</Card>
</ul>
</Section>
</template>
+9 -4
View File
@@ -4,7 +4,7 @@ import { useRouter } from "vue-router";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { NativeSelect, NativeSelectOption } from "@/components/ui/native-select";
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Spinner } from "@/components/ui/spinner";
import { api } from "@/lib/api";
import { useOrgStore } from "@/stores/org";
@@ -78,9 +78,14 @@ async function run() {
<form class="grid gap-1.5" @submit.prevent="run">
<div class="flex gap-2 max-sm:flex-wrap">
<Input v-model="prompt" class="min-w-0 flex-1" placeholder="Describe a task" aria-label="Task" />
<NativeSelect v-model="workflow" aria-label="Workflow" class="text-label" :disabled="!definitions.length">
<NativeSelectOption v-for="d in definitions" :key="d.id" :value="d.id">{{ d.name || d.id }}</NativeSelectOption>
</NativeSelect>
<Select v-model="workflow" :disabled="!definitions.length">
<SelectTrigger class="w-48 max-sm:flex-1" aria-label="Workflow"><SelectValue /></SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectItem v-for="d in definitions" :key="d.id" :value="d.id">{{ d.name || d.id }}</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
<Button type="submit" :disabled="!prompt.trim() || !workflow || submitting">
<Spinner v-if="submitting" data-icon="inline-start" />Run
</Button>
+13 -24
View File
@@ -3,13 +3,7 @@ import { storeToRefs } from "pinia";
import { Check, Circle } from "@lucide/vue";
import { computed, ref, watch } from "vue";
import {
Card,
CardAction,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { setupPanelState, type SetupPanelState } from "./setup-preference";
import { useTasksStore } from "@/stores/tasks";
@@ -37,22 +31,17 @@ const pct = computed(() => {
</script>
<template>
<Card v-if="panel.kind === 'incomplete'" size="sm">
<CardHeader>
<CardTitle>Setup</CardTitle>
<CardAction>
<span class="text-sm font-semibold text-link tabular-nums">{{ pct }}%</span>
</CardAction>
</CardHeader>
<CardContent>
<ul class="grid gap-2 text-sm">
<li v-for="(step, i) in steps" :key="i" class="flex items-center gap-2">
<Check v-if="step.done" class="size-3.5 shrink-0 text-ok" aria-label="Done" />
<Circle v-else class="size-3.5 shrink-0 text-fg-subtle" aria-label="To do" />
<RouterLink v-if="!step.done && step.path" :to="step.path" class="font-medium hover:underline">{{ step.title }}</RouterLink>
<span v-else :class="step.done ? 'text-fg-muted' : 'font-medium'">{{ step.title }}</span>
<Section v-if="panel.kind === 'incomplete'" title="Setup" class="mb-0">
<template #action>
<span class="text-label font-semibold text-link tabular-nums">{{ pct }}%</span>
</template>
<ul class="grid gap-2 text-label">
<li v-for="(step, i) in steps" :key="i" class="flex items-center gap-2">
<Check v-if="step.done" class="size-3.5 shrink-0 text-ok" aria-label="Done" />
<Circle v-else class="size-3.5 shrink-0 text-fg-subtle" aria-label="To do" />
<RouterLink v-if="!step.done && step.path" :to="step.path" class="font-medium hover:underline">{{ step.title }}</RouterLink>
<span v-else :class="step.done ? 'text-fg-muted' : 'font-medium'">{{ step.title }}</span>
</li>
</ul>
</CardContent>
</Card>
</ul>
</Section>
</template>
+13 -24
View File
@@ -14,7 +14,8 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Badge } from "@/components/ui/badge";
import type { BadgeVariants } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { Timestamp } from "@/components/ui/timestamp";
import {
Empty,
EmptyHeader,
@@ -99,12 +100,6 @@ function openTerminal(): void {
terminalOpen.value = true;
}
function formatTimestamp(value?: string): string {
if (!value) return "–";
const at = new Date(value);
return Number.isNaN(at.getTime()) ? value : at.toLocaleString();
}
function scopes(binding: HarnessBinding): string {
return binding.scopes?.length ? binding.scopes.join(", ") : "–";
}
@@ -136,8 +131,8 @@ function scopes(binding: HarnessBinding): string {
<AlertDescription>Start the daemon with a container runtime and a harness token to log in to a CLI from here.</AlertDescription>
</Alert>
<Card v-else class="mb-4">
<CardContent class="flex flex-wrap items-end gap-3">
<Section v-else>
<div class="flex flex-wrap items-end gap-3">
<div class="flex flex-col gap-1 text-sm">
<Label for="harness-profile" class="text-fg-muted">Profile</Label>
<Select v-model="profile" :disabled="!state.profiles.length">
@@ -154,17 +149,14 @@ function scopes(binding: HarnessBinding): string {
</Select>
</div>
<Button :disabled="!profile" @click="openTerminal">Open setup terminal</Button>
</CardContent>
</Card>
</div>
</Section>
<Card v-if="terminalOpen && profile" class="mb-4">
<CardContent class="h-96">
<SetupTerminal :profile="profile" />
</CardContent>
</Card>
<Section v-if="terminalOpen && profile">
<div class="h-96"><SetupTerminal :profile="profile" /></div>
</Section>
<Card>
<CardContent>
<Section>
<Table>
<TableHeader>
<TableRow>
@@ -186,16 +178,13 @@ function scopes(binding: HarnessBinding): string {
{{ statuses[bindingStatus(binding)].label }}
</Badge>
</TableCell>
<TableCell>{{ formatTimestamp(binding.expires_at) }}</TableCell>
<TableCell><Timestamp :at="binding.expires_at" absolute /></TableCell>
<TableCell class="text-fg-muted">{{ scopes(binding) }}</TableCell>
<TableCell class="text-fg-muted">
{{ formatTimestamp(binding.updated_at) }}
</TableCell>
<TableCell class="text-fg-muted"><Timestamp :at="binding.updated_at" /></TableCell>
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
</template>
</div>
</template>
+10 -30
View File
@@ -1,13 +1,7 @@
<script setup lang="ts">
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import {
Dialog,
DialogContent,
@@ -53,29 +47,16 @@ function onOpenChange(open: boolean) {
}}</DialogTitle>
</DialogHeader>
<Card>
<CardContent>
<MappingForm />
</CardContent>
</Card>
<Section class="mb-0">
<MappingForm />
</Section>
<Card>
<CardHeader>
<CardTitle>Bound fields</CardTitle>
</CardHeader>
<CardContent>
<MappingFieldsTable />
</CardContent>
<CardFooter>
<Button variant="outline" @click="runPreview">Preview</Button>
</CardFooter>
</Card>
<Section title="Bound fields" class="mb-0">
<MappingFieldsTable />
<Button variant="outline" class="mt-4" @click="runPreview">Preview</Button>
</Section>
<Card>
<CardHeader>
<CardTitle>Payload</CardTitle>
</CardHeader>
<CardContent>
<Section title="Payload" class="mb-0">
<Alert v-if="draft.payloadError" variant="destructive">
<AlertDescription>{{ draft.payloadError }}</AlertDescription>
</Alert>
@@ -85,8 +66,7 @@ function onOpenChange(open: boolean) {
@pick="addField"
/>
<p v-else class="text-sm text-fg-muted">No event selected.</p>
</CardContent>
</Card>
</Section>
<!-- Beside the buttons, not at the top: the dialog scrolls, and Save is
clicked at the bottom, where a refusal must be seen. -->
+2 -4
View File
@@ -2,7 +2,7 @@
import { Button } from "@/components/ui/button";
import { TableCell, TableRow } from "@/components/ui/table";
import { eventTypeLabel } from "@/captures/event-types";
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
import { matchCountLabel } from "./match-count";
import { eventTypes, type Mapping } from "./state";
@@ -25,9 +25,7 @@ const emit = defineEmits<{
mapping.fields?.length ?? 0
}}</TableCell>
<TableCell class="tabular-nums">{{ matchCountLabel(mapping) }}</TableCell>
<TableCell class="text-fg-muted">{{
mapping.match_count ? ago(mapping.last_matched_at) : "–"
}}</TableCell>
<TableCell class="text-fg-muted"><Timestamp :at="mapping.match_count ? mapping.last_matched_at : null" /></TableCell>
<TableCell>
<div class="flex justify-end gap-2">
<Button variant="outline" size="xs" @click="emit('edit', mapping)"
+3 -5
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Card, CardContent } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import {
Empty,
EmptyDescription,
@@ -50,8 +50,7 @@ import {
</EmptyHeader>
</Empty>
<Card v-else>
<CardContent>
<Section v-else>
<Table>
<TableHeader>
<TableRow>
@@ -73,6 +72,5 @@ import {
/>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
</template>
+10 -17
View File
@@ -4,7 +4,7 @@ import { computed, onMounted, ref } from "vue";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardAction, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { Input } from "@/components/ui/input";
import {
Select,
@@ -105,13 +105,9 @@ onMounted(load);
<div v-if="error" role="alert" class="mb-4 text-sm text-danger"><p>{{ error }}</p><Button variant="outline" size="sm" @click="load">Retry</Button></div>
<Card class="mb-4">
<CardHeader>
<CardAction>
<Button size="sm" @click="editing = true">New policy</Button>
</CardAction>
</CardHeader>
<CardContent class="flex flex-col gap-3">
<Section>
<template #action><Button size="sm" @click="editing = true">New policy</Button></template>
<div class="flex flex-col gap-3">
<p v-if="loading" role="status" class="text-sm text-fg-muted">Loading policies…</p>
<p v-else-if="!error && !policies.length" class="text-sm text-fg-subtle">No policies yet.</p>
<div
@@ -133,14 +129,11 @@ onMounted(load);
<Button size="sm" variant="outline" @click="remove(p)">Delete</Button>
</div>
</div>
</CardContent>
</Card>
</div>
</Section>
<Card v-if="editing">
<CardHeader>
<CardTitle>{{ draft.id ? draft.id : "New policy" }}</CardTitle>
</CardHeader>
<CardContent class="flex flex-col gap-3">
<Section v-if="editing" :title="draft.id ? draft.id : 'New policy'">
<div class="flex flex-col gap-3">
<div class="flex flex-wrap gap-2">
<Input v-model="draft.id" placeholder="policy id" class="w-56" />
<Select v-model="draft.level">
@@ -172,7 +165,7 @@ onMounted(load);
<Button :disabled="!canSave || saving" @click="save">Save</Button>
<Button variant="outline" @click="(editing = false), (draft = blank())">Cancel</Button>
</div>
</CardContent>
</Card>
</div>
</Section>
</div>
</template>
+7 -6
View File
@@ -26,6 +26,7 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Badge } from "@/components/ui/badge";
import { Section } from "@/components/ui/section";
import { api } from "@/lib/api";
import { useOrgStore, type Identity } from "@/stores/org";
@@ -133,8 +134,9 @@ const isAgent = (value: Identity) =>
<Button type="submit" size="sm" :disabled="!name.trim() || !!store.identityBusy"><Plus data-icon="inline-start" />Create</Button>
</form>
<ul class="divide-y divide-border rounded-lg border border-border bg-card" aria-label="Agents">
<li v-for="value in store.identities" :key="value.id" class="flex flex-wrap items-center gap-3 px-4 py-3">
<Section>
<ul class="divide-y divide-border" aria-label="Agents">
<li v-for="value in store.identities" :key="value.id" class="flex flex-wrap items-center gap-3 py-3 first:pt-0 last:pb-0">
<span class="grid size-8 shrink-0 place-items-center rounded-md bg-secondary text-fg-muted">
<component :is="icons[value.kind]" class="size-4" aria-hidden="true" />
</span>
@@ -181,7 +183,7 @@ const isAgent = (value: Identity) =>
<Button variant="ghost" size="sm" class="text-danger" :disabled="!!store.identityBusy" @click="retiring = value">Retire</Button>
</div>
</li>
<li v-if="!store.identitiesLoaded" class="px-4 py-3 text-sm text-fg-muted" role="status">Loading agents…</li>
<li v-if="!store.identitiesLoaded" class="py-3 text-sm text-fg-muted" role="status">Loading agents…</li>
<li v-else-if="!store.identities.length && !store.identityError">
<Empty class="py-6">
<EmptyHeader>
@@ -190,10 +192,9 @@ const isAgent = (value: Identity) =>
</Empty>
</li>
</ul>
</Section>
<div class="mt-8">
<IdentityGrantsCard />
</div>
<IdentityGrantsCard />
<AlertDialog :open="!!retiring" @update:open="(open) => !open && (retiring = null)">
<AlertDialogContent>
+9 -13
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import PageHeader from "@/base/PageHeader.vue";
import CreateAccount from "@/accounts/CreateAccount.vue";
import { Card, CardContent } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { storeToRefs } from "pinia";
import { computed, onMounted, ref } from "vue";
import { Plus, Trash2 } from "@lucide/vue";
@@ -138,8 +138,7 @@ const remove = (member: Member) =>
<p v-if="error" role="alert" class="mb-4 text-sm text-danger">{{ error }}</p>
<Card>
<CardContent>
<Section>
<Table>
<TableHeader>
<TableRow>
@@ -191,13 +190,11 @@ const remove = (member: Member) =>
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
<CreateAccount v-if="org?.id===identities.homeOrg" @created="load" />
<section class="mt-8 grid gap-6 lg:grid-cols-2" aria-label="Add people">
<div>
<h2 class="mb-3 text-sm font-medium">Add an identity</h2>
<div class="grid gap-4 lg:grid-cols-2">
<Section title="Add an identity" class="mb-0">
<form class="flex flex-wrap items-center gap-2" @submit.prevent="add">
<Select v-model="picked">
<SelectTrigger class="w-64" aria-label="Identity">
@@ -220,10 +217,9 @@ const remove = (member: Member) =>
<Button type="submit" size="sm" :disabled="!picked || busy !== ''">
<Plus data-icon="inline-start" /> Add member</Button>
</form>
</div>
</Section>
<div>
<h2 class="mb-3 text-sm font-medium">Invite a person</h2>
<Section title="Invite a person" class="mb-0">
<form class="flex flex-wrap items-center gap-2" @submit.prevent="addPerson">
<Input
v-model="person"
@@ -242,7 +238,7 @@ const remove = (member: Member) =>
<Button type="submit" size="sm" :disabled="!person.trim() || busy !== ''">
<Plus data-icon="inline-start" /> Invite person</Button>
</form>
</div>
</section>
</Section>
</div>
</div>
</template>
+9 -11
View File
@@ -4,6 +4,7 @@ import { computed, onMounted, ref } from "vue";
import { Plus, Trash2 } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Section } from "@/components/ui/section";
import { Input } from "@/components/ui/input";
import { useSettingsStore } from "@/stores/settings";
import DraftHint from "@/settings/DraftHint.vue";
@@ -46,7 +47,6 @@ function addProvider() {
newProvider.value = "";
}
const bound = computed(() => new Set(((store.drafts["credential-bindings"]?.value as { service: string }[] | null) ?? []).map((b) => b.service)));
const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase";
</script>
<template>
@@ -55,9 +55,8 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
<p v-for="e in errors" :key="String(e)" class="mb-4 text-sm text-danger" role="alert">{{ e }}</p>
<template v-if="aliases">
<h2 :class="eyebrow">Aliases</h2>
<div class="rounded-lg border border-border bg-card">
<div v-for="(model, alias) in aliases" :key="alias" class="flex flex-wrap items-center gap-3 border-b border-border px-4 py-2.5 last-of-type:border-b-0">
<Section title="Aliases">
<div v-for="(model, alias) in aliases" :key="alias" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
<label :for="`org-alias-${alias}`" class="w-28 font-mono text-sm font-medium">{{ alias }}</label>
<Input
:id="`org-alias-${alias}`"
@@ -71,28 +70,27 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
<span v-if="issue(String(alias))" class="text-xs text-danger">{{ issue(String(alias))?.message }}</span>
<Button variant="ghost" size="icon" class="ml-auto" :aria-label="`Remove alias ${alias}`" @click="delete aliases[alias]"><Trash2 /></Button>
</div>
<form class="flex gap-2 border-t border-border px-4 py-3" @submit.prevent="addAlias">
<form class="flex gap-2 border-t border-border pt-3" @submit.prevent="addAlias">
<Input v-model="newAlias" class="max-w-56 font-mono" placeholder="alias, e.g. default" aria-label="New alias" />
<Button type="submit" variant="outline" size="sm" :disabled="!newAlias.trim()"><Plus data-icon="inline-start" />Add alias</Button>
</form>
</div>
</Section>
</template>
<template v-if="providers">
<h2 :class="[eyebrow, 'mt-10']">Providers</h2>
<div class="rounded-lg border border-border bg-card">
<div v-for="(provider, name) in providers" :key="name" class="flex flex-wrap items-center gap-3 border-b border-border px-4 py-2.5 last-of-type:border-b-0">
<Section title="Providers">
<div v-for="(provider, name) in providers" :key="name" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
<span class="w-28 font-mono text-sm font-medium">{{ name }}</span>
<Input v-model="provider.class" class="w-36 font-mono" :aria-label="`Class for ${name}`" />
<Input v-model="provider.base_url" class="max-w-md flex-1 font-mono max-sm:basis-full" placeholder="base URL (empty: class default)" :aria-label="`Base URL for ${name}`" />
<RouterLink v-if="!bound.has(String(name))" to="/org/credential-bindings" class="text-xs text-warn hover:underline">Add a credential binding named "{{ name }}"</RouterLink>
<Button variant="ghost" size="icon" class="ml-auto" :aria-label="`Remove provider ${name}`" @click="delete providers[name]"><Trash2 /></Button>
</div>
<form class="flex gap-2 border-t border-border px-4 py-3" @submit.prevent="addProvider">
<form class="flex gap-2 border-t border-border pt-3" @submit.prevent="addProvider">
<Input v-model="newProvider" class="max-w-56 font-mono" placeholder="provider name" aria-label="New provider" />
<Button type="submit" variant="outline" size="sm" :disabled="!newProvider.trim()"><Plus data-icon="inline-start" />Add provider</Button>
</form>
</div>
</Section>
</template>
</div>
</template>
+5 -8
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import PageHeader from "@/base/PageHeader.vue";
import { Card, CardContent } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { storeToRefs } from "pinia";
import { onMounted, ref } from "vue";
import { Plus } from "@lucide/vue";
@@ -84,8 +84,7 @@ async function create(): Promise<void> {
<p v-if="error" role="alert" class="mb-4 text-sm text-danger">{{ error }}</p>
<Card>
<CardContent>
<Section>
<Table>
<TableHeader>
<TableRow>
@@ -114,11 +113,9 @@ async function create(): Promise<void> {
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
<section class="mt-8" aria-labelledby="new-workspace">
<h2 id="new-workspace" class="mb-3 text-sm font-medium">New workspace</h2>
<Section title="New workspace">
<form class="flex flex-wrap items-center gap-2" @submit.prevent="create">
<Input v-model="id" class="w-40 font-mono" placeholder="id" aria-label="Workspace id" required />
<Input v-model="name" class="w-56" placeholder="Name" aria-label="Workspace name" required />
@@ -126,6 +123,6 @@ async function create(): Promise<void> {
<Button type="submit" size="sm" :disabled="!id.trim() || !name.trim() || busy">
<Plus data-icon="inline-start" /> Create</Button>
</form>
</section>
</Section>
</div>
</template>
+1 -1
View File
@@ -25,7 +25,7 @@ defineEmits<{ remove: [index: number] }>();
v-for="(item, i) in items"
:key="i"
:value="String(i)"
class="rounded-lg border border-border bg-card px-5 not-last:border-b"
class="rounded-xl bg-card px-4 ring-1 ring-foreground/10 not-last:border-b-0"
>
<header class="flex items-center gap-2 [&>h3]:min-w-0 [&>h3]:flex-1">
<AccordionTrigger class="min-w-0 flex-1 items-center text-title hover:no-underline" :class="mono && 'font-mono'">
+11 -6
View File
@@ -19,6 +19,7 @@ import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { Input } from "@/components/ui/input";
import { Badge } from "@/components/ui/badge";
import { Switch } from "@/components/ui/switch";
import { Section } from "@/components/ui/section";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { grants, stage, useExtensionsStore, type Extension } from "@/stores/extensions";
import ApplyStatusRows from "./ApplyStatusRows.vue";
@@ -75,8 +76,9 @@ const tones = {
<TabsTrigger value="marketplace">Marketplace</TabsTrigger>
</TabsList>
<TabsContent value="installed">
<ul class="divide-y divide-border rounded-lg border border-border bg-card" aria-label="Extensions">
<li v-for="extension in store.extensions" :key="extension.name" class="flex flex-wrap items-center gap-3 px-4 py-3">
<Section>
<ul class="divide-y divide-border" aria-label="Extensions">
<li v-for="extension in store.extensions" :key="extension.name" class="flex flex-wrap items-center gap-3 py-3 first:pt-0 last:pb-0">
<div class="min-w-0 w-full lg:w-auto lg:flex-1">
<p class="truncate text-sm font-medium">
{{ extension.display_name || extension.name }}
@@ -141,7 +143,7 @@ const tones = {
><Trash2
/></Button>
</li>
<li v-if="loading" class="px-4 py-3 text-sm text-fg-muted" role="status">Loading extensions…</li>
<li v-if="loading" class="py-3 text-sm text-fg-muted" role="status">Loading extensions…</li>
<li v-else-if="!store.extensions.length && !store.error">
<Empty class="py-6">
<EmptyHeader>
@@ -150,13 +152,15 @@ const tones = {
</Empty>
</li>
</ul>
</Section>
<ApplyStatusRows :kind="KIND" class="mt-6 border-t border-border py-4" />
</TabsContent>
<TabsContent value="marketplace">
<p v-if="store.catalogueError" class="text-sm text-fg-muted">{{ store.catalogueError }}</p>
<ul v-else class="divide-y divide-border rounded-lg border border-border bg-card">
<li v-for="entry in available" :key="entry.name" class="flex flex-wrap items-center gap-3 px-4 py-3">
<Section v-else>
<ul class="divide-y divide-border">
<li v-for="entry in available" :key="entry.name" class="flex flex-wrap items-center gap-3 py-3 first:pt-0 last:pb-0">
<div class="min-w-0 flex-1">
<p class="truncate text-sm font-medium">
{{ entry.name }}
@@ -167,8 +171,9 @@ const tones = {
<Button size="sm" :disabled="!!store.busy" @click="store.installFromCatalogue(entry.name)">
<Plus data-icon="inline-start" /> Install</Button>
</li>
<li v-if="!available.length" class="px-4 py-3 text-sm text-fg-muted">Everything listed is installed.</li>
<li v-if="!available.length" class="py-3 text-sm text-fg-muted">Everything listed is installed.</li>
</ul>
</Section>
<details class="mt-3">
<summary class="cursor-pointer text-xs text-fg-muted">Install by reference</summary>
<form class="mt-2 flex flex-wrap gap-2" @submit.prevent="install">
+5 -7
View File
@@ -5,7 +5,8 @@ import { storeToRefs } from "pinia";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { Timestamp } from "@/components/ui/timestamp";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import {
Select,
@@ -15,7 +16,6 @@ import {
SelectValue,
} from "@/components/ui/select";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { ago } from "@/lib/format";
import { useSettingsStore, type AuditEntry } from "@/stores/settings";
import { formatValue } from "@/lib/changes";
import { filterHistory, historyEmptyTitle } from "./history";
@@ -147,8 +147,7 @@ const restorable = (entry: AuditEntry) =>
<p v-if="restoreError" class="mb-2 text-sm text-danger" role="alert">{{ restoreError }}</p>
<p v-if="error" class="text-sm text-danger" role="alert">{{ error }}</p>
<Card v-else>
<CardContent>
<Section v-else>
<Table class="table-fixed">
<TableHeader>
<TableRow>
@@ -163,7 +162,7 @@ const restorable = (entry: AuditEntry) =>
</TableHeader>
<TableBody>
<TableRow v-for="entry in rows" :key="entry.id" class="align-top">
<TableCell class="text-fg-muted" :title="entry.at">{{ entry.at ? ago(entry.at) : "" }}</TableCell>
<TableCell class="text-fg-muted"><Timestamp :at="entry.at" /></TableCell>
<TableCell class="truncate">{{ titles.get(entry.record_key) ?? entry.record_key }}</TableCell>
<TableCell class="truncate font-mono text-xs" :title="entry.field">{{ entry.field || "whole value" }}</TableCell>
<TableCell class="font-mono text-xs whitespace-normal">
@@ -203,7 +202,6 @@ const restorable = (entry: AuditEntry) =>
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
</div>
</template>
+7 -7
View File
@@ -4,6 +4,7 @@ import { Plus, X } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Section } from "@/components/ui/section";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { useOrgStore } from "@/stores/org";
import { useSettingsStore } from "@/stores/settings";
@@ -44,25 +45,24 @@ function removeIdentity(id: string) {
</script>
<template>
<section class="mb-8" aria-labelledby="identity-grants">
<h2 id="identity-grants" class="mb-3 text-sm font-medium">Credential grants</h2>
<Section title="Credential grants">
<p v-if="error" role="alert" class="mb-3 text-sm text-danger">{{ error }}</p>
<div v-if="grants" class="divide-y divide-border rounded-lg border border-border bg-card">
<div class="flex flex-wrap items-center gap-3 px-4 py-2.5">
<div v-if="grants" class="divide-y divide-border">
<div class="flex flex-wrap items-center gap-3 py-2.5">
<span class="w-40 shrink-0 text-sm">Default</span>
<ToggleGroup type="multiple" variant="outline" size="sm" :model-value="grants.root ?? []" aria-label="Default grants" @update:model-value="(v) => setRoot(v as string[])">
<ToggleGroupItem v-for="service in store.credentialServices" :key="service" :value="service" class="font-mono text-xs">{{ service }}</ToggleGroupItem>
</ToggleGroup>
<DraftHint :kind="KIND" path="root" />
</div>
<div v-for="(services, id) in grants.identities" :key="id" class="flex flex-wrap items-center gap-3 px-4 py-2.5">
<div v-for="(services, id) in grants.identities" :key="id" class="flex flex-wrap items-center gap-3 py-2.5">
<span class="w-40 shrink-0 truncate text-sm">{{ org.identityName(String(id)) }}</span>
<ToggleGroup type="multiple" variant="outline" size="sm" :model-value="services" :aria-label="`${org.identityName(String(id))} grants`" @update:model-value="(v) => setIdentity(String(id), v as string[])">
<ToggleGroupItem v-for="service in store.credentialServices" :key="service" :value="service" class="font-mono text-xs">{{ service }}</ToggleGroupItem>
</ToggleGroup>
<Button variant="ghost" size="sm" class="ml-auto" :aria-label="`Remove ${org.identityName(String(id))}`" @click="removeIdentity(String(id))"><X /></Button>
</div>
<div v-if="addable.length" class="px-4 py-2.5">
<div v-if="addable.length" class="py-2.5">
<Select :model-value="undefined" @update:model-value="(id) => setIdentity(String(id), [])">
<SelectTrigger class="w-56" aria-label="Add identity"><Plus class="size-4" /><SelectValue placeholder="Add identity" /></SelectTrigger>
<SelectContent><SelectGroup>
@@ -71,5 +71,5 @@ function removeIdentity(id: string) {
</Select>
</div>
</div>
</section>
</Section>
</template>
+4 -1
View File
@@ -5,6 +5,7 @@ import { Trash2 } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { Section } from "@/components/ui/section";
import { Switch } from "@/components/ui/switch";
import {
TagsInput,
@@ -50,7 +51,8 @@ const args = computed({
</script>
<template>
<div class="grid gap-4 rounded-lg border border-border bg-card p-4">
<Section class="mb-0">
<div class="grid gap-4">
<div class="flex items-center gap-3">
<Input
:id="`${id}-name`"
@@ -101,4 +103,5 @@ const args = computed({
<Switch v-model="server.parallel_tool_calls" />
Parallel tool calls</label>
</div>
</Section>
</template>
+2 -1
View File
@@ -18,6 +18,7 @@ import { Input } from "@/components/ui/input";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { SettingRow } from "@/components/ui/setting-row";
import { Textarea } from "@/components/ui/textarea";
import { Timestamp } from "@/components/ui/timestamp";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import CardAccordion from "./CardAccordion.vue";
import DraftHint from "./DraftHint.vue";
@@ -119,7 +120,7 @@ const whenKind = (job: Job) => job.schedule.kind || "interval";
<CardAccordion v-model:open="open" :items="jobs" :title="(job) => job.detail || job.id || 'New schedule'" remove-label="Delete" @remove="jobs.splice($event, 1)">
<template #aside="{ item: job }">
<span v-if="job.next_run" class="text-xs text-fg-subtle">Next run {{ new Date(job.next_run).toLocaleString() }}</span>
<span v-if="job.next_run" class="text-xs text-fg-subtle">Next run <Timestamp :at="job.next_run" absolute /></span>
</template>
<template #default="{ item: job, index: i }">
<SettingRow label="Schedule name" :for="`job-${i}-name`" hint="Used as the task title for scheduled workflows.">
+5 -3
View File
@@ -15,6 +15,7 @@ import {
NumberFieldInput,
} from "@/components/ui/number-field";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { Section } from "@/components/ui/section";
import { SettingRow } from "@/components/ui/setting-row";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import DraftHint from "./DraftHint.vue";
@@ -60,7 +61,7 @@ const labelIssue = computed(() => issue("label"));
</p>
<template v-if="policy">
<h2 class="mb-1 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Dispatch</h2>
<Section title="Dispatch">
<SettingRow label="Trigger">
<div class="flex flex-wrap items-center gap-3">
<ToggleGroup type="single" variant="outline" size="sm" :model-value="policy.dispatch.trigger" aria-label="Trigger" @update:model-value="(value) => { if (value && policy) policy.dispatch.trigger = value as string; }">
@@ -94,8 +95,9 @@ const labelIssue = computed(() => issue("label"));
<DraftHint :kind="KIND" path="dispatch.ack_reaction" />
</div>
</SettingRow>
</Section>
<h2 class="mt-10 mb-1 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">Retries and polling</h2>
<Section title="Retries and polling">
<SettingRow label="Max retries" hint="Then marked dead.">
<div class="flex flex-wrap items-center gap-3">
<NumberField v-model="policy.max_retries" :min="0" class="w-32">
@@ -115,7 +117,7 @@ const labelIssue = computed(() => issue("label"));
</div>
<p v-if="intervalIssue" class="mt-1.5 text-xs text-danger">{{ intervalIssue.message }}</p>
</SettingRow>
</Section>
</template>
</div>
</template>
+13 -24
View File
@@ -11,6 +11,8 @@ import {
SheetHeader,
SheetTitle,
} from "@/components/ui/sheet";
import { Section } from "@/components/ui/section";
import { StatusDot } from "@/components/ui/status-dot";
import { Spinner } from "@/components/ui/spinner";
import { Badge } from "@/components/ui/badge";
import { useSettingsStore } from "@/stores/settings";
@@ -84,11 +86,7 @@ async function save() {
aria-label="Unsaved changes"
>
<div class="flex flex-wrap items-center gap-3 px-4 py-3">
<span
class="size-2 shrink-0 rounded-full"
:class="invalid.length ? 'bg-danger' : 'bg-primary'"
aria-hidden="true"
/>
<StatusDot :tone="invalid.length ? 'danger' : 'warn'" />
<p class="min-w-40 flex-1 text-sm">
<span class="font-medium">{{ count }} unsaved settings {{ count === 1 ? "change" : "changes" }}</span>
<span class="text-fg-subtle"> · {{ sections.map((s) => s.title).join(", ") }}</span>
@@ -123,34 +121,25 @@ async function save() {
role="alert"
>
{{ invalid.length }} invalid {{ invalid.length === 1 ? "field" : "fields" }} must be fixed before saving.</p>
<section
v-for="section in sections"
:key="section.kind"
class="rounded-lg border border-border bg-card"
>
<header class="flex items-center gap-2 border-b border-border px-3 py-2">
<h3 class="flex-1 truncate text-sm font-medium">{{ section.title }}</h3>
<Badge v-if="section.restart" variant="warn">After restart</Badge>
<Button variant="ghost" size="sm" @click="store.resetDraft(section.kind)">Revert</Button>
</header>
<Section v-for="section in sections" :key="section.kind" :title="section.title" class="mb-0">
<template #action>
<div class="flex items-center gap-2">
<Badge v-if="section.restart" variant="warn">After restart</Badge>
<Button variant="ghost" size="sm" @click="store.resetDraft(section.kind)">Revert</Button>
</div>
</template>
<ChangeList
:changes="section.changes"
:label="(path) => fieldLabel(section.kind, path)"
@revert="(change) => store.revertDraftChange(section.kind, change)"
/>
<ul
v-if="section.issues.length"
class="space-y-0.5 border-t border-border px-3 py-2 text-xs text-danger"
role="alert"
>
<ul v-if="section.issues.length" class="mt-2 space-y-0.5 text-xs text-danger" role="alert">
<li v-for="issue in section.issues" :key="issue.path">
<span class="font-medium">{{ issue.label }}</span>: {{ issue.message }}
</li>
</ul>
<p v-if="section.error" class="border-t border-border px-3 py-2 text-sm text-danger" role="alert">
{{ section.error }}
</p>
</section>
<p v-if="section.error" class="mt-2 text-sm text-danger" role="alert">{{ section.error }}</p>
</Section>
</div>
<SheetFooter class="flex-row justify-end gap-2 border-t border-border">
<Button variant="ghost" @click="discardAll">Discard all</Button>
+13 -16
View File
@@ -15,6 +15,7 @@ import {
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Section } from "@/components/ui/section";
import { SettingRow } from "@/components/ui/setting-row";
import { Switch } from "@/components/ui/switch";
import { useOrgStore } from "@/stores/org";
@@ -141,7 +142,6 @@ const allowedText = (id: string) => policyFor(id).allowed.join(", ");
function setAllowed(id: string, text: string) {
setPolicy(id, { allowed: text.split(",").map((ref) => ref.trim()).filter(Boolean) });
}
const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase";
</script>
<template>
@@ -156,13 +156,12 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
</p>
<template v-if="aliases">
<h2 :class="eyebrow">Aliases</h2>
<p v-if="!aliases.default" class="mb-3 text-sm text-warn" role="alert">Set the default alias.</p>
<datalist id="alias-models">
<option v-for="m in modelOptions" :key="m" :value="m" />
</datalist>
<div class="rounded-lg border border-border bg-card">
<div v-for="alias in aliasNames" :key="alias" class="flex flex-wrap items-center gap-3 border-b border-border px-4 py-2.5 last-of-type:border-b-0">
<Section title="Aliases">
<p v-if="!aliases.default" class="mb-3 text-sm text-warn" role="alert">Set the default alias.</p>
<div v-for="alias in aliasNames" :key="alias" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
<label :for="`alias-${alias}`" class="w-28 text-sm font-medium">{{ alias }}</label>
<template v-if="alias === 'embedding'">
<Select :model-value="embeddingProvider" @update:model-value="(v) => setEmbedding(String(v), embeddingModel)">
@@ -199,20 +198,19 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
<Trash2 />
</Button>
</div>
<form class="flex flex-wrap gap-2 border-t border-border px-4 py-3" @submit.prevent="addAlias">
<form class="flex flex-wrap gap-2 border-t border-border pt-3" @submit.prevent="addAlias">
<Input v-model="newAlias" class="max-w-56 font-mono" placeholder="alias" aria-label="New alias" />
<Button type="submit" variant="outline" size="sm" :disabled="!newAlias.trim()"><Plus data-icon="inline-start" />Add alias</Button>
</form>
</div>
</Section>
</template>
<template v-if="policies && otherOrgs.length">
<h2 :class="[eyebrow, 'mt-10']">Org access</h2>
<datalist id="org-allowed">
<option v-for="m in [...providerWildcards, ...modelOptions]" :key="m" :value="m" />
</datalist>
<div class="rounded-lg border border-border bg-card">
<div v-for="o in otherOrgs" :key="o.id" class="flex flex-wrap items-center gap-3 border-b border-border px-4 py-2.5 last-of-type:border-b-0">
<Section title="Org access">
<div v-for="o in otherOrgs" :key="o.id" class="flex flex-wrap items-center gap-3 border-b border-border py-2.5 last-of-type:border-b-0">
<span class="w-28 truncate text-sm font-medium" :title="o.id">{{ o.name }}</span>
<Input
:model-value="allowedText(o.id)"
@@ -227,17 +225,16 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
Own providers</label>
<DraftHint kind="org-model-policy" :path="o.id" />
</div>
</div>
</Section>
</template>
<template v-if="providers">
<h2 :class="[eyebrow, 'mt-10']">Providers</h2>
<datalist id="available-providers">
<option v-for="p in available" :key="p.id" :value="p.id">{{ p.name }}</option>
</datalist>
<div class="rounded-lg border border-border bg-card">
<Section title="Providers">
<Accordion type="multiple">
<AccordionItem v-for="(provider, name) in providers" :key="name" :value="String(name)" class="px-4">
<AccordionItem v-for="(provider, name) in providers" :key="name" :value="String(name)">
<AccordionTrigger class="hover:no-underline">
<span class="flex min-w-0 flex-1 flex-wrap items-center gap-x-3">
<span class="w-28 text-left font-mono text-sm font-medium">{{ name }}</span>
@@ -283,14 +280,14 @@ const eyebrow = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
</AccordionContent>
</AccordionItem>
</Accordion>
<form class="flex flex-wrap items-center gap-2 border-t border-border px-4 py-3" @submit.prevent="addProvider">
<form class="flex flex-wrap items-center gap-2 border-t border-border pt-3" @submit.prevent="addProvider">
<Input v-model="newProvider" list="available-providers" class="max-w-56 font-mono" placeholder="provider" aria-label="New provider" />
<Button type="submit" variant="outline" size="sm" :disabled="!newProvider.trim()"><Plus data-icon="inline-start" />Add provider</Button>
<span v-if="available.length" class="text-xs text-fg-subtle">Available:
<Button v-for="p in available" :key="p.id" type="button" variant="link" size="xs" class="h-auto px-1 font-mono text-fg-subtle" @click="newProvider = p.id; addProvider()">{{ p.id }}</Button>
</span>
</form>
</div>
</Section>
</template>
</div>
</template>
+5 -10
View File
@@ -4,7 +4,7 @@ import { onMounted, onUnmounted } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
import ServicesCard from "./ServicesCard.vue";
import UpdateSettingsCard from "./UpdateSettingsCard.vue";
@@ -24,19 +24,15 @@ onUnmounted(() => clearInterval(timer));
<template>
<PageHeader title="Status" />
<div class="flex flex-col gap-4">
<Alert v-if="config?.reload?.last_error" variant="destructive">
<div>
<Alert v-if="config?.reload?.last_error" variant="destructive" class="mb-4">
<AlertTitle>Configuration reload failed</AlertTitle>
<AlertDescription>{{ config.reload.last_error }}</AlertDescription>
</Alert>
<ServicesCard />
<VersionsCard />
<UpdateSettingsCard />
<Card v-if="config?.bootstrap && Object.keys(config.bootstrap).length">
<CardHeader>
<CardTitle>Startup settings</CardTitle>
</CardHeader>
<CardContent>
<Section v-if="config?.bootstrap && Object.keys(config.bootstrap).length" title="Startup settings">
<Table>
<TableBody>
<TableRow v-for="(reason, key) in config.bootstrap" :key="key">
@@ -45,7 +41,6 @@ onUnmounted(() => clearInterval(timer));
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
</div>
</template>
+23 -15
View File
@@ -17,6 +17,7 @@ import {
InputGroupInput,
InputGroupText,
} from "@/components/ui/input-group";
import { Section } from "@/components/ui/section";
import { SettingRow } from "@/components/ui/setting-row";
import { Switch } from "@/components/ui/switch";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
@@ -85,7 +86,6 @@ watch(
},
);
const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase";
</script>
<template>
@@ -100,8 +100,8 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
</p>
<template v-if="tools">
<h2 :class="eyebrow">MCP servers</h2>
<div class="grid gap-3 border-t border-border pt-4">
<Section title="MCP servers">
<div class="grid gap-3">
<McpServerEditor
v-for="server in shown"
:key="keyOf(server)"
@@ -114,12 +114,15 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
<Plus data-icon="inline-start" /> Add MCP server</Button>
</div>
</div>
</Section>
<div class="mt-10 flex items-center gap-3">
<h2 :class="[eyebrow, 'flex-1']">MiniMax</h2>
<DraftHint :kind="KIND" path="minimax.enabled" />
<Switch v-model="tools.minimax.enabled" aria-label="MiniMax enabled" />
</div>
<Section title="MiniMax">
<template #action>
<div class="flex items-center gap-3">
<DraftHint :kind="KIND" path="minimax.enabled" />
<Switch v-model="tools.minimax.enabled" aria-label="MiniMax enabled" />
</div>
</template>
<SettingRow label="API key">
<SecretRefField
v-model="tools.minimax.api_key_ref"
@@ -131,11 +134,15 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
<SettingRow label="URL" for="minimax-url">
<div class="flex flex-wrap items-center gap-3"><Input id="minimax-url" v-model="tools.minimax.base_url" class="max-w-md font-mono" /><DraftHint :kind="KIND" path="minimax.base_url" /></div>
</SettingRow>
<div class="mt-10 flex items-center gap-3">
<h2 :class="[eyebrow, 'flex-1']">Web fetch</h2>
<DraftHint :kind="KIND" path="web_fetch.enabled" />
<Switch v-model="webFetchOn" aria-label="Web fetch enabled" />
</div>
</Section>
<Section title="Web fetch">
<template #action>
<div class="flex items-center gap-3">
<DraftHint :kind="KIND" path="web_fetch.enabled" />
<Switch v-model="webFetchOn" aria-label="Web fetch enabled" />
</div>
</template>
<SettingRow label="Max download" for="wf-bytes">
<div class="flex flex-wrap items-center gap-3">
<ByteSizeInput id="wf-bytes" v-model="tools.web_fetch.max_bytes" :disabled="!webFetchOn" />
@@ -162,8 +169,9 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
<DraftHint :kind="KIND" path="web_fetch.allow_private_networks" />
</div>
</SettingRow>
</Section>
<h2 :class="[eyebrow, 'mt-10']">Tool output</h2>
<Section title="Tool output">
<SettingRow label="Max result length" for="tp-chars" :hint="`≈ ${Math.round(tools.policy.max_result_chars / 4).toLocaleString()} tokens`">
<div class="flex flex-wrap items-center gap-3">
<InputGroup class="w-48">
@@ -181,7 +189,7 @@ const eyebrow = "text-caption font-medium tracking-[0.06em] text-fg-subtle upper
<DraftHint :kind="KIND" path="policy.spill_dir" />
</div>
</SettingRow>
</Section>
</template>
</div>
</template>
+3 -8
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, onMounted } from "vue";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { Input } from "@/components/ui/input";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { SettingRow } from "@/components/ui/setting-row";
@@ -30,11 +30,7 @@ const channel = computed({
</script>
<template>
<Card v-if="draft">
<CardHeader>
<CardTitle>Updates</CardTitle>
</CardHeader>
<CardContent>
<Section v-if="draft" title="Updates">
<p v-if="error" class="mb-2 text-sm text-danger" role="alert">{{ error }}</p>
<SettingRow label="Release channel">
<div class="flex justify-end">
@@ -48,6 +44,5 @@ const channel = computed({
<Input id="update-pin" v-model="draft.pin" class="max-w-40 font-mono" placeholder="1.48.0" />
</div>
</SettingRow>
</CardContent>
</Card>
</Section>
</template>
+3 -8
View File
@@ -3,7 +3,7 @@ import { computed, onMounted, ref } from "vue";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import {
Table,
TableBody,
@@ -131,11 +131,7 @@ onMounted(load);
<template>
<p v-if="notConfigured" class="text-sm text-fg-muted">Update checks not configured.</p>
<Card v-else>
<CardHeader>
<CardTitle>Versions</CardTitle>
</CardHeader>
<CardContent>
<Section v-else title="Versions">
<p v-if="loadError" class="text-sm text-danger">{{ loadError }}</p>
<p v-else-if="loading" class="text-sm text-fg-muted">Checking…</p>
<template v-else>
@@ -185,6 +181,5 @@ onMounted(load);
{{ installError }}
</p>
</template>
</CardContent>
</Card>
</Section>
</template>
+7 -17
View File
@@ -10,27 +10,18 @@ export interface Skill {
<script setup lang="ts">
import { Badge } from "@/components/ui/badge";
import {
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
/** One catalogue entry: what it is, and where it came from. */
const props = defineProps<{ skill: Skill }>();
</script>
<template>
<Card>
<CardHeader>
<CardTitle>{{ props.skill.name || "Untitled skill" }}</CardTitle>
<CardDescription>{{
props.skill.description || "No description provided."
}}</CardDescription>
</CardHeader>
<CardContent>
<Section
:title="props.skill.name || 'Untitled skill'"
:description="props.skill.description || 'No description provided.'"
class="mb-0"
>
<div class="flex items-center justify-between gap-2">
<span class="text-xs text-fg-subtle">{{
props.skill.source || "Unknown source"
@@ -39,6 +30,5 @@ const props = defineProps<{ skill: Skill }>();
props.skill.workflow
}}</Badge>
</div>
</CardContent>
</Card>
</Section>
</template>
+6 -14
View File
@@ -4,12 +4,7 @@ import { useSettingsStore } from "@/stores/settings";
import { computed, onMounted, ref } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import {
Empty,
EmptyDescription,
@@ -54,18 +49,16 @@ const filtered = computed(() => {
<PageHeader title="Skills" />
<ApplyStatusRows kind="skills" class="mb-4" />
<Card>
<CardHeader>
<CardTitle>Catalogue</CardTitle>
<Section title="Catalogue">
<template #action>
<Input
v-model="search"
type="search"
placeholder="Search skills…"
aria-label="Search skills"
class="max-w-xs"
class="w-56 max-w-full"
/>
</CardHeader>
<CardContent>
</template>
<div
class="grid grid-cols-1 gap-4 lg:grid-cols-[repeat(auto-fit,minmax(340px,1fr))]"
>
@@ -93,7 +86,6 @@ const filtered = computed(() => {
:skill="skill"
/>
</div>
</CardContent>
</Card>
</Section>
</div>
</template>
+3 -5
View File
@@ -5,7 +5,7 @@ import { onMounted, ref } from "vue";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { Input } from "@/components/ui/input";
import {
Table,
@@ -98,8 +98,7 @@ function url(source: Source): string {
<SourceSecret v-if="revealed" :source="revealed" @dismiss="revealed = null" />
<Card v-if="sources && sources.length">
<CardContent>
<Section v-if="sources && sources.length">
<Table>
<TableHeader>
<TableRow>
@@ -220,7 +219,6 @@ function url(source: Source): string {
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
</section>
</template>
+2 -4
View File
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed } from "vue";
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
import ChangeFileTable from "./ChangeFileTable.vue";
import { captureLinks, totalsLabel } from "./changed-files";
@@ -27,9 +27,7 @@ const prNumber = computed(() => props.capture.pr_number);
: "Captured"
}}<span v-if="capture.stage"> in stage {{ capture.stage }}</span>
</span>
<span class="text-xs text-fg-muted">{{
capture.captured_at ? ago(capture.captured_at) : ""
}}</span>
<span v-if="capture.captured_at" class="text-xs text-fg-muted"><Timestamp :at="capture.captured_at" /></span>
</div>
<div
class="mt-2 mb-3 flex flex-wrap items-center gap-3 text-xs text-fg-muted"
+7 -11
View File
@@ -21,6 +21,7 @@ import { statusKind, statusLabel } from "@/lib/task-meta";
import { cn } from "@/lib/utils";
import DispatchLinks from "@/bindings/DispatchLinks.vue";
import { MetadataList } from "@/components/ui/metadata-list";
import { Section } from "@/components/ui/section";
import StartNewRun from "./StartNewRun.vue";
import TaskRowActions from "./TaskRowActions.vue";
import { shownActionIds } from "./task-actions";
@@ -145,25 +146,20 @@ const headerActions = computed(() =>
</div>
</div>
<div v-if="description" class="mt-4">
<h2 class="text-sm font-medium">Description</h2>
<p class="mt-1 whitespace-pre-wrap break-words text-sm text-fg-muted">{{ description }}</p>
</div>
<Section v-if="description" title="Description" class="mt-4 mb-0">
<p class="whitespace-pre-wrap break-words text-sm text-fg-muted">{{ description }}</p>
</Section>
<div
v-if="sections.length || run.attempts?.called_by"
class="mt-3 flex w-fit max-w-full flex-wrap gap-x-10 gap-y-4 rounded-xl bg-card p-4 ring-1 ring-foreground/10"
>
<div v-if="sections.length || run.attempts?.called_by" class="mt-3 flex flex-wrap items-start gap-3">
<p v-if="run.attempts?.called_by" class="text-xs text-fg-subtle">
Called by
<RouterLink :to="`/tasks/${run.attempts.called_by}`" class="font-mono text-fg-muted hover:text-foreground hover:underline"
>task #{{ run.attempts.called_by }}</RouterLink
>
</p>
<section v-for="section in sections" :key="section.title" :aria-label="section.title" class="min-w-0">
<h2 class="mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase">{{ section.title }}</h2>
<Section v-for="section in sections" :key="section.title" :title="section.title" class="mb-0 min-w-0">
<MetadataList :rows="section.rows" class="text-fg-muted" />
</section>
</Section>
</div>
<Alert
+13 -16
View File
@@ -2,12 +2,14 @@
import { computed } from "vue";
import { ArrowUpRight } from "@lucide/vue";
import { ago, compact } from "@/lib/format";
import { compact } from "@/lib/format";
import { cn } from "@/lib/utils";
import { stageStatusMeta } from "./stage-rail";
import { MetadataList } from "@/components/ui/metadata-list";
import { Section } from "@/components/ui/section";
import { StatusDot } from "@/components/ui/status-dot";
import { Timestamp } from "@/components/ui/timestamp";
import StageRail from "./StageRail.vue";
import { STATUS_FILL } from "@/lib/status";
import { useTaskRun } from "./use-task-run";
import { duration } from "./timeline-event";
@@ -16,7 +18,7 @@ import { duration } from "./timeline-event";
const run = useTaskRun();
const attempts = computed(() => [...(run.attempts?.attempts ?? [])].reverse());
const dot = (status?: string) => STATUS_FILL[stageStatusMeta(status).kind];
const tone = (status?: string) => stageStatusMeta(status).kind;
const details = computed(() => {
const task = run.task;
if (!task) return [];
@@ -28,14 +30,11 @@ const details = computed(() => {
if (task.tokens_used) rows.push({ label: "Tokens", value: compact(task.tokens_used), mono: true });
return rows;
});
const panel = "rounded-xl bg-card p-4 ring-1 ring-foreground/10";
const heading = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle uppercase";
</script>
<template>
<aside class="grid gap-4" aria-label="Task details">
<section v-if="attempts.length" :class="panel" aria-labelledby="rail-attempts">
<h2 id="rail-attempts" :class="heading">Attempts</h2>
<Section v-if="attempts.length" title="Attempts" class="mb-0">
<ul class="flex flex-col gap-0.5">
<li v-for="a in attempts" :key="a.attempt">
<button
@@ -49,24 +48,22 @@ const heading = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
"
@click="run.selectAttempt(Number(a.attempt))"
>
<span class="size-2 shrink-0 rounded-full" :class="dot(a.status)" aria-hidden="true" />
<StatusDot :tone="tone(a.status)" />
<span class="flex-1">Attempt {{ a.attempt }}</span>
<span class="text-xs text-fg-subtle">{{ a.status ? stageStatusMeta(a.status).label : "" }}</span>
</button>
<p v-if="a.started_at" class="px-3 pb-1 pl-7 text-xs text-fg-subtle">
{{ ago(a.started_at) }}<template v-if="a.duration_ms"> · {{ duration(a.duration_ms) }}</template>
<Timestamp :at="a.started_at" /><template v-if="a.duration_ms"> · {{ duration(a.duration_ms) }}</template>
</p>
</li>
</ul>
</section>
</Section>
<section :class="panel" aria-labelledby="rail-stages">
<h2 id="rail-stages" :class="heading">Stages</h2>
<Section title="Stages" class="mb-0">
<StageRail :state="run.attempts" />
</section>
</Section>
<section v-if="run.task" :class="panel" aria-labelledby="rail-details">
<h2 id="rail-details" :class="heading">Details</h2>
<Section v-if="run.task" title="Details" class="mb-0">
<MetadataList :rows="details">
<template #value="{ row }">
<a v-if="row.href" :href="row.href" target="_blank" rel="noreferrer" class="inline-flex items-center gap-0.5 hover:underline"
@@ -75,6 +72,6 @@ const heading = "mb-2 text-caption font-medium tracking-[0.06em] text-fg-subtle
<template v-else>{{ row.value }}</template>
</template>
</MetadataList>
</section>
</Section>
</aside>
</template>
+2 -1
View File
@@ -46,6 +46,7 @@ import { RouterLink, useRouter } from "vue-router";
import { Badge } from "@/components/ui/badge";
import { TableCell, TableRow } from "@/components/ui/table";
import { Timestamp } from "@/components/ui/timestamp";
import { ago } from "@/lib/format";
import { statusKind, statusLabel } from "@/lib/task-meta";
import TaskRowActions from "./TaskRowActions.vue";
@@ -191,7 +192,7 @@ function open() {
props.task.created_at ? `Created ${ago(props.task.created_at)}` : ''
"
>
{{ ago(props.task.updated_at) }}
<Timestamp :at="props.task.updated_at" />
</TableCell>
<TableCell>
<TaskRowActions :task="props.task" @done="emit('done', $event)" />
+5 -32
View File
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { Ellipsis } from "@lucide/vue";
import { computed, ref } from "vue";
import { useRouter } from "vue-router";
import { RadioGroupItem, RadioGroupRoot } from "reka-ui";
@@ -24,12 +23,8 @@ import {
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { MoreMenu } from "@/components/ui/more-menu";
import { Label } from "@/components/ui/label";
import { Textarea } from "@/components/ui/textarea";
import { api, classifyActionError, type ActionErrorKind } from "@/lib/api";
@@ -133,7 +128,6 @@ const linkControls = computed<Control[]>(() =>
controls.value.filter((c) => c.kind === "link"),
);
const menuOpen = ref(false);
const confirmingMeta = computed(() =>
confirmingId.value ? actionFor(confirmingId.value) : null,
@@ -271,14 +265,6 @@ function submitRetry(currentDefinition = false) {
function onConfirmationOpen(open: boolean) {
if (!open) confirming.value = null;
}
// A menu item must close its menu before the dialog can take focus, so both
// surfaces funnel through the same request() once the menu is down; the
// inFlight disabling and the error handling stay identical either way.
function requestFromMenu(id: string) {
menuOpen.value = false;
request(id);
}
</script>
<template>
@@ -333,30 +319,17 @@ function requestFromMenu(id: string) {
</Button>
</template>
<DropdownMenu v-if="overflowControls.length" v-model:open="menuOpen">
<DropdownMenuTrigger as-child>
<Button
variant="ghost"
size="icon-sm"
aria-label="More actions"
:disabled="inFlight"
@click.stop
>
<Ellipsis :size="14" />
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<span v-if="overflowControls.length" class="contents" @click.stop><MoreMenu label="More actions">
<DropdownMenuItem
v-for="control in overflowControls"
:key="control.id"
:variant="control.kind === 'danger' ? 'destructive' : 'default'"
:disabled="inFlight || (control.id === 'approve' && approveDisabled)"
@click.stop="requestFromMenu(control.id)"
@click.stop="request(control.id)"
>
{{ control.label }}
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</MoreMenu></span>
</div>
<Dialog :open="rereviewOpen" @update:open="onRereviewOpen">
+4 -7
View File
@@ -1,7 +1,8 @@
<script setup lang="ts">
import { computed } from "vue";
import { ago } from "@/lib/format";
import { StatusDot } from "@/components/ui/status-dot";
import { Timestamp } from "@/components/ui/timestamp";
import { describeTimelineEvent } from "./timeline-event";
import type { TaskEvent } from "./task-run";
@@ -21,11 +22,7 @@ const line = computed(() => describeTimelineEvent(props.event));
<template>
<li class="flex items-start gap-3">
<span
class="mt-[5px] size-2 shrink-0 rounded-full"
:class="line.tone === 'warn' ? 'bg-warn' : 'bg-primary'"
aria-hidden="true"
/>
<StatusDot :tone="line.tone === 'warn' ? 'warn' : 'info'" class="mt-2" />
<div>
<div class="text-sm font-medium">{{ line.title }}</div>
<div v-if="line.detail" class="mt-0.5 text-xs text-fg-muted">
@@ -40,7 +37,7 @@ const line = computed(() => describeTimelineEvent(props.event));
>{{ link.label }}</RouterLink
>
</div>
<div class="mt-0.5 text-xs text-fg-subtle">{{ ago(event.at) }}</div>
<div class="mt-0.5 text-xs text-fg-subtle"><Timestamp :at="event.at" /></div>
</div>
</li>
</template>
+2 -5
View File
@@ -5,6 +5,7 @@ import { computed, onMounted, ref, watch } from "vue";
import { ArrowLeft, Braces, Type } from "@lucide/vue";
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog";
import { Timestamp } from "@/components/ui/timestamp";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
@@ -144,10 +145,6 @@ function resolved(name: string): { value?: string; failure?: string } {
return name in values ? { value: shortValue(values[name]) } : {};
}
function when(at?: string): string {
return at ? new Date(at).toLocaleString(undefined, { dateStyle: "short", timeStyle: "short" }) : "";
}
// A mapping another binding also reads is left as it is: the edit gets its own.
function sharedMapping(id?: string): boolean {
return bindings.value.some((b) => b.mapping_id === id && b.id !== props.binding?.id);
@@ -282,7 +279,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
<Select v-if="sourceCaptures.length" :model-value="captureId ?? undefined" @update:model-value="captureId = String($event)">
<SelectTrigger id="bind-capture" size="sm" class="w-full" aria-label="Example event"><SelectValue placeholder="Pick an event" /></SelectTrigger>
<SelectContent>
<SelectItem v-for="c in sourceCaptures" :key="c.id" :value="String(c.id)">#{{ c.id }} · {{ when(c.received_at) }}{{ c.event_type ? "" : " · unidentified" }}</SelectItem>
<SelectItem v-for="c in sourceCaptures" :key="c.id" :value="String(c.id)">#{{ c.id }} · <Timestamp :at="c.received_at" absolute />{{ c.event_type ? "" : " · unidentified" }}</SelectItem>
</SelectContent>
</Select>
<p v-else class="text-xs text-fg-subtle" :title="`Send an event to ${hookURL} and it appears here`">No events</p>
+3 -13
View File
@@ -1,12 +1,7 @@
<script setup lang="ts">
import { computed } from "vue";
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import {
Table,
TableBody,
@@ -27,11 +22,7 @@ const maxMs = computed(() => maxStageMs(props.stages));
</script>
<template>
<Card>
<CardHeader>
<CardTitle>Slowest stages</CardTitle>
</CardHeader>
<CardContent>
<Section title="Slowest stages" class="mb-0">
<Table>
<TableHeader>
<TableRow>
@@ -53,6 +44,5 @@ const maxMs = computed(() => maxStageMs(props.stages));
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
</template>
+3 -13
View File
@@ -1,12 +1,7 @@
<script setup lang="ts">
import { computed } from "vue";
import {
Card,
CardContent,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import {
Empty,
EmptyHeader,
@@ -31,11 +26,7 @@ const rows = computed(() => failingStages(props.stages));
</script>
<template>
<Card>
<CardHeader>
<CardTitle>Most failures</CardTitle>
</CardHeader>
<CardContent>
<Section title="Most failures" class="mb-0">
<Empty v-if="!rows.length">
<EmptyHeader>
<EmptyTitle>No failures recorded</EmptyTitle>
@@ -60,6 +51,5 @@ const rows = computed(() => failingStages(props.stages));
</TableRow>
</TableBody>
</Table>
</CardContent>
</Card>
</Section>
</template>
+4 -4
View File
@@ -117,7 +117,7 @@ const scopedLogs = computed(() => logs.value ? { ...logs.value, entries: (logs.v
<p class="text-xs text-fg-muted">Agent's own report · {{ describeTimelineEvent(report).title }}</p>
</div>
<div v-if="group.tools.length" class="space-y-1">
<h4 class="text-xs font-medium text-fg-muted">Tool calls · {{ group.tools.length }}</h4>
<h4 class="text-caption font-medium uppercase text-fg-muted">Tool calls · {{ group.tools.length }}</h4>
<ol class="divide-y divide-border rounded-md border border-border">
<li v-for="(tool, i) in expanded ? group.tools : group.tools.slice(0, 12)" :key="i" class="px-3 py-2">
<div class="flex justify-between gap-2 text-xs"><span class="font-mono">{{ tool.data?.tool }}</span><span :class="tool.data?.failed ? 'text-danger' : 'text-fg-muted'">{{ tool.data?.failed ? 'Failed' : 'Returned' }}</span></div>
@@ -130,18 +130,18 @@ const scopedLogs = computed(() => logs.value ? { ...logs.value, entries: (logs.v
<p v-else-if="group.agents.length" class="text-xs text-fg-muted">{{ group.agents.reduce((sum, agent) => sum + agent.tokens_used, 0).toLocaleString() }} tokens recorded</p>
</section>
<section v-if="suppressed.length" class="space-y-1">
<h3 class="text-xs font-medium text-fg-muted">Skipped in test run</h3>
<h3 class="text-caption font-medium uppercase text-fg-muted">Skipped in test run</h3>
<ul class="divide-y divide-border rounded-md border border-border">
<li v-for="(event, i) in suppressed" :key="i" class="px-3 py-2 text-xs break-words whitespace-pre-wrap">{{ event.detail }}</li>
</ul>
</section>
<section class="space-y-3">
<h3 class="text-xs font-medium text-fg-muted">Captured changes</h3>
<h3 class="text-caption font-medium uppercase text-fg-muted">Captured changes</h3>
<p v-if="changesError" role="alert" class="text-danger">{{ changesError }}</p>
<ChangeCapture v-for="(capture, i) in captures" :key="i" :capture="capture" :task="task" />
</section>
<section class="space-y-2">
<h3 class="text-xs font-medium text-fg-muted">Log</h3>
<h3 class="text-caption font-medium uppercase text-fg-muted">Log</h3>
<TaskLogs :state="scopedLogs" :attempt="attempt" :filterable="false" />
</section>
</div>
+4 -3
View File
@@ -7,6 +7,7 @@ import { Button } from "@/components/ui/button";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { ago } from "@/lib/format";
import { Timestamp } from "@/components/ui/timestamp";
import { cn } from "@/lib/utils";
import WorkflowCanvas from "./WorkflowCanvas.vue";
import { lineDiff, stepMarks, type WorkflowRevision } from "./workflow-revisions";
@@ -50,7 +51,7 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
<span class="font-mono text-xs text-fg-subtle">v{{ item.version }}</span>
<Badge :variant="CHANGE_VARIANTS[item.change]">{{ item.change }}</Badge>
</span>
<span class="mt-0.5 block truncate text-xs text-fg-muted" :title="item.at">{{ item.actor || "unknown" }} · {{ item.source || "unknown" }} · {{ ago(item.at) }}</span>
<span class="mt-0.5 block truncate text-xs text-fg-muted" :title="item.at">{{ item.actor || "unknown" }} · {{ item.source || "unknown" }} · <Timestamp :at="item.at" /></span>
</button>
</li>
<li v-if="!revisions.length" class="px-3 py-2 text-sm text-fg-muted">{{ error || "No recorded changes" }}</li>
@@ -77,11 +78,11 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
><span class="inline-block w-4 select-none text-fg-subtle">{{ line.kind === "add" ? "+" : line.kind === "del" ? "-" : "" }}</span>{{ line.text }}</span></code></pre>
<div v-else class="grid min-h-0 flex-1 gap-3 max-md:flex-none md:grid-cols-2">
<div class="flex min-h-0 flex-col gap-1">
<span class="text-xs font-medium text-fg-muted">v{{ revision.version }}</span>
<span class="text-caption font-medium uppercase text-fg-muted">v{{ revision.version }}</span>
<div class="min-h-0 flex-1 max-md:h-72 max-md:flex-none"><WorkflowCanvas :yaml="then" :marks="thenMarks" /></div>
</div>
<div class="flex min-h-0 flex-col gap-1">
<span class="text-xs font-medium text-fg-muted">Current</span>
<span class="text-caption font-medium uppercase text-fg-muted">Current</span>
<div class="min-h-0 flex-1 max-md:h-72 max-md:flex-none"><WorkflowCanvas :yaml="current" :marks="nowMarks" /></div>
</div>
</div>
+16 -11
View File
@@ -12,7 +12,10 @@ import {
EmptyTitle,
} from "@/components/ui/empty";
import { Badge } from "@/components/ui/badge";
import { Card } from "@/components/ui/card";
import { Section } from "@/components/ui/section";
import { StatusDot } from "@/components/ui/status-dot";
import { Table, TableBody, TableCell, TableRow } from "@/components/ui/table";
import { Switch } from "@/components/ui/switch";
import { api } from "@/lib/api";
import { delivered } from "@/lib/delivered";
@@ -206,14 +209,14 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
</ul>
</div>
<section v-if="!selected && !loading && store.state.resource && !error" class="min-w-0 rounded-lg border border-border bg-card" aria-label="Workflow">
<Section v-if="!selected && !loading && store.state.resource && !error" class="mb-0 min-w-0" role="region" aria-label="Workflow">
<Empty>
<EmptyHeader>
<EmptyTitle>No workflows</EmptyTitle>
</EmptyHeader>
</Empty>
</section>
<section v-else-if="selected && store.state.resource" class="min-w-0 rounded-lg border border-border bg-card px-3 py-4 sm:px-5 max-md:flex max-md:h-full max-md:min-h-0 max-md:flex-col" aria-label="Workflow">
</Section>
<Card v-else-if="selected && store.state.resource" class="min-w-0 px-3 sm:px-5 max-md:flex max-md:h-full max-md:min-h-0 max-md:flex-col" role="region" aria-label="Workflow">
<!-- Below lg the list is gone: this picks the workflow instead. -->
<header class="mb-2 flex shrink-0 items-center gap-2 lg:hidden">
<div class="min-w-0 flex-1"><WorkflowPicker class="w-full" :value="selected" :workflows="rows" label="Workflow" @pick="selected = $event" /></div>
@@ -251,16 +254,18 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
<EmptyTitle>No runs yet</EmptyTitle>
</EmptyHeader>
</Empty>
<ul v-else class="divide-y divide-border">
<li v-for="t in workflowRuns" :key="t.id" class="flex items-center gap-3 py-2 text-sm">
<RouterLink :to="`/tasks/${t.id}`" class="min-w-0 flex-1 truncate hover:underline">{{ t.title || `Task ${t.id}` }}</RouterLink>
<span class="hidden font-mono text-xs text-fg-subtle sm:block">{{ t.owner && t.repo ? `${t.owner}/${t.repo}${t.issue_url && t.issue_number ? ` #${t.issue_number}` : ""}` : "" }}</span>
<Badge :variant="statusKind(t.status ?? '')">{{ statusLabel(t.status ?? "") }}</Badge>
</li>
</ul>
<Table v-else aria-label="Runs">
<TableBody>
<TableRow v-for="t in workflowRuns" :key="t.id">
<TableCell class="w-full max-w-0 truncate"><RouterLink :to="`/tasks/${t.id}`" class="hover:underline">{{ t.title || `Task ${t.id}` }}</RouterLink></TableCell>
<TableCell class="hidden font-mono text-xs text-fg-subtle sm:table-cell">{{ t.owner && t.repo ? `${t.owner}/${t.repo}${t.issue_url && t.issue_number ? ` #${t.issue_number}` : ""}` : "" }}</TableCell>
<TableCell class="text-right"><Badge :variant="statusKind(t.status ?? '')">{{ statusLabel(t.status ?? "") }}</Badge></TableCell>
</TableRow>
</TableBody>
</Table>
</template>
</WorkflowEditor>
</section>
</Card>
</div>
</div>
</template>