feat(webui): settings lists share a card accordion that opens the new item and blocks adding while unsaved

This commit is contained in:
sam committed 2026-10-13 19:06:01 +11:00
1 parent 30742f9c57
commit b12a58aae6
13 files changed
+176 -130

No files matched your search

+1 -1
View File
@@ -1 +1 @@
import{h as e,n as t,o as n,t as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v,yn as y}from"./PageHeader.js";import{Y as b,o as x}from"./alert.js";import{_ as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`flex items-center justify-between`},E={class:`font-mono text-sm`},D=`agent-profiles`,O=i({__name:`AgentProfilesPage`,setup(i){let O=n();f(O.load);let k=c(()=>O.drafts[D]?.value),A=y(``);function j(){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=``)}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(n,i)=>(u(),_(`div`,null,[s(h,{title:`Agent profiles`},{default:o(()=>[s(r,{kinds:[D]},null,8,[`kinds`])]),_:1}),s(t,{kind:D,class:`mb-4`}),d(O).catalogError||d(O).pageErrorFor(D)?(u(),_(`p`,C,p(d(O).catalogError||d(O).pageErrorFor(D)),1)):l(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:b(j,[`prevent`])},[s(d(e),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`},null,8,[`modelValue`]),s(d(x),{type:`submit`,disabled:!A.value.trim()||!!k.value?.[A.value.trim()]},{default:o(()=>[...i[1]||=[a(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(k.value??{}).length?l(``,!0):(u(),_(`p`,w,`No agent profiles.`)),(u(!0),_(m,null,v(k.value,(t,n)=>(u(),_(`section`,{key:n,class:`mb-6 border-t pt-4`},[g(`div`,T,[g(`h2`,E,p(n),1),s(d(x),{variant:`ghost`,size:`sm`,onClick:e=>delete k.value[n]},{default:o(()=>[...i[2]||=[a(`Remove profile`,-1)]]),_:1},8,[`onClick`])]),s(d(S),{label:`Image`,for:`${n}-image`},{default:o(()=>[s(d(e),{id:`${n}-image`,modelValue:t.image,"onUpdate:modelValue":e=>t.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Kit`,for:`${n}-kit`,hint:`Pinned digest. Used only when Image is empty.`},{default:o(()=>[s(d(e),{id:`${n}-kit`,modelValue:t.kit,"onUpdate:modelValue":e=>t.kit=e,placeholder:`registry/kit@sha256:…`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Adapter`,for:`${n}-adapter`},{default:o(()=>[s(d(e),{id:`${n}-adapter`,modelValue:t.adapter,"onUpdate:modelValue":e=>t.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(S),{label:`Tools`,for:`${n}-tools`,hint:`Comma-separated tool names.`},{default:o(()=>[s(d(e),{id:`${n}-tools`,"model-value":(t.tools??[]).join(`, `),"onUpdate:modelValue":e=>M(t,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]))),128))]))}});export{O as default};
import{b as e,d as t,o as n,s as r,t as i}from"./CardAccordion.js";import{A as a,D as o,Jt as s,O as c,_ as l,b as u,ht as d,kn as f,lt as p,nr as m,t as h,v as g,x as _,yn as v}from"./PageHeader.js";import{X as y,o as b}from"./alert.js";import{_ as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w=`agent-profiles`,T=a({__name:`AgentProfilesPage`,setup(a){let T=t();p(T.load);let E=l(()=>T.drafts[w]?.value),D=v(``),O=v(``),k=l(()=>T.changesFor(w).length>0),A=l(()=>Object.entries(E.value??{}));function j(){if(k.value)return;let e=D.value.trim();if(!e||E.value?.[e])return;let t=T.drafts[w];t&&(t.value||={},t.value[e]={image:``,kit:``,adapter:``,tools:[]},D.value=``,O.value=String(Object.keys(t.value).indexOf(e)))}function M(e,t){e.tools=String(t).split(`,`).map(e=>e.trim()).filter(Boolean)}return(t,a)=>(d(),_(`div`,null,[c(h,{title:`Agent profiles`},{default:s(()=>[c(n,{kinds:[w]},null,8,[`kinds`])]),_:1}),c(r,{kind:w,class:`mb-4`}),f(T).catalogError||f(T).pageErrorFor(w)?(d(),_(`p`,S,m(f(T).catalogError||f(T).pageErrorFor(w)),1)):u(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:y(j,[`prevent`])},[c(f(e),{modelValue:D.value,"onUpdate:modelValue":a[0]||=e=>D.value=e,"aria-label":`Profile name`,placeholder:`Profile name`,class:`max-w-xs`,disabled:k.value},null,8,[`modelValue`,`disabled`]),c(f(b),{type:`submit`,disabled:k.value||!D.value.trim()||!!E.value?.[D.value.trim()]},{default:s(()=>[...a[3]||=[o(`Add profile`,-1)]]),_:1},8,[`disabled`])],32),Object.keys(E.value??{}).length?u(``,!0):(d(),_(`p`,C,`No agent profiles.`)),c(i,{open:O.value,"onUpdate:open":a[1]||=e=>O.value=e,items:A.value,title:([e])=>e,"remove-label":`Remove`,mono:``,onRemove:a[2]||=e=>delete E.value[A.value[e][0]]},{default:s(({item:[t,n]})=>[c(f(x),{label:`Image`,for:`${t}-image`},{default:s(()=>[c(f(e),{id:`${t}-image`,modelValue:n.image,"onUpdate:modelValue":e=>n.image=e,placeholder:`Container image`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),c(f(x),{label:`Kit`,for:`${t}-kit`,hint:`Pinned digest. Used only when Image is empty.`},{default:s(()=>[c(f(e),{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`]),c(f(x),{label:`Adapter`,for:`${t}-adapter`},{default:s(()=>[c(f(e),{id:`${t}-adapter`,modelValue:n.adapter,"onUpdate:modelValue":e=>n.adapter=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),c(f(x),{label:`Tools`,for:`${t}-tools`,hint:`Comma-separated tool names.`},{default:s(()=>[c(f(e),{id:`${t}-tools`,"model-value":(n.tools??[]).join(`, `),"onUpdate:modelValue":e=>M(n,e)},null,8,[`id`,`model-value`,`onUpdate:modelValue`])]),_:2},1032,[`for`])]),_:1},8,[`open`,`items`,`title`])]))}});export{T as default};
+1 -1
View File
@@ -1 +1 @@
import{h as e,n as t,o as n,t as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v}from"./PageHeader.js";import{o as y}from"./alert.js";import{_ as b,g as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w={class:`flex justify-end`},T=`credential-bindings`,E=i({__name:`CredentialBindingsPage`,setup(i){let E=n();f(E.load);let D=c(()=>E.drafts[T]?.value);function O(){let e=E.drafts[T];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}))}return(n,i)=>(u(),_(`div`,null,[s(h,{title:`Credential bindings`},{default:o(()=>[s(r,{kinds:[T]},null,8,[`kinds`]),s(d(y),{onClick:O},{default:o(()=>[...i[0]||=[a(`Add binding`,-1)]]),_:1})]),_:1}),s(t,{kind:T,class:`mb-4`}),d(E).catalogError||d(E).pageErrorFor(T)?(u(),_(`p`,S,p(d(E).catalogError||d(E).pageErrorFor(T)),1)):l(``,!0),D.value?.length?l(``,!0):(u(),_(`p`,C,`No credential bindings.`)),(u(!0),_(m,null,v(D.value,(t,n)=>(u(),_(`section`,{key:n,class:`mb-6 border-t pt-4`},[g(`div`,w,[s(d(y),{variant:`ghost`,size:`sm`,onClick:e=>D.value.splice(n,1)},{default:o(()=>[...i[1]||=[a(`Remove binding`,-1)]]),_:1},8,[`onClick`])]),s(d(b),{label:`Service`,for:`binding-${n}-service`},{default:o(()=>[s(d(e),{id:`binding-${n}-service`,modelValue:t.service,"onUpdate:modelValue":e=>t.service=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(b),{label:`Organisation`,for:`binding-${n}-org`,hint:`Empty uses the default organisation.`},{default:o(()=>[s(d(e),{id:`binding-${n}-org`,modelValue:t.org,"onUpdate:modelValue":e=>t.org=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),s(d(b),{label:`Secret`},{default:o(()=>[s(x,{modelValue:t.secret,"onUpdate:modelValue":e=>t.secret=e,"id-prefix":`binding-${n}-secret`},null,8,[`modelValue`,`onUpdate:modelValue`,`id-prefix`])]),_:2},1024)]))),128))]))}});export{E as default};
import{b as e,d as t,o as n,s as r,t as i}from"./CardAccordion.js";import{A as a,D as o,Jt as s,O as c,_ as l,b as u,ht as d,kn as f,lt as p,nr as m,t as h,x as g,yn as _}from"./PageHeader.js";import{o as v}from"./alert.js";import{_ as y,g as b}from"./index.js";var x={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},S={key:1,class:`text-sm text-fg-muted`},C=`credential-bindings`,w=a({__name:`CredentialBindingsPage`,setup(a){let w=t();p(w.load);let T=l(()=>w.drafts[C]?.value),E=_(``),D=l(()=>w.changesFor(C).length>0);function O(){if(D.value)return;let e=w.drafts[C];e&&(e.value||=[],e.value.push({service:``,org:``,secret:{engine:``,key:``}}),E.value=String(e.value.length-1))}return(t,a)=>(d(),g(`div`,null,[c(h,{title:`Credential bindings`},{default:s(()=>[c(n,{kinds:[C]},null,8,[`kinds`]),c(f(v),{disabled:D.value,onClick:O},{default:s(()=>[...a[2]||=[o(`Add binding`,-1)]]),_:1},8,[`disabled`])]),_:1}),c(r,{kind:C,class:`mb-4`}),f(w).catalogError||f(w).pageErrorFor(C)?(d(),g(`p`,x,m(f(w).catalogError||f(w).pageErrorFor(C)),1)):u(``,!0),T.value?.length?u(``,!0):(d(),g(`p`,S,`No credential bindings.`)),c(i,{open:E.value,"onUpdate:open":a[0]||=e=>E.value=e,items:T.value??[],title:e=>e.service||`New binding`,"remove-label":`Remove`,mono:``,onRemove:a[1]||=e=>T.value.splice(e,1)},{default:s(({item:t,index:n})=>[c(f(y),{label:`Service`,for:`binding-${n}-service`},{default:s(()=>[c(f(e),{id:`binding-${n}-service`,modelValue:t.service,"onUpdate:modelValue":e=>t.service=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),c(f(y),{label:`Organisation`,for:`binding-${n}-org`,hint:`Empty uses the default organisation.`},{default:s(()=>[c(f(e),{id:`binding-${n}-org`,modelValue:t.org,"onUpdate:modelValue":e=>t.org=e},null,8,[`id`,`modelValue`,`onUpdate:modelValue`])]),_:2},1032,[`for`]),c(f(y),{label:`Secret`},{default:s(()=>[c(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{w as default};
-3
View File
@@ -1,3 +0,0 @@
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as ee,Lt as te,M as D,Mn as ne,Mt as re,N as ie,Nn as ae,Nt as oe,O,On as se,Ot as ce,P as le,Pt as ue,Q as de,Qn as fe,Qt as pe,R as me,Rt as he,S as ge,Sn as _e,St as k,T as ve,Tn as ye,Tt as be,U as xe,Ut as A,V as Se,Vt as Ce,W as we,Wt as j,X as Te,Xt as Ee,Y as De,Yt as Oe,Z as ke,Zt as Ae,_ as M,_n as N,_t as je,a as Me,an as Ne,at as Pe,b as Fe,bn as Ie,bt as Le,c as Re,cn as ze,ct as Be,d as Ve,dn as P,dt as He,en as Ue,er as We,et as Ge,f as Ke,fn as qe,ft as Je,g as Ye,gn as Xe,gt as Ze,h as Qe,hn as $e,ht as F,i as et,in as tt,it as nt,j as rt,jt as it,k as at,kn as I,kt as ot,l as st,ln as ct,lt,m as ut,mn as dt,mt as ft,n as pt,nn as mt,nr as ht,nt as L,o as gt,on as _t,ot as vt,p as yt,pn as bt,pt as xt,q as St,qt as Ct,r as wt,rn as Tt,rr as Et,rt as Dt,s as Ot,sn as kt,st as At,tn as jt,tr as Mt,tt as R,u as Nt,un as Pt,ut as Ft,v as It,vn as Lt,vt as Rt,w as zt,wn as Bt,wt as Vt,x as Ht,xn as Ut,xt as Wt,y as z,yn as B,yt as Gt,z as Kt,zt as qt}from"./PageHeader.js";import{A as Jt,B as Yt,C as Xt,D as Zt,E as Qt,F as $t,G as en,H as tn,I as nn,J as rn,K as an,L as on,M as sn,N as cn,O as ln,P as un,R as dn,T as fn,U as pn,V as mn,W as hn,Y as gn,b as _n,d as vn,f as yn,g as bn,i as xn,j as Sn,k as Cn,m as wn,n as Tn,o as En,q as Dn,r as On,t as kn,v as An,w as jn,x as Mn,z as Nn}from"./alert.js";var Pn=Object.defineProperty,Fn=((e,t)=>{let n={};for(var r in e)Pn(n,r,{get:e[r],enumerable:!0});return t||Pn(n,Symbol.toStringTag,{value:`Module`}),n})({BaseTransition:()=>pt,BaseTransitionPropsValidators:()=>wt,Comment:()=>et,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Me,ErrorTypeStrings:()=>gt,Fragment:()=>Ot,KeepAlive:()=>Re,ReactiveEffect:()=>Ue,Static:()=>st,Suspense:()=>Nt,Teleport:()=>Ve,Text:()=>Ke,TrackOpTypes:()=>jt,Transition:()=>Qt,TransitionGroup:()=>Zt,TriggerOpTypes:()=>mt,VueElement:()=>ln,assertNumber:()=>yt,callWithAsyncErrorHandling:()=>ut,callWithErrorHandling:()=>Qe,camelize:()=>ne,capitalize:()=>ae,cloneVNode:()=>Ye,compatUtils:()=>null,compile:()=>In,computed:()=>M,createApp:()=>Cn,createBlock:()=>z,createCommentVNode:()=>Fe,createElementBlock:()=>Ht,createElementVNode:()=>It,createHydrationRenderer:()=>ge,createPropsRestProxy:()=>o,createRenderer:()=>zt,createSSRApp:()=>Jt,createSlots:()=>ve,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>O,customRef:()=>Tt,defineAsyncComponent:()=>at,defineComponent:()=>n,defineCustomElement:()=>Sn,defineEmits:()=>rt,defineExpose:()=>D,defineModel:()=>ie,defineOptions:()=>le,defineProps:()=>h,defineSSRCustomElement:()=>sn,defineSlots:()=>x,devtools:()=>ee,effect:()=>tt,effectScope:()=>Ne,getCurrentInstance:()=>me,getCurrentScope:()=>_t,getCurrentWatcher:()=>kt,getTransitionRawChildren:()=>Kt,guardReactiveProps:()=>i,h:()=>Se,handleError:()=>y,hasInjectionContext:()=>xe,hydrate:()=>cn,hydrateOnIdle:()=>we,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>St,initCustomFormatter:()=>C,initDirectivesForSSR:()=>un,inject:()=>De,isMemoSame:()=>Te,isProxy:()=>ze,isReactive:()=>ct,isReadonly:()=>Pt,isRef:()=>P,isRuntimeOnly:()=>ke,isShallow:()=>qe,isVNode:()=>de,markRaw:()=>bt,mergeDefaults:()=>e,mergeModels:()=>Ge,mergeProps:()=>R,nextTick:()=>L,nodeOps:()=>$t,normalizeClass:()=>fe,normalizeProps:()=>We,normalizeStyle:()=>Mt,onActivated:()=>Dt,onBeforeMount:()=>nt,onBeforeUnmount:()=>Pe,onBeforeUpdate:()=>vt,onDeactivated:()=>At,onErrorCaptured:()=>Be,onMounted:()=>lt,onRenderTracked:()=>Ft,onRenderTriggered:()=>He,onScopeDispose:()=>dt,onServerPrefetch:()=>Je,onUnmounted:()=>xt,onUpdated:()=>ft,onWatcherCleanup:()=>$e,openBlock:()=>F,patchProp:()=>nn,popScopeId:()=>Ze,provide:()=>je,proxyRefs:()=>Xe,pushScopeId:()=>Rt,queuePostFlushCb:()=>Gt,reactive:()=>N,readonly:()=>Lt,ref:()=>B,registerRuntimeCompiler:()=>Le,render:()=>on,renderList:()=>Wt,renderSlot:()=>k,resolveComponent:()=>c,resolveDirective:()=>Vt,resolveDynamicComponent:()=>be,resolveFilter:()=>null,resolveTransitionHooks:()=>m,setBlockTracking:()=>d,setDevtoolsHook:()=>ce,setTransitionHooks:()=>ot,shallowReactive:()=>Ie,shallowReadonly:()=>Ut,shallowRef:()=>_e,ssrContextKey:()=>r,ssrUtils:()=>it,stop:()=>s,toDisplayString:()=>ht,toHandlerKey:()=>Et,toHandlers:()=>re,toRaw:()=>Bt,toRef:()=>ye,toRefs:()=>p,toValue:()=>u,transformVNodeArgs:()=>oe,triggerRef:()=>se,unref:()=>I,useAttrs:()=>ue,useCssModule:()=>dn,useCssVars:()=>Nn,useHost:()=>Yt,useId:()=>g,useModel:()=>S,useSSRContext:()=>te,useShadowRoot:()=>mn,useSlots:()=>he,useTemplateRef:()=>qt,useTransitionState:()=>a,vModelCheckbox:()=>tn,vModelDynamic:()=>pn,vModelRadio:()=>hn,vModelSelect:()=>en,vModelText:()=>an,vShow:()=>Dn,version:()=>Ce,warn:()=>b,watch:()=>A,watchEffect:()=>j,watchPostEffect:()=>v,watchSyncEffect:()=>E,withAsyncContext:()=>Ct,withCtx:()=>w,withLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?Se(t.default({present:o.value})[0],{ref:e=>{let t=U(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),zi=`dismissableLayer.pointerDownOutside`,Bi=`dismissableLayer.focusOutside`;function Vi(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 Hi(e,t){if(!Vi(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=B(!1),i=B(()=>{});return j(a=>{if(!H||!u(n))return;let o=t?.value?.ownerDocument??globalThis.document,s=async n=>{let a=n.target;if(t?.value&&a){if(Hi(t.value,a))o.removeEventListener(`click`,i.value),r.value=!1;else{if(n.target&&!r.value){let t={originalEvent:n};function r(){vr(zi,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:()=>{u(n)&&(r.value=!0)}}}function Wi(e,t,n=!0){let r=B(!1);return j(i=>{if(!H||!u(n))return;let a=t?.value?.ownerDocument??globalThis.document,o=async n=>{if(!t?.value)return;await L(),await L();let i=n.target;t.value&&i&&!Hi(t.value,i)&&n.target&&!r.value&&vr(Bi,e,{originalEvent:n})};a.addEventListener(`focusin`,o),i(()=>a.removeEventListener(`focusin`,o))}),{onFocusCapture:()=>{u(n)&&(r.value=!0)},onBlurCapture:()=>{u(n)&&(r.value=!1)}}}var Gi=N({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ki=n({__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}=W(),o=M(()=>a.value?.ownerDocument??globalThis.document),s=M(()=>Gi.layersRoot),c=M(()=>a.value?Array.from(s.value).indexOf(a.value):-1),l=M(()=>Gi.layersWithOutsidePointerEventsDisabled.size>0),u=M(()=>{let e=Array.from(s.value),[t]=[...Gi.layersWithOutsidePointerEventsDisabled].slice(-1),n=e.indexOf(t);return c.value>=n}),d=Ui(async e=>{let t=[...Gi.branches].some(t=>t?.contains(e.target));n.present&&u.value&&!t&&(r(`pointerDownOutside`,e),r(`interactOutside`,e),await L(),e.defaultPrevented||r(`dismiss`))},a,()=>n.present),f=Wi(e=>{let t=[...Gi.branches].some(t=>t?.contains(e.target));n.present&&!t&&(r(`focusOutside`,e),r(`interactOutside`,e),e.defaultPrevented||r(`dismiss`))},a);return Kr(`Escape`,e=>{n.present&&c.value===s.value.size-1&&(r(`escapeKeyDown`,e),e.defaultPrevented||r(`dismiss`))},{target:()=>o.value?.defaultView??globalThis.window}),A([a,()=>n.disableOutsidePointerEvents,()=>n.present],([e,t,n],r,i)=>{if(e&&n&&t){let t=e.ownerDocument;ii(t,e),Gi.layersWithOutsidePointerEventsDisabled.add(e),i(()=>{Gi.layersWithOutsidePointerEventsDisabled.delete(e),ai(t,e)})}},{immediate:!0}),A([a,()=>n.present],([e,t],n,r)=>{e&&t&&(s.value.add(e),r(()=>{s.value.delete(e)}))},{immediate:!0}),j(e=>{e(()=>{a.value&&(s.value.delete(a.value),Gi.layersWithOutsidePointerEventsDisabled.delete(a.value))})}),(t,n)=>(F(),z(I(wn),{ref:I(i),"as-child":e.asChild,as:e.as,"data-dismissable-layer":``,style:Mt({pointerEvents:l.value?u.value?`auto`:`none`:void 0}),onFocusCapture:I(f).onFocusCapture,onBlurCapture:I(f).onBlurCapture,onPointerdownCapture:I(d).onPointerDownCapture},{default:w(()=>[k(t.$slots,`default`)]),_:3},8,[`as-child`,`as`,`style`,`onFocusCapture`,`onBlurCapture`,`onPointerdownCapture`]))}}),qi=xr(()=>B([]));function Ji(){let e=qi();return{add(t){let n=e.value[0];t!==n&&n?.pause(),e.value=Yi(e.value,t),e.value.unshift(t)},remove(t){e.value=Yi(e.value,t),e.value[0]?.resume()}}}function Yi(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}var Xi=`focusScope.autoFocusOnMount`,Zi=`focusScope.autoFocusOnUnmount`,Qi={bubbles:!1,cancelable:!0};function $i(e,t){let n=t;for(;n;){if(e.contains(n))return!0;n=n.getRootNode().host??null}return!1}function ea(e,{select:t=!1}={}){let n=V();for(let r of e)if(G(r,{select:t}),V()!==n)return!0}function ta(e){let t=na(e);return[ra(t,e),ra(t.reverse(),e)]}function na(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. Line truncated
+1 -1
View File
@@ -1 +1 @@
import{h as e,n as t,o as n,t as r}from"./HistoryLink.js";import{A as i,D as a,Jt as o,O as s,_ as c,b as l,ht as u,kn as d,lt as f,nr as p,s as m,t as h,v as g,x as _,xt as v,yn as y}from"./PageHeader.js";import{Y as b,o as x}from"./alert.js";import{v as S}from"./index.js";var C={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},w={key:1,class:`text-sm text-fg-muted`},T={class:`mb-3 flex items-center justify-between`},E=[`for`],D=`eda-playbooks`,O=i({__name:`PlaybooksPage`,setup(i){let O=n();f(O.load);let k=c(()=>O.drafts[D]?.value),A=y(``);function j(){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=``)}return(n,i)=>(u(),_(`div`,null,[s(h,{title:`Playbooks`},{default:o(()=>[s(r,{kinds:[D]},null,8,[`kinds`])]),_:1}),s(t,{kind:D,class:`mb-4`}),d(O).catalogError||d(O).pageErrorFor(D)?(u(),_(`p`,C,p(d(O).catalogError||d(O).pageErrorFor(D)),1)):l(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:b(j,[`prevent`])},[s(d(e),{modelValue:A.value,"onUpdate:modelValue":i[0]||=e=>A.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`},null,8,[`modelValue`]),s(d(x),{type:`submit`,disabled:!A.value.trim()||k.value?.playbooks.some(e=>e.id===A.value.trim())},{default:o(()=>[...i[1]||=[a(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),k.value?.playbooks.length?l(``,!0):(u(),_(`p`,w,`No playbooks installed.`)),(u(!0),_(m,null,v(k.value?.playbooks,(e,t)=>(u(),_(`section`,{key:t,class:`mb-6 border-t pt-4`},[g(`div`,T,[g(`label`,{for:`playbook-${t}`,class:`font-mono text-sm`},p(e.id),9,E),s(d(x),{variant:`ghost`,size:`sm`,onClick:e=>k.value.playbooks.splice(t,1)},{default:o(()=>[...i[2]||=[a(`Remove playbook`,-1)]]),_:1},8,[`onClick`])]),s(d(S),{id:`playbook-${t}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.id} YAML`,class:`min-h-64 font-mono`,spellcheck:`false`},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`aria-label`])]))),128))]))}});export{O as default};
import{b as e,d as t,o as n,s as r,t as i}from"./CardAccordion.js";import{A as a,D as o,Jt as s,O as c,_ as l,b as u,ht as d,kn as f,lt as p,nr as m,t as h,v as g,x as _,yn as v}from"./PageHeader.js";import{X as y,o as b}from"./alert.js";import{v as x}from"./index.js";var S={key:0,class:`mb-4 text-sm text-destructive`,role:`alert`},C={key:1,class:`text-sm text-fg-muted`},w=`eda-playbooks`,T=a({__name:`PlaybooksPage`,setup(a){let T=t();p(T.load);let E=l(()=>T.drafts[w]?.value),D=v(``),O=v(``),k=l(()=>T.changesFor(w).length>0);function A(){if(k.value)return;let e=D.value.trim();if(!e||E.value?.playbooks.some(t=>t.id===e))return;let t=T.drafts[w];t&&(t.value||={playbooks:[]},t.value.playbooks.push({id:e,yaml:``}),D.value=``,O.value=String(t.value.playbooks.length-1))}return(t,a)=>(d(),_(`div`,null,[c(h,{title:`Playbooks`},{default:s(()=>[c(n,{kinds:[w]},null,8,[`kinds`])]),_:1}),c(r,{kind:w,class:`mb-4`}),f(T).catalogError||f(T).pageErrorFor(w)?(d(),_(`p`,S,m(f(T).catalogError||f(T).pageErrorFor(w)),1)):u(``,!0),g(`form`,{class:`mb-4 flex gap-2`,onSubmit:y(A,[`prevent`])},[c(f(e),{modelValue:D.value,"onUpdate:modelValue":a[0]||=e=>D.value=e,"aria-label":`Playbook ID`,placeholder:`Playbook ID`,class:`max-w-xs`,disabled:k.value},null,8,[`modelValue`,`disabled`]),c(f(b),{type:`submit`,disabled:k.value||!D.value.trim()||E.value?.playbooks.some(e=>e.id===D.value.trim())},{default:s(()=>[...a[3]||=[o(`Add playbook`,-1)]]),_:1},8,[`disabled`])],32),E.value?.playbooks.length?u(``,!0):(d(),_(`p`,C,`No playbooks installed.`)),c(i,{open:O.value,"onUpdate:open":a[1]||=e=>O.value=e,items:E.value?.playbooks??[],title:e=>e.id,"remove-label":`Remove`,mono:``,onRemove:a[2]||=e=>E.value.playbooks.splice(e,1)},{default:s(({item:e,index:t})=>[c(f(x),{id:`playbook-${t}`,modelValue:e.yaml,"onUpdate:modelValue":t=>e.yaml=t,"aria-label":`${e.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{T as default};
+3 -3
View File
@@ -1,3 +1,3 @@
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as _,O as v,Pn as y,Qn as b,R as x,Rn as ee,S as te,Sn as S,St as C,U as w,Un as ne,Ut as T,V as E,Vn as re,Wn as D,Wt as O,Xn as k,Y as ie,Yn as A,Zn as j,_ as M,_n as ae,dn as oe,g as se,ht as N,i as P,ir as ce,jn as le,kn as F,kt as ue,l as de,lt as I,m as fe,mn as pe,mt as me,n as he,nt as ge,on as _e,ot as ve,pt as ye,qn as be,r as xe,rn as Se,s as Ce,tt as we,w as Te,wn as Ee,x as De,xn as Oe,y as ke,yn as Ae,yt as je,z as Me,zn as L}from"./PageHeader.js";var Ne=void 0,Pe=typeof window<`u`&&window.trustedTypes;if(Pe)try{Ne=Pe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Fe=Ne?e=>Ne.createHTML(e):e=>e,Ie=`http://www.w3.org/2000/svg`,Le=`http://www.w3.org/1998/Math/MathML`,R=typeof document<`u`?document:null,Re=R&&R.createElement(`template`),ze={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`?R.createElementNS(Ie,e):t===`mathml`?R.createElementNS(Le,e):n?R.createElement(e,{is:n}):R.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>R.createTextNode(e),createComment:e=>R.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>R.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{Re.innerHTML=Fe(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Re.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]}},z=`transition`,Be=`animation`,Ve=Symbol(`_vtc`),He={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},Ue=y({},xe,He),We=(e=>(e.displayName=`Transition`,e.props=Ue,e))((e,{slots:t})=>E(he,qe(e),t)),Ge=(e,t=[])=>{L(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ke=e=>e?L(e)?e.some(e=>e.length>1):e.length>1:!1;function qe(e){let t={};for(let n in e)n in He||(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,m=Je(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:b,onLeave:x,onLeaveCancelled:ee,onBeforeAppear:te=_,onAppear:S=v,onAppearCancelled:C=b}=t,w=(e,t,n,r)=>{e._enterCancelled=r,V(e,t?u:s),V(e,t?l:o),n&&n()},ne=(e,t)=>{e._isLeaving=!1,V(e,d),V(e,p),V(e,f),t&&t()},T=e=>(t,n)=>{let i=e?S:v,o=()=>w(t,e,n);Ge(i,[t,o]),Xe(()=>{V(t,e?c:a),B(t,e?u:s),Ke(i)||Qe(t,r,h,o)})};return y(t,{onBeforeEnter(e){Ge(_,[e]),B(e,a),B(e,o)},onBeforeAppear(e){Ge(te,[e]),B(e,c),B(e,l)},onEnter:T(!1),onAppear:T(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ne(e,t);B(e,d),e._enterCancelled?(B(e,f),nt(e)):(nt(e),B(e,f)),Xe(()=>{e._isLeaving&&(V(e,d),B(e,p),Ke(x)||Qe(e,r,g,n))}),Ge(x,[e,n])},onEnterCancelled(e){w(e,!1,void 0,!0),Ge(b,[e])},onAppearCancelled(e){w(e,!0,void 0,!0),Ge(C,[e])},onLeaveCancelled(e){ne(e),Ge(ee,[e])}})}function Je(e){if(e==null)return null;if(u(e))return[Ye(e.enter),Ye(e.leave)];{let t=Ye(e);return[t,t]}}function Ye(e){return ce(e)}function B(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Ve]||(e[Ve]=new Set)).add(t)}function V(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Ve];n&&(n.delete(t),n.size||(e[Ve]=void 0))}function Xe(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ze=0;function Qe(e,t,n,r){let i=e._endId=++Ze,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=$e(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 $e(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${z}Delay`),a=r(`${z}Duration`),o=et(i,a),s=r(`${Be}Delay`),c=r(`${Be}Duration`),l=et(s,c),u=null,d=0,f=0;t===z?o>0&&(u=z,d=o,f=a.length):t===Be?l>0&&(u=Be,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?z:Be:null,f=u?u===z?a.length:c.length:0);let p=u===z&&/\b(?:transform|all)(?:,|$)/.test(r(`${z}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function et(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)Line truncated
`))),e[W]=U(i);let a=r||i.props&&i.props.type===`number`;H(e,t?`change`:`input`,t=>{t.target.composing||e[W](on(e.value,n,a))}),(n||a)&&H(e,`change`,()=>{e.value=on(e.value,n,a)}),t||(H(e,`compositionstart`,nn),H(e,`compositionend`,rn),H(e,`change`,rn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[an];delete e[an],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[W](on(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[W]=U(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?j(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},cn={deep:!0,created(e,t,n){e[W]=U(n),H(e,`change`,()=>{let t=e._modelValue,n=mn(e),r=e.checked,i=e[W];if(L(t)){let e=k(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(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(hn(e,r))})},mounted:ln,beforeUpdate(e,t,n){e[W]=U(n),ln(e,t,n)}};function ln(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(L(t))i=k(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=A(t,hn(e,!0))}e.checked!==i&&(e.checked=i)}var un={created(e,{value:t},n){e.checked=A(t,n.props.value),e[W]=U(n),H(e,`change`,()=>{e[W](mn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[W]=U(r),t!==n&&(e.checked=A(t,r.props.value))}},dn={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,H(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?j(mn(e)):mn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?L(i)?t.slice():t:i];try{e[W](i)}finally{ge(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[W]=U(r)},mounted(e,{value:t}){pn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[W]=U(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!fn(t,n[1],n[0]))&&pn(e,t)}};function fn(e,t,n){if(!n||L(e))return A(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function pn(e,t){let n=e.multiple,r=L(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=mn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):k(t,o)>-1}else a.selected=t.has(o)}else if(A(mn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function mn(e){return`_value`in e?e._value:e.value}function hn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var gn={created(e,t,n){vn(e,t,n,null,`created`)},mounted(e,t,n){vn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){vn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){vn(e,t,n,r,`updated`)}};function _n(e,t){switch(e){case`SELECT`:return dn;case`TEXTAREA`:return sn;default:switch(t){case`checkbox`:return cn;case`radio`:return un;default:return sn}}}function vn(e,t,n,r,i){let a=_n(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function yn(){sn.getSSRProps=({value:e})=>({value:e}),un.getSSRProps=({value:e},t)=>{if(t.props&&A(t.props.value,e))return{checked:!0}},cn.getSSRProps=({value:e},t)=>{if(L(e)){if(t.props&&k(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},gn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=_n(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var bn=[`ctrl`,`shift`,`alt`,`meta`],xn={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)=>bn.some(n=>e[`${n}Key`]&&!t.includes(n))},Sn=(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=xn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Cn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},wn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||Cn[e]===r))return e(n)}))},Tn=y({patchProp:Ft},ze),En,Dn=!1;function On(){return En||=Te(Tn)}function kn(){return En=Dn?En:te(Tn),Dn=!0,En}var An=((...e)=>{On().render(...e)}),jn=((...e)=>{kn().hydrate(...e)}),Mn=((...e)=>{let t=On().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Fn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Pn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),Nn=((...e)=>{let t=kn().createApp(...e),{mount: Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ti;function Ei(e){Ti=e}var Di=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Oi(e){let t=e instanceof Di?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 ki(e,t){let n=await fetch(e,t);if(Ti?.(n.status===401),!n.ok)throw new Di(await wi(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Ci,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 ki(e,s);return a?await c.json():void 0}var Ai={secretEngines:()=>$(`/api/secret-engines`),checkSecret:e=>$(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>$(`/api/alerts`),dismissAlert:e=>$(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>$(`/api/identities`),identityCreate:e=>$(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>$(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await ki(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Ci)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Q({limit:e})),eventTypes:e=>$(`/api/event-types`+Q({workspace:e})),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:e=>$(`/api/mappings`+Q({workspace:e})),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:e=>$(`/api/bindings`+Q({workspace:e})),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELLine truncated
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as _,O as v,Pn as y,Qn as b,R as x,Rn as ee,S as te,Sn as S,St as C,U as w,Un as ne,Ut as T,V as E,Vn as re,Wn as D,Wt as O,Xn as k,Y as ie,Yn as A,Zn as j,_ as M,_n as ae,dn as oe,g as se,ht as N,i as P,ir as ce,jn as le,kn as F,kt as ue,l as de,lt as fe,m as pe,mn as me,mt as he,n as ge,nt as _e,on as ve,ot as ye,pt as be,qn as xe,r as Se,rn as Ce,s as we,tt as Te,w as Ee,wn as De,x as Oe,xn as ke,y as Ae,yn as je,yt as Me,z as Ne,zn as I}from"./PageHeader.js";var Pe=void 0,Fe=typeof window<`u`&&window.trustedTypes;if(Fe)try{Pe=Fe.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Ie=Pe?e=>Pe.createHTML(e):e=>e,Le=`http://www.w3.org/2000/svg`,Re=`http://www.w3.org/1998/Math/MathML`,L=typeof document<`u`?document:null,ze=L&&L.createElement(`template`),Be={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`?L.createElementNS(Le,e):t===`mathml`?L.createElementNS(Re,e):n?L.createElement(e,{is:n}):L.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>L.createTextNode(e),createComment:e=>L.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>L.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{ze.innerHTML=Ie(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=ze.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]}},R=`transition`,Ve=`animation`,He=Symbol(`_vtc`),Ue={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},We=y({},Se,Ue),Ge=(e=>(e.displayName=`Transition`,e.props=We,e))((e,{slots:t})=>E(ge,Je(e),t)),Ke=(e,t=[])=>{I(e)?e.forEach(e=>e(...t)):e&&e(...t)},qe=e=>e?I(e)?e.some(e=>e.length>1):e.length>1:!1;function Je(e){let t={};for(let n in e)n in Ue||(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,m=Ye(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:b,onLeave:x,onLeaveCancelled:ee,onBeforeAppear:te=_,onAppear:S=v,onAppearCancelled:C=b}=t,w=(e,t,n,r)=>{e._enterCancelled=r,B(e,t?u:s),B(e,t?l:o),n&&n()},ne=(e,t)=>{e._isLeaving=!1,B(e,d),B(e,p),B(e,f),t&&t()},T=e=>(t,n)=>{let i=e?S:v,o=()=>w(t,e,n);Ke(i,[t,o]),Ze(()=>{B(t,e?c:a),z(t,e?u:s),qe(i)||$e(t,r,h,o)})};return y(t,{onBeforeEnter(e){Ke(_,[e]),z(e,a),z(e,o)},onBeforeAppear(e){Ke(te,[e]),z(e,c),z(e,l)},onEnter:T(!1),onAppear:T(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ne(e,t);z(e,d),e._enterCancelled?(z(e,f),rt(e)):(rt(e),z(e,f)),Ze(()=>{e._isLeaving&&(B(e,d),z(e,p),qe(x)||$e(e,r,g,n))}),Ke(x,[e,n])},onEnterCancelled(e){w(e,!1,void 0,!0),Ke(b,[e])},onAppearCancelled(e){w(e,!0,void 0,!0),Ke(C,[e])},onLeaveCancelled(e){ne(e),Ke(ee,[e])}})}function Ye(e){if(e==null)return null;if(u(e))return[Xe(e.enter),Xe(e.leave)];{let t=Xe(e);return[t,t]}}function Xe(e){return ce(e)}function z(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[He]||(e[He]=new Set)).add(t)}function B(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[He];n&&(n.delete(t),n.size||(e[He]=void 0))}function Ze(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Qe=0;function $e(e,t,n,r){let i=e._endId=++Qe,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=et(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 et(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${R}Delay`),a=r(`${R}Duration`),o=tt(i,a),s=r(`${Ve}Delay`),c=r(`${Ve}Duration`),l=tt(s,c),u=null,d=0,f=0;t===R?o>0&&(u=R,d=o,f=a.length):t===Ve?l>0&&(u=Ve,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?R:Ve:null,f=u?u===R?a.length:c.length:0);let p=u===R&&/\b(?:transform|all)(?:,|$)/.test(r(`${R}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function tt(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,nLine truncated
`))),e[U]=H(i);let a=r||i.props&&i.props.type===`number`;V(e,t?`change`:`input`,t=>{t.target.composing||e[U](sn(e.value,n,a))}),(n||a)&&V(e,`change`,()=>{e.value=sn(e.value,n,a)}),t||(V(e,`compositionstart`,rn),V(e,`compositionend`,an),V(e,`change`,an))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[on];delete e[on],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[U](sn(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[U]=H(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?j(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ln={deep:!0,created(e,t,n){e[U]=H(n),V(e,`change`,()=>{let t=e._modelValue,n=hn(e),r=e.checked,i=e[U];if(I(t)){let e=k(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(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(gn(e,r))})},mounted:un,beforeUpdate(e,t,n){e[U]=H(n),un(e,t,n)}};function un(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(I(t))i=k(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=A(t,gn(e,!0))}e.checked!==i&&(e.checked=i)}var dn={created(e,{value:t},n){e.checked=A(t,n.props.value),e[U]=H(n),V(e,`change`,()=>{e[U](hn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[U]=H(r),t!==n&&(e.checked=A(t,r.props.value))}},fn={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,V(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?j(hn(e)):hn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?I(i)?t.slice():t:i];try{e[U](i)}finally{_e(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[U]=H(r)},mounted(e,{value:t}){mn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[U]=H(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!pn(t,n[1],n[0]))&&mn(e,t)}};function pn(e,t,n){if(!n||I(e))return A(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function mn(e,t){let n=e.multiple,r=I(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=hn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):k(t,o)>-1}else a.selected=t.has(o)}else if(A(hn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function hn(e){return`_value`in e?e._value:e.value}function gn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var _n={created(e,t,n){yn(e,t,n,null,`created`)},mounted(e,t,n){yn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){yn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){yn(e,t,n,r,`updated`)}};function vn(e,t){switch(e){case`SELECT`:return fn;case`TEXTAREA`:return cn;default:switch(t){case`checkbox`:return ln;case`radio`:return dn;default:return cn}}}function yn(e,t,n,r,i){let a=vn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function bn(){cn.getSSRProps=({value:e})=>({value:e}),dn.getSSRProps=({value:e},t)=>{if(t.props&&A(t.props.value,e))return{checked:!0}},ln.getSSRProps=({value:e},t)=>{if(I(e)){if(t.props&&k(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},_n.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=vn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var xn=[`ctrl`,`shift`,`alt`,`meta`],Sn={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)=>xn.some(n=>e[`${n}Key`]&&!t.includes(n))},Cn=(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=Sn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},wn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Tn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||wn[e]===r))return e(n)}))},En=y({patchProp:It},Be),Dn,On=!1;function kn(){return Dn||=Ee(En)}function An(){return Dn=On?Dn:te(En),On=!0,Dn}var jn=((...e)=>{kn().render(...e)}),Mn=((...e)=>{An().hydrate(...e)}),Nn=((...e)=>{let t=kn().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=In(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Fn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),Pn=((...e)=>{let t=An().createApp(...e),{mount: Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ei;function Di(e){Ei=e}var Oi=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function ki(e){let t=e instanceof Oi?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 Ai(e,t){let n=await fetch(e,t);if(Ei?.(n.status===401),!n.ok)throw new Oi(await Ti(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=wi,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 Ai(e,s);return a?await c.json():void 0}var ji={secretEngines:()=>$(`/api/secret-engines`),checkSecret:e=>$(`/api/secret-references/check`,{method:`POST`,body:e}),health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),addOrgMember:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/members`,{method:`POST`,body:t}),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),alerts:()=>$(`/api/alerts`),dismissAlert:e=>$(`/api/alerts/${e}/dismiss`,{method:`POST`,parse:!1}),identities:()=>$(`/api/identities`),identityCreate:e=>$(`/api/identities`,{method:`POST`,body:e}),identityCommand:(e,t,n)=>$(`/api/identities/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`POST`,body:n}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await Ai(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(wi)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Q({limit:e})),eventTypes:e=>$(`/api/event-types`+Q({workspace:e})),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:e=>$(`/api/mappings`+Q({workspace:e})),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:e=>$(`/api/bindings`+Q({workspace:e})),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELLine truncated
+71 -71
View File
@@ -1,68 +1,68 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/HistoryLink.js","assets/PageHeader.js","assets/alert.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as ee,Z as T,_ as te,a as E,b as ne,c as re,d as ie,et as D,f as ae,g as oe,h as O,i as se,j as ce,k as le,l as ue,m as de,n as fe,nt as pe,o as me,p as he,q as ge,r as _e,rt as ve,s as ye,t as be,tt as xe,u as Se,v as Ce,w as we,x as Te,y as Ee,z as De}from"./HistoryLink.js";import{$ as Oe,A as k,B as ke,C as Ae,Ct as je,D as A,Dn as Me,En as Ne,Ft as Pe,It as Fe,Jt as j,Kt as Ie,Mt as Le,O as M,Pt as Re,Qn as N,R as ze,Rt as Be,Sn as Ve,St as P,Tn as He,Tt as Ue,Ut as F,V as We,Wt as Ge,X as Ke,Xt as qe,Y as Je,Zt as Ye,_ as I,_n as Xe,_t as Ze,an as Qe,at as $e,b as L,bn as et,d as tt,dn as nt,er as rt,et as it,ht as R,it as at,kn as z,lt as B,mn as ot,nr as V,nt as st,on as ct,pn as lt,pt as ut,rn as dt,s as H,t as ft,tr as pt,tt as U,v as W,vn as mt,wn as ht,x as G,xt as K,y as q,yn as J,zt as gt}from"./PageHeader.js";import{E as _t,G as vt,J as yt,K as bt,S as xt,T as St,Y as Ct,_ as wt,a as Tt,c as Et,d as Dt,f as Ot,h as kt,i as At,k as jt,l as Mt,m as Nt,n as Pt,o as Y,p as Ft,q as It,r as Lt,s as Rt,t as zt,u as Bt,v as X,w as Z,y as Vt}from"./alert.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 Ht=St({name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]}),Ut=St({name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]}),Wt=St({name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]}),Gt=St({name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]}),Kt=St({name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]}),qt=St({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),Jt=St({name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]}),Yt=St({name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]}),Xt=St({name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]}),Zt=St({name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]}),Qt=St({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),$t=St({name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]}),en=St({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}),tn=St({name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]}),nn=St({name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}),rn=St({name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]}),an=St({name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),on=St({name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 Line truncated
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/CardAccordion.js","assets/PageHeader.js","assets/alert.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,O as h,P as g,Q as _,R as v,S as y,T as b,U as x,V as S,W as C,X as w,Y as ee,Z as T,_ as te,_t as E,a as ne,at as re,b as D,c as ie,ct as ae,d as O,dt as oe,et as se,f as ce,ft as le,g as ue,gt as de,h as fe,ht as pe,i as me,it as he,j as ge,k as _e,l as ve,lt as ye,m as be,mt as xe,n as Se,nt as Ce,o as we,ot as Te,p as Ee,pt as De,q as Oe,r as ke,rt as Ae,s as je,st as Me,t as Ne,tt as Pe,u as Fe,ut as Ie,v as Le,vt as Re,w as ze,x as Be,y as Ve,z as He}from"./CardAccordion.js";import{$ as Ue,A as k,B as We,C as Ge,Ct as Ke,D as A,Dn as qe,En as Je,Ft as Ye,It as Xe,Jt as j,Kt as Ze,Mt as Qe,O as M,Pt as $e,Qn as N,R as et,Rt as tt,Sn as nt,St as P,Tn as rt,Tt as it,Ut as F,V as at,Wt as ot,X as st,Xt as ct,Y as lt,Zt as ut,_ as I,_n as dt,_t as ft,an as pt,at as mt,b as L,bn as ht,d as gt,dn as _t,er as vt,et as yt,ht as R,it as bt,kn as z,lt as B,mn as xt,nr as V,nt as St,on as Ct,pn as wt,pt as Tt,rn as Et,s as H,t as Dt,tr as Ot,tt as U,v as W,vn as kt,wn as At,x as G,xt as K,y as q,yn as J,zt as jt}from"./PageHeader.js";import{A as Mt,D as Nt,E as Pt,J as Ft,K as It,S as Lt,T as Rt,X as zt,Y as Bt,_ as Vt,a as Ht,c as Ut,d as Wt,f as Gt,h as Kt,i as qt,l as Jt,m as Yt,n as Xt,o as Y,p as Zt,q as Qt,r as $t,s as en,t as tn,u as nn,v as X,w as Z,y as rn}from"./alert.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 an=Pt({name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]}),on=Pt({name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]}),sn=Pt({name:`arrow-up-down`,size:24,node:[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]}),cn=Pt({name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]}),ln=Pt({name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]}),un=Pt({name:`bell`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]}),dn=Pt({name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]}),fn=Pt({name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]}),pn=Pt({name:`braces`,size:24,node:[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]],aliases:[`curly-braces`]}),mn=Pt({name:`calendar-clock`,size:24,node:[[`path`,{d:`M16 14v2.2l1.6 1`,key:`fo4ql5`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`path`,{d:`M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338`,key:`7hb8p4`}],[`path`,{d:`M3 9h5.859`,key:`numkqi`}],[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`circle`,{cx:`16`,cy:`16`,r:`6`,key:`qoo3c4`}]]}),hn=Pt({name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]}),gn=Pt({name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]}),_n=Pt({name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]}),vn=Pt({name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]}),yn=Pt({name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]}),bn=Pt({name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 Line truncated
`);d=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&&(fr.value=n.session_id),n.type===`delta`&&(o+=n.text,_r.value=_r.value?{..._r.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],_r.value=_r.value?{..._r.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),_r.value=_r.value?{..._r.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`);pr.value=[...pr.value,{from:`assistant`,text:o,tool_calls:a}],_r.value=null,hr.value=`Ready`,await Mr()}catch(e){let t=e;t.name===`AbortError`&&!c?(_r.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},hr.value=`Stopped`):(_r.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?ar(r):void 0,isRetry:i},hr.value=`Error. Retry available.`)}finally{clearTimeout(l),lr=null,Ar=null,gr.value=!1}}function Gr(){hr.value=`Stopping…`,fr.value&&X.chatCancel(fr.value).catch(()=>{}),jr()}function Kr(){B(()=>{Mr().catch(e=>{hr.value=e.message||`Chat unavailable`})}),ut(()=>{jr()})}async function qr(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 Wr({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var Jr=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Yr=k({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return Z(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(R(),G(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":z(sr),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:N(r(!e.open))},[M(z(bn),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:N(r(e.open))},[M(z(Yn),{size:22})],2)],8,Jr))}});function Xr(e){return typeof e==`string`?`'${e}'`:new ei().serialize(e)}var Zr=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Qr=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Zr.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function $r(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Qr[n]?Qr[n]:n+128,s=a<128&&Qr[a]?Qr[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var ei=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?$r(e,t):n===`number`&&r===`number`?e-t:$r(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort($r),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$ArrayLine truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Tr.value=n.session_id),n.type===`delta`&&(o+=n.text,Ar.value=Ar.value?{...Ar.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Ar.value=Ar.value?{...Ar.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Ar.value=Ar.value?{...Ar.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`);Er.value=[...Er.value,{from:`assistant`,text:o,tool_calls:a}],Ar.value=null,Or.value=`Ready`,await Gr()}catch(e){let t=e;t.name===`AbortError`&&!c?(Ar.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Or.value=`Stopped`):(Ar.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?vr(r):void 0,isRetry:i},Or.value=`Error. Retry available.`)}finally{clearTimeout(l),Sr=null,Ur=null,kr.value=!1}}function ii(){Or.value=`Stopping…`,Tr.value&&X.chatCancel(Tr.value).catch(()=>{}),Wr()}function ai(){B(()=>{Gr().catch(e=>{Or.value=e.message||`Chat unavailable`})}),Tt(()=>{Wr()})}async function oi(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 ri({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var si=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],ci=k({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return Z(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(R(),G(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":z(br),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:N(r(!e.open))},[M(z(Pn),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:N(r(e.open))},[M(z(cr),{size:22})],2)],8,si))}});function li(e,t,n){let r=e.findIndex(e=>De(e,t)),i=e.findIndex(e=>De(e,n));if(r===-1||i===-1)return[];let[a,o]=[r,i].sort((e,t)=>e-t);return e.slice(a,o+1)}function ui(e,t=-1/0,n=1/0){return Math.min(n,Math.max(t,e))}function di(e,t){let n=e,r=t.toString(),i=r.indexOf(`.`),a=i>=0?r.length-i:0;if(a>0){let e=10**a;n=Math.round(n*e)/e}return n}function fi(e,t,n,r){t=Number(t),n=Number(n);let i=(e-(Number.isNaN(t)?0:t))%r,a=di(Math.abs(i)*2>=r?e+Math.sign(i)*(r-Math.abs(i)):e-i,r);return Number.isNaN(t)?!Number.isNaN(n)&&a>n&&(a=Math.floor(di(n/r,r))*r):a<t?a=t:!Number.isNaN(n)&&a>n&&(a=t+Math.floor(di((n-t)/r,r))*r),a=di(a,r),a}var pi=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Bopomofo}]/u,mi=/android/i;function hi(){return typeof navigator<`u`&&mi.test(navigator.userAgent)}function gi(e){let t=J(!1),n=J(!0),r=J(!1),i=I(()=>t.value&&n.value);function a(){t.value=!0,n.value=!0,r.value=!1}function o(e){e.data&&(pi.test(e.data)?(n.value=!0,r.value=!0):hi()&&!r.value&&(n.value=!1))}function s(n){St(()=>{t.value=!1,e?.(n)})}return{isComposing:t,shouldDeferInput:i,handleCompositionStart:a,handleCompositionUpdate:o,handleCompositionEnd:s}}function _i(e){let t=I(()=>z(e)),n=I(()=>new Intl.Collator(`en`,{usage:`search`,...t.value}));return{startsWith:(e,t)=>t.length===0||(e=e.normalize(`NFC`),t=t.normalize(`NFC`),n.value.compare(e.slice(0,t.length),t)===0),endsWith:(e,t)=>t.length===0||(e=e.normalize(`NFC`),t=t.normalize(`NFC`),n.value.compare(e.slice(-t.length),t)===0),contains:(e,t)=>{if(t.length===0)return!0;if(e=e.normalize(`NFC`),t=t.normalize(`NFC`),t.length>e.length)return!1;let r=n.value.compare;if(e.includes(t))return!0;let i=t.length;for(let n=0;n+i<=e.length;n++)if(r(t,e.slice(n,n+i))===0)return!0;return!1}}}function vi(e){return I(()=>!qe(e)||!!ee(e)?.closest(`form`))}function yi(){let e=et()?.vnode?.scopeId;return e?{[e]:``}:{}}function bi(e,t){let n=re(!1,300);Te(()=>{n.value=!1});let r=J(null),i=se();function a(){r.value=null,n.value=!1}function o(e,t){if(!t)return;let i=e.currentTarget,a={x:e.clientX,y:e.clientY},o=Si(a,xi(a,i.getBoundingClientRect()),1),s=Ci(t.getBoundingClientRect()),c=Ti([...o,...s]);r.value=c,n.value=!0}return ot(n=>{if(e.value&&t.value){let r=e.value,i=t.value,a=e=>o(e,i),s=e=>o(e,r);r.addEventListener(`pointerleave`,a),i.addEventListener(`pointerleave`,s),n(()=>{r.removeEventListener(`pointerleave`,a),i.removeEventListener(`pointerleave`,s)})}}),ot(n=>{if(r.value){let o=n=>{if(!r.value||!(n.target instanceof Element))return;let o=n.target,s={x:n.clientX,y:n. Line truncated
- a positive number
- less than the value passed to \`max\` (or ${Ys} if no \`max\` prop is set)
- less than the value passed to \`max\` (or ${Ms} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`),null)}function ec(e){return Qs(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ys}\`.`),Ys)}var tc=k({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:Ys},getValueLabel:{type:Function,required:!1,default:(e,t)=>Qs(e)?`${Math.round(e/t*Ys)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;p();let i=x(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=x(n,`max`,r,{passive:n.max===void 0});F(()=>i.value,async e=>{let t=$s(e,n.max);t!==e&&(await st(),i.value=t)},{immediate:!0}),F(()=>n.max,e=>{let t=ec(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=I(()=>oi(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return Zs({modelValue:i,max:a,progressState:o}),(t,n)=>(R(),q(z(Nt),{"as-child":e.asChild,as:e.as,"aria-valuemax":z(a),"aria-valuemin":0,"aria-valuenow":Qs(z(i))?z(i):void 0,"aria-valuetext":e.getValueText?.(z(i),z(a)),"aria-label":e.getValueLabel(z(i),z(a)),role:`progressbar`,"data-state":o.value,"data-value":z(i)??void 0,"data-max":z(a)},{default:j(()=>[P(t.$slots,`default`,{modelValue:z(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),nc=k({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Xs();return p(),(e,r)=>(R(),q(z(Nt),U(t,{"data-state":z(n).progressState.value,"data-value":z(n).modelValue?.value??void 0,"data-max":z(n).max.value}),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),rc=`radio.select`;function ic(e,t,n){_(rc,n,{originalEvent:e,value:t})}var ac=k({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=x(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=Ne(n),{forwardRef:o,currentElement:s}=p(),c=gi(s),l=_i(),u=I(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||ic(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(t,n)=>(R(),G(H,null,[M(z(Nt),U({id:e.id,ref:z(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":z(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":z(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:z(a),required:e.required,name:e.name},{...z(l),...t.$attrs},{onClick:Ct(d,[`stop`])}),{default:j(()=>[P(t.$slots,`default`,{checked:z(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),z(c)&&e.name?(R(),q(z(Ra),U({key:0,type:`radio`,tabindex:`-1`,value:z(a),checked:!!z(i),name:e.name,disabled:e.disabled,required:e.required},z(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):L(`v-if`,!0)],64))}}),[oc,sc]=D(`RadioGroupRoot`),cc=k({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=p(),s=x(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:c,loop:l,orientation:u,name:d,required:f,dir:m}=Ne(n),h=o(m),g=gi(a);return sc({modelValue:s,changeModelValue:e=>{s.value=e},disabled:c,loop:l,orientation:u,name:d?.value,required:f}),(t,n)=>(R(),q(z(So),{"as-child":``,orientation:z(u),dir:z(h),loop:z(l)},{default:j(()=>[M(z(Nt),{ref:z(i),role:`radiogroup`,"data-disabled":z(c)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":z(u),"aria-required":z(f),dir:z(h)},{default:j(()=>[P(t.$slots,`default`,{modelValue:z(s)}),z(g)&&z(d)?(R(),q(z(Ra),{key:0,required:z(f),disabled:z(c),value:z(s),name:z(d)},null,8,[`required`,`disabled`,`value`,`name`])):L(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[lc,uc]=D(`RadioGroupItem`),dc=k({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,requirLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Nd(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Nd(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=Fd(c),u=e+1<n.length?Fd(n[e+1]):null;if(l&&u&&Id(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Fd(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Nd(e)),rows:r.map(e=>e.map(e=>Nd(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:Nd(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:Nd(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Fd(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 Id(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Ld={class:`[overflow-wrap:anywhere]`},Rd={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},zd={class:`font-mono text-[0.85em]`},Bd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Vd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Hd={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Ud={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Wd={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Gd={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Kd={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},qd={key:8,class:`mb-2.5 last:mb-0`},Jd=k({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=I(()=>Pd(t.text));return(e,t)=>(R(),G(`div`,Ld,[(R(!0),G(H,null,K(n.value,(e,t)=>(R(),G(H,{key:t},[e.kind===`pre`?(R(),G(`pre`,Rd,[W(`code`,zd,V(e.code),1)])):e.kind===`table`?(R(),G(`table`,Bd,[W(`thead`,null,[W(`tr`,null,[(R(!0),G(H,null,K(e.head,(e,t)=>(R(),G(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[M(jd,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(R(!0),G(H,null,K(e.rows,(e,t)=>(R(),G(`tr`,{key:t},[(R(!0),G(H,null,K(e,(e,t)=>(R(),G(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[M(jd,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(R(),G(`blockquote`,Vd,[M(jd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(R(),G(`h1`,Hd,[M(jd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(R(),G(`h2`,Ud,[M(jd,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(R(),G(`h3`,Wd,[M(jd,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(R(),G(`ul`,Gd,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(jd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(R(),G(`ol`,Kd,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(jd,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(R(),G(`p`,qd,[M(jd,{inline:e.inline},null,8,[`inline`])])):L(``,!0)],64))),128))]))}}),Yd={class:`truncate`},Xd=k({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=je(`RouterLink`);return R(),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:j(()=>[M(z(Gt),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Yd,V(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Zd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Qd={class:`font-semibold text-foreground`},$d={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},ef=k({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=I(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=I(()=>t.tool.parameters||t.tool.Parameters||``),i=I(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=I(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(R(),q(Xd,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(R(),G(`div`,Zd,[M(z(Jn),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Qd,V(n.value),1),r.value?(R(),G(`code`,$d,V(r.value),1)):L(``,!0),W(`span`,{class:N(z(Z)(`text-fg-muted`,i.value&&`text-danger`))},V(a.value),3)]))}}),tf={key:0,class:`mb-2 grid gap-0.5 text-xs`},nf={key:1,class:`mb-2 flex flex-wrap gap-1.5`},rf={key:3,class:`whitespace-pre-wrap`},af=k({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(R(),G(`div`,{class:N([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:N(z(Z)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(R(),G(`div`,tf,[(R(!0),G(H,null,K(e.tools,(t,n)=>(R(),q(ef,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):L(``,!0),e.media.length?(R(),G(`div`,nf,[(R(!0),G(H,null,K(e.media,(e,t)=>(R(),q(wd,{key:t,attachment:e},null,8,[`attachment`]))),128))])):L(``,!0),e.assistant?(R(),q(Jd,{key:2,text:e.text},null,8,[`text`])):(R(),G(`div`,rf,V(e.text),1)),P(t.$slots,`default`)],2)],2))}}),of={class:`text-sm`},sf={class:`font-medium`},cf={key:0,class:`mt-1 text-fg-muted`},lf={key:1,class:`mt-2 flex flex-wrap gap-2`},uf=k({__name:`ChatChooLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Z_?`${n.slice(0,Z_).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}function $_(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function ev(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 tv(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function nv(e){return typeof e==`string`?e:``}function rv(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=ev(t.duration_ms),i=[r,e&&`ran for ${e}`].filter(Boolean).join(` · `);return{title:t.interrupted?`Stage interrupted: ${n}`:t.skipped?`Skipped stage: ${n}`:t.error?`Stage failed: ${n}`:`Finished stage: ${n}`,detail:[i,nv(t.error),nv(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:[nv(t.previous_stage)&&`after ${nv(t.previous_stage)}`,nv(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=tv(t.iterations),i=tv(t.tokens),a=Number(t.cached_tokens)||0,o=tv((Number(t.prompt_tokens)||0)-a),s=tv(t.completion_tokens),c=tv(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,nv(t.model)].filter(Boolean);return{title:`Agent ${nv(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=nv(t.author);return{title:`Remediation ${nv(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${nv(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=nv(t.pr_number);return{title:`Pull request approved`,detail:[nv(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${nv(t.attempt)} of ${nv(t.of)} failed: ${e.stage||`step`}`,detail:nv(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=nv(t.source),n=nv(t.capture_id),r=[{label:`binding ${nv(t.binding_name)||nv(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 ${nv(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:$_(e.kind||e.type),detail:e.detail||``}}var iv=[`title`],av=k({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=e_(),a=I(()=>i.taskIDFor(n.event)),o=I(()=>Q_(n.event));function s(){a.value>0&&r(`open`,a.value)}let c=I(()=>n.event.at?Ng(n.event.at):`—`);return(e,t)=>(R(),q(z(Y_),{class:N(a.value>0?`cursor-pointer`:``),role:a.value>0?`link`:void 0,tabindex:a.value>0?0:void 0,title:a.value>0?`Open task details`:void 0,onClick:s,onKeydown:[yt(Ct(s,[`prevent`]),[`enter`]),yt(Ct(s,[`prevent`]),[`space`])]},{default:j(()=>[M(z(Q),{class:`font-medium`},{default:j(()=>[A(V(z(rv)({...n.event,at:void 0,detail:void 0}).title),1)]),_:1}),M(z(Q),{class:`font-mono`},{default:j(()=>[A(V(a.value>0?`#${a.value}`:`—`),1)]),_:1}),M(z(Q),{class:`w-[55%] max-w-0`},{default:j(()=>[W(`span`,{class:`block truncate`,title:o.value.truncated?o.value.full:void 0},V(o.value.text),9,iv)]),_:1}),M(z(Q),null,{default:j(()=>[A(V(c.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),ov=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function sv(e){return(Number(e?.task_id)||0)>0}function cv(e,t){return t===`tasks`?sv(e):t!==`system`||!sv(e)}function lv(e,t){return e.filter(e=>cv(e,t))}function uv(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function dv(e,t){return`${e}:${t??0}`}function fv(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=dv(Q_(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 pv={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},mv={class:`max-h-[28rem] overflow-y-auto`},hv=[`aria-expanded`,`aria-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 Cy(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 wy(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 Ty(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 Ey(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 Dy=J([]),Oy=J([]),ky=J(!0),Ay=J(null),jy=J(null),My=J(!1),Ny=J(null);async function Py(){try{let e=await X.eventTypes(xy().workspace);ky.value=e.enabled!==!1,Dy.value=e.event_types||[],Oy.value=e.proposals||[],Ay.value=null}catch(e){Ay.value=e.message||String(e)}}function Fy(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Iy(e){Ny.value=null,jy.value=e}function Ly(e){let t=Gy.value.find(t=>String(t.id)===e.sample_id);Iy({mode:`proposal`,id:null,source:e.source,name:``,rule:Fy(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Ry(e=``){Iy({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function zy(e){Iy({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:Fy(e.rule),headersText:``,body:``,exampleHeaders:{}})}function By(){jy.value=null}async function Vy(){let e=jy.value;if(e){My.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:Ey(e.rule)});else{let t=e.mode===`paste`?Sy(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:Ey(e.rule),example:{headers:t,body:e.body}})}jy.value=null,await Py()}catch(e){Ny.value=e.message||String(e)}finally{My.value=!1}}}var Hy=J(null);async function Uy(){let e=Hy.value;if(Hy.value=null,e)try{await X.eventTypeDelete(e.id),await Py()}catch(e){Ay.value=e.message||String(e)}}var Wy=100,Gy=J([]),Ky=J(!0),qy=J(null),Jy=J(!0),Yy=J(null);async function Xy(){try{let e=await X.captures(Wy);Ky.value=e.enabled!==!1,Gy.value=e.captures||[],qy.value=null}catch(e){qy.value=e.message||String(e)}finally{Jy.value=!1}}function Zy(e){let t=Gy.value.find(t=>t.id===e);return t&&(Yy.value=t),!!t}function Qy(){Gy.value.length&&(Yy.value=Gy.value[0])}function $y(){he(`captures`,()=>{Xy(),Py()})}var eb=k({__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:n}){let r=e,i=n,a=Ot(r,`class`),o=t(a,i);return(e,t)=>(R(),q(z(tl),U({"data-slot":`tabs`,"data-orientation":z(o).orientation||`horizontal`},z(o),{class:z(Z)(`gap-2 group/tabs flex data-horizontal:flex-col`,r.class)}),{default:j(t=>[P(e.$slots,`default`,rt(ke(t)))]),_:3},16,[`data-orientation`,`class`]))}}),tb=k({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ot(t,`class`);return(e,r)=>(R(),q(z(il),U({"data-slot":`tabs-content`,class:z(Z)(`text-sm flex-1 outline-none`,t.class)},z(n)),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`class`]))}}),nb=k({__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=Ot(t,`class`,`variant`);return(r,i)=>(R(),q(z(al),U({"data-slot":`tabs-list`,"data-variant":e.variant},z(n),{class:z(Z)(z(ib)({variant:e.variant}),t.class)}),{default:j(()=>[P(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),rb=k({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Ot(t,`class`),r=ce(n);return(e,n)=>(R(),q(z(ol),U({"data-slot":`tabs-trigger`,class:z(Z)(`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:outline-ring disabled:pointerLine truncated
`)}};jL.defaultYaml={explicit:!1,version:`1.2`},jL.defaultTags={"!!":`tag:yaml.org,2002:`};function ML(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 NL(e){let t=new Set;return wL(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function PL(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function FL(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=NL(e);let a=PL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(gL(t.node)||vL(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 IL(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=IL(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=IL(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=IL(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=IL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function LL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>LL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!bL(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 RL=class{constructor(e){Object.defineProperty(this,dL,{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(!pL(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=LL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?IL(i,{"":o},``,o):o}},zL=class extends RL{constructor(e){super(aL),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=[],wL(e,{Node:(e,t)=>{(fL(t)||bL(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||=(LL(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=BL(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(ML(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 BL(e,t,n){if(fL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(vL(t)){let r=0;for(let i of t.items){let t=BL(e,i,n);t>r&&(r=t)}return r}if(hL(t)){let r=BL(e,t.key,n),i=BL(e,t.value,n);return Math.max(r,i)}return 1}var VL=e=>!e||typeof e!=`function`&&typeof e!=`object`,HL=class extends RL{constructor(e){super(lL),this.value=e}toJSON(e,t){return t?.keep?this.value:LL(this.value,e,t)}toString(){return String(this.value)}};HL.BLOCK_FOLDED=`BLOCK_FOLDED`,HL.BLOCK_LITERAL=`BLOCK_LITERAL`,HL.PLAIN=`PLAIN`,HL.QUOTE_DOUBLE=`QUOTE_DOUBLE`,HL.QUOTE_SINGLE=`QUOTE_SINGLE`;var UL=`tag:yaml.org,2002:`;function WL(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 GL(e,t,n){if(pL(e)&&(e=e.contents),yL(e))return e;if(hL(e)){let t=n.schema[sL].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 zL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=UL+t.slice(2));let l=WL(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new HL(e);return c&&(c.node=t),t Line truncated
`)?XL(n,t):n.includes(`
Defaulting to \`null\`.`),null)}function Ls(e){return Fs(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ms}\`.`),Ms)}var Rs=k({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:Ms},getValueLabel:{type:Function,required:!1,default:(e,t)=>Fs(e)?`${Math.round(e/t*Ms)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(t,{emit:n}){let r=t,i=n;S();let a=e(r,`modelValue`,i,{passive:r.modelValue===void 0}),o=e(r,`max`,i,{passive:r.max===void 0});F(()=>a.value,async e=>{let t=Is(e,r.max);t!==e&&(await St(),a.value=t)},{immediate:!0}),F(()=>r.max,e=>{let t=Ls(r.max);t!==e&&(o.value=t)},{immediate:!0});let s=I(()=>ye(a.value)?`indeterminate`:a.value===o.value?`complete`:`loading`);return Ps({modelValue:a,max:o,progressState:s}),(e,n)=>(R(),q(z(Yt),{"as-child":t.asChild,as:t.as,"aria-valuemax":z(o),"aria-valuemin":0,"aria-valuenow":Fs(z(a))?z(a):void 0,"aria-valuetext":t.getValueText?.(z(a),z(o)),"aria-label":t.getValueLabel(z(a),z(o)),role:`progressbar`,"data-state":s.value,"data-value":z(a)??void 0,"data-max":z(o)},{default:j(()=>[P(e.$slots,`default`,{modelValue:z(a)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),zs=k({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=Ns();return S(),(e,r)=>(R(),q(z(Yt),U(t,{"data-state":z(n).progressState.value,"data-value":z(n).modelValue?.value??void 0,"data-max":z(n).max.value}),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),Bs=`radio.select`;function Vs(e,t,n){Ie(Bs,n,{originalEvent:e,value:t})}var Hs=k({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(t,{emit:n}){let r=t,i=n,a=e(r,`checked`,i,{passive:r.checked===void 0}),{value:o}=Je(r),{forwardRef:s,currentElement:c}=S(),l=vi(c),u=yi(),d=I(()=>r.id&&c.value?document.querySelector(`[for="${r.id}"]`)?.innerText:void 0);function f(e){r.disabled||Vs(e,r.value,e=>{i(`select`,e),!e?.defaultPrevented&&(a.value=!0,l.value&&e.stopPropagation())})}return(e,n)=>(R(),G(H,null,[M(z(Yt),U({id:t.id,ref:z(s),role:`radio`,type:t.as===`button`?`button`:void 0,as:t.as,"aria-checked":z(a)??!1,"aria-label":d.value,"as-child":t.asChild,disabled:t.disabled?``:void 0,"data-state":z(a)?`checked`:`unchecked`,"data-disabled":t.disabled?``:void 0,value:z(o),required:t.required,name:t.name},{...z(u),...e.$attrs},{onClick:zt(f,[`stop`])}),{default:j(()=>[P(e.$slots,`default`,{checked:z(a)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),z(l)&&t.name?(R(),q(z(xa),U({key:0,type:`radio`,tabindex:`-1`,value:z(o),checked:!!z(a),name:t.name,disabled:t.disabled,required:t.required},z(u)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):L(`v-if`,!0)],64))}}),[Us,Ws]=le(`RadioGroupRoot`),Gs=k({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(t,{emit:n}){let r=t,i=n,{forwardRef:a,currentElement:o}=S(),s=e(r,`modelValue`,i,{defaultValue:r.defaultValue,passive:r.modelValue===void 0}),{disabled:c,loop:l,orientation:u,name:d,required:f,dir:p}=Je(r),m=C(p),h=vi(o);return Ws({modelValue:s,changeModelValue:e=>{s.value=e},disabled:c,loop:l,orientation:u,name:d?.value,required:f}),(e,n)=>(R(),q(z(io),{"as-child":``,orientation:z(u),dir:z(m),loop:z(l)},{default:j(()=>[M(z(Yt),{ref:z(a),role:`radiogroup`,"data-disabled":z(c)?``:void 0,"as-child":t.asChild,as:t.as,"aria-orientation":z(u),"aria-required":z(f),dir:z(m)},{default:j(()=>[P(e.$slots,`default`,{modelValue:z(s)}),z(h)&&z(d)?(R(),q(z(xa),{key:0,required:z(f),disabled:z(c),value:z(s),name:z(d)},null,8,[`required`,`disabled`,`value`,`name`])):L(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Ks,qs]=le(`RadioGroupItem`),Js=k({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,reqLine truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:gd(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>gd(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=vd(c),u=e+1<n.length?vd(n[e+1]):null;if(l&&u&&yd(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=vd(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>gd(e)),rows:r.map(e=>e.map(e=>gd(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:gd(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1])}else c.startsWith(`>`)?(o(),s(),t.push({kind:`blockquote`,inline:gd(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function vd(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 yd(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var bd={class:`[overflow-wrap:anywhere]`},xd={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Sd={class:`font-mono text-[0.85em]`},Cd={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},wd={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Td={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Ed={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Dd={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Od={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},kd={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Ad={key:8,class:`mb-2.5 last:mb-0`},jd=k({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=I(()=>_d(t.text));return(e,t)=>(R(),G(`div`,bd,[(R(!0),G(H,null,K(n.value,(e,t)=>(R(),G(H,{key:t},[e.kind===`pre`?(R(),G(`pre`,xd,[W(`code`,Sd,V(e.code),1)])):e.kind===`table`?(R(),G(`table`,Cd,[W(`thead`,null,[W(`tr`,null,[(R(!0),G(H,null,K(e.head,(e,t)=>(R(),G(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[M(md,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(R(!0),G(H,null,K(e.rows,(e,t)=>(R(),G(`tr`,{key:t},[(R(!0),G(H,null,K(e,(e,t)=>(R(),G(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[M(md,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(R(),G(`blockquote`,wd,[M(md,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(R(),G(`h1`,Td,[M(md,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(R(),G(`h2`,Ed,[M(md,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(R(),G(`h3`,Dd,[M(md,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(R(),G(`ul`,Od,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(md,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(R(),G(`ol`,kd,[(R(!0),G(H,null,K(e.items,(e,t)=>(R(),G(`li`,{key:t},[M(md,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(R(),G(`p`,Ad,[M(md,{inline:e.inline},null,8,[`inline`])])):L(``,!0)],64))),128))]))}}),Md={class:`truncate`},Nd=k({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Ke(`RouterLink`);return R(),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:j(()=>[M(z(cn),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Md,V(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Pd={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Fd={class:`font-semibold text-foreground`},Id={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Ld=k({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=I(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=I(()=>t.tool.parameters||t.tool.Parameters||``),i=I(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=I(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(R(),q(Nd,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(R(),G(`div`,Pd,[M(z(sr),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Fd,V(n.value),1),r.value?(R(),G(`code`,Id,V(r.value),1)):L(``,!0),W(`span`,{class:N(z(Z)(`text-fg-muted`,i.value&&`text-danger`))},V(a.value),3)]))}}),Rd={key:0,class:`mb-2 grid gap-0.5 text-xs`},zd={key:1,class:`mb-2 flex flex-wrap gap-1.5`},Bd={key:3,class:`whitespace-pre-wrap`},Vd=k({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(R(),G(`div`,{class:N([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:N(z(Z)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(R(),G(`div`,Rd,[(R(!0),G(H,null,K(e.tools,(t,n)=>(R(),q(Ld,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):L(``,!0),e.media.length?(R(),G(`div`,zd,[(R(!0),G(H,null,K(e.media,(e,t)=>(R(),q(sd,{key:t,attachment:e},null,8,[`attachment`]))),128))])):L(``,!0),e.assistant?(R(),q(jd,{key:2,text:e.text},null,8,[`text`])):(R(),G(`div`,Bd,V(e.text),1)),P(t.$slots,`default`)],2)],2))}}),Hd={class:`text-sm`},Ud={class:`font-medium`},Wd={key:0,class:`mt-1 text-fg-muted`},Gd={key:1,class:`mt-2 flex flex-wrap gap-2`},Kd=k({__name:`ChatChooLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>P_?`${n.slice(0,P_).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}function I_(e){return String(e||`event`).replaceAll(`_`,` `).replace(/\b\w/g,e=>e.toUpperCase())}function L_(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 R_(e){let t=Number(e);return!Number.isFinite(t)||t<=0?``:t.toLocaleString(`en-US`)}function z_(e){return typeof e==`string`?e:``}function B_(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=L_(t.duration_ms),i=[r,e&&`ran for ${e}`].filter(Boolean).join(` · `);return{title:t.interrupted?`Stage interrupted: ${n}`:t.skipped?`Skipped stage: ${n}`:t.error?`Stage failed: ${n}`:`Finished stage: ${n}`,detail:[i,z_(t.error),z_(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:[z_(t.previous_stage)&&`after ${z_(t.previous_stage)}`,z_(t.previous_reason)].filter(Boolean).join(`: `)||e.detail||``}}if(e.kind===`agent_finish`){let r=R_(t.iterations),i=R_(t.tokens),a=Number(t.cached_tokens)||0,o=R_((Number(t.prompt_tokens)||0)-a),s=R_(t.completion_tokens),c=R_(t.cached_tokens),l=[r&&`${r} iterations`,i&&`${i} tokens`,o&&`${o} fresh prompt`,s&&`${s} completion`,c&&`${c} cached`,z_(t.model)].filter(Boolean);return{title:`Agent ${z_(t.status)||`finished`}: ${n}`,detail:l.join(` · `)||e.detail||``}}if(e.kind===`remediation_round`){let e=Number(t.of),n=z_(t.author);return{title:`Remediation ${z_(t.round)}${e>0?` of ${e}`:``}`,detail:[n&&`answers ${n}'s review`,t.review_id?`#${z_(t.review_id)}`:``].filter(Boolean).join(` `)}}if(e.kind===`review_approved`){let e=z_(t.pr_number);return{title:`Pull request approved`,detail:[z_(t.author),e&&`#${e}`].filter(Boolean).join(` · `)}}if(e.kind===`step_retried`)return{title:`Attempt ${z_(t.attempt)} of ${z_(t.of)} failed: ${e.stage||`step`}`,detail:z_(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=z_(t.source),n=z_(t.capture_id),r=[{label:`binding ${z_(t.binding_name)||z_(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 ${z_(t.captured_after)}`:``].filter(Boolean).join(` · `)}}return{title:I_(e.kind||e.type),detail:e.detail||``}}var V_=[`title`],H_=k({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Lg(),a=I(()=>i.taskIDFor(n.event)),o=I(()=>F_(n.event));function s(){a.value>0&&r(`open`,a.value)}let c=I(()=>n.event.at?gg(n.event.at):`—`);return(e,t)=>(R(),q(z(M_),{class:N(a.value>0?`cursor-pointer`:``),role:a.value>0?`link`:void 0,tabindex:a.value>0?0:void 0,title:a.value>0?`Open task details`:void 0,onClick:s,onKeydown:[Bt(zt(s,[`prevent`]),[`enter`]),Bt(zt(s,[`prevent`]),[`space`])]},{default:j(()=>[M(z(Q),{class:`font-medium`},{default:j(()=>[A(V(z(B_)({...n.event,at:void 0,detail:void 0}).title),1)]),_:1}),M(z(Q),{class:`font-mono`},{default:j(()=>[A(V(a.value>0?`#${a.value}`:`—`),1)]),_:1}),M(z(Q),{class:`w-[55%] max-w-0`},{default:j(()=>[W(`span`,{class:`block truncate`,title:o.value.truncated?o.value.full:void 0},V(o.value.text),9,V_)]),_:1}),M(z(Q),null,{default:j(()=>[A(V(c.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),U_=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function W_(e){return(Number(e?.task_id)||0)>0}function G_(e,t){return t===`tasks`?W_(e):t!==`system`||!W_(e)}function K_(e,t){return e.filter(e=>G_(e,t))}function q_(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function J_(e,t){return`${e}:${t??0}`}function Y_(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=J_(F_(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 X_={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},Z_={class:`max-h-[28rem] overflow-y-auto`},Q_=[`aria-expanded`,`aria-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 oy(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 sy(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 cy(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 ly(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 uy=J([]),dy=J([]),fy=J(!0),py=J(null),my=J(null),hy=J(!1),gy=J(null);async function _y(){try{let e=await X.eventTypes(iy().workspace);fy.value=e.enabled!==!1,uy.value=e.event_types||[],dy.value=e.proposals||[],py.value=null}catch(e){py.value=e.message||String(e)}}function vy(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function yy(e){gy.value=null,my.value=e}function by(e){let t=Oy.value.find(t=>String(t.id)===e.sample_id);yy({mode:`proposal`,id:null,source:e.source,name:``,rule:vy(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function xy(e=``){yy({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function Sy(e){yy({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:vy(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Cy(){my.value=null}async function wy(){let e=my.value;if(e){hy.value=!0;try{if(e.mode===`edit`&&e.id)await X.eventTypeUpdate(e.id,{name:e.name,rule:ly(e.rule)});else{let t=e.mode===`paste`?ay(e.headersText):e.exampleHeaders;await X.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:ly(e.rule),example:{headers:t,body:e.body}})}my.value=null,await _y()}catch(e){gy.value=e.message||String(e)}finally{hy.value=!1}}}var Ty=J(null);async function Ey(){let e=Ty.value;if(Ty.value=null,e)try{await X.eventTypeDelete(e.id),await _y()}catch(e){py.value=e.message||String(e)}}var Dy=100,Oy=J([]),ky=J(!0),Ay=J(null),jy=J(!0),My=J(null);async function Ny(){try{let e=await X.captures(Dy);ky.value=e.enabled!==!1,Oy.value=e.captures||[],Ay.value=null}catch(e){Ay.value=e.message||String(e)}finally{jy.value=!1}}function Py(e){let t=Oy.value.find(t=>t.id===e);return t&&(My.value=t),!!t}function Fy(){Oy.value.length&&(My.value=Oy.value[0])}function Iy(){Le(`captures`,()=>{Ny(),_y()})}var Ly=k({__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=Gt(n,`class`),a=He(i,r);return(e,t)=>(R(),q(z(Rc),U({"data-slot":`tabs`,"data-orientation":z(a).orientation||`horizontal`},z(a),{class:z(Z)(`gap-2 group/tabs flex data-horizontal:flex-col`,n.class)}),{default:j(t=>[P(e.$slots,`default`,vt(We(t)))]),_:3},16,[`data-orientation`,`class`]))}}),Ry=k({__name:`TabsContent`,props:{value:{},forceMount:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,n=Gt(t,`class`);return(e,r)=>(R(),q(z(Vc),U({"data-slot":`tabs-content`,class:z(Z)(`text-sm flex-1 outline-none`,t.class)},z(n)),{default:j(()=>[P(e.$slots,`default`)]),_:3},16,[`class`]))}}),zy=k({__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=Gt(t,`class`,`variant`);return(r,i)=>(R(),q(z(Hc),U({"data-slot":`tabs-list`,"data-variant":e.variant},z(n),{class:z(Z)(z(Vy)({variant:e.variant}),t.class)}),{default:j(()=>[P(r.$slots,`default`)]),_:3},16,[`data-variant`,`class`]))}}),By=k({__name:`TabsTrigger`,props:{value:{},disabled:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e,r=Gt(t,`class`),i=n(r);return(e,n)=>(R(),q(z(Uc),U({"data-slot":`tabs-trigger`,class:z(Z)(`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:outline-ring disabled:pointerLine truncated
`)}};aL.defaultYaml={explicit:!1,version:`1.2`},aL.defaultTags={"!!":`tag:yaml.org,2002:`};function oL(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 sL(e){let t=new Set;return QI(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function cL(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function lL(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=sL(e);let a=cL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(WI(t.node)||KI(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 uL(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=uL(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=uL(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=uL(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=uL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function dL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>dL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!JI(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 fL=class{constructor(e){Object.defineProperty(this,zI,{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(!VI(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=dL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?uL(i,{"":o},``,o):o}},pL=class extends fL{constructor(e){super(NI),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=[],QI(e,{Node:(e,t)=>{(BI(t)||JI(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||=(dL(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=mL(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(oL(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 mL(e,t,n){if(BI(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(KI(t)){let r=0;for(let i of t.items){let t=mL(e,i,n);t>r&&(r=t)}return r}if(UI(t)){let r=mL(e,t.key,n),i=mL(e,t.value,n);return Math.max(r,i)}return 1}var hL=e=>!e||typeof e!=`function`&&typeof e!=`object`,gL=class extends fL{constructor(e){super(LI),this.value=e}toJSON(e,t){return t?.keep?this.value:dL(this.value,e,t)}toString(){return String(this.value)}};gL.BLOCK_FOLDED=`BLOCK_FOLDED`,gL.BLOCK_LITERAL=`BLOCK_LITERAL`,gL.PLAIN=`PLAIN`,gL.QUOTE_DOUBLE=`QUOTE_DOUBLE`,gL.QUOTE_SINGLE=`QUOTE_SINGLE`;var _L=`tag:yaml.org,2002:`;function vL(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 yL(e,t,n){if(VI(e)&&(e=e.contents),qI(e))return e;if(UI(e)){let t=n.schema[FI].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 pL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=_L+t.slice(2));let l=vL(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new gL(e);return c&&(c.node=t),t Line truncated
`)?wL(n,t):n.includes(`
`)?`
`+XL(n,t):(e.endsWith(` `)?``:` `)+n,QL=`flow`,$L=`block`,eR=`quoted`;function tR(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=nR(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=nR(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+wL(n,t):(e.endsWith(` `)?``:` `)+n,EL=`flow`,DL=`block`,OL=`quoted`;function kL(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=AL(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=AL(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 nR(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 rR=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),iR=e=>/^(%|---|\.\.\.)/m.test(e);function aR(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 oR(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(iR(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 AL(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 jL=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ML=e=>/^(%|---|\.\.\.)/m.test(e);function NL(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 PL(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(ML(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:tR(o,a,eR,rR(t,!1))}function sR(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return oR(e,t);let n=t.indent||(iR(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:tR(r,n,QL,rR(t,!1))}function cR(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=oR;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?sR:i&&!t?oR:n?sR:oR}return r(e,t)}var lR;try{lR=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:kL(o,a,OL,jL(t,!1))}function FL(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return PL(e,t);let n=t.indent||(ML(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:kL(r,n,EL,jL(t,!1))}function IL(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=PL;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?FL:i&&!t?PL:n?FL:PL}return r(e,t)}var LL;try{LL=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{lR=/\n+(?!\n|$)/g}function uR({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 cR(n,r);let l=r.indent||(r.forceBlockIndent||iR(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===HL.BLOCK_FOLDED?!1:t===HL.BLOCK_LITERAL||!aR(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{LL=/\n+(?!\n|$)/g}function RL({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 IL(n,r);let l=r.indent||(r.forceBlockIndent||ML(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===gL.BLOCK_FOLDED?!1:t===gL.BLOCK_LITERAL||!NL(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(lR,`$&${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(LL,`$&${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=rR(r,!0);o!==`folded`&&t!==HL.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=tR(`${v}${e}${p}`,l,$L,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function dR(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 cR(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?cR(a,t):uR(e,t,n,r);if(!s&&!u&&i!==HL.PLAIN&&a.includes(`
`))return uR(e,t,n,r);if(iR(a)){if(c===``)return t.forceBlockIndent=!0,uR(e,t,n,r);if(s&&c===l)return cR(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 cR(a,t)}return s?d:tR(d,c,QL,rR(t,!1))}function fR(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!==HL.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=HL.QUOTE_DOUBLE);let c=e=>{switch(e){case HL.BLOCK_FOLDED:case HL.BLOCK_LITERAL:return i||a?cR(o.value,t):uR(o,t,n,r);case HL.QUOTE_DOUBLE:return oR(o.value,t);case HL.QUOTE_SINGLE:return sR(o.value,t);case HL.PLAIN:return dR(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 pR(e,t){let n=Object.assign({blockQuote:!0,commentString:YL,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 mR(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(gL(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 hR(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(gL(e)||vL(e))&&e.anchor;a&&ML(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 gR(e,t,n,r){if(hL(e))return e.toString(t,n,r);if(fL(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=yL(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=mR(t.doc.schema.tags,a);let o=hR(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):gL(a)?fR(a,t,n,r):a.toString(t,n,r);return o?gL(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function _R({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=yL(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(vL(e)||!yL(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||vL(e)||(gL(e)?e.type===HL.BLOCK_FOLDED||e.type===HL.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=gR(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+=ZL(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=ZL(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=ZL(g,n.indent,l(f))));let _,v,y;yL(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&&gL(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&_L(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=gR(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${XL(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=jL(r,!0);o!==`folded`&&t!==gL.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=kL(`${v}${e}${p}`,l,DL,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function zL(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 IL(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?IL(a,t):RL(e,t,n,r);if(!s&&!u&&i!==gL.PLAIN&&a.includes(`
`))return RL(e,t,n,r);if(ML(a)){if(c===``)return t.forceBlockIndent=!0,RL(e,t,n,r);if(s&&c===l)return IL(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 IL(a,t)}return s?d:kL(d,c,EL,jL(t,!1))}function BL(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!==gL.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=gL.QUOTE_DOUBLE);let c=e=>{switch(e){case gL.BLOCK_FOLDED:case gL.BLOCK_LITERAL:return i||a?IL(o.value,t):RL(o,t,n,r);case gL.QUOTE_DOUBLE:return PL(o.value,t);case gL.QUOTE_SINGLE:return FL(o.value,t);case gL.PLAIN:return zL(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 VL(e,t){let n=Object.assign({blockQuote:!0,commentString:CL,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 HL(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(WI(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 UL(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(WI(e)||KI(e))&&e.anchor;a&&oL(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 WL(e,t,n,r){if(UI(e))return e.toString(t,n,r);if(BI(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=qI(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=HL(t.doc.schema.tags,a);let o=UL(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):WI(a)?BL(a,t,n,r):a.toString(t,n,r);return o?WI(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function GL({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=qI(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(KI(e)||!qI(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||KI(e)||(WI(e)?e.type===gL.BLOCK_FOLDED||e.type===gL.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=WL(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+=TL(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=TL(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=TL(g,n.indent,l(f))));let _,v,y;qI(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&&WI(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&GI(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=WL(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${wL(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&vL(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&KI(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+=ZL(g,n.indent,l(y)):h&&i&&i(),g}function vR(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var yR=`<<`,bR={identify:e=>e===yR||typeof e==`symbol`&&e.description===yR,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new HL(Symbol(yR)),{addToJSMap:SR}),stringify:()=>yR},xR=(e,t)=>(bR.identify(t)||gL(t)&&(!t.type||t.type===HL.PLAIN)&&bR.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===bR.tag&&e.default);function SR(e,t,n){let r=wR(e,n);if(_L(r))for(let n of r.items)CR(e,t,n);else if(Array.isArray(r))for(let n of r)CR(e,t,n);else CR(e,t,r)}function CR(e,t,n){let r=wR(e,n);if(!mL(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 wR(e,t){return e&&fL(t)?t.resolve(e.doc,e):t}function TR(e,t,{key:n,value:r}){if(yL(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(xR(e,n))SR(e,t,r);else{let i=LL(n,``,e);if(t instanceof Map)t.set(i,LL(r,i,e));else if(t instanceof Set)t.add(i);else{let a=ER(n,i,e),o=LL(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function ER(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(yL(e)&&n?.doc){let t=pR(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)+`..."`),vR(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 DR(e,t,n){return new OR(GL(e,void 0,n),GL(t,void 0,n))}var OR=class e{constructor(e,t=null){Object.defineProperty(this,dL,{value:cL}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return yL(n)&&(n=n.clone(t)),yL(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return TR(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?_R(this,e,t,n):JSON.stringify(this)}};function kR(e,t,n){return(t.inFlow??e.flow?jR:AR)(e,t,n)}function AR({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(yL(i))!d&&i.spaceBefore&&f.push(``),MR(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(hL(i)){let e=yL(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),MR(n,f,e.commentBefore,d))}d=!1;let s=gR(i,u,()=>o=null,()=>d=!0);o&&(s+=ZL(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+=TL(g,n.indent,l(y)):h&&i&&i(),g}function KL(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var qL=`<<`,JL={identify:e=>e===qL||typeof e==`symbol`&&e.description===qL,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new gL(Symbol(qL)),{addToJSMap:XL}),stringify:()=>qL},YL=(e,t)=>(JL.identify(t)||WI(t)&&(!t.type||t.type===gL.PLAIN)&&JL.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===JL.tag&&e.default);function XL(e,t,n){let r=QL(e,n);if(GI(r))for(let n of r.items)ZL(e,t,n);else if(Array.isArray(r))for(let n of r)ZL(e,t,n);else ZL(e,t,r)}function ZL(e,t,n){let r=QL(e,n);if(!HI(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 QL(e,t){return e&&BI(t)?t.resolve(e.doc,e):t}function $L(e,t,{key:n,value:r}){if(qI(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(YL(e,n))XL(e,t,r);else{let i=dL(n,``,e);if(t instanceof Map)t.set(i,dL(r,i,e));else if(t instanceof Set)t.add(i);else{let a=eR(n,i,e),o=dL(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function eR(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(qI(e)&&n?.doc){let t=VL(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)+`..."`),KL(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 tR(e,t,n){return new nR(yL(e,void 0,n),yL(t,void 0,n))}var nR=class e{constructor(e,t=null){Object.defineProperty(this,zI,{value:II}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return qI(n)&&(n=n.clone(t)),qI(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return $L(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?GL(this,e,t,n):JSON.stringify(this)}};function rR(e,t,n){return(t.inFlow??e.flow?aR:iR)(e,t,n)}function iR({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(qI(i))!d&&i.spaceBefore&&f.push(``),oR(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(UI(i)){let e=qI(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),oR(n,f,e.commentBefore,d))}d=!1;let s=WL(i,u,()=>o=null,()=>d=!0);o&&(s+=TL(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+=`
`+XL(l(e),c),s&&s()):d&&o&&o(),p}function jR({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(yL(i))i.spaceBefore&&d.push(``),MR(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(hL(i)){let e=yL(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),MR(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=yL(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=gR(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+=ZL(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 MR({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=XL(t(r),e);n.push(i.trimStart())}}function NR(e,t){let n=gL(t)?t.value:t;for(let r of e)if(hL(r)&&(r.key===t||r.key===n||gL(r.key)&&r.key.value===n))return r}var PR=class extends JL{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(sL,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(DR(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=hL(e)?e:!e||typeof e!=`object`||!(`key`in e)?new OR(e,e?.value):new OR(e.key,e.value);let r=NR(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);gL(r.value)&&VL(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=NR(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=NR(this.items,e)?.value;return(!t&&gL(n)?n.value:n)??void 0}has(e){return!!NR(this.items,e)}set(e,t){this.add(new OR(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)TR(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!hL(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})),kR(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},FR={collection:`map`,default:!0,nodeClass:PR,tag:`tag:yaml.org,2002:map`,resolve(e,t){return mL(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>PR.from(e,t,n)},IR=class extends JL{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(uL,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=LR(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=LR(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&gL(r)?r.value:r}has(e){let t=LR(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=LR(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];gL(r)&&VL(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(LL(e,String(r++),t));return n}toString(e,t,n){return e?kR(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(GL(a,void 0,n))}}return i}};function LR(e){let t=gL(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var RR={collection:`seq`,default:!0,nodeClass:IR,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return _L(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>IR.from(e,t,n)},zR={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),fR(e,t,n,r)}},BR={identify:e=>e==null,createNode:()=>new HL(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new HL(null),stringify:({source:e},t)=>typeof e==`string`&&BR.test.test(e)?e:t.options.nullStr},VR={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new HL(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&VR.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function HR({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 UR={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:HR},WR={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 fR({comment:e,type:t,value:s},r,i,a)}};function iz(e,t){if(_L(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!hL(r)){if(mL(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new OR(new HL(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]=hL(r)?r:new OR(r)}}else t(`Expected a sequence for this tag`);return e}function az(e,t,n){let{replacer:r}=n,i=new IR(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(DR(o,s,n))}return i}var oz={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:iz,createNode:az},sz=class e extends IR{constructor(){super(),this.add=PR.prototype.add.bind(this),this.delete=PR.prototype.delete.bind(this),this.get=PR.prototype.get.bind(this),this.has=PR.prototype.has.bind(this),this.set=PR.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(hL(e)?(r=LL(e.key,``,t),i=LL(e.value,r,t)):r=LL(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=az(e,t,n),i=new this;return i.items=r.items,i}};sz.tag=`tag:yaml.org,2002:omap`;var cz={collection:`seq`,identify:e=>e instanceof Map,nodeClass:sz,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=iz(e,t),r=[];for(let{key:e}of n.items)gL(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new sz,n)},createNode:(e,t,n)=>sz.from(e,t,n)};function lz({value:e,source:t},n){return t&&(e?uz:dz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var uz={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 HL(!0),stringify:lz},dz={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 HL(!1),stringify:lz},fz={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:HR},pz={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():HR(e)}},mz={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 HL(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:HR},hz=e=>typeof e==`bigint`||Number.isInteger(e);function gz(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 _z(e,t,n){let{value:r}=e;if(hz(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return HR(e)}var vz={identify:hz,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>gz(e,2,2,n),stringify:e=>_z(e,2,`0b`)},yz={identify:hz,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>gz(e,1,8,n),stringify:e=>_z(e,8,`0`)},bz={identify:hz,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>gz(e,0,10,n),stringify:HR},xz={identify:hz,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>gz(e,2,16,n),stringify:e=>_z(e,16,`0x`)},Sz=class e extends PR{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=hL(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new OR(e.key,null):new OR(e,null),NR(this.items,t.key)||this.items.push(t)}get(e,t){let n=NR(this.items,e);return!t&&hL(n)?gL(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=NR(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new OR(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(XL(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(XL(a(t),``)))}return n.join(`
`+wL(l(e),c),s&&s()):d&&o&&o(),p}function aR({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(qI(i))i.spaceBefore&&d.push(``),oR(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(UI(i)){let e=qI(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),oR(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=qI(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=WL(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+=TL(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 oR({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=wL(t(r),e);n.push(i.trimStart())}}function sR(e,t){let n=WI(t)?t.value:t;for(let r of e)if(UI(r)&&(r.key===t||r.key===n||WI(r.key)&&r.key.value===n))return r}var cR=class extends SL{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(FI,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(tR(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=UI(e)?e:!e||typeof e!=`object`||!(`key`in e)?new nR(e,e?.value):new nR(e.key,e.value);let r=sR(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);WI(r.value)&&hL(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=sR(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=sR(this.items,e)?.value;return(!t&&WI(n)?n.value:n)??void 0}has(e){return!!sR(this.items,e)}set(e,t){this.add(new nR(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)$L(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!UI(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})),rR(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},lR={collection:`map`,default:!0,nodeClass:cR,tag:`tag:yaml.org,2002:map`,resolve(e,t){return HI(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>cR.from(e,t,n)},uR=class extends SL{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(RI,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=dR(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=dR(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&WI(r)?r.value:r}has(e){let t=dR(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=dR(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];WI(r)&&hL(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(dL(e,String(r++),t));return n}toString(e,t,n){return e?rR(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(yL(a,void 0,n))}}return i}};function dR(e){let t=WI(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var fR={collection:`seq`,default:!0,nodeClass:uR,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return GI(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>uR.from(e,t,n)},pR={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),BL(e,t,n,r)}},mR={identify:e=>e==null,createNode:()=>new gL(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new gL(null),stringify:({source:e},t)=>typeof e==`string`&&mR.test.test(e)?e:t.options.nullStr},hR={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new gL(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&hR.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function gR({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 _R={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:gR},vR={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 BL({comment:e,type:t,value:s},r,i,a)}};function MR(e,t){if(GI(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!UI(r)){if(HI(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new nR(new gL(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]=UI(r)?r:new nR(r)}}else t(`Expected a sequence for this tag`);return e}function NR(e,t,n){let{replacer:r}=n,i=new uR(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(tR(o,s,n))}return i}var PR={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:MR,createNode:NR},FR=class e extends uR{constructor(){super(),this.add=cR.prototype.add.bind(this),this.delete=cR.prototype.delete.bind(this),this.get=cR.prototype.get.bind(this),this.has=cR.prototype.has.bind(this),this.set=cR.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(UI(e)?(r=dL(e.key,``,t),i=dL(e.value,r,t)):r=dL(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=NR(e,t,n),i=new this;return i.items=r.items,i}};FR.tag=`tag:yaml.org,2002:omap`;var IR={collection:`seq`,identify:e=>e instanceof Map,nodeClass:FR,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=MR(e,t),r=[];for(let{key:e}of n.items)WI(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new FR,n)},createNode:(e,t,n)=>FR.from(e,t,n)};function LR({value:e,source:t},n){return t&&(e?RR:zR).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var RR={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 gL(!0),stringify:LR},zR={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 gL(!1),stringify:LR},BR={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:gR},VR={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():gR(e)}},HR={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 gL(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:gR},UR=e=>typeof e==`bigint`||Number.isInteger(e);function WR(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 GR(e,t,n){let{value:r}=e;if(UR(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return gR(e)}var KR={identify:UR,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>WR(e,2,2,n),stringify:e=>GR(e,2,`0b`)},qR={identify:UR,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>WR(e,1,8,n),stringify:e=>GR(e,8,`0`)},JR={identify:UR,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>WR(e,0,10,n),stringify:gR},YR={identify:UR,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>WR(e,2,16,n),stringify:e=>GR(e,16,`0x`)},XR=class e extends cR{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=UI(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new nR(e.key,null):new nR(e,null),sR(this.items,t.key)||this.items.push(t)}get(e,t){let n=sR(this.items,e);return!t&&UI(n)?WI(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=sR(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new nR(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(wL(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(wL(a(t),``)))}return n.join(`
`)+`
`}var Lz=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,dL,{value:oL});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 jL({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[dL]:{value:oL}});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=yL(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Rz(this.contents)&&this.contents.add(e)}addIn(e,t){Rz(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=NL(this);e.anchor=!t||n.has(t)?PL(t||`a`,n):t}return new zL(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}=FL(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=GL(e,l,p);return o&&vL(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new OR(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Rz(this.contents)?this.contents.delete(e):!1}deleteIn(e){return qL(e)?this.contents!=null&&(this.contents=null,!0):Rz(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return vL(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return qL(e)?!t&&gL(this.contents)?this.contents.value:this.contents:vL(this.contents)?this.contents.getIn(e,t):void 0}has(e){return vL(this.contents)?this.contents.has(e):!1}hasIn(e){return qL(e)?this.contents!==void 0:vL(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=KL(this.schema,[e],t):Rz(this.contents)&&this.contents.set(e,t)}setIn(e,t){qL(e)?this.contents=t:this.contents==null?this.contents=KL(this.schema,Array.from(e),t):Rz(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 jL({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 jL({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 Fz(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=LL(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`?IL(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 Iz(this,e)}};function Rz(e){if(vL(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var zz=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Bz=class extends zz{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Vz=class extends zz{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Hz=(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 Uz(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 Wz(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(Wz(t.key)||Wz(t.value))return!0}return!1;default:return!0}}function Gz(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Wz(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Kz(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||gL(e)&&gL(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var qz=`All mapping items must start at the same column`;function Jz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??PR)(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=Uz(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`,qz)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Wz(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`,qz);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Gz(r.indent,u,i),n.atKey=!1,Kz(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Uz(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&&Gz(r.indent,f,i),s=c.range[2];let l=new OR(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 OR(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 Yz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??IR)(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=Uz(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&&Gz(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Xz(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 Zz=`Block collections are not allowed within flow collections`,Qz=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function $z({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?PR:IR))(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=Uz(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&&Wz(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];hL(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],Qz(m)&&i(r.range,`BLOCK_IN_FLOW`,Zz)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);Qz(f)&&i(g.range,`BLOCK_IN_FLOW`,Zz),n.atKey=!1;let _=Uz(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?Qz(m)&&i(v.range,`BLOCK_IN_FLOW`,Zz):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new OR(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Kz(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new PR(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=Xz(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 eB(e,t,n,r,i,a){let o=n.type===`block-map`?Jz(e,t,n,r,a):n.type===`block-seq`?Yz(e,t,n,r,a):$z(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function tB(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===PR.tagName&&s===`map`||o===IR.tagName&&s===`seq`)return eB(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),eB(e,t,n,i,o)}let l=eB(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=yL(u)?u:new HL(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function nB(e,t,n){let r=t.offset,i=rB(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?HL.BLOCK_FOLDED:HL.BLOCK_LITERAL,o=t.source?iB(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 dz=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,zI,{value:PI});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 aL({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[zI]:{value:PI}});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=qI(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){fz(this.contents)&&this.contents.add(e)}addIn(e,t){fz(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=sL(this);e.anchor=!t||n.has(t)?cL(t||`a`,n):t}return new pL(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}=lL(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=yL(e,l,p);return o&&KI(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new nR(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return fz(this.contents)?this.contents.delete(e):!1}deleteIn(e){return xL(e)?this.contents!=null&&(this.contents=null,!0):fz(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return KI(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return xL(e)?!t&&WI(this.contents)?this.contents.value:this.contents:KI(this.contents)?this.contents.getIn(e,t):void 0}has(e){return KI(this.contents)?this.contents.has(e):!1}hasIn(e){return xL(e)?this.contents!==void 0:KI(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=bL(this.schema,[e],t):fz(this.contents)&&this.contents.set(e,t)}setIn(e,t){xL(e)?this.contents=t:this.contents==null?this.contents=bL(this.schema,Array.from(e),t):fz(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 aL({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 aL({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 lz(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=dL(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`?uL(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 uz(this,e)}};function fz(e){if(KI(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var pz=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},mz=class extends pz{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},hz=class extends pz{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},gz=(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 _z(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 vz(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(vz(t.key)||vz(t.value))return!0}return!1;default:return!0}}function yz(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&vz(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function bz(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||WI(e)&&WI(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var xz=`All mapping items must start at the same column`;function Sz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??cR)(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=_z(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`,xz)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||vz(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`,xz);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&yz(r.indent,u,i),n.atKey=!1,bz(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=_z(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&&yz(r.indent,f,i),s=c.range[2];let l=new nR(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 nR(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 Cz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??uR)(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=_z(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&&yz(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function wz(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 Tz=`Block collections are not allowed within flow collections`,Ez=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function Dz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?cR:uR))(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=_z(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&&vz(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];UI(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],Ez(m)&&i(r.range,`BLOCK_IN_FLOW`,Tz)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);Ez(f)&&i(g.range,`BLOCK_IN_FLOW`,Tz),n.atKey=!1;let _=_z(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?Ez(m)&&i(v.range,`BLOCK_IN_FLOW`,Tz):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new nR(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;bz(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new cR(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=wz(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 Oz(e,t,n,r,i,a){let o=n.type===`block-map`?Sz(e,t,n,r,a):n.type===`block-seq`?Cz(e,t,n,r,a):Dz(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function kz(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===cR.tagName&&s===`map`||o===uR.tagName&&s===`seq`)return Oz(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),Oz(e,t,n,i,o)}let l=Oz(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=qI(u)?u:new gL(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function Az(e,t,n){let r=t.offset,i=jz(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?gL.BLOCK_FOLDED:gL.BLOCK_LITERAL,o=t.source?Mz(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===HL.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===gL.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -75,59 +75,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 rB({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 iB(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 aB(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=HL.PLAIN,c=oB(a,l);break;case`single-quoted-scalar`:s=HL.QUOTE_SINGLE,c=sB(a,l);break;case`double-quoted-scalar`:s=HL.QUOTE_DOUBLE,c=lB(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=Xz(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function oB(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}`),cB(e)}function sB(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),cB(e.slice(1,-1)).replace(/''/g,`'`)}function cB(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 jz({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 Mz(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 Nz(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=gL.PLAIN,c=Pz(a,l);break;case`single-quoted-scalar`:s=gL.QUOTE_SINGLE,c=Fz(a,l);break;case`double-quoted-scalar`:s=gL.QUOTE_DOUBLE,c=Lz(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=wz(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function Pz(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}`),Iz(e)}function Fz(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),Iz(e.slice(1,-1)).replace(/''/g,`'`)}function Iz(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 lB(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 Lz(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}=uB(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=dB[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=Rz(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=zz[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+=fB(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+=Bz(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 uB(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 Rz(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 dB={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function fB(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 pB(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?nB(e,t,r):aB(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[lL]:c?mB(e.schema,i,c,n,r):t.type===`scalar`?hB(e,i,t,r):e.schema[lL];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=gL(a)?a:new HL(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new HL(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 mB(e,t,n,r,i){if(n===`!`)return e[lL];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[lL])}function hB({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[lL];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[lL];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 gB(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 _B={composeNode:vB,composeEmptyNode:yB};function vB(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=bB(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=pB(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=tB(_B,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??=yB(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&&(!gL(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 yB(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=pB(e,{type:`scalar`,offset:gB(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 bB({options:e},{offset:t,source:n,end:r},i){let a=new zL(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=Xz(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function xB(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Lz(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Uz(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?vB(c,i,l,o):yB(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Xz(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function SB(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 CB(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 zz={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Bz(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 Vz(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Az(e,t,r):Nz(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[LI]:c?Hz(e.schema,i,c,n,r):t.type===`scalar`?Uz(e,i,t,r):e.schema[LI];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=WI(a)?a:new gL(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new gL(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 Hz(e,t,n,r,i){if(n===`!`)return e[LI];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[LI])}function Uz({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[LI];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[LI];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 Wz(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 Gz={composeNode:Kz,composeEmptyNode:qz};function Kz(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=Jz(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=Vz(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=kz(Gz,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??=qz(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&&(!WI(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 qz(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=Vz(e,{type:`scalar`,offset:Wz(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 Jz({options:e},{offset:t,source:n,end:r},i){let a=new pL(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=wz(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function Yz(e,t,{offset:n,start:r,value:i,end:a},o){let s=new dz(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=_z(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?Kz(c,i,l,o):qz(c,l.end,r,null,l,o);let u=s.contents.range[2],d=wz(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function Xz(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 Zz(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 wB=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=SB(e);r?this.warnings.push(new Vz(i,t,n)):this.errors.push(new Bz(i,t,n))},this.directives=new jL({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=CB(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(vL(i)&&!i.flow&&i.items.length>0){let e=i.items[0];hL(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:CB(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=SB(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=xB(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 Bz(SB(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 Bz(SB(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Xz(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 Bz(SB(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 Lz(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}}},TB=Symbol(`break visit`),EB=Symbol(`skip children`),DB=Symbol(`remove item`);function OB(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),kB(Object.freeze([]),e,t)}OB.BREAK=TB,OB.SKIP=EB,OB.REMOVE=DB,OB.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},OB.parentCollection=(e,t)=>{let n=OB.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 kB(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=kB(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===TB)return TB;else r===DB&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function AB(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 Qz=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=Xz(e);r?this.warnings.push(new hz(i,t,n)):this.errors.push(new mz(i,t,n))},this.directives=new aL({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=Zz(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(KI(i)&&!i.flow&&i.items.length>0){let e=i.items[0];UI(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:Zz(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=Xz(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=Yz(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 mz(Xz(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 mz(Xz(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=wz(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 mz(Xz(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 dz(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}}},$z=Symbol(`break visit`),eB=Symbol(`skip children`),tB=Symbol(`remove item`);function nB(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),rB(Object.freeze([]),e,t)}nB.BREAK=$z,nB.SKIP=eB,nB.REMOVE=tB,nB.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},nB.parentCollection=(e,t)=>{let n=nB.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 rB(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=rB(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===$z)return $z;else r===tB&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function iB(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 jB(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var MB=new Set(`0123456789ABCDEFabcdef`),NB=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),PB=new Set(`,[]{}`),FB=new Set(` ,[]{}
\r `),IB=e=>!e||FB.has(e),LB=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 aB(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var oB=new Set(`0123456789ABCDEFabcdef`),sB=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),cB=new Set(`,[]{}`),lB=new Set(` ,[]{}
\r `),uB=e=>!e||lB.has(e),dB=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===`...`)&&jB(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===`...`)&&jB(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&&!jB(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===`:`)&&jB(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(IB),`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(`...`))&&jB(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(IB),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||jB(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===`...`)&&aB(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===`...`)&&aB(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&&!aB(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===`:`)&&aB(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(uB),`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(`...`))&&aB(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(uB),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||aB(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=>jB(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=>aB(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(jB(r)||e&&PB.has(r))break;t=n}else if(jB(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(aB(r)||e&&cB.has(r))break;t=n}else if(aB(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&PB.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&PB.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(IB),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(jB(n)||t&&PB.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(;!jB(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(NB.has(t))t=this.buffer[++e];else if(t===`%`&&MB.has(this.buffer[e+1])&&MB.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&&cB.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&cB.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(uB),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(aB(n)||t&&cB.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(;!aB(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(sB.has(t))t=this.buffer[++e];else if(t===`%`&&oB.has(this.buffer[e+1])&&oB.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)}},RB=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 zB(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function BB(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 VB(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 HB(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 UB(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 WB(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 GB(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!zB(t.start,`explicit-key-ind`)&&!zB(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,VB(t.value)?t.value.end?WB(t.value.end,t.sep):t.value.end=t.sep:WB(t.start,t.sep),delete t.sep)}var KB=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 LB,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=AB(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`&&GB(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&&BB(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)}},fB=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 pB(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function mB(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 hB(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 gB(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 _B(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 vB(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 yB(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!pB(t.start,`explicit-key-ind`)&&!pB(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,hB(t.value)?t.value.end?vB(t.value.end,t.sep):t.value.end=t.sep:vB(t.start,t.sep),delete t.sep)}var bB=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 dB,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=iB(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`&&yB(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&&mB(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)){WB(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(zB(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=UB(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(zB(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(VB(t.key)&&!zB(t.sep,`newline`)){let e=UB(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]}):zB(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&&!zB(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)){WB(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||zB(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)){vB(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(pB(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=_B(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(pB(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(hB(t.key)&&!pB(t.sep,`newline`)){let e=_B(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]}):pB(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&&!pB(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)){vB(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||pB(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=UB(HB(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=UB(HB(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 qB(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new RB||null,prettyErrors:t}}function JB(e,t={}){let{lineCounter:n,prettyErrors:r}=qB(t),i=new KB(n?.addNewLine),a=new wB(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 Bz(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Hz(e,n)),o.warnings.forEach(Hz(e,n))),o}function YB(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=JB(e,n);if(!i)return null;if(i.warnings.forEach(e=>vR(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 XB(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 pL(e)&&!r?e.toString(n):new Lz(e,r,n).toString(n)}var ZB=e=>typeof e==`object`&&!!e&&!Array.isArray(e),QB=e=>ZB(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function $B(e){if(ZB(e)){if(ZB(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:QB(e.parallel)};if(ZB(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:QB(e.switch.cases)}}}function eV(e){return e.slice(2).includes(`parallel`)}function tV(e,t){let n=JB(e).getIn(t,!0);if(mL(n))return n.toJSON()}function nV(e,t,n){let r=JB(e);return r.setIn(t,r.createNode(pV(n))),r.toString()}function rV(e,t,n){let r=JB(e),i=t.slice(0,-1),a=eV(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(_L(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!_L(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 iV(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 aV(e,t){let n=e.getIn(t,!0),r=$B(mL(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!mL(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function oV(e,t,n){let r=JB(e),{kind:i,branches:a}=aV(r,t);if(iV(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function sV(e,t,n,r){let i=JB(e),{kind:a,branches:o}=aV(i,t);if(iV(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>gL(e.key)&&e.key.value===n);if(!s||!gL(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function cV(e,t,n){let r=JB(e),{kind:i,branches:a}=aV(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 DV(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(CV)].map(e=>e[1]))]}function OV(e){let t=JB(e).toJS(),n=wV(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=wV(e)?e:{},p=$B(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=wV(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,title:g||SV(m),type:m,role:gV(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:TV(m,h),summary:EV(h),when:typeof d.when==`string`?d.when:void 0,retry:wV(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 DV([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=$B(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*yV,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=wV(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*bV,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*yV,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*yV},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*yV-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*bV;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*yV-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*yV,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*yV-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 kV={agent:Yt,command:zn,repo:pn,gate:Fn,forge:xn,human:Wn,review:un,workflow:qn},AV={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function jV(e){return e===`parallel`?pn:e===`switch`?Ln:kV[e.split(`.`)[0]]??qn}function MV(e){return Object.keys(AV).map(t=>({title:AV[t],icon:kV[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function NV(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 PV(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function FV(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 IV(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=FV(e,r.type))}return n}var LV=k({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),q(z(Pl),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:j(()=>[M(z(Vl),{"aria-label":e.label},{default:j(()=>[M(z(Hl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),M(z(Fl),null,{default:j(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(R(),q(z(Rl),{key:0,value:e.value,disabled:``},{default:j(()=>[A(V(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):L(``,!0),(R(!0),G(H,null,K(e.workflows,e=>(R(),q(z(Rl),{key:e.id,value:e.id},{default:j(()=>[A(V(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function RV(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function zV(e,t=[]){let n=JB(e),r=n.errors[0];if(r)return{ok:!1,message:$V(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!eH(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`stLine truncated
`).map((e,t)=>({number:t+1,text:e,tokens:YV(e)}))}var qV=/^(\s*)(-\s+)?/,JV=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function YV(e){let{code:t,comment:n}=XV(e),r=ZV(t);return n&&r.push({text:n,kind:`comment`}),r}function XV(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 ZV(e){if(!e)return[];let t=[],n=qV.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=JV.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,...QV(i[4]??``)]):[...t,...QV(r)]}function QV(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 $V(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function eH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function tH(e){return typeof e==`string`&&e.trim()!==``}var nH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},rH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},iH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},aH={class:`min-w-0 flex-1`},oH={class:`truncate font-mono text-[11px] text-fg-subtle`},sH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},cH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},lH={key:1,class:`space-y-3`},uH={key:0,class:`block space-y-1.5`},dH={id:`switch-on`},fH=[`value`],pH={class:`text-xs font-medium text-muted-foreground`},mH={class:`flex items-center gap-2`},hH={key:1,role:`alert`,class:`text-xs text-danger`},gH={key:2,class:`space-y-1.5`},_H=[`title`],vH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},yH={key:3,class:`divide-y divide-border rounded-md border border-border`},bH=[`title`],xH={key:0,class:`space-y-3`},SH={class:`text-[13px]`},CH={key:0,class:`text-danger`},wH={class:`ml-2 text-xs text-fg-subtle`},TH={key:1,class:`space-y-3`},EH={class:`text-[13px]`},DH={class:`ml-2 text-xs text-fg-subtle`},OH=[`title`],kH={key:0,class:`text-xs text-danger`},AH={class:`space-y-2`},jH={class:`divide-y divide-border rounded-md border border-border`},MH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},NH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},PH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},FH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},IH={class:`flex items-center border-t border-border px-4 py-2.5`},LH=k({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>tV(n.yaml,n.path)??{}),a=I(()=>$B(i.value)),o=I(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=I(()=>a.value?.branches.map(([e])=>e)??[]),c=I(()=>o.value===`parallel`?2:1);function l(e){r(`update:yaml`,nV(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let u=J(``),d=J(``);function f(e,t,i=``){try{let a=e===`add`?oV(n.yaml,n.path,t):e===`rename`?sV(n.yaml,n.path,t,i):cV(n.yaml,n.path,t);r(`update:yaml`,a),u.value=``,d.value=``}catch(e){d.value=String(e.message)}}let p=I(()=>n.vocabulary.find(e=>e.name===o.value)),m=I(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),h=I(()=>fV(n.yaml,n.path)),g=I(()=>p.value?.settings&&i.value.settings?WV(i.value.settings,p.value.settings,`settings`):``),_=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],v=/mission|body|detail|plan|rules/;function y(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:o.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:v.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 b=I(()=>{let e=Object.entries(p.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:y(e,t),options:o.value===`agent.run`&&e===`model`?n.modelAliases:t.enum??[]})),t=e.filter(e=>_.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key))[0],r=e.filter(e=>e!==t);return{lead:t,compact:r.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:r.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function x(e){let{id:t,type:i,...a}=e;r(`update:yaml`,nV(n.yaml,n.path,{id:t,type:i,...a}))}function S(e,t){x({...i.value,[e]:t})}function C(e){S(`retry`,{...i.value.retry,...e})}function w(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,x({...i.value,settings:n})}function ee(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&t!==m.value[e]&&(delete n.inputs,delete n.outputs),x({...i.value,settings:n})}let T=I(()=>n.workflows.find(e=>e.id===m.value.workflow)),te=I(()=>Object.entries(mV(T.value?.yaml??``,`inputs`)??{})),E=I(()=>Object.entries(mV(T.value?.yaml??``,`outputs`)??{})),ne=I(()=>Object.entries(mV(n.yaml,`inputs`)??{})),re=I(()=>Object.entries(mV(n.yaml,`outputs`)??{})),ie=I(()=>m.value.inputs??{}),D=I(()=>m.value.outputs??{}),ae=e=>typeof e==`string`&&e.startsWith(`inputs.`),oe=e=>ie.value[e]===void 0?``:String(ie.value[e]);function se(e,t,n){w(`inputs`,{...ie.value,[e]:t===``?void 0:ae(t)?t:FV(t,n??`string`)})}let ce=J(null);function le(e,t){let n=ce.value??b.value.lead?.key;if(!n)return;let r=typeof m.value[n]==`string`?m.value[n]:``,i=`{{ steps.${e}.${t} }}`;w(n,r?`${r.trimEnd()} ${i}`:i)}let ue=J({});function de(e,t){try{w(e,t.trim()?YB(t):void 0),ue.value={...ue.value,[e]:``}}catch(t){ue.val Line truncated
`)[0]}}}let fe=e=>e===void 0?``:XB(e).trimEnd(),pe=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),me=e=>typeof m.value[e]==`string`?m.value[e]:``;return(t,n)=>(R(),G(`aside`,nH,[W(`header`,rH,[W(`span`,iH,[(R(),q(Ue(z(jV)(o.value)),{class:`size-4`}))]),W(`div`,aH,[M(z(O),{"model-value":i.value.id??``,class:`h-7 truncate border-transparent px-1 font-medium shadow-none hover:border-input dark:bg-transparent`,placeholder:z(SV)(o.value),"aria-label":`Step id`,"onUpdate:modelValue":n[0]||=e=>S(`id`,String(e))},null,8,[`model-value`,`placeholder`]),W(`div`,oH,V(o.value),1)]),M(z(Y),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:j(()=>[M(z(Yn))]),_:1})]),W(`div`,sH,[g.value?(R(),G(`p`,cH,V(g.value),1)):L(``,!0),a.value?(R(),G(`section`,lH,[o.value===`switch`?(R(),G(`label`,uH,[n[18]||=W(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),M(z(O),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>l(e.target.value.trim())},null,8,[`model-value`]),W(`datalist`,dH,[(R(!0),G(H,null,K(h.value,e=>(R(),G(`option`,{key:e,value:`steps.${e}.result.`},null,8,fH))),128))])])):L(``,!0),W(`div`,pH,V(o.value===`switch`?`Cases`:`Branches`),1),(R(!0),G(H,null,K(s.value,e=>(R(),G(`div`,{key:e,class:`flex items-center gap-2`},[M(z(O),{"model-value":e,class:N(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>f(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),M(z(Y),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>f(`delete`,e)},{default:j(()=>[M(z(Vn))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),W(`div`,mH,[M(z(O),{modelValue:u.value,"onUpdate:modelValue":n[3]||=e=>u.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=yt(Ct(e=>f(`add`,u.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),M(z(Y),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!u.value.trim(),onClick:n[5]||=e=>f(`add`,u.value.trim())},{default:j(()=>[M(z(On))]),_:1},8,[`aria-label`,`disabled`])]),d.value?(R(),G(`p`,hH,V(d.value),1)):L(``,!0)])):L(``,!0),b.value.lead?(R(),G(`section`,gH,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:b.value.lead.schema.description},[A(V(pe(b.value.lead.key,b.value.lead.schema))+` `,1),b.value.lead.schema.description?(R(),q(z(on),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,_H),b.value.lead.kind===`workflow`?(R(),q(LV,{key:0,value:me(b.value.lead.key),workflows:e.workflows,label:pe(b.value.lead.key,b.value.lead.schema),onPick:n[6]||=e=>ee(b.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):b.value.lead.kind===`select`?(R(),q(z(AI),{key:1,size:`sm`,class:`w-full`,"model-value":me(b.value.lead.key),"onUpdate:modelValue":n[7]||=e=>w(b.value.lead.key,String(e)||void 0)},{default:j(()=>[M(z(jI),{value:``},{default:j(()=>[...n[19]||=[A(`Default`,-1)]]),_:1}),(R(!0),G(H,null,K(b.value.lead.options,e=>(R(),q(z(jI),{key:e,value:e},{default:j(()=>[A(V(e),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])):b.value.lead.kind===`text`?(R(),q(z(au),{key:2,"model-value":me(b.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>ce.value=b.value.lead.key,"onUpdate:modelValue":n[9]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])):(R(),q(z(O),{key:3,"model-value":me(b.value.lead.key),onFocus:n[10]||=e=>ce.value=b.value.lead.key,"onUpdate:modelValue":n[11]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])),h.value.length&&b.value.lead.kind!==`select`?(R(),G(`div`,vH,[n[20]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(R(!0),G(H,null,K(h.value,e=>(R(),G(H,{key:e},[M(z(Y),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>le(e,`summary`)},{default:j(()=>[A(V(e),1)]),_:2},1032,[`onClick`]),M(z(Y),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>le(e,`result`)},{default:j(()=>[A(V(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):L(``,!0)])):L(``,!0),b.value.compact.length?(R(),G(`section`,yH,[(R(!0),G(H,null,K(b.value.compact,t=>(R(),G(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[A(V(pe(t.key,t.schema))+` `,1),t.schema.description?(R(),q(z(on),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,bH),t.kind===`workflow`?(R(),q(LV,{key:0,class:`max-w-48`,value:me(t.key),workflows:e.workflows,label:pe(t.key,t.schema),onPick:e=>ee(t.key,e)},null,8,[`vLine 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=_B(gB(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=_B(gB(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 xB(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new fB||null,prettyErrors:t}}function SB(e,t={}){let{lineCounter:n,prettyErrors:r}=xB(t),i=new bB(n?.addNewLine),a=new Qz(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 mz(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(gz(e,n)),o.warnings.forEach(gz(e,n))),o}function CB(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=SB(e,n);if(!i)return null;if(i.warnings.forEach(e=>KL(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 wB(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 VI(e)&&!r?e.toString(n):new dz(e,r,n).toString(n)}var TB=e=>typeof e==`object`&&!!e&&!Array.isArray(e),EB=e=>TB(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function DB(e){if(TB(e)){if(TB(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:EB(e.parallel)};if(TB(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:EB(e.switch.cases)}}}function OB(e){return e.slice(2).includes(`parallel`)}function kB(e,t){let n=SB(e).getIn(t,!0);if(HI(n))return n.toJSON()}function AB(e,t,n){let r=SB(e);return r.setIn(t,r.createNode(VB(n))),r.toString()}function jB(e,t,n){let r=SB(e),i=t.slice(0,-1),a=OB(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(GI(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!GI(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 MB(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 NB(e,t){let n=e.getIn(t,!0),r=DB(HI(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!HI(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function PB(e,t,n){let r=SB(e),{kind:i,branches:a}=NB(r,t);if(MB(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function FB(e,t,n,r){let i=SB(e),{kind:a,branches:o}=NB(i,t);if(MB(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>WI(e.key)&&e.key.value===n);if(!s||!WI(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function IB(e,t,n){let r=SB(e),{kind:i,branches:a}=NB(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 tV(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(ZB)].map(e=>e[1]))]}function nV(e){let t=SB(e).toJS(),n=QB(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=QB(e)?e:{},p=DB(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=QB(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,title:g||XB(m),type:m,role:WB(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:$B(m,h),summary:eV(h),when:typeof d.when==`string`?d.when:void 0,retry:QB(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 tV([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=DB(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*qB,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=QB(t)&&typeof t.id==`string`?t.id:i,f=i===`switch`&&!o.some(([e])=>e==="default"),h=o.length+ +!!f,g=[],_=0;o.forEach(([t,n],o)=>{let s=(o-(h-1)/2)*JB,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*qB,t,d,[...f,r],i);m(l,a,[...f,r-1]),l=[a]}),_=Math.max(_,n.length);let v=`add-${e}-${t}`;r.push({id:v,type:`add`,position:{x:s+104,y:(u+n.length)*qB},data:{kind:`step`,key:v,title:``,type:``,detail:``,branch:t,lane:i,insertAfter:[...f,n.length-1]}}),m(l,v),g.push(v)});let v=(Math.max(_,1)+1)*qB-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*JB;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*qB-40},style:{width:`264px`,height:`${v}px`},zIndex:-1,data:{kind:`step`,key:t,title:t,type:``,detail:``,lane:i}})}),f&&(g.push(c),s.add(c)),l=g,u+=Math.max(_,1)+1;continue}let i=p(t,String(e+1),0,u*qB,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*qB-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 rV={agent:fn,command:$n,repo:Dn,gate:Yn,forge:Fn,human:rr,review:wn,workflow:or},iV={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function aV(e){return e===`parallel`?Dn:e===`switch`?Zn:rV[e.split(`.`)[0]]??or}function oV(e){return Object.keys(iV).map(t=>({title:iV[t],icon:rV[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function sV(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 cV(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function lV(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 uV(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=lV(e,r.type))}return n}var dV=k({__name:`WorkflowPicker`,props:{value:{},workflows:{},label:{}},emits:[`pick`],setup(e,{emit:t}){let n=t;return(t,r)=>(R(),q(z(_l),{"model-value":e.value||void 0,"onUpdate:modelValue":r[0]||=e=>n(`pick`,String(e))},{default:j(()=>[M(z(wl),{"aria-label":e.label},{default:j(()=>[M(z(Tl),{placeholder:`Choose workflow`})]),_:1},8,[`aria-label`]),M(z(vl),null,{default:j(()=>[e.value&&!e.workflows.some(t=>t.id===e.value)?(R(),q(z(xl),{key:0,value:e.value,disabled:``},{default:j(()=>[A(V(e.value)+` (unavailable)`,1)]),_:1},8,[`value`])):L(``,!0),(R(!0),G(H,null,K(e.workflows,e=>(R(),q(z(xl),{key:e.id,value:e.id},{default:j(()=>[A(V(e.id),1)]),_:2},1032,[`value`]))),128))]),_:1})]),_:1},8,[`model-value`]))}});function fV(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function pV(e,t=[]){let n=SB(e),r=n.errors[0];if(r)return{ok:!1,message:DV(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!OV(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`stLine truncated
`).map((e,t)=>({number:t+1,text:e,tokens:CV(e)}))}var xV=/^(\s*)(-\s+)?/,SV=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function CV(e){let{code:t,comment:n}=wV(e),r=TV(t);return n&&r.push({text:n,kind:`comment`}),r}function wV(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 TV(e){if(!e)return[];let t=[],n=xV.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=SV.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,...EV(i[4]??``)]):[...t,...EV(r)]}function EV(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 DV(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function OV(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function kV(e){return typeof e==`string`&&e.trim()!==``}var AV={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},jV={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},MV={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},NV={class:`min-w-0 flex-1`},PV={class:`truncate font-mono text-[11px] text-fg-subtle`},FV={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},IV={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},LV={key:1,class:`space-y-3`},RV={key:0,class:`block space-y-1.5`},zV={id:`switch-on`},BV=[`value`],VV={class:`text-xs font-medium text-muted-foreground`},HV={class:`flex items-center gap-2`},UV={key:1,role:`alert`,class:`text-xs text-danger`},WV={key:2,class:`space-y-1.5`},GV=[`title`],KV={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},qV={key:3,class:`divide-y divide-border rounded-md border border-border`},JV=[`title`],YV={key:0,class:`space-y-3`},XV={class:`text-[13px]`},ZV={key:0,class:`text-danger`},QV={class:`ml-2 text-xs text-fg-subtle`},$V={key:1,class:`space-y-3`},eH={class:`text-[13px]`},tH={class:`ml-2 text-xs text-fg-subtle`},nH=[`title`],rH={key:0,class:`text-xs text-danger`},iH={class:`space-y-2`},aH={class:`divide-y divide-border rounded-md border border-border`},oH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},sH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},cH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},lH={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},uH={class:`flex items-center border-t border-border px-4 py-2.5`},dH=k({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{},workflows:{},modelAliases:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=I(()=>kB(n.yaml,n.path)??{}),a=I(()=>DB(i.value)),o=I(()=>a.value?.kind??(typeof i.value.type==`string`?i.value.type:``)),s=I(()=>a.value?.branches.map(([e])=>e)??[]),c=I(()=>o.value===`parallel`?2:1);function l(e){r(`update:yaml`,AB(n.yaml,n.path,{...i.value,switch:{...i.value.switch,on:e}}))}let u=J(``),d=J(``);function f(e,t,i=``){try{let a=e===`add`?PB(n.yaml,n.path,t):e===`rename`?FB(n.yaml,n.path,t,i):IB(n.yaml,n.path,t);r(`update:yaml`,a),u.value=``,d.value=``}catch(e){d.value=String(e.message)}}let p=I(()=>n.vocabulary.find(e=>e.name===o.value)),m=I(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),h=I(()=>BB(n.yaml,n.path)),g=I(()=>p.value?.settings&&i.value.settings?vV(i.value.settings,p.value.settings,`settings`):``),_=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],v=/mission|body|detail|plan|rules/;function y(e,t){return[`workflow.call`,`workflow.handoff`].includes(o.value)&&e===`workflow`||o.value===`human.approve`&&e===`then`?`workflow`:o.value===`agent.run`&&e===`model`?`select`:t.type===`string`?t.enum?`select`:v.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 b=I(()=>{let e=Object.entries(p.value?.settings?.properties??{}).filter(([e])=>o.value!==`workflow.call`||![`inputs`,`outputs`].includes(e)).map(([e,t])=>({key:e,schema:t,kind:y(e,t),options:o.value===`agent.run`&&e===`model`?n.modelAliases:t.enum??[]})),t=e.filter(e=>_.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>_.indexOf(e.key)-_.indexOf(t.key))[0],r=e.filter(e=>e!==t);return{lead:t,compact:r.filter(e=>[`workflow`,`select`,`line`,`number`,`boolean`].includes(e.kind)),long:r.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function x(e){let{id:t,type:i,...a}=e;r(`update:yaml`,AB(n.yaml,n.path,{id:t,type:i,...a}))}function S(e,t){x({...i.value,[e]:t})}function C(e){S(`retry`,{...i.value.retry,...e})}function w(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&e===`wait`&&t!==!0&&delete n.outputs,x({...i.value,settings:n})}function ee(e,t){let n={...m.value,[e]:t};o.value===`workflow.call`&&t!==m.value[e]&&(delete n.inputs,delete n.outputs),x({...i.value,settings:n})}let T=I(()=>n.workflows.find(e=>e.id===m.value.workflow)),te=I(()=>Object.entries(HB(T.value?.yaml??``,`inputs`)??{})),E=I(()=>Object.entries(HB(T.value?.yaml??``,`outputs`)??{})),ne=I(()=>Object.entries(HB(n.yaml,`inputs`)??{})),re=I(()=>Object.entries(HB(n.yaml,`outputs`)??{})),ie=I(()=>m.value.inputs??{}),ae=I(()=>m.value.outputs??{}),O=e=>typeof e==`string`&&e.startsWith(`inputs.`),oe=e=>ie.value[e]===void 0?``:String(ie.value[e]);function se(e,t,n){w(`inputs`,{...ie.value,[e]:t===``?void 0:O(t)?t:lV(t,n??`string`)})}let ce=J(null);function le(e,t){let n=ce.value??b.value.lead?.key;if(!n)return;let r=typeof m.value[n]==`string`?m.value[n]:``,i=`{{ steps.${e}.${t} }}`;w(n,r?`${r.trimEnd()} ${i}`:i)}let ue=J({});function de(e,t){try{w(e,t.trim()?CB(t):void 0),ue.value={...ue.value,[e]:``}}catch(t){ue.valu Line truncated
`)[0]}}}let fe=e=>e===void 0?``:wB(e).trimEnd(),pe=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),me=e=>typeof m.value[e]==`string`?m.value[e]:``;return(t,n)=>(R(),G(`aside`,AV,[W(`header`,jV,[W(`span`,MV,[(R(),q(it(z(aV)(o.value)),{class:`size-4`}))]),W(`div`,NV,[M(z(D),{"model-value":i.value.id??``,class:`h-7 truncate border-transparent px-1 font-medium shadow-none hover:border-input dark:bg-transparent`,placeholder:z(XB)(o.value),"aria-label":`Step id`,"onUpdate:modelValue":n[0]||=e=>S(`id`,String(e))},null,8,[`model-value`,`placeholder`]),W(`div`,PV,V(o.value),1)]),M(z(Y),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:n[1]||=e=>r(`close`)},{default:j(()=>[M(z(cr))]),_:1})]),W(`div`,FV,[g.value?(R(),G(`p`,IV,V(g.value),1)):L(``,!0),a.value?(R(),G(`section`,LV,[o.value===`switch`?(R(),G(`label`,RV,[n[18]||=W(`span`,{class:`text-xs font-medium text-muted-foreground`,title:`The value whose case runs; a case named default runs when none matches`},`Switch on`,-1),M(z(D),{"model-value":a.value.on,class:`font-mono`,placeholder:`steps.assess.result.fit`,list:`switch-on`,onChange:n[2]||=e=>l(e.target.value.trim())},null,8,[`model-value`]),W(`datalist`,zV,[(R(!0),G(H,null,K(h.value,e=>(R(),G(`option`,{key:e,value:`steps.${e}.result.`},null,8,BV))),128))])])):L(``,!0),W(`div`,VV,V(o.value===`switch`?`Cases`:`Branches`),1),(R(!0),G(H,null,K(s.value,e=>(R(),G(`div`,{key:e,class:`flex items-center gap-2`},[M(z(D),{"model-value":e,class:N(o.value===`switch`&&`font-mono`),"aria-label":`${o.value===`switch`?`Case`:`Branch`} ${e}`,onChange:t=>f(`rename`,e,t.target.value.trim())},null,8,[`model-value`,`class`,`aria-label`,`onChange`]),M(z(Y),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e}`,disabled:s.value.length<=c.value,onClick:t=>f(`delete`,e)},{default:j(()=>[M(z(xe))]),_:1},8,[`aria-label`,`disabled`,`onClick`])]))),128)),W(`div`,HV,[M(z(D),{modelValue:u.value,"onUpdate:modelValue":n[3]||=e=>u.value=e,"aria-label":o.value===`switch`?`New case value`:`New branch name`,placeholder:o.value===`switch`?`Value, or default`:`Branch name`,onKeydown:n[4]||=Bt(zt(e=>f(`add`,u.value.trim()),[`prevent`]),[`enter`])},null,8,[`modelValue`,`aria-label`,`placeholder`]),M(z(Y),{type:`button`,size:`icon-sm`,variant:`outline`,"aria-label":o.value===`switch`?`Add case`:`Add branch`,disabled:!u.value.trim(),onClick:n[5]||=e=>f(`add`,u.value.trim())},{default:j(()=>[M(z(Hn))]),_:1},8,[`aria-label`,`disabled`])]),d.value?(R(),G(`p`,UV,V(d.value),1)):L(``,!0)])):L(``,!0),b.value.lead?(R(),G(`section`,WV,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:b.value.lead.schema.description},[A(V(pe(b.value.lead.key,b.value.lead.schema))+` `,1),b.value.lead.schema.description?(R(),q(z(bn),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,GV),b.value.lead.kind===`workflow`?(R(),q(dV,{key:0,value:me(b.value.lead.key),workflows:e.workflows,label:pe(b.value.lead.key,b.value.lead.schema),onPick:n[6]||=e=>ee(b.value.lead.key,e)},null,8,[`value`,`workflows`,`label`])):b.value.lead.kind===`select`?(R(),q(z(iI),{key:1,size:`sm`,class:`w-full`,"model-value":me(b.value.lead.key),"onUpdate:modelValue":n[7]||=e=>w(b.value.lead.key,String(e)||void 0)},{default:j(()=>[M(z(aI),{value:``},{default:j(()=>[...n[19]||=[A(`Default`,-1)]]),_:1}),(R(!0),G(H,null,K(b.value.lead.options,e=>(R(),q(z(aI),{key:e,value:e},{default:j(()=>[A(V(e),1)]),_:2},1032,[`value`]))),128))]),_:1},8,[`model-value`])):b.value.lead.kind===`text`?(R(),q(z(Hl),{key:2,"model-value":me(b.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:n[8]||=e=>ce.value=b.value.lead.key,"onUpdate:modelValue":n[9]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])):(R(),q(z(D),{key:3,"model-value":me(b.value.lead.key),onFocus:n[10]||=e=>ce.value=b.value.lead.key,"onUpdate:modelValue":n[11]||=e=>w(b.value.lead.key,String(e))},null,8,[`model-value`])),h.value.length&&b.value.lead.kind!==`select`?(R(),G(`div`,KV,[n[20]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(R(!0),G(H,null,K(h.value,e=>(R(),G(H,{key:e},[M(z(Y),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>le(e,`summary`)},{default:j(()=>[A(V(e),1)]),_:2},1032,[`onClick`]),M(z(Y),{type:`button`,variant:`outline`,size:`xs`,class:`font-mono`,onClick:t=>le(e,`result`)},{default:j(()=>[A(V(e)+`.result`,1)]),_:2},1032,[`onClick`])],64))),128))])):L(``,!0)])):L(``,!0),b.value.compact.length?(R(),G(`section`,qV,[(R(!0),G(H,null,K(b.value.compact,t=>(R(),G(`div`,{key:t.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:t.schema.description},[A(V(pe(t.key,t.schema))+` `,1),t.schema.description?(R(),q(z(bn),{key:0,class:`size-3 text-fg-subtle`})):L(``,!0)],8,JV),t.kind===`workflow`?(R(),q(dV,{key:0,class:`max-w-48`,value:me(t.key),workflows:e.workflows,label:pe(t.key,t.schema),onPick:e=>ee(t.key,e)},null,8,[`vLine truncated
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>w(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(R(),G(H,{key:2},[M(z(au),{"model-value":fe(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>de(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),ue.value[e.key]?(R(),G(`span`,kH,V(ue.value[e.key]),1)):L(``,!0)],64))]))),128)),W(`section`,AH,[n[37]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,jH,[W(`label`,MH,[n[31]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),M(z(O),{class:`h-7 w-48 font-mono text-xs`,placeholder:`always`,"model-value":i.value.when??``,"onUpdate:modelValue":n[12]||=e=>S(`when`,String(e))},null,8,[`model-value`])]),W(`label`,NH,[n[34]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),M(z(AI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:j(()=>[M(z(jI),{value:``},{default:j(()=>[...n[32]||=[A(`Park the task`,-1)]]),_:1}),M(z(jI),{value:`continue`},{default:j(()=>[...n[33]||=[A(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),W(`label`,PH,[n[35]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),M(z(O),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":i.value.retry?.attempts??``,"onUpdate:modelValue":n[14]||=e=>C({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),W(`label`,FH,[n[36]||=W(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),M(z(wh),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),W(`footer`,IH,[M(z(Y),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:j(()=>[M(z(Vn)),n[38]||=A(`Delete step`,-1)]),_:1}),M(z(Y),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:j(()=>[...n[39]||=[A(`Done`,-1)]]),_:1})])]))}}),RH=`repository_path`;function zH(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:RH,path:n.trim(),type:`string`,required:!0}),r}function BH(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function VH(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=BH(gb(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function HH(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:gb(e.value,i.type??`string`)})}return n}function UH(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function WH(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...WH(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...WH(n,r)]}):[]}function GH(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function KH(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function qH(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var JH={class:`flex h-full flex-col`},YH={class:`flex items-center gap-2 border-b border-border px-4 py-3`},XH={class:`min-w-0 flex-1 truncate text-sm font-medium`},ZH={key:0,class:`flex flex-1 items-center justify-center`},QH={class:`space-y-1.5`},$H={key:1,class:`space-y-1.5`},eU=[`title`],tU={class:`space-y-1.5`},nU={id:`bind-paths`},rU=[`value`],iU={class:`divide-y divide-border rounded-md border border-border`},aU={class:`flex items-center gap-1.5 text-xs`},oU={class:`font-mono`},sU={class:`text-fg-subtle`},cU={key:0,class:`text-danger`,title:`Required`},lU={key:2,class:`text-xs text-danger`},uU=[`title`],dU={key:0,class:`space-y-1 px-3 py-2`},fU={key:0,class:`text-xs text-danger`},pU={key:1,class:`truncate font-mono text-xs text-success`},mU={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},hU={class:`space-y-2`},gU={key:0,role:`alert`,class:`text-xs text-danger`},_U={key:1,class:`text-xs text-fg-subtle`},vU={class:`flex gap-2`},yU=`__new__`,bU=k({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i= Line truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(R(),G(H,{key:2},[M(z(Hl),{"model-value":fe(m.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>de(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),ue.value[e.key]?(R(),G(`span`,rH,V(ue.value[e.key]),1)):L(``,!0)],64))]))),128)),W(`section`,iH,[n[37]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,aH,[W(`label`,oH,[n[31]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),M(z(D),{class:`h-7 w-48 font-mono text-xs`,placeholder:`always`,"model-value":i.value.when??``,"onUpdate:modelValue":n[12]||=e=>S(`when`,String(e))},null,8,[`model-value`])]),W(`label`,sH,[n[34]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),M(z(iI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:j(()=>[M(z(aI),{value:``},{default:j(()=>[...n[32]||=[A(`Park the task`,-1)]]),_:1}),M(z(aI),{value:`continue`},{default:j(()=>[...n[33]||=[A(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),W(`label`,cH,[n[35]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),M(z(D),{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 text-right text-[13px]`,"model-value":i.value.retry?.attempts??``,"onUpdate:modelValue":n[14]||=e=>C({attempts:String(e)===``?void 0:Number(String(e))})},null,8,[`model-value`])]),W(`label`,lH,[n[36]||=W(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),M(z(sh),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":n[15]||=e=>C({backoff:e||void 0})},null,8,[`model-value`])])])])]),W(`footer`,uH,[M(z(Y),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:n[16]||=e=>r(`remove`)},{default:j(()=>[M(z(xe)),n[38]||=A(`Delete step`,-1)]),_:1}),M(z(Y),{type:`button`,size:`sm`,class:`ml-auto`,onClick:n[17]||=e=>r(`close`)},{default:j(()=>[...n[39]||=[A(`Done`,-1)]]),_:1})])]))}}),fH=`repository_path`;function pH(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:fH,path:n.trim(),type:`string`,required:!0}),r}function mH(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function hH(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=mH($y(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function gH(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:$y(e.value,i.type??`string`)})}return n}function _H(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function vH(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...vH(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...vH(n,r)]}):[]}function yH(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function bH(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function xH(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var SH={class:`flex h-full flex-col`},CH={class:`flex items-center gap-2 border-b border-border px-4 py-3`},wH={class:`min-w-0 flex-1 truncate text-sm font-medium`},TH={key:0,class:`flex flex-1 items-center justify-center`},EH={class:`space-y-1.5`},DH={key:1,class:`space-y-1.5`},OH=[`title`],kH={class:`space-y-1.5`},AH={id:`bind-paths`},jH=[`value`],MH={class:`divide-y divide-border rounded-md border border-border`},NH={class:`flex items-center gap-1.5 text-xs`},PH={class:`font-mono`},FH={class:`text-fg-subtle`},IH={key:0,class:`text-danger`,title:`Required`},LH={key:2,class:`text-xs text-danger`},RH=[`title`],zH={key:0,class:`space-y-1 px-3 py-2`},BH={key:0,class:`text-xs text-danger`},VH={key:1,class:`truncate font-mono text-xs text-success`},HH={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},UH={class:`space-y-2`},WH={key:0,role:`alert`,class:`text-xs text-danger`},GH={key:1,class:`text-xs text-fg-subtle`},KH={class:`flex gap-2`},qH=`__new__`,JH=k({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i= Line 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 XX(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=ZX(n.code,e);return Array.isArray(e)?e.some(e=>YX(n[r],e,t,n.type===`keyup`)):YX(n[r],e,t,n.type===`keyup`)}}function ZX(e,t){return t.includes(e)?`code`:`key`}function QX(e,t){let n=I(()=>Me(t?.target)??KX),r=Ve(Me(e)===!0),i=!1,a=new Set,o=c(Me(e));F(()=>Me(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),WW([`blur`,`contextmenu`],s),KW((...e)=>o(...e),e=>{let n=Me(t?.actInsideInputWithModifier)??!0,a=Me(t?.preventDefault)??!1;if(i=JX(e),(!i||i&&!n)&&qX(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}),KW((...e)=>o(...e),e=>{let n=Me(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&qX(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=Me(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?XX(e,a):e}return r}var $X=`vue-flow__node-desc`,eZ=`vue-flow__edge-desc`,tZ=`vue-flow__aria-live`,nZ=[`Enter`,` `,`Escape`],rZ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function iZ(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function aZ(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 oZ(e){return{width:e.offsetWidth,height:e.offsetHeight}}function sZ(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function cZ(e,t){return{x:sZ(e.x,t[0][0],t[1][0]),y:sZ(e.y,t[0][1],t[1][1])}}function lZ(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function uZ(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function dZ(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!uZ(e)}function fZ(e){return dZ(e)&&`computedPosition`in e}function pZ(e){return!Number.isNaN(e)&&Number.isFinite(e)}function mZ(e){return pZ(e.width)&&pZ(e.height)&&pZ(e.x)&&pZ(e.y)}function hZ(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:lt({width:0,height:0}),computedPosition:lt({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:MQ(e.data)?e.data:{},events:lt(MQ(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function gZ(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:MQ(e.data)?e.data:{},events:lt(MQ(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function _Z(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 vZ(...e){if(e.length===3){let[t,n,r]=e;return _Z(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>uZ(e)&&e.source===r).map(e=>n.find(t=>dZ(t)&&t.id===e.target))}function yZ(...e){if(e.length===3){let[t,n,r]=e;return _Z(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>uZ(e)&&e.target===r).map(e=>n.find(t=>dZ(t)&&t.id===e.source))}function bZ({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function xZ(e,t){return t.some(t=>uZ(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 SZ({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function CZ({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?hQ(s,o):s}function wZ(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 TZ({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function EZ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function DZ(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=wZ(t,TZ({...r.computedPosition,...r.dimensions}))}return EZ(t)}function OZ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...CZ(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= 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 wX(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=TX(n.code,e);return Array.isArray(e)?e.some(e=>CX(n[r],e,t,n.type===`keyup`)):CX(n[r],e,t,n.type===`keyup`)}}function TX(e,t){return t.includes(e)?`code`:`key`}function EX(e,t){let n=I(()=>qe(t?.target)??bX),r=nt(qe(e)===!0),i=!1,a=new Set,o=c(qe(e));F(()=>qe(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),vW([`blur`,`contextmenu`],s),bW((...e)=>o(...e),e=>{let n=qe(t?.actInsideInputWithModifier)??!0,a=qe(t?.preventDefault)??!1;if(i=SX(e),(!i||i&&!n)&&xX(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}),bW((...e)=>o(...e),e=>{let n=qe(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&xX(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=qe(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?wX(e,a):e}return r}var DX=`vue-flow__node-desc`,OX=`vue-flow__edge-desc`,kX=`vue-flow__aria-live`,AX=[`Enter`,` `,`Escape`],jX={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function MX(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function NX(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 PX(e){return{width:e.offsetWidth,height:e.offsetHeight}}function FX(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function IX(e,t){return{x:FX(e.x,t[0][0],t[1][0]),y:FX(e.y,t[0][1],t[1][1])}}function LX(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function RX(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function zX(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!RX(e)}function BX(e){return zX(e)&&`computedPosition`in e}function VX(e){return!Number.isNaN(e)&&Number.isFinite(e)}function HX(e){return VX(e.width)&&VX(e.height)&&VX(e.x)&&VX(e.y)}function UX(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:wt({width:0,height:0}),computedPosition:wt({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:oQ(e.data)?e.data:{},events:wt(oQ(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function WX(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:oQ(e.data)?e.data:{},events:wt(oQ(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function GX(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 KX(...e){if(e.length===3){let[t,n,r]=e;return GX(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>RX(e)&&e.source===r).map(e=>n.find(t=>zX(t)&&t.id===e.target))}function qX(...e){if(e.length===3){let[t,n,r]=e;return GX(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>RX(e)&&e.target===r).map(e=>n.find(t=>zX(t)&&t.id===e.source))}function JX({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function YX(e,t){return t.some(t=>RX(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 XX({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function ZX({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?UZ(s,o):s}function QX(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 $X({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function eZ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function tZ(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=QX(t,$X({...r.computedPosition,...r.dimensions}))}return eZ(t)}function nZ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...ZX(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s= 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}
@@ -147,6 +147,6 @@ 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`},lQ=class extends Error{constructor(e,...t){super(cQ[e]?.call(cQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function uQ(e){return`clientX`in e}function dQ(e){return`sourceEvent`in e}function fQ(e,t){let n=uQ(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 pQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function mQ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function hQ(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var gQ=()=>!0;function _Q(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function vQ(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())aZ(i,iZ(e))>0&&r.push(e);return r}var yQ=250;function bQ(e,t,n,r){let i=[],a=1/0,o=vQ(e,n,t+yQ);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}=rQ(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 xQ(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=gQ},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:_}=fQ(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=SQ(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===VX.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=TQ(t,e,a,p,n,!0)}return b}function SQ(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function CQ(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function wQ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function TQ(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===VX.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,...rQ(o,c,c.position,!0)}:c}var EQ={[RX.Left]:RX.Right,[RX.Right]:RX.Left,[RX.Top]:RX.Bottom,[RX.Bottom]:RX.Top},DQ=[`production`,`prod`];function OQ(e,...t){kQ()&&console.warn(`[Vue Flow]: ${e}`,...t)}function kQ(){return!DQ.includes(`production`)}function AQ(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,...oZ(t)}}):null}function jQ(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),st(()=>{o.blur()})):n([e])}function MQ(e){return z(e)!==void 0}function NQ(e,t,n,r){if(!e||!e.source||!e.target)return n(new lQ(sQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=uZ(e)?e:{...e,id:bZ(e)},i=gZ(i,void 0,r),!xZ(i,t)&&i}function PQ(e,t,n,r,i){if(!t.source||!t.target)return i(new lQ(sQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new lQ(sQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?bZ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function FQ(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!dZ(o)){n(new lQ(sQ.NODE_INVALID,o?.id));continue}let s=hZ(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 lQ(sQ.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 IQ(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 LQ(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}`;IQ(`source`,o,`${r}-${a}--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`},LZ=class extends Error{constructor(e,...t){super(IZ[e]?.call(IZ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function RZ(e){return`clientX`in e}function zZ(e){return`sourceEvent`in e}function BZ(e,t){let n=RZ(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 VZ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function HZ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function UZ(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var WZ=()=>!0;function GZ(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function KZ(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())NX(i,MX(e))>0&&r.push(e);return r}var qZ=250;function JZ(e,t,n,r){let i=[],a=1/0,o=KZ(e,n,t+qZ);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}=jZ(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 YZ(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=WZ},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:_}=BZ(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=XZ(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===hX.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=$Z(t,e,a,p,n,!0)}return b}function XZ(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function ZZ(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function QZ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function $Z(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===hX.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,...jZ(o,c,c.position,!0)}:c}var eQ={[fX.Left]:fX.Right,[fX.Right]:fX.Left,[fX.Top]:fX.Bottom,[fX.Bottom]:fX.Top},tQ=[`production`,`prod`];function nQ(e,...t){rQ()&&console.warn(`[Vue Flow]: ${e}`,...t)}function rQ(){return!tQ.includes(`production`)}function iQ(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,...PX(t)}}):null}function aQ(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),St(()=>{o.blur()})):n([e])}function oQ(e){return z(e)!==void 0}function sQ(e,t,n,r){if(!e||!e.source||!e.target)return n(new LZ(FZ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=RX(e)?e:{...e,id:JX(e)},i=WX(i,void 0,r),!YX(i,t)&&i}function cQ(e,t,n,r,i){if(!t.source||!t.target)return i(new LZ(FZ.EDGE_INVALID,e.id)),!1;if(!n)return i(new LZ(FZ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?JX(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function lQ(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!zX(o)){n(new LZ(FZ.NODE_INVALID,o?.id));continue}let s=UX(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 LZ(FZ.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 uQ(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 dQ(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}`;uQ(`source`,o,`${r}-${a}--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 e2(e){let t=JB(e).toJS(),n=new Map;for(let r of OV(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 t2(e,t,n){let r=e2(e),i=e2(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 n2={class:`grid h-[calc(100dvh-17rem)] min-h-[26rem] grid-cols-[18rem_1fr] gap-3`},r2={class:`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,"aria-label":`Revisions`},i2=[`aria-current`,`onClick`],a2={class:`flex items-center gap-2 text-sm`},o2={class:`font-mono text-xs text-fg-subtle`},s2=[`title`],c2={key:0,class:`px-3 py-2 text-sm text-muted-foreground`},l2={key:0,class:`flex min-h-0 flex-col gap-2`},u2={class:`flex items-center gap-2`},d2={class:`text-xs text-muted-foreground`},f2={key:0,class:`rounded-lg border border-border p-4 text-sm text-muted-foreground`},p2={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},m2={class:`inline-block w-4 select-none text-fg-subtle`},h2={key:2,class:`grid min-h-0 flex-1 grid-cols-2 gap-3`},g2={class:`flex min-h-0 flex-col gap-1`},_2={class:`text-xs font-medium text-muted-foreground`},v2={class:`min-h-0 flex-1`},y2={class:`flex min-h-0 flex-col gap-1`},b2={class:`min-h-0 flex-1`},x2=k({__name:`WorkflowHistory`,props:it({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:it([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Fe(e,`selected`),a=Fe(e,`mode`);F(()=>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=I(()=>n.revisions.find(e=>e.version===i.value)),s=I(()=>o.value?.yaml??null),c=I(()=>s.value===null?[]:$0(s.value,n.current)),l=I(()=>s.value!==null&&s.value===n.current),u=I(()=>s.value===null?{}:t2(s.value,n.current,`removed`)),d=I(()=>s.value===null?{}:t2(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(R(),G(`div`,n2,[W(`ol`,r2,[(R(!0),G(H,null,K(e.revisions,e=>(R(),G(`li`,{key:e.version},[W(`button`,{type:`button`,class:N([`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},[W(`span`,a2,[W(`span`,o2,`v`+V(e.version),1),M(z(At),{variant:f[e.change]},{default:j(()=>[A(V(e.change),1)]),_:2},1032,[`variant`])]),W(`span`,{class:`mt-0.5 block truncate text-xs text-muted-foreground`,title:e.at},V(e.actor||`unknown`)+` · `+V(e.source||`unknown`)+` · `+V(z(Ng)(e.at)),9,s2)],10,i2)]))),128)),e.revisions.length?L(``,!0):(R(),G(`li`,c2,V(e.error||`No recorded changes`),1))]),o.value?(R(),G(`div`,l2,[W(`div`,u2,[M(z(eb),{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e},{default:j(()=>[M(z(nb),null,{default:j(()=>[M(z(rb),{value:`yaml`},{default:j(()=>[...n[2]||=[A(`YAML`,-1)]]),_:1}),M(z(rb),{value:`canvas`},{default:j(()=>[...n[3]||=[A(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),W(`span`,d2,V(l.value?`Same as the current definition`:`Compared with the current definition`),1),M(z(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[1]||=e=>r(`restore`,s.value)},{default:j(()=>[M(z(jn),{"data-icon":`inline-start`}),n[4]||=A(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(R(),G(`p`,f2,`Workflow removed in this revision.`)):a.value===`yaml`?(R(),G(`pre`,p2,[W(`code`,null,[(R(!0),G(H,null,K(c.value,(e,t)=>(R(),G(`span`,{key:t,class:N([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[W(`span`,m2,V(e.kind===`add`?`+`:e.kind===`del`?`-`:``),1),A(V(e.text),1)],2))),128))])])):(R(),G(`div`,h2,[W(`div`,g2,[W(`span`,_2,`v`+V(o.value.version),1),W(`div`,v2,[M(Y0,{yaml:s.value,marks:u.value},null,8,[`yaml`,`marks`])])]),W(`div`,y2,[n[5]||=W(`span`,{class:`text-xs font-medium text-muted-foreground`},`Current`,-1),W(`div`,b2,[M(Y0,{yaml:e.current,marks:d.value},null,8,[`yaml`,`marks`])])])]))])):L(``,!0)]))}}),S2=`workflow-definitions`;function C2(e){let t=me(),n=J([]),r=J(``);async function i(){try{n.value=await t.history(S2),r.value=``} 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 O0(e){let t=SB(e).toJS(),n=new Map;for(let r of nV(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 k0(e,t,n){let r=O0(e),i=O0(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 A0={class:`grid h-[calc(100dvh-17rem)] min-h-[26rem] grid-cols-[18rem_1fr] gap-3`},j0={class:`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,"aria-label":`Revisions`},M0=[`aria-current`,`onClick`],N0={class:`flex items-center gap-2 text-sm`},P0={class:`font-mono text-xs text-fg-subtle`},F0=[`title`],I0={key:0,class:`px-3 py-2 text-sm text-muted-foreground`},L0={key:0,class:`flex min-h-0 flex-col gap-2`},R0={class:`flex items-center gap-2`},z0={class:`text-xs text-muted-foreground`},B0={key:0,class:`rounded-lg border border-border p-4 text-sm text-muted-foreground`},V0={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},H0={class:`inline-block w-4 select-none text-fg-subtle`},U0={key:2,class:`grid min-h-0 flex-1 grid-cols-2 gap-3`},W0={class:`flex min-h-0 flex-col gap-1`},G0={class:`text-xs font-medium text-muted-foreground`},K0={class:`min-h-0 flex-1`},q0={class:`flex min-h-0 flex-col gap-1`},J0={class:`min-h-0 flex-1`},Y0=k({__name:`WorkflowHistory`,props:yt({revisions:{},current:{},error:{}},{selected:{default:0},selectedModifiers:{},mode:{default:`yaml`},modeModifiers:{}}),emits:yt([`restore`],[`update:selected`,`update:mode`]),setup(e,{emit:t}){let n=e,r=t,i=Xe(e,`selected`),a=Xe(e,`mode`);F(()=>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=I(()=>n.revisions.find(e=>e.version===i.value)),s=I(()=>o.value?.yaml??null),c=I(()=>s.value===null?[]:D0(s.value,n.current)),l=I(()=>s.value!==null&&s.value===n.current),u=I(()=>s.value===null?{}:k0(s.value,n.current,`removed`)),d=I(()=>s.value===null?{}:k0(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(R(),G(`div`,A0,[W(`ol`,j0,[(R(!0),G(H,null,K(e.revisions,e=>(R(),G(`li`,{key:e.version},[W(`button`,{type:`button`,class:N([`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},[W(`span`,N0,[W(`span`,P0,`v`+V(e.version),1),M(z(qt),{variant:f[e.change]},{default:j(()=>[A(V(e.change),1)]),_:2},1032,[`variant`])]),W(`span`,{class:`mt-0.5 block truncate text-xs text-muted-foreground`,title:e.at},V(e.actor||`unknown`)+` · `+V(e.source||`unknown`)+` · `+V(z(gg)(e.at)),9,F0)],10,M0)]))),128)),e.revisions.length?L(``,!0):(R(),G(`li`,I0,V(e.error||`No recorded changes`),1))]),o.value?(R(),G(`div`,L0,[W(`div`,R0,[M(z(Ly),{modelValue:a.value,"onUpdate:modelValue":n[0]||=e=>a.value=e},{default:j(()=>[M(z(zy),null,{default:j(()=>[M(z(By),{value:`yaml`},{default:j(()=>[...n[2]||=[A(`YAML`,-1)]]),_:1}),M(z(By),{value:`canvas`},{default:j(()=>[...n[3]||=[A(`Canvas`,-1)]]),_:1})]),_:1})]),_:1},8,[`modelValue`]),W(`span`,z0,V(l.value?`Same as the current definition`:`Compared with the current definition`),1),M(z(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[1]||=e=>r(`restore`,s.value)},{default:j(()=>[M(z(Gn),{"data-icon":`inline-start`}),n[4]||=A(` Restore this version`,-1)]),_:1},8,[`disabled`,`title`])]),s.value===null?(R(),G(`p`,B0,`Workflow removed in this revision.`)):a.value===`yaml`?(R(),G(`pre`,V0,[W(`code`,null,[(R(!0),G(H,null,K(c.value,(e,t)=>(R(),G(`span`,{key:t,class:N([`block min-h-6 px-3 whitespace-pre-wrap`,{"bg-ok/10":e.kind===`add`,"bg-danger/10 text-danger":e.kind===`del`}])},[W(`span`,H0,V(e.kind===`add`?`+`:e.kind===`del`?`-`:``),1),A(V(e.text),1)],2))),128))])])):(R(),G(`div`,U0,[W(`div`,W0,[W(`span`,G0,`v`+V(o.value.version),1),W(`div`,K0,[M(C0,{yaml:s.value,marks:u.value},null,8,[`yaml`,`marks`])])]),W(`div`,q0,[n[5]||=W(`span`,{class:`text-xs font-medium text-muted-foreground`},`Current`,-1),W(`div`,J0,[M(C0,{yaml:e.current,marks:d.value},null,8,[`yaml`,`marks`])])])]))])):L(``,!0)]))}}),X0=`workflow-definitions`;function Z0(e){let t=O(),n=J([]),r=J(``);async function i(){try{n.value=await t.history(X0),r.value=``}c 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/alert.js">
<link rel="modulepreload" crossorigin href="/assets/HistoryLink.js">
<link rel="modulepreload" crossorigin href="/assets/CardAccordion.js">
<link rel="stylesheet" crossorigin href="/assets/index.css">
</head>
<body>
+12 -5
View File
@@ -6,6 +6,7 @@ import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
import { useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import CardAccordion from "./CardAccordion.vue";
import HistoryLink from "./HistoryLink.vue";
interface Profile { image?: string; kit?: string; adapter?: string; tools?: string[] }
@@ -14,7 +15,11 @@ const store = useSettingsStore();
onMounted(store.load);
const profiles = computed(() => store.drafts[KIND]?.value as Record<string, Profile> | null);
const name = ref("");
const open = ref("");
const unsaved = computed(() => store.changesFor(KIND).length > 0);
const entries = computed(() => Object.entries(profiles.value ?? {}));
function add() {
if (unsaved.value) return;
const key = name.value.trim();
if (!key || profiles.value?.[key]) return;
const draft = store.drafts[KIND];
@@ -22,6 +27,7 @@ function add() {
if (!draft.value) draft.value = {};
(draft.value as Record<string, Profile>)[key] = { image: "", kit: "", adapter: "", tools: [] };
name.value = "";
open.value = String(Object.keys(draft.value as Record<string, Profile>).indexOf(key));
}
function tools(profile: Profile, value: string | number) {
profile.tools = String(value).split(",").map(tool => tool.trim()).filter(Boolean);
@@ -33,16 +39,17 @@ function tools(profile: Profile, value: string | number) {
<ApplyStatusRows :kind="KIND" class="mb-4" />
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<form class="mb-4 flex gap-2" @submit.prevent="add">
<Input v-model="name" aria-label="Profile name" placeholder="Profile name" class="max-w-xs" />
<Button type="submit" :disabled="!name.trim() || !!profiles?.[name.trim()]">Add profile</Button>
<Input v-model="name" aria-label="Profile name" placeholder="Profile name" class="max-w-xs" :disabled="unsaved" />
<Button type="submit" :disabled="unsaved || !name.trim() || !!profiles?.[name.trim()]">Add profile</Button>
</form>
<p v-if="!Object.keys(profiles ?? {}).length" class="text-sm text-fg-muted">No agent profiles.</p>
<section v-for="(profile, key) in profiles" :key="key" class="mb-6 border-t pt-4">
<div class="flex items-center justify-between"><h2 class="font-mono text-sm">{{ key }}</h2><Button variant="ghost" size="sm" @click="delete profiles![key]">Remove profile</Button></div>
<CardAccordion v-model:open="open" :items="entries" :title="([key]) => key" remove-label="Remove" mono @remove="delete profiles![entries[$event]![0]]">
<template #default="{ item: [key, profile] }">
<SettingRow label="Image" :for="`${key}-image`"><Input :id="`${key}-image`" v-model="profile.image" placeholder="Container image" /></SettingRow>
<SettingRow label="Kit" :for="`${key}-kit`" hint="Pinned digest. Used only when Image is empty."><Input :id="`${key}-kit`" v-model="profile.kit" placeholder="registry/kit@sha256:…" /></SettingRow>
<SettingRow label="Adapter" :for="`${key}-adapter`"><Input :id="`${key}-adapter`" v-model="profile.adapter" /></SettingRow>
<SettingRow label="Tools" :for="`${key}-tools`" hint="Comma-separated tool names."><Input :id="`${key}-tools`" :model-value="(profile.tools ?? []).join(', ')" @update:model-value="tools(profile, $event)" /></SettingRow>
</section>
</template>
</CardAccordion>
</div>
</template>
+42
View File
@@ -0,0 +1,42 @@
<script setup lang="ts" generic="T">
import { Trash2 } from "@lucide/vue";
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion";
import { Button } from "@/components/ui/button";
/**
* A list of configuration cards where one is open at a time. The owning page
* opens a new card when it adds one and refuses to add another while unsaved
* changes exist.
*/
defineProps<{
items: T[];
title: (item: T, index: number) => string;
removeLabel: string;
mono?: boolean;
}>();
const open = defineModel<string>("open", { default: "" });
defineEmits<{ remove: [index: number] }>();
</script>
<template>
<Accordion v-model="open" type="single" collapsible class="mb-4 gap-4">
<AccordionItem
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"
>
<header class="flex items-center gap-2 [&>h3]:min-w-0 [&>h3]:flex-1">
<AccordionTrigger class="min-w-0 flex-1 items-center text-[15px] hover:no-underline" :class="mono && 'font-mono'">
<span class="truncate">{{ title(item, i) }}</span>
</AccordionTrigger>
<slot name="aside" :item="item" :index="i" />
<Button variant="ghost" size="icon" :aria-label="`${removeLabel} ${title(item, i)}`" @click="$emit('remove', i)"><Trash2 /></Button>
</header>
<AccordionContent>
<slot :item="item" :index="i" />
</AccordionContent>
</AccordionItem>
</Accordion>
</template>
+11 -5
View File
@@ -1,11 +1,12 @@
<script setup lang="ts">
import { computed, onMounted } from "vue";
import { computed, onMounted, ref } from "vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { SettingRow } from "@/components/ui/setting-row";
import { useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import CardAccordion from "./CardAccordion.vue";
import HistoryLink from "./HistoryLink.vue";
import SecretRefField from "./SecretRefField.vue";
interface Binding { service: string; org?: string; secret: { engine: string; key: string } }
@@ -13,24 +14,29 @@ const KIND = "credential-bindings";
const store = useSettingsStore();
onMounted(store.load);
const bindings = computed(() => store.drafts[KIND]?.value as Binding[] | null);
const open = ref("");
const unsaved = computed(() => store.changesFor(KIND).length > 0);
function add() {
if (unsaved.value) return;
const draft = store.drafts[KIND];
if (!draft) return;
if (!draft.value) draft.value = [];
(draft.value as Binding[]).push({ service: "", org: "", secret: { engine: "", key: "" } });
open.value = String((draft.value as Binding[]).length - 1);
}
</script>
<template>
<div>
<PageHeader title="Credential bindings"><HistoryLink :kinds="[KIND]" /><Button @click="add">Add binding</Button></PageHeader>
<PageHeader title="Credential bindings"><HistoryLink :kinds="[KIND]" /><Button :disabled="unsaved" @click="add">Add binding</Button></PageHeader>
<ApplyStatusRows :kind="KIND" class="mb-4" />
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<p v-if="!bindings?.length" class="text-sm text-fg-muted">No credential bindings.</p>
<section v-for="(binding, index) in bindings" :key="index" class="mb-6 border-t pt-4">
<div class="flex justify-end"><Button variant="ghost" size="sm" @click="bindings!.splice(index, 1)">Remove binding</Button></div>
<CardAccordion v-model:open="open" :items="bindings ?? []" :title="(b) => b.service || 'New binding'" remove-label="Remove" mono @remove="bindings!.splice($event, 1)">
<template #default="{ item: binding, index }">
<SettingRow label="Service" :for="`binding-${index}-service`"><Input :id="`binding-${index}-service`" v-model="binding.service" /></SettingRow>
<SettingRow label="Organisation" :for="`binding-${index}-org`" hint="Empty uses the default organisation."><Input :id="`binding-${index}-org`" v-model="binding.org" /></SettingRow>
<SettingRow label="Secret"><SecretRefField v-model="binding.secret" :id-prefix="`binding-${index}-secret`" /></SettingRow>
</section>
</template>
</CardAccordion>
</div>
</template>
+11 -5
View File
@@ -6,6 +6,7 @@ import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { useSettingsStore } from "@/stores/settings";
import ApplyStatusRows from "./ApplyStatusRows.vue";
import CardAccordion from "./CardAccordion.vue";
import HistoryLink from "./HistoryLink.vue";
interface Playbook { id: string; yaml: string }
const KIND = "eda-playbooks";
@@ -13,7 +14,10 @@ const store = useSettingsStore();
onMounted(store.load);
const collection = computed(() => store.drafts[KIND]?.value as { playbooks: Playbook[] } | null);
const id = ref("");
const open = ref("");
const unsaved = computed(() => store.changesFor(KIND).length > 0);
function add() {
if (unsaved.value) return;
const key = id.value.trim();
if (!key || collection.value?.playbooks.some(entry => entry.id === key)) return;
const draft = store.drafts[KIND];
@@ -21,6 +25,7 @@ function add() {
if (!draft.value) draft.value = { playbooks: [] };
(draft.value as { playbooks: Playbook[] }).playbooks.push({ id: key, yaml: "" });
id.value = "";
open.value = String((draft.value as { playbooks: Playbook[] }).playbooks.length - 1);
}
</script>
<template>
@@ -28,11 +33,12 @@ function add() {
<PageHeader title="Playbooks"><HistoryLink :kinds="[KIND]" /></PageHeader>
<ApplyStatusRows :kind="KIND" class="mb-4" />
<p v-if="store.catalogError || store.pageErrorFor(KIND)" class="mb-4 text-sm text-destructive" role="alert">{{ store.catalogError || store.pageErrorFor(KIND) }}</p>
<form class="mb-4 flex gap-2" @submit.prevent="add"><Input v-model="id" aria-label="Playbook ID" placeholder="Playbook ID" class="max-w-xs" /><Button type="submit" :disabled="!id.trim() || collection?.playbooks.some(entry => entry.id === id.trim())">Add playbook</Button></form>
<form class="mb-4 flex gap-2" @submit.prevent="add"><Input v-model="id" aria-label="Playbook ID" placeholder="Playbook ID" class="max-w-xs" :disabled="unsaved" /><Button type="submit" :disabled="unsaved || !id.trim() || collection?.playbooks.some(entry => entry.id === id.trim())">Add playbook</Button></form>
<p v-if="!collection?.playbooks.length" class="text-sm text-fg-muted">No playbooks installed.</p>
<section v-for="(entry, index) in collection?.playbooks" :key="index" class="mb-6 border-t pt-4">
<div class="mb-3 flex items-center justify-between"><label :for="`playbook-${index}`" class="font-mono text-sm">{{ entry.id }}</label><Button variant="ghost" size="sm" @click="collection!.playbooks.splice(index, 1)">Remove playbook</Button></div>
<Textarea :id="`playbook-${index}`" v-model="entry.yaml" :aria-label="`${entry.id} YAML`" class="min-h-64 font-mono" spellcheck="false" />
</section>
<CardAccordion v-model:open="open" :items="collection?.playbooks ?? []" :title="(entry) => entry.id" remove-label="Remove" mono @remove="collection!.playbooks.splice($event, 1)">
<template #default="{ item: entry, index }">
<Textarea :id="`playbook-${index}`" v-model="entry.yaml" :aria-label="`${entry.id} YAML`" class="mb-3 min-h-64 font-mono" spellcheck="false" />
</template>
</CardAccordion>
</div>
</template>
+16 -15
View File
@@ -1,8 +1,8 @@
<script setup lang="ts">
import ApplyStatusRows from "./ApplyStatusRows.vue";
import { computed, onMounted } from "vue";
import { computed, onMounted, ref } from "vue";
import { storeToRefs } from "pinia";
import { CalendarClock, Plus, Trash2 } from "@lucide/vue";
import { CalendarClock, Plus } from "@lucide/vue";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
@@ -19,6 +19,7 @@ import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { SettingRow } from "@/components/ui/setting-row";
import { Textarea } from "@/components/ui/textarea";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import CardAccordion from "./CardAccordion.vue";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
@@ -60,8 +61,12 @@ const pools = [
{ value: "parallel", label: "Parallel" },
];
const open = ref("");
const unsaved = computed(() => store.changesFor(KIND).length > 0);
function add() {
jobs.value?.push({
if (unsaved.value || !jobs.value) return;
jobs.value.push({
id: "",
kind: "workflow",
detail: "",
@@ -70,6 +75,7 @@ function add() {
target: {},
payload: { text: "" },
});
open.value = String(jobs.value.length - 1);
}
// datetime-local speaks local wall time without a zone; the document stores
@@ -90,7 +96,7 @@ const whenKind = (job: Job) => job.schedule.kind || "interval";
<div>
<PageHeader title="Schedules">
<HistoryLink :kinds="resources.map((r) => r.kind)" />
<Button v-if="jobs?.length" size="sm" @click="add"><Plus data-icon="inline-start" />Add schedule</Button>
<Button v-if="jobs?.length" size="sm" :disabled="unsaved" @click="add"><Plus data-icon="inline-start" />Add schedule</Button>
</PageHeader>
<ApplyStatusRows v-for="resource in resources" :key="resource.kind" :kind="resource.kind" class="mb-4" />
@@ -111,17 +117,11 @@ const whenKind = (job: Job) => job.schedule.kind || "interval";
</EmptyContent>
</Empty>
<section
v-for="(job, i) in jobs"
:key="i"
class="mb-4 rounded-lg border border-border bg-card px-5 pt-4 pb-2"
:aria-label="job.detail || job.id || 'New schedule'"
>
<header class="flex items-center gap-2">
<h2 class="min-w-0 flex-1 truncate text-[15px] font-medium">{{ job.detail || job.id || "New schedule" }}</h2>
<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>
<Button variant="ghost" size="icon" aria-label="Delete schedule" @click="jobs.splice(i, 1)"><Trash2 /></Button>
</header>
</template>
<template #default="{ item: job, index: i }">
<SettingRow label="ID" :for="`job-${i}-id`">
<div class="flex flex-wrap items-center gap-3">
<Input :id="`job-${i}-id`" v-model="job.id" class="max-w-sm font-mono" :aria-invalid="jobIssue(i) ? true : undefined" />
@@ -190,7 +190,8 @@ const whenKind = (job: Job) => job.schedule.kind || "interval";
<DraftHint :kind="KIND" :path="`${i}.pool`" />
</div>
</SettingRow>
</section>
</template>
</CardAccordion>
</template>
</div>
</template>
+6 -19
View File
@@ -2,9 +2,8 @@
import ApplyStatusRows from "./ApplyStatusRows.vue";
import { computed, onMounted, ref } from "vue";
import { storeToRefs } from "pinia";
import { Plus, Trash2 } from "@lucide/vue";
import { Plus } from "@lucide/vue";
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion";
import PageHeader from "@/base/PageHeader.vue";
import { Button } from "@/components/ui/button";
@@ -33,6 +32,7 @@ import {
TagsInputItemText,
} from "@/components/ui/tags-input";
import { resourcesForPage, useSettingsStore } from "@/stores/settings";
import CardAccordion from "./CardAccordion.vue";
import CommandListEditor from "./CommandListEditor.vue";
import DraftHint from "./DraftHint.vue";
import HistoryLink from "./HistoryLink.vue";
@@ -91,20 +91,8 @@ const protectOf = (repo: Repo) => repo.protect ?? [];
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">{{ catalogError || error }}</p>
<template v-if="draft">
<Accordion v-model="open" type="single" collapsible class="mb-4 gap-4">
<AccordionItem
v-for="(repo, i) in repos"
:key="i"
:value="String(i)"
class="rounded-lg border border-border bg-card px-5 not-last:border-b"
>
<header class="flex items-center gap-2 [&>h3]:min-w-0 [&>h3]:flex-1">
<AccordionTrigger class="min-w-0 flex-1 items-center font-mono text-[15px] hover:no-underline">
<span class="truncate">{{ repo.owner }}/{{ repo.name }}</span>
</AccordionTrigger>
<Button variant="ghost" size="icon" :aria-label="`Remove ${repo.owner}/${repo.name}`" @click="repos.splice(i, 1)"><Trash2 /></Button>
</header>
<AccordionContent>
<CardAccordion v-model:open="open" :items="repos" :title="(r) => `${r.owner}/${r.name}`" remove-label="Remove" mono @remove="repos.splice($event, 1)">
<template #default="{ item: repo, index: i }">
<SettingRow label="Base branch" :for="`repo-${i}-base`">
<div class="flex flex-wrap items-center gap-3">
<Input :id="`repo-${i}-base`" v-model="repo.base" class="max-w-56 font-mono" />
@@ -181,9 +169,8 @@ const protectOf = (repo: Repo) => repo.protect ?? [];
<DraftHint :kind="KIND" :path="`${i}.allow_concurrent`" />
</div>
</SettingRow>
</AccordionContent>
</AccordionItem>
</Accordion>
</template>
</CardAccordion>
<div class="flex gap-2">
<Input v-model="newRepo" class="max-w-72 font-mono" placeholder="owner/repository" aria-label="New repository" :disabled="unsaved" @keydown.enter="addRepo" />