fix(webui): cut tutorial and marketing prose from labels, hints, empty states and confirms

This commit is contained in:
sam committed 2026-10-13 17:37:53 +11:00
1 parent 0e25291d47
commit 8001c893bd
32 files changed
+118 -130

No files matched your search

+8 -8
View File
@@ -181,8 +181,8 @@ type RetryModeMeta struct {
// order. Callers receive a fresh slice.
func RetryModes() []RetryModeMeta {
return []RetryModeMeta{
{ID: string(RetryRefreshOntoBase), Label: "Refresh onto base", Description: "Start the retry from the current base branch, discarding work already pushed on this task's branch.", Default: true},
{ID: string(RetryContinuePushedWork), Label: "Continue pushed work", Description: "Resume the branch this task already pushed, keeping its commits.", RequiresBranch: true},
{ID: string(RetryRefreshOntoBase), Label: "Refresh onto base", Description: "Retry from the current base; discards pushed commits.", Default: true},
{ID: string(RetryContinuePushedWork), Label: "Continue pushed work", Description: "Resume the pushed branch.", RequiresBranch: true},
}
}
@@ -221,13 +221,13 @@ type ActionMeta struct {
func Statuses() []StatusMeta {
return []StatusMeta{
{ID: Queued, Label: "Queued", Kind: "idle"},
{ID: Running, Label: "Working", Kind: "info"},
{ID: Running, Label: "Running", Kind: "info"},
{ID: WaitingHuman, Label: "Waiting for you", Kind: "warn", NeedsYou: true},
{ID: PROpen, Label: "In review", Kind: "ok"},
{ID: Merged, Label: "Merged", Kind: "ok"},
{ID: Completed, Label: "Done", Kind: "ok"},
{ID: Parked, Label: "Parked", Kind: "warn", NeedsYou: true},
{ID: Dead, Label: "Stopped (too many retries)", Kind: "danger"},
{ID: Dead, Label: "Stopped: retry cap", Kind: "danger"},
{ID: Rejected, Label: "Rejected", Kind: "danger"},
{ID: Declined, Label: "Won't do", Kind: "idle"},
}
@@ -237,13 +237,13 @@ func Statuses() []StatusMeta {
// Callers receive a fresh slice.
func ActionCatalog() []ActionMeta {
return []ActionMeta{
{ID: string(ActionCancel), Label: "Cancel", Kind: "quiet", Confirm: `Cancel "{title}"? This closes the forge issue.`},
{ID: string(ActionStop), Label: "Stop", Kind: "primary", Confirm: `Stop "{title}"? Recoverable work will remain parked.`},
{ID: string(ActionCancel), Label: "Cancel", Kind: "quiet", Confirm: `Cancel "{title}"? Closes the issue.`},
{ID: string(ActionStop), Label: "Stop", Kind: "primary", Confirm: `Stop "{title}"? Work stays parked.`},
{ID: string(ActionApprove), Label: "Approve", Kind: "primary"},
{ID: string(ActionRereview), Label: "Re-review", Kind: "quiet"},
{ID: string(ActionReject), Label: "Reject", Kind: "quiet", Confirm: `Reject "{title}"? This closes the forge issue.`},
{ID: string(ActionReject), Label: "Reject", Kind: "quiet", Confirm: `Reject "{title}"? Closes the issue.`},
{ID: string(ActionRetry), Label: "Retry", Kind: "primary"},
{ID: string(ActionAbandon), Label: "Abandon", Kind: "quiet", Confirm: `Abandon "{title}"? Archie stops working on it; the forge issue stays open.`},
{ID: string(ActionAbandon), Label: "Abandon", Kind: "quiet", Confirm: `Abandon "{title}"? The issue stays open.`},
{ID: string(ActionArchive), Label: "Archive", Kind: "quiet", Confirm: `Archive the local record for "{title}"?`},
{ID: string(ActionMerge), Label: "Merge", Kind: "primary", Confirm: `Merge the pull request for "{title}"?`},
{ID: string(ActionOpenPR), Label: "Open PR", Kind: "link"},
+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; leave Image empty when using a Kit.`},{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{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};
+1 -1
View File
@@ -13,4 +13,4 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),oa&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=ka(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Wi(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-Aa),Aa),t/=Aa,t/Math.abs(t)+Math.round(t*(ja-1)))}shouldForceSelection(e){return na?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),Ma)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(na&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._active Line truncated
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(F(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(k(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<Es+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Es+1&&(this._liveRegion.textContent+=Se.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let Line truncated
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return be.get()},set promptLabel(e){be.set(e)},get tooMuchOutput(){return Se.get()},set tooMuchOutput(e){Se.set(e)}}}_verifyIntegers(...e){for(zs of e)if(zs===1/0||isNaN(zs)||zs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zs of e)if(zs&&(zs===1/0||isNaN(zs)||zs%1!=0||zs<0))throw Error(`This API only accepts positive integers`)}},Vs=2,Hs=1,Us=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Vs,Math.floor(u/e.css.cell.width)),rows:Math.max(Hs,Math.floor(l/e.css.cell.height))}}};function Ws(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function Gs(e,t,n=80,r=24){let i=t.protocol===`https:`?`wss:`:`ws:`,a=new URLSearchParams({profile:e,cols:String(n),rows:String(r)}).toString();return`${i}//${t.host}/api/harness/terminal?${a}`}var Ks={class:`flex h-full min-h-0 flex-col gap-2`},qs={key:0,class:`text-sm text-muted-foreground`,role:`status`},Js=e({__name:`SetupTerminal`,props:{profile:{}},setup(e){let n=e,r=g(null),s=g(`connecting`),l=null,d=null,m=null,h=null;function _(){try{m?.fit()}catch{}}return c(()=>{let e=r.value;if(!e)return;l=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),m=new Us,l.loadAddon(m),l.open(e),_(),l.focus();let t=new WebSocket(Gs(n.profile,window.location,l?.cols??80,l?.rows??24));d=t,t.binaryType=`arraybuffer`,t.onopen=()=>{s.value=`open`},t.onmessage=e=>{l&&(typeof e.data==`string`?l.write(e.data):l.write(new Uint8Array(e.data)))},t.onerror=()=>{s.value=`failed`},t.onclose=()=>{s.value=`closed`},l.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),h=new ResizeObserver(_),h.observe(e)}),i(()=>{h?.disconnect(),h=null,d?.close(),d=null,l?.dispose(),l=null,m=null}),(e,n)=>(o(),p(`div`,Ks,[s.value===`open`?a(``,!0):(o(),p(`p`,qs,[s.value===`connecting`?(o(),p(u,{key:0},[t(`Connecting…`)],64)):s.value===`closed`?(o(),p(u,{key:1},[t(`The terminal session ended.`)],64)):(o(),p(u,{key:2},[t(`Could not open the setup terminal.`)],64))])),f(`div`,{ref_key:`host`,ref:r,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Ys={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},Xs={key:1,class:`space-y-2`},Zs={class:`flex flex-col gap-1 text-sm`},Qs=e({__name:`HarnessPage`,setup(e){let i=g(null),x=g(!0),ve=g(null),S=g(!1),C=g(``),w=g(!1),ye={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};c(be);async function be(){x.value=!0,ve.value=null,S.value=!1;try{let e=await ae.harnessBindings();i.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},C.value=i.value.profiles[0]??``}catch(e){let t=e instanceof _?e.status:void 0;t===501||t===503?S.value=!0:ve.value=e instanceof Error?e.message:String(e),i.value=null}finally{x.value=!1}}function xe(){i.value?.terminal&&C.value&&(w.value=!0)}function Se(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Ce(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,c)=>(o(),p(`div`,null,[r(d,{title:`Harness`}),ve.value?(o(),p(`p`,Ys,l(ve.value),1)):a(``,!0),x.value?(o(),p(`div`,Xs,[r(s(me),{class:`h-24 w-full`}),r(s(me),{class:`h-40 w-full`})])):S.value?(o(),h(s(le),{key:2},{default:n(()=>[r(s(pe),null,{default:n(()=>[r(s(v),null,{default:n(()=>[...c[1]||=[t(`Harness bindings are not config Line truncated
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return be.get()},set promptLabel(e){be.set(e)},get tooMuchOutput(){return Se.get()},set tooMuchOutput(e){Se.set(e)}}}_verifyIntegers(...e){for(zs of e)if(zs===1/0||isNaN(zs)||zs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(zs of e)if(zs&&(zs===1/0||isNaN(zs)||zs%1!=0||zs<0))throw Error(`This API only accepts positive integers`)}},Vs=2,Hs=1,Us=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Vs,Math.floor(u/e.css.cell.width)),rows:Math.max(Hs,Math.floor(l/e.css.cell.height))}}};function Ws(e,t=Date.now()){if(!e.captured)return`unconfigured`;if(!e.expires_at)return`ready`;let n=Date.parse(e.expires_at);return Number.isNaN(n)?`ready`:n<=t?`expired`:n-t<=18e5?`expiring`:`ready`}function Gs(e,t,n=80,r=24){let i=t.protocol===`https:`?`wss:`:`ws:`,a=new URLSearchParams({profile:e,cols:String(n),rows:String(r)}).toString();return`${i}//${t.host}/api/harness/terminal?${a}`}var Ks={class:`flex h-full min-h-0 flex-col gap-2`},qs={key:0,class:`text-sm text-muted-foreground`,role:`status`},Js=e({__name:`SetupTerminal`,props:{profile:{}},setup(e){let n=e,r=g(null),s=g(`connecting`),l=null,d=null,m=null,h=null;function _(){try{m?.fit()}catch{}}return c(()=>{let e=r.value;if(!e)return;l=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),m=new Us,l.loadAddon(m),l.open(e),_(),l.focus();let t=new WebSocket(Gs(n.profile,window.location,l?.cols??80,l?.rows??24));d=t,t.binaryType=`arraybuffer`,t.onopen=()=>{s.value=`open`},t.onmessage=e=>{l&&(typeof e.data==`string`?l.write(e.data):l.write(new Uint8Array(e.data)))},t.onerror=()=>{s.value=`failed`},t.onclose=()=>{s.value=`closed`},l.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),h=new ResizeObserver(_),h.observe(e)}),i(()=>{h?.disconnect(),h=null,d?.close(),d=null,l?.dispose(),l=null,m=null}),(e,n)=>(o(),p(`div`,Ks,[s.value===`open`?a(``,!0):(o(),p(`p`,qs,[s.value===`connecting`?(o(),p(u,{key:0},[t(`Connecting…`)],64)):s.value===`closed`?(o(),p(u,{key:1},[t(`The terminal session ended.`)],64)):(o(),p(u,{key:2},[t(`Could not open the setup terminal.`)],64))])),f(`div`,{ref_key:`host`,ref:r,class:`min-h-0 flex-1 overflow-hidden rounded-md border border-border bg-[#0b0f14] p-2`},null,512)]))}}),Ys={key:0,class:`mb-4 text-sm text-danger`,role:`alert`},Xs={key:1,class:`space-y-2`},Zs={class:`flex flex-col gap-1 text-sm`},Qs=e({__name:`HarnessPage`,setup(e){let i=g(null),x=g(!0),ve=g(null),S=g(!1),C=g(``),w=g(!1),ye={ready:{label:`Ready`,variant:`ok`},expiring:{label:`Expiring soon`,variant:`warn`},expired:{label:`Expired`,variant:`danger`},unconfigured:{label:`Not set up`,variant:`idle`}};c(be);async function be(){x.value=!0,ve.value=null,S.value=!1;try{let e=await ae.harnessBindings();i.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},C.value=i.value.profiles[0]??``}catch(e){let t=e instanceof _?e.status:void 0;t===501||t===503?S.value=!0:ve.value=e instanceof Error?e.message:String(e),i.value=null}finally{x.value=!1}}function xe(){i.value?.terminal&&C.value&&(w.value=!0)}function Se(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Ce(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,c)=>(o(),p(`div`,null,[r(d,{title:`Harness`}),ve.value?(o(),p(`p`,Ys,l(ve.value),1)):a(``,!0),x.value?(o(),p(`div`,Xs,[r(s(me),{class:`h-24 w-full`}),r(s(me),{class:`h-40 w-full`})])):S.value?(o(),h(s(le),{key:2},{default:n(()=>[r(s(pe),null,{default:n(()=>[r(s(v),null,{default:n(()=>[...c[1]||=[t(`Harness bindings are not config Line truncated
+1 -1
View File
@@ -1 +1 @@
import{A as e,Ct as t,D as n,Jt as r,O as i,ht as a,t as o,v as s,x as c}from"./PageHeader.js";var l=e({__name:`NotFoundPage`,setup(e){return(e,l)=>{let u=t(`RouterLink`);return a(),c(`div`,null,[i(o,{title:`Page not found`}),l[1]||=s(`p`,{class:`mb-4 text-sm text-fg-muted`},`This address does not match a page.`,-1),i(u,{to:`/`,class:`text-sm underline`},{default:r(()=>[...l[0]||=[n(`Return to dashboard`,-1)]]),_:1})])}}});export{l as default};
import{A as e,Ct as t,D as n,Jt as r,O as i,ht as a,t as o,v as s,x as c}from"./PageHeader.js";var l=e({__name:`NotFoundPage`,setup(e){return(e,l)=>{let u=t(`RouterLink`);return a(),c(`div`,null,[i(o,{title:`Page not found`}),l[1]||=s(`p`,{class:`mb-4 text-sm text-fg-muted`},`No page at this address.`,-1),i(u,{to:`/`,class:`text-sm underline`},{default:r(()=>[...l[0]||=[n(`Return to dashboard`,-1)]]),_:1})])}}});export{l as default};
+64 -64
View File
@@ -10,59 +10,59 @@ 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 a
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
`)}};NL.defaultYaml={explicit:!1,version:`1.2`},NL.defaultTags={"!!":`tag:yaml.org,2002:`};function PL(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 FL(e){let t=new Set;return EL(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function IL(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??=FL(e);let a=IL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(vL(t.node)||bL(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 RL(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=RL(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=RL(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=RL(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=RL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function zL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>zL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!SL(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 BL=class{constructor(e){Object.defineProperty(this,pL,{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(!hL(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=zL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?RL(i,{"":o},``,o):o}},VL=class extends BL{constructor(e){super(sL),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=[],EL(e,{Node:(e,t)=>{(mL(t)||SL(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||=(zL(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=HL(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(PL(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 HL(e,t,n){if(mL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(bL(t)){let r=0;for(let i of t.items){let t=HL(e,i,n);t>r&&(r=t)}return r}if(_L(t)){let r=HL(e,t.key,n),i=HL(e,t.value,n);return Math.max(r,i)}return 1}var UL=e=>!e||typeof e!=`function`&&typeof e!=`object`,WL=class extends BL{constructor(e){super(dL),this.value=e}toJSON(e,t){return t?.keep?this.value:zL(this.value,e,t)}toString(){return String(this.value)}};WL.BLOCK_FOLDED=`BLOCK_FOLDED`,WL.BLOCK_LITERAL=`BLOCK_LITERAL`,WL.PLAIN=`PLAIN`,WL.QUOTE_DOUBLE=`QUOTE_DOUBLE`,WL.QUOTE_SINGLE=`QUOTE_SINGLE`;var GL=`tag:yaml.org,2002:`;function KL(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 qL(e,t,n){if(hL(e)&&(e=e.contents),xL(e))return e;if(_L(e)){let t=n.schema[lL].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 VL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=GL+t.slice(2));let l=KL(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new WL(e);return c&&(c.node=t),t Line truncated
`)?QL(n,t):n.includes(`
`)}),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
`)}};ML.defaultYaml={explicit:!1,version:`1.2`},ML.defaultTags={"!!":`tag:yaml.org,2002:`};function NL(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 PL(e){let t=new Set;return TL(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function FL(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function IL(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=PL(e);let a=FL(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(_L(t.node)||yL(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 LL(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=LL(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=LL(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=LL(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=LL(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function RL(e,t,n){if(Array.isArray(e))return e.map((e,t)=>RL(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!xL(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 zL=class{constructor(e){Object.defineProperty(this,fL,{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(!mL(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=RL(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?LL(i,{"":o},``,o):o}},BL=class extends zL{constructor(e){super(oL),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=[],TL(e,{Node:(e,t)=>{(pL(t)||xL(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||=(RL(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=VL(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(NL(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 VL(e,t,n){if(pL(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(yL(t)){let r=0;for(let i of t.items){let t=VL(e,i,n);t>r&&(r=t)}return r}if(gL(t)){let r=VL(e,t.key,n),i=VL(e,t.value,n);return Math.max(r,i)}return 1}var HL=e=>!e||typeof e!=`function`&&typeof e!=`object`,UL=class extends zL{constructor(e){super(uL),this.value=e}toJSON(e,t){return t?.keep?this.value:RL(this.value,e,t)}toString(){return String(this.value)}};UL.BLOCK_FOLDED=`BLOCK_FOLDED`,UL.BLOCK_LITERAL=`BLOCK_LITERAL`,UL.PLAIN=`PLAIN`,UL.QUOTE_DOUBLE=`QUOTE_DOUBLE`,UL.QUOTE_SINGLE=`QUOTE_SINGLE`;var WL=`tag:yaml.org,2002:`;function GL(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 KL(e,t,n){if(mL(e)&&(e=e.contents),bL(e))return e;if(gL(e)){let t=n.schema[cL].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 BL(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=WL+t.slice(2));let l=GL(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new UL(e);return c&&(c.node=t),t Line truncated
`)?ZL(n,t):n.includes(`
`)?`
`+QL(n,t):(e.endsWith(` `)?``:` `)+n,eR=`flow`,tR=`block`,nR=`quoted`;function rR(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=iR(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=iR(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+ZL(n,t):(e.endsWith(` `)?``:` `)+n,$L=`flow`,eR=`block`,tR=`quoted`;function nR(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=rR(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=rR(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 iR(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 aR=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),oR=e=>/^(%|---|\.\.\.)/m.test(e);function sR(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 cR(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(oR(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 rR(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 iR=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),aR=e=>/^(%|---|\.\.\.)/m.test(e);function oR(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 sR(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(aR(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:rR(o,a,nR,aR(t,!1))}function lR(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return cR(e,t);let n=t.indent||(oR(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:rR(r,n,eR,aR(t,!1))}function uR(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=cR;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?lR:i&&!t?cR:n?lR:cR}return r(e,t)}var dR;try{dR=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:nR(o,a,tR,iR(t,!1))}function cR(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return sR(e,t);let n=t.indent||(aR(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:nR(r,n,$L,iR(t,!1))}function lR(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=sR;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?cR:i&&!t?sR:n?cR:sR}return r(e,t)}var uR;try{uR=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{dR=/\n+(?!\n|$)/g}function fR({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 uR(n,r);let l=r.indent||(r.forceBlockIndent||oR(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===WL.BLOCK_FOLDED?!1:t===WL.BLOCK_LITERAL||!sR(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{uR=/\n+(?!\n|$)/g}function dR({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 lR(n,r);let l=r.indent||(r.forceBlockIndent||aR(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===UL.BLOCK_FOLDED?!1:t===UL.BLOCK_LITERAL||!oR(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(dR,`$&${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(uR,`$&${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=aR(r,!0);o!==`folded`&&t!==WL.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=rR(`${v}${e}${p}`,l,tR,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function pR(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 uR(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?uR(a,t):fR(e,t,n,r);if(!s&&!u&&i!==WL.PLAIN&&a.includes(`
`))return fR(e,t,n,r);if(oR(a)){if(c===``)return t.forceBlockIndent=!0,fR(e,t,n,r);if(s&&c===l)return uR(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 uR(a,t)}return s?d:rR(d,c,eR,aR(t,!1))}function mR(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!==WL.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=WL.QUOTE_DOUBLE);let c=e=>{switch(e){case WL.BLOCK_FOLDED:case WL.BLOCK_LITERAL:return i||a?uR(o.value,t):fR(o,t,n,r);case WL.QUOTE_DOUBLE:return cR(o.value,t);case WL.QUOTE_SINGLE:return lR(o.value,t);case WL.PLAIN:return pR(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 hR(e,t){let n=Object.assign({blockQuote:!0,commentString:ZL,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 gR(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(vL(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 _R(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(vL(e)||bL(e))&&e.anchor;a&&PL(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 vR(e,t,n,r){if(_L(e))return e.toString(t,n,r);if(mL(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=xL(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=gR(t.doc.schema.tags,a);let o=_R(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):vL(a)?mR(a,t,n,r):a.toString(t,n,r);return o?vL(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function yR({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=xL(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(bL(e)||!xL(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||bL(e)||(vL(e)?e.type===WL.BLOCK_FOLDED||e.type===WL.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=vR(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+=$L(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=$L(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=$L(g,n.indent,l(f))));let _,v,y;xL(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&&vL(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&yL(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=vR(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${QL(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=iR(r,!0);o!==`folded`&&t!==UL.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=nR(`${v}${e}${p}`,l,eR,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function fR(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 lR(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?lR(a,t):dR(e,t,n,r);if(!s&&!u&&i!==UL.PLAIN&&a.includes(`
`))return dR(e,t,n,r);if(aR(a)){if(c===``)return t.forceBlockIndent=!0,dR(e,t,n,r);if(s&&c===l)return lR(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 lR(a,t)}return s?d:nR(d,c,$L,iR(t,!1))}function pR(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!==UL.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=UL.QUOTE_DOUBLE);let c=e=>{switch(e){case UL.BLOCK_FOLDED:case UL.BLOCK_LITERAL:return i||a?lR(o.value,t):dR(o,t,n,r);case UL.QUOTE_DOUBLE:return sR(o.value,t);case UL.QUOTE_SINGLE:return cR(o.value,t);case UL.PLAIN:return fR(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 mR(e,t){let n=Object.assign({blockQuote:!0,commentString:XL,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 hR(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(_L(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 gR(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(_L(e)||yL(e))&&e.anchor;a&&NL(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 _R(e,t,n,r){if(gL(e))return e.toString(t,n,r);if(pL(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=bL(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=hR(t.doc.schema.tags,a);let o=gR(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):_L(a)?pR(a,t,n,r):a.toString(t,n,r);return o?_L(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function vR({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=bL(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(yL(e)||!bL(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||yL(e)||(_L(e)?e.type===UL.BLOCK_FOLDED||e.type===UL.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=_R(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+=QL(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=QL(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=QL(g,n.indent,l(f))));let _,v,y;bL(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&&_L(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&vL(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=_R(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${ZL(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&bL(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&yL(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+=$L(g,n.indent,l(y)):h&&i&&i(),g}function bR(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var xR=`<<`,SR={identify:e=>e===xR||typeof e==`symbol`&&e.description===xR,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new WL(Symbol(xR)),{addToJSMap:wR}),stringify:()=>xR},CR=(e,t)=>(SR.identify(t)||vL(t)&&(!t.type||t.type===WL.PLAIN)&&SR.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===SR.tag&&e.default);function wR(e,t,n){let r=ER(e,n);if(yL(r))for(let n of r.items)TR(e,t,n);else if(Array.isArray(r))for(let n of r)TR(e,t,n);else TR(e,t,r)}function TR(e,t,n){let r=ER(e,n);if(!gL(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 ER(e,t){return e&&mL(t)?t.resolve(e.doc,e):t}function DR(e,t,{key:n,value:r}){if(xL(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(CR(e,n))wR(e,t,r);else{let i=zL(n,``,e);if(t instanceof Map)t.set(i,zL(r,i,e));else if(t instanceof Set)t.add(i);else{let a=OR(n,i,e),o=zL(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function OR(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(xL(e)&&n?.doc){let t=hR(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)+`..."`),bR(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 kR(e,t,n){return new AR(qL(e,void 0,n),qL(t,void 0,n))}var AR=class e{constructor(e,t=null){Object.defineProperty(this,pL,{value:uL}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return xL(n)&&(n=n.clone(t)),xL(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return DR(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?yR(this,e,t,n):JSON.stringify(this)}};function jR(e,t,n){return(t.inFlow??e.flow?NR:MR)(e,t,n)}function MR({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(xL(i))!d&&i.spaceBefore&&f.push(``),PR(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(_L(i)){let e=xL(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),PR(n,f,e.commentBefore,d))}d=!1;let s=vR(i,u,()=>o=null,()=>d=!0);o&&(s+=$L(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+=QL(g,n.indent,l(y)):h&&i&&i(),g}function yR(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var bR=`<<`,xR={identify:e=>e===bR||typeof e==`symbol`&&e.description===bR,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new UL(Symbol(bR)),{addToJSMap:CR}),stringify:()=>bR},SR=(e,t)=>(xR.identify(t)||_L(t)&&(!t.type||t.type===UL.PLAIN)&&xR.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===xR.tag&&e.default);function CR(e,t,n){let r=TR(e,n);if(vL(r))for(let n of r.items)wR(e,t,n);else if(Array.isArray(r))for(let n of r)wR(e,t,n);else wR(e,t,r)}function wR(e,t,n){let r=TR(e,n);if(!hL(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 TR(e,t){return e&&pL(t)?t.resolve(e.doc,e):t}function ER(e,t,{key:n,value:r}){if(bL(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(SR(e,n))CR(e,t,r);else{let i=RL(n,``,e);if(t instanceof Map)t.set(i,RL(r,i,e));else if(t instanceof Set)t.add(i);else{let a=DR(n,i,e),o=RL(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function DR(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(bL(e)&&n?.doc){let t=mR(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)+`..."`),yR(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 OR(e,t,n){return new kR(KL(e,void 0,n),KL(t,void 0,n))}var kR=class e{constructor(e,t=null){Object.defineProperty(this,fL,{value:lL}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return bL(n)&&(n=n.clone(t)),bL(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return ER(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?vR(this,e,t,n):JSON.stringify(this)}};function AR(e,t,n){return(t.inFlow??e.flow?MR:jR)(e,t,n)}function jR({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(bL(i))!d&&i.spaceBefore&&f.push(``),NR(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(gL(i)){let e=bL(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),NR(n,f,e.commentBefore,d))}d=!1;let s=_R(i,u,()=>o=null,()=>d=!0);o&&(s+=QL(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+=`
`+QL(l(e),c),s&&s()):d&&o&&o(),p}function NR({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(xL(i))i.spaceBefore&&d.push(``),PR(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(_L(i)){let e=xL(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),PR(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=xL(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=vR(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+=$L(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 PR({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=QL(t(r),e);n.push(i.trimStart())}}function FR(e,t){let n=vL(t)?t.value:t;for(let r of e)if(_L(r)&&(r.key===t||r.key===n||vL(r.key)&&r.key.value===n))return r}var IR=class extends XL{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(lL,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(kR(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=_L(e)?e:!e||typeof e!=`object`||!(`key`in e)?new AR(e,e?.value):new AR(e.key,e.value);let r=FR(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);vL(r.value)&&UL(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=FR(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=FR(this.items,e)?.value;return(!t&&vL(n)?n.value:n)??void 0}has(e){return!!FR(this.items,e)}set(e,t){this.add(new AR(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)DR(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!_L(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})),jR(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},LR={collection:`map`,default:!0,nodeClass:IR,tag:`tag:yaml.org,2002:map`,resolve(e,t){return gL(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>IR.from(e,t,n)},RR=class extends XL{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(fL,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=zR(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=zR(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&vL(r)?r.value:r}has(e){let t=zR(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=zR(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];vL(r)&&UL(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(zL(e,String(r++),t));return n}toString(e,t,n){return e?jR(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(qL(a,void 0,n))}}return i}};function zR(e){let t=vL(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var BR={collection:`seq`,default:!0,nodeClass:RR,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return yL(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>RR.from(e,t,n)},VR={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),mR(e,t,n,r)}},HR={identify:e=>e==null,createNode:()=>new WL(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new WL(null),stringify:({source:e},t)=>typeof e==`string`&&HR.test.test(e)?e:t.options.nullStr},UR={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new WL(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&UR.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function WR({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 GR={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:WR},KR={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 mR({comment:e,type:t,value:s},r,i,a)}};function oz(e,t){if(yL(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!_L(r)){if(gL(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new AR(new WL(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]=_L(r)?r:new AR(r)}}else t(`Expected a sequence for this tag`);return e}function sz(e,t,n){let{replacer:r}=n,i=new RR(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(kR(o,s,n))}return i}var cz={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:oz,createNode:sz},lz=class e extends RR{constructor(){super(),this.add=IR.prototype.add.bind(this),this.delete=IR.prototype.delete.bind(this),this.get=IR.prototype.get.bind(this),this.has=IR.prototype.has.bind(this),this.set=IR.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(_L(e)?(r=zL(e.key,``,t),i=zL(e.value,r,t)):r=zL(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=sz(e,t,n),i=new this;return i.items=r.items,i}};lz.tag=`tag:yaml.org,2002:omap`;var uz={collection:`seq`,identify:e=>e instanceof Map,nodeClass:lz,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=oz(e,t),r=[];for(let{key:e}of n.items)vL(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new lz,n)},createNode:(e,t,n)=>lz.from(e,t,n)};function dz({value:e,source:t},n){return t&&(e?fz:pz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var fz={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 WL(!0),stringify:dz},pz={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 WL(!1),stringify:dz},mz={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:WR},hz={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():WR(e)}},gz={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 WL(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:WR},_z=e=>typeof e==`bigint`||Number.isInteger(e);function vz(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 yz(e,t,n){let{value:r}=e;if(_z(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return WR(e)}var bz={identify:_z,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>vz(e,2,2,n),stringify:e=>yz(e,2,`0b`)},xz={identify:_z,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>vz(e,1,8,n),stringify:e=>yz(e,8,`0`)},Sz={identify:_z,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>vz(e,0,10,n),stringify:WR},Cz={identify:_z,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>vz(e,2,16,n),stringify:e=>yz(e,16,`0x`)},wz=class e extends IR{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=_L(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new AR(e.key,null):new AR(e,null),FR(this.items,t.key)||this.items.push(t)}get(e,t){let n=FR(this.items,e);return!t&&_L(n)?vL(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=FR(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new AR(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(QL(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(QL(a(t),``)))}return n.join(`
`+ZL(l(e),c),s&&s()):d&&o&&o(),p}function MR({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(bL(i))i.spaceBefore&&d.push(``),NR(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(gL(i)){let e=bL(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),NR(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=bL(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=_R(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+=QL(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 NR({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=ZL(t(r),e);n.push(i.trimStart())}}function PR(e,t){let n=_L(t)?t.value:t;for(let r of e)if(gL(r)&&(r.key===t||r.key===n||_L(r.key)&&r.key.value===n))return r}var FR=class extends YL{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(cL,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(OR(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=gL(e)?e:!e||typeof e!=`object`||!(`key`in e)?new kR(e,e?.value):new kR(e.key,e.value);let r=PR(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);_L(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=PR(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=PR(this.items,e)?.value;return(!t&&_L(n)?n.value:n)??void 0}has(e){return!!PR(this.items,e)}set(e,t){this.add(new kR(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)ER(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!gL(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})),AR(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},IR={collection:`map`,default:!0,nodeClass:FR,tag:`tag:yaml.org,2002:map`,resolve(e,t){return hL(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>FR.from(e,t,n)},LR=class extends YL{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(dL,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=RR(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=RR(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&_L(r)?r.value:r}has(e){let t=RR(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=RR(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];_L(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(RL(e,String(r++),t));return n}toString(e,t,n){return e?AR(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(KL(a,void 0,n))}}return i}};function RR(e){let t=_L(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var zR={collection:`seq`,default:!0,nodeClass:LR,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return vL(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>LR.from(e,t,n)},BR={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),pR(e,t,n,r)}},VR={identify:e=>e==null,createNode:()=>new UL(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new UL(null),stringify:({source:e},t)=>typeof e==`string`&&VR.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 UL(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 UR({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 WR={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:UR},GR={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 pR({comment:e,type:t,value:s},r,i,a)}};function az(e,t){if(vL(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!gL(r)){if(hL(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new kR(new UL(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]=gL(r)?r:new kR(r)}}else t(`Expected a sequence for this tag`);return e}function oz(e,t,n){let{replacer:r}=n,i=new LR(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(OR(o,s,n))}return i}var sz={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:az,createNode:oz},cz=class e extends LR{constructor(){super(),this.add=FR.prototype.add.bind(this),this.delete=FR.prototype.delete.bind(this),this.get=FR.prototype.get.bind(this),this.has=FR.prototype.has.bind(this),this.set=FR.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(gL(e)?(r=RL(e.key,``,t),i=RL(e.value,r,t)):r=RL(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=oz(e,t,n),i=new this;return i.items=r.items,i}};cz.tag=`tag:yaml.org,2002:omap`;var lz={collection:`seq`,identify:e=>e instanceof Map,nodeClass:cz,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=az(e,t),r=[];for(let{key:e}of n.items)_L(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new cz,n)},createNode:(e,t,n)=>cz.from(e,t,n)};function uz({value:e,source:t},n){return t&&(e?dz:fz).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var dz={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 UL(!0),stringify:uz},fz={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 UL(!1),stringify:uz},pz={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:UR},mz={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():UR(e)}},hz={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 UL(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:UR},gz=e=>typeof e==`bigint`||Number.isInteger(e);function _z(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 vz(e,t,n){let{value:r}=e;if(gz(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return UR(e)}var yz={identify:gz,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>_z(e,2,2,n),stringify:e=>vz(e,2,`0b`)},bz={identify:gz,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>_z(e,1,8,n),stringify:e=>vz(e,8,`0`)},xz={identify:gz,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>_z(e,0,10,n),stringify:UR},Sz={identify:gz,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>_z(e,2,16,n),stringify:e=>vz(e,16,`0x`)},Cz=class e extends FR{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=gL(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new kR(e.key,null):new kR(e,null),PR(this.items,t.key)||this.items.push(t)}get(e,t){let n=PR(this.items,e);return!t&&gL(n)?_L(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=PR(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new kR(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(ZL(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(ZL(a(t),``)))}return n.join(`
`)+`
`}var zz=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,pL,{value:cL});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 NL({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[pL]:{value:cL}});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=xL(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){Bz(this.contents)&&this.contents.add(e)}addIn(e,t){Bz(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=FL(this);e.anchor=!t||n.has(t)?IL(t||`a`,n):t}return new VL(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=qL(e,l,p);return o&&bL(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new AR(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return Bz(this.contents)?this.contents.delete(e):!1}deleteIn(e){return YL(e)?this.contents!=null&&(this.contents=null,!0):Bz(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return bL(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return YL(e)?!t&&vL(this.contents)?this.contents.value:this.contents:bL(this.contents)?this.contents.getIn(e,t):void 0}has(e){return bL(this.contents)?this.contents.has(e):!1}hasIn(e){return YL(e)?this.contents!==void 0:bL(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=JL(this.schema,[e],t):Bz(this.contents)&&this.contents.set(e,t)}setIn(e,t){YL(e)?this.contents=t:this.contents==null?this.contents=JL(this.schema,Array.from(e),t):Bz(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 NL({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 NL({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=zL(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`?RL(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 Rz(this,e)}};function Bz(e){if(bL(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Vz=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Hz=class extends Vz{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Uz=class extends Vz{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Wz=(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 Gz(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 Kz(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(Kz(t.key)||Kz(t.value))return!0}return!1;default:return!0}}function qz(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Kz(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function Jz(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||vL(e)&&vL(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Yz=`All mapping items must start at the same column`;function Xz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??IR)(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=Gz(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`,Yz)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Kz(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`,Yz);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&qz(r.indent,u,i),n.atKey=!1,Jz(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Gz(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&&qz(r.indent,f,i),s=c.range[2];let l=new AR(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 AR(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 Zz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??RR)(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=Gz(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&&qz(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Qz(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 $z=`Block collections are not allowed within flow collections`,eB=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function tB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?IR:RR))(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=Gz(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&&Kz(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];_L(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],eB(m)&&i(r.range,`BLOCK_IN_FLOW`,$z)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);eB(f)&&i(g.range,`BLOCK_IN_FLOW`,$z),n.atKey=!1;let _=Gz(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?eB(m)&&i(v.range,`BLOCK_IN_FLOW`,$z):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new AR(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;Jz(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new IR(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=Qz(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 nB(e,t,n,r,i,a){let o=n.type===`block-map`?Xz(e,t,n,r,a):n.type===`block-seq`?Zz(e,t,n,r,a):tB(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function rB(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===IR.tagName&&s===`map`||o===RR.tagName&&s===`seq`)return nB(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),nB(e,t,n,i,o)}let l=nB(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=xL(u)?u:new WL(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function iB(e,t,n){let r=t.offset,i=aB(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?WL.BLOCK_FOLDED:WL.BLOCK_LITERAL,o=t.source?oB(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 Rz=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,fL,{value:sL});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 ML({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[fL]:{value:sL}});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=bL(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){zz(this.contents)&&this.contents.add(e)}addIn(e,t){zz(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=PL(this);e.anchor=!t||n.has(t)?FL(t||`a`,n):t}return new BL(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}=IL(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=KL(e,l,p);return o&&yL(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new kR(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return zz(this.contents)?this.contents.delete(e):!1}deleteIn(e){return JL(e)?this.contents!=null&&(this.contents=null,!0):zz(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return yL(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return JL(e)?!t&&_L(this.contents)?this.contents.value:this.contents:yL(this.contents)?this.contents.getIn(e,t):void 0}has(e){return yL(this.contents)?this.contents.has(e):!1}hasIn(e){return JL(e)?this.contents!==void 0:yL(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=qL(this.schema,[e],t):zz(this.contents)&&this.contents.set(e,t)}setIn(e,t){JL(e)?this.contents=t:this.contents==null?this.contents=qL(this.schema,Array.from(e),t):zz(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 ML({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 ML({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 Iz(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=RL(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`?LL(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 Lz(this,e)}};function zz(e){if(yL(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var Bz=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},Vz=class extends Bz{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},Hz=class extends Bz{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},Uz=(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 Wz(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 Gz(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(Gz(t.key)||Gz(t.value))return!0}return!1;default:return!0}}function Kz(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Gz(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function qz(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||_L(e)&&_L(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Jz=`All mapping items must start at the same column`;function Yz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??FR)(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=Wz(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`,Jz)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||Gz(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`,Jz);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&Kz(r.indent,u,i),n.atKey=!1,qz(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=Wz(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&&Kz(r.indent,f,i),s=c.range[2];let l=new kR(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 kR(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 Xz({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??LR)(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=Wz(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&&Kz(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Zz(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 Qz=`Block collections are not allowed within flow collections`,$z=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function eB({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?FR:LR))(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=Wz(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&&Gz(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];gL(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],$z(m)&&i(r.range,`BLOCK_IN_FLOW`,Qz)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);$z(f)&&i(g.range,`BLOCK_IN_FLOW`,Qz),n.atKey=!1;let _=Wz(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?$z(m)&&i(v.range,`BLOCK_IN_FLOW`,Qz):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new kR(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;qz(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new FR(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=Zz(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 tB(e,t,n,r,i,a){let o=n.type===`block-map`?Yz(e,t,n,r,a):n.type===`block-seq`?Xz(e,t,n,r,a):eB(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function nB(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===FR.tagName&&s===`map`||o===LR.tagName&&s===`seq`)return tB(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),tB(e,t,n,i,o)}let l=tB(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=bL(u)?u:new UL(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function rB(e,t,n){let r=t.offset,i=iB(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?UL.BLOCK_FOLDED:UL.BLOCK_LITERAL,o=t.source?aB(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===WL.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===UL.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 aB({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 oB(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 sB(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=WL.PLAIN,c=cB(a,l);break;case`single-quoted-scalar`:s=WL.QUOTE_SINGLE,c=lB(a,l);break;case`double-quoted-scalar`:s=WL.QUOTE_DOUBLE,c=dB(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=Qz(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function cB(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}`),uB(e)}function lB(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),uB(e.slice(1,-1)).replace(/''/g,`'`)}function uB(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 iB({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 aB(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 oB(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=UL.PLAIN,c=sB(a,l);break;case`single-quoted-scalar`:s=UL.QUOTE_SINGLE,c=cB(a,l);break;case`double-quoted-scalar`:s=UL.QUOTE_DOUBLE,c=uB(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=Zz(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function sB(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}`),lB(e)}function cB(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),lB(e.slice(1,-1)).replace(/''/g,`'`)}function lB(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 dB(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 uB(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}=fB(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=pB[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=dB(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=fB[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+=mB(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+=pB(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 fB(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 dB(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 pB={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function mB(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 hB(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?iB(e,t,r):sB(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[dL]:c?gB(e.schema,i,c,n,r):t.type===`scalar`?_B(e,i,t,r):e.schema[dL];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=vL(a)?a:new WL(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new WL(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 gB(e,t,n,r,i){if(n===`!`)return e[dL];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[dL])}function _B({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[dL];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[dL];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 vB(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 yB={composeNode:bB,composeEmptyNode:xB};function bB(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=SB(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=hB(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=rB(yB,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??=xB(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&&(!vL(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 xB(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=hB(e,{type:`scalar`,offset:vB(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 SB({options:e},{offset:t,source:n,end:r},i){let a=new VL(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=Qz(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function CB(e,t,{offset:n,start:r,value:i,end:a},o){let s=new zz(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Gz(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?bB(c,i,l,o):xB(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Qz(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function wB(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 TB(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 fB={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function pB(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 mB(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?rB(e,t,r):oB(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[uL]:c?hB(e.schema,i,c,n,r):t.type===`scalar`?gB(e,i,t,r):e.schema[uL];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=_L(a)?a:new UL(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new UL(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 hB(e,t,n,r,i){if(n===`!`)return e[uL];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[uL])}function gB({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[uL];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[uL];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 _B(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 vB={composeNode:yB,composeEmptyNode:bB};function yB(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=xB(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=mB(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=nB(vB,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??=bB(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&&(!_L(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 bB(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=mB(e,{type:`scalar`,offset:_B(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 xB({options:e},{offset:t,source:n,end:r},i){let a=new BL(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=Zz(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function SB(e,t,{offset:n,start:r,value:i,end:a},o){let s=new Rz(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=Wz(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?yB(c,i,l,o):bB(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Zz(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function CB(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 wB(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 EB=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=wB(e);r?this.warnings.push(new Uz(i,t,n)):this.errors.push(new Hz(i,t,n))},this.directives=new NL({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=TB(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(bL(i)&&!i.flow&&i.items.length>0){let e=i.items[0];_L(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:TB(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=wB(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=CB(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 Hz(wB(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 Hz(wB(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Qz(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 Hz(wB(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 zz(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}}},DB=Symbol(`break visit`),OB=Symbol(`skip children`),kB=Symbol(`remove item`);function AB(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),jB(Object.freeze([]),e,t)}AB.BREAK=DB,AB.SKIP=OB,AB.REMOVE=kB,AB.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},AB.parentCollection=(e,t)=>{let n=AB.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 jB(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=jB(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===DB)return DB;else r===kB&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function MB(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 TB=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=CB(e);r?this.warnings.push(new Hz(i,t,n)):this.errors.push(new Vz(i,t,n))},this.directives=new ML({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=wB(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(yL(i)&&!i.flow&&i.items.length>0){let e=i.items[0];gL(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:wB(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=CB(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=SB(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 Vz(CB(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 Vz(CB(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Zz(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 Vz(CB(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 Rz(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}}},EB=Symbol(`break visit`),DB=Symbol(`skip children`),OB=Symbol(`remove item`);function kB(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),AB(Object.freeze([]),e,t)}kB.BREAK=EB,kB.SKIP=DB,kB.REMOVE=OB,kB.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},kB.parentCollection=(e,t)=>{let n=kB.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 AB(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=AB(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===EB)return EB;else r===OB&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function jB(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 NB(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var PB=new Set(`0123456789ABCDEFabcdef`),FB=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),IB=new Set(`,[]{}`),LB=new Set(` ,[]{}
\r `),RB=e=>!e||LB.has(e),zB=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 MB(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var NB=new Set(`0123456789ABCDEFabcdef`),PB=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),FB=new Set(`,[]{}`),IB=new Set(` ,[]{}
\r `),LB=e=>!e||IB.has(e),RB=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===`...`)&&NB(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===`...`)&&NB(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&&!NB(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===`:`)&&NB(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(RB),`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(`...`))&&NB(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(RB),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||NB(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===`...`)&&MB(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===`...`)&&MB(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&&!MB(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===`:`)&&MB(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(LB),`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(`...`))&&MB(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(LB),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||MB(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=>NB(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=>MB(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(NB(r)||e&&IB.has(r))break;t=n}else if(NB(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(MB(r)||e&&FB.has(r))break;t=n}else if(MB(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&IB.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&IB.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(RB),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(NB(n)||t&&IB.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(;!NB(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(FB.has(t))t=this.buffer[++e];else if(t===`%`&&PB.has(this.buffer[e+1])&&PB.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&&FB.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&FB.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(LB),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(MB(n)||t&&FB.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(;!MB(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(PB.has(t))t=this.buffer[++e];else if(t===`%`&&NB.has(this.buffer[e+1])&&NB.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)}},BB=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 VB(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function HB(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 UB(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 WB(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 GB(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 KB(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 qB(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!VB(t.start,`explicit-key-ind`)&&!VB(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,UB(t.value)?t.value.end?KB(t.value.end,t.sep):t.value.end=t.sep:KB(t.start,t.sep),delete t.sep)}var JB=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 zB,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=MB(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`&&qB(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&&HB(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)}},zB=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 BB(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function VB(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 UB(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 WB(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 GB(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 KB(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!BB(t.start,`explicit-key-ind`)&&!BB(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,HB(t.value)?t.value.end?GB(t.value.end,t.sep):t.value.end=t.sep:GB(t.start,t.sep),delete t.sep)}var qB=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 RB,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=jB(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`&&KB(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&&VB(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)){KB(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(VB(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=GB(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(VB(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(UB(t.key)&&!VB(t.sep,`newline`)){let e=GB(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]}):VB(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&&!VB(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)){KB(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||VB(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)){GB(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(BB(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=WB(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(BB(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)&&!BB(t.sep,`newline`)){let e=WB(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]}):BB(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&&!BB(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)){GB(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||BB(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=GB(WB(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=GB(WB(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 YB(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new BB||null,prettyErrors:t}}function XB(e,t={}){let{lineCounter:n,prettyErrors:r}=YB(t),i=new JB(n?.addNewLine),a=new EB(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 Hz(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Wz(e,n)),o.warnings.forEach(Wz(e,n))),o}function ZB(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=XB(e,n);if(!i)return null;if(i.warnings.forEach(e=>bR(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 QB(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 hL(e)&&!r?e.toString(n):new zz(e,r,n).toString(n)}var $B=e=>typeof e==`object`&&!!e&&!Array.isArray(e),eV=e=>$B(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function tV(e){if($B(e)){if($B(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:eV(e.parallel)};if($B(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:eV(e.switch.cases)}}}function nV(e){return e.slice(2).includes(`parallel`)}function rV(e,t){let n=XB(e).getIn(t,!0);if(gL(n))return n.toJSON()}function iV(e,t,n){let r=XB(e);return r.setIn(t,r.createNode(hV(n))),r.toString()}function aV(e,t,n){let r=XB(e),i=t.slice(0,-1),a=nV(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(yL(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!yL(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 oV(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 sV(e,t){let n=e.getIn(t,!0),r=tV(gL(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!gL(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function cV(e,t,n){let r=XB(e),{kind:i,branches:a}=sV(r,t);if(oV(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function lV(e,t,n,r){let i=XB(e),{kind:a,branches:o}=sV(i,t);if(oV(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>vL(e.key)&&e.key.value===n);if(!s||!vL(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function uV(e,t,n){let r=XB(e),{kind:i,branches:a}=sV(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 kV(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(TV)].map(e=>e[1]))]}function AV(e){let t=XB(e).toJS(),n=EV(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=EV(e)?e:{},p=tV(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=EV(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||wV(m),type:m,role:vV(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:DV(m,h),summary:OV(h),when:typeof d.when==`string`?d.when:void 0,retry:EV(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 kV([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=tV(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*xV,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=EV(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)*SV,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*xV,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)*xV},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)*xV-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*SV;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*xV-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*xV,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*xV-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 jV={agent:Yt,command:zn,repo:pn,gate:Fn,forge:xn,human:Wn,review:un,workflow:qn},MV={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function NV(e){return e===`parallel`?pn:e===`switch`?Ln:jV[e.split(`.`)[0]]??qn}function PV(e){return Object.keys(MV).map(t=>({title:MV[t],icon:jV[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function FV(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 IV(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 RV(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 zV=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 BV(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function VV(e,t=[]){let n=XB(e),r=n.errors[0];if(r)return{ok:!1,message:tH(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!nH(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:ZV(e)}))}var YV=/^(\s*)(-\s+)?/,XV=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function ZV(e){let{code:t,comment:n}=QV(e),r=$V(t);return n&&r.push({text:n,kind:`comment`}),r}function QV(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 $V(e){if(!e)return[];let t=[],n=YV.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=XV.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,...eH(i[4]??``)]):[...t,...eH(r)]}function eH(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 tH(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function nH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function rH(e){return typeof e==`string`&&e.trim()!==``}var iH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},aH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},oH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},sH={class:`min-w-0 flex-1`},cH={class:`truncate font-mono text-[11px] text-fg-subtle`},lH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},uH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},dH={key:1,class:`space-y-3`},fH={key:0,class:`block space-y-1.5`},pH={id:`switch-on`},mH=[`value`],hH={class:`text-xs font-medium text-muted-foreground`},gH={class:`flex items-center gap-2`},_H={key:1,role:`alert`,class:`text-xs text-danger`},vH={key:2,class:`space-y-1.5`},yH=[`title`],bH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},xH={key:3,class:`divide-y divide-border rounded-md border border-border`},SH=[`title`],CH={key:0,class:`space-y-3`},wH={class:`text-[13px]`},TH={key:0,class:`text-danger`},EH={class:`ml-2 text-xs text-fg-subtle`},DH={key:1,class:`space-y-3`},OH={class:`text-[13px]`},kH={class:`ml-2 text-xs text-fg-subtle`},AH=[`title`],jH={key:0,class:`text-xs text-danger`},MH={class:`space-y-2`},NH={class:`divide-y divide-border rounded-md border border-border`},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 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`},RH={class:`flex items-center border-t border-border px-4 py-2.5`},zH=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(()=>rV(n.yaml,n.path)??{}),a=I(()=>tV(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`,iV(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`?cV(n.yaml,n.path,t):e===`rename`?lV(n.yaml,n.path,t,i):uV(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(()=>mV(n.yaml,n.path)),g=I(()=>p.value?.settings&&i.value.settings?KV(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`,iV(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(gV(T.value?.yaml??``,`inputs`)??{})),E=I(()=>Object.entries(gV(T.value?.yaml??``,`outputs`)??{})),ne=I(()=>Object.entries(gV(n.yaml,`inputs`)??{})),re=I(()=>Object.entries(gV(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: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()?ZB(t):void 0),ue.value={...ue.value,[e]:``}}catch(t){ue.val Line truncated
`)[0]}}}let fe=e=>e===void 0?``:QB(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`,iH,[W(`header`,aH,[W(`span`,oH,[(R(),q(Ue(z(NV)(o.value)),{class:`size-4`}))]),W(`div`,sH,[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(wV)(o.value),"aria-label":`Step id`,"onUpdate:modelValue":n[0]||=e=>S(`id`,String(e))},null,8,[`model-value`,`placeholder`]),W(`div`,cH,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`,lH,[g.value?(R(),G(`p`,uH,V(g.value),1)):L(``,!0),a.value?(R(),G(`section`,dH,[o.value===`switch`?(R(),G(`label`,fH,[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`,pH,[(R(!0),G(H,null,K(h.value,e=>(R(),G(`option`,{key:e,value:`steps.${e}.result.`},null,8,mH))),128))])])):L(``,!0),W(`div`,hH,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`,gH,[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`,_H,V(d.value),1)):L(``,!0)])):L(``,!0),b.value.lead?(R(),G(`section`,vH,[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,yH),b.value.lead.kind===`workflow`?(R(),q(zV,{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(jI),{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(MI),{value:``},{default:j(()=>[...n[19]||=[A(`Default`,-1)]]),_:1}),(R(!0),G(H,null,K(b.value.lead.options,e=>(R(),q(z(MI),{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`,bH,[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`,xH,[(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,SH),t.kind===`workflow`?(R(),q(zV,{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=WB(UB(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=WB(UB(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 JB(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new zB||null,prettyErrors:t}}function YB(e,t={}){let{lineCounter:n,prettyErrors:r}=JB(t),i=new qB(n?.addNewLine),a=new TB(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 Vz(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(Uz(e,n)),o.warnings.forEach(Uz(e,n))),o}function XB(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=YB(e,n);if(!i)return null;if(i.warnings.forEach(e=>yR(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 ZB(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 mL(e)&&!r?e.toString(n):new Rz(e,r,n).toString(n)}var QB=e=>typeof e==`object`&&!!e&&!Array.isArray(e),$B=e=>QB(e)?Object.entries(e).map(([e,t])=>[e,Array.isArray(t)?t:[]]):[];function eV(e){if(QB(e)){if(QB(e.parallel))return{kind:`parallel`,base:[`parallel`],branches:$B(e.parallel)};if(QB(e.switch))return{kind:`switch`,base:[`switch`,`cases`],on:typeof e.switch.on==`string`?e.switch.on:``,branches:$B(e.switch.cases)}}}function tV(e){return e.slice(2).includes(`parallel`)}function nV(e,t){let n=YB(e).getIn(t,!0);if(hL(n))return n.toJSON()}function rV(e,t,n){let r=YB(e);return r.setIn(t,r.createNode(mV(n))),r.toString()}function iV(e,t,n){let r=YB(e),i=t.slice(0,-1),a=tV(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(vL(o)||(r.setIn(i,r.createNode([])),o=r.getIn(i,!0)),!vL(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 aV(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 oV(e,t){let n=e.getIn(t,!0),r=eV(hL(n)?n.toJSON():void 0),i=r?e.getIn([...t,...r.base],!0):void 0;if(!r||!hL(i))throw Error(`This step has no branches.`);return{kind:r.kind,branches:i}}function sV(e,t,n){let r=YB(e),{kind:i,branches:a}=oV(r,t);if(aV(n,i),a.has(n))throw Error(`Branch ${n} already exists.`);return a.set(n,r.createNode([])),r.toString()}function cV(e,t,n,r){let i=YB(e),{kind:a,branches:o}=oV(i,t);if(aV(r,a),n!==r&&o.has(r))throw Error(`Branch ${r} already exists.`);let s=o.items.find(e=>_L(e.key)&&e.key.value===n);if(!s||!_L(s.key))throw Error(`Branch ${n} does not exist.`);return s.key.value=r,i.toString()}function lV(e,t,n){let r=YB(e),{kind:i,branches:a}=oV(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 OV(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(wV)].map(e=>e[1]))]}function kV(e){let t=YB(e).toJS(),n=TV(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=TV(e)?e:{},p=eV(d),m=p?.kind??(typeof d.type==`string`?d.type:``),h=TV(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||CV(m),type:m,role:_V(m),step:l?.length===2?String(Number(l[1])+1).padStart(2,`0`):void 0,detail:p?.on?`on ${p.on.replace(/^steps\./,``)}`:EV(m,h),summary:DV(h),when:typeof d.when==`string`?d.when:void 0,retry:TV(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 OV([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=eV(t);if(n){let{kind:i,base:a,branches:o}=n,c=p(t,String(e+1),0,u*bV,void 0,void 0,[`steps`,e]);m(l,c,[`steps`,e-1]),u++;let d=TV(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)*xV,l=[c],f=[`steps`,e,...a,t];n.forEach((n,r)=>{let a=p(n,`${e+1}-${t}-${r+1}`,s,(u+r)*bV,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)*bV},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)*bV-24;o.forEach(([t],n)=>{let a=(n-(h-1)/2)*xV;r.push({id:`lane-${e}-${t}`,type:`lane`,position:{x:a-12,y:u*bV-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*bV,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*bV-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 AV={agent:Yt,command:zn,repo:pn,gate:Fn,forge:xn,human:Wn,review:un,workflow:qn},jV={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function MV(e){return e===`parallel`?pn:e===`switch`?Ln:AV[e.split(`.`)[0]]??qn}function NV(e){return Object.keys(jV).map(t=>({title:jV[t],icon:AV[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function PV(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 FV(e,t){return e.filter(e=>e.required&&!(t[e.name]??``).trim()).map(e=>e.name)}function IV(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 LV(e,t){let n={};for(let r of e){let e=t[r.name];e!==void 0&&e!==``&&(n[r.name]=IV(e,r.type))}return n}var RV=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 zV(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function BV(e,t=[]){let n=YB(e),r=n.errors[0];if(r)return{ok:!1,message:eH(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!tH(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:XV(e)}))}var JV=/^(\s*)(-\s+)?/,YV=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function XV(e){let{code:t,comment:n}=ZV(e),r=QV(t);return n&&r.push({text:n,kind:`comment`}),r}function ZV(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 QV(e){if(!e)return[];let t=[],n=JV.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=YV.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,...$V(i[4]??``)]):[...t,...$V(r)]}function $V(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 eH(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function tH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function nH(e){return typeof e==`string`&&e.trim()!==``}var rH={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},iH={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},aH={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},oH={class:`min-w-0 flex-1`},sH={class:`truncate font-mono text-[11px] text-fg-subtle`},cH={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},lH={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},uH={key:1,class:`space-y-3`},dH={key:0,class:`block space-y-1.5`},fH={id:`switch-on`},pH=[`value`],mH={class:`text-xs font-medium text-muted-foreground`},hH={class:`flex items-center gap-2`},gH={key:1,role:`alert`,class:`text-xs text-danger`},_H={key:2,class:`space-y-1.5`},vH=[`title`],yH={key:4,class:`flex flex-wrap items-center gap-1 pt-0.5`},bH={key:3,class:`divide-y divide-border rounded-md border border-border`},xH=[`title`],SH={key:0,class:`space-y-3`},CH={class:`text-[13px]`},wH={key:0,class:`text-danger`},TH={class:`ml-2 text-xs text-fg-subtle`},EH={key:1,class:`space-y-3`},DH={class:`text-[13px]`},OH={class:`ml-2 text-xs text-fg-subtle`},kH=[`title`],AH={key:0,class:`text-xs text-danger`},jH={class:`space-y-2`},MH={class:`divide-y divide-border rounded-md border border-border`},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 min-h-10 items-center gap-3 px-3 py-1.5`},LH={class:`flex items-center border-t border-border px-4 py-2.5`},RH=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(()=>nV(n.yaml,n.path)??{}),a=I(()=>eV(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`,rV(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`?sV(n.yaml,n.path,t):e===`rename`?cV(n.yaml,n.path,t,i):lV(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(()=>pV(n.yaml,n.path)),g=I(()=>p.value?.settings&&i.value.settings?GV(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`,rV(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(hV(T.value?.yaml??``,`inputs`)??{})),E=I(()=>Object.entries(hV(T.value?.yaml??``,`outputs`)??{})),ne=I(()=>Object.entries(hV(n.yaml,`inputs`)??{})),re=I(()=>Object.entries(hV(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:IV(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()?XB(t):void 0),ue.value={...ue.value,[e]:``}}catch(t){ue.val Line truncated
`)[0]}}}let fe=e=>e===void 0?``:ZB(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`,rH,[W(`header`,iH,[W(`span`,aH,[(R(),q(Ue(z(MV)(o.value)),{class:`size-4`}))]),W(`div`,oH,[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(CV)(o.value),"aria-label":`Step id`,"onUpdate:modelValue":n[0]||=e=>S(`id`,String(e))},null,8,[`model-value`,`placeholder`]),W(`div`,sH,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`,cH,[g.value?(R(),G(`p`,lH,V(g.value),1)):L(``,!0),a.value?(R(),G(`section`,uH,[o.value===`switch`?(R(),G(`label`,dH,[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`,fH,[(R(!0),G(H,null,K(h.value,e=>(R(),G(`option`,{key:e,value:`steps.${e}.result.`},null,8,pH))),128))])])):L(``,!0),W(`div`,mH,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`,hH,[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`,gH,V(d.value),1)):L(``,!0)])):L(``,!0),b.value.lead?(R(),G(`section`,_H,[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,vH),b.value.lead.kind===`workflow`?(R(),q(RV,{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(jI),{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(MI),{value:``},{default:j(()=>[...n[19]||=[A(`Default`,-1)]]),_:1}),(R(!0),G(H,null,K(b.value.lead.options,e=>(R(),q(z(MI),{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`,yH,[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`,bH,[(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,xH),t.kind===`workflow`?(R(),q(RV,{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`,jH,V(ue.value[e.key]),1)):L(``,!0)],64))]))),128)),W(`section`,MH,[n[37]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,NH,[W(`label`,PH,[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`,FH,[n[34]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),M(z(jI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:j(()=>[M(z(MI),{value:``},{default:j(()=>[...n[32]||=[A(`Park the task`,-1)]]),_:1}),M(z(MI),{value:`continue`},{default:j(()=>[...n[33]||=[A(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),W(`label`,IH,[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`,LH,[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`,RH,[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})])]))}}),BH=`repository_path`;function VH(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:BH,path:n.trim(),type:`string`,required:!0}),r}function HH(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function UH(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=HH(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 WH(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 GH(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 KH(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...KH(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...KH(n,r)]}):[]}function qH(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function JH(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 YH(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var XH={class:`flex h-full flex-col`},ZH={class:`flex items-center gap-2 border-b border-border px-4 py-3`},QH={class:`min-w-0 flex-1 truncate text-sm font-medium`},$H={key:0,class:`flex flex-1 items-center justify-center`},eU={class:`space-y-1.5`},tU={key:1,class:`space-y-1.5`},nU=[`title`],rU={class:`space-y-1.5`},iU={id:`bind-paths`},aU=[`value`],oU={class:`divide-y divide-border rounded-md border border-border`},sU={class:`flex items-center gap-1.5 text-xs`},cU={class:`font-mono`},lU={class:`text-fg-subtle`},uU={key:0,class:`text-danger`,title:`Required`},dU={key:2,class:`text-xs text-danger`},fU=[`title`],pU={key:0,class:`space-y-1 px-3 py-2`},mU={key:0,class:`text-xs text-danger`},hU={key:1,class:`truncate font-mono text-xs text-success`},gU={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},_U={class:`space-y-2`},vU={key:0,role:`alert`,class:`text-xs text-danger`},yU={key:1,class:`text-xs text-fg-subtle`},bU={class:`flex gap-2`},xU=`__new__`,SU=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(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`,AH,V(ue.value[e.key]),1)):L(``,!0)],64))]))),128)),W(`section`,jH,[n[37]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,MH,[W(`label`,NH,[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`,PH,[n[34]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),M(z(jI),{size:`sm`,"model-value":i.value.on_failure??``,"onUpdate:modelValue":n[13]||=e=>S(`on_failure`,String(e)||void 0)},{default:j(()=>[M(z(MI),{value:``},{default:j(()=>[...n[32]||=[A(`Park the task`,-1)]]),_:1}),M(z(MI),{value:`continue`},{default:j(()=>[...n[33]||=[A(`Continue`,-1)]]),_:1})]),_:1},8,[`model-value`])]),W(`label`,FH,[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`,IH,[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`,LH,[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})])]))}}),zH=`repository_path`;function BH(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:zH,path:n.trim(),type:`string`,required:!0}),r}function VH(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=VH(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 UH(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 WH(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 GH(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...GH(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...GH(n,r)]}):[]}function KH(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function qH(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 JH(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var YH={class:`flex h-full flex-col`},XH={class:`flex items-center gap-2 border-b border-border px-4 py-3`},ZH={class:`min-w-0 flex-1 truncate text-sm font-medium`},QH={key:0,class:`flex flex-1 items-center justify-center`},$H={class:`space-y-1.5`},eU={key:1,class:`space-y-1.5`},tU=[`title`],nU={class:`space-y-1.5`},rU={id:`bind-paths`},iU=[`value`],aU={class:`divide-y divide-border rounded-md border border-border`},oU={class:`flex items-center gap-1.5 text-xs`},sU={class:`font-mono`},cU={class:`text-fg-subtle`},lU={key:0,class:`text-danger`,title:`Required`},uU={key:2,class:`text-xs text-danger`},dU=[`title`],fU={key:0,class:`space-y-1 px-3 py-2`},pU={key:0,class:`text-xs text-danger`},mU={key:1,class:`truncate font-mono text-xs text-success`},hU={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},gU={class:`space-y-2`},_U={key:0,role:`alert`,class:`text-xs text-danger`},vU={key:1,class:`text-xs text-fg-subtle`},yU={class:`flex gap-2`},bU=`__new__`,xU=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 QX(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=$X(n.code,e);return Array.isArray(e)?e.some(e=>ZX(n[r],e,t,n.type===`keyup`)):ZX(n[r],e,t,n.type===`keyup`)}}function $X(e,t){return t.includes(e)?`code`:`key`}function eZ(e,t){let n=I(()=>Me(t?.target)??JX),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}),KW([`blur`,`contextmenu`],s),JW((...e)=>o(...e),e=>{let n=Me(t?.actInsideInputWithModifier)??!0,a=Me(t?.preventDefault)??!1;if(i=XX(e),(!i||i&&!n)&&YX(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}),JW((...e)=>o(...e),e=>{let n=Me(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&YX(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`?QX(e,a):e}return r}var tZ=`vue-flow__node-desc`,nZ=`vue-flow__edge-desc`,rZ=`vue-flow__aria-live`,iZ=[`Enter`,` `,`Escape`],aZ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function oZ(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function sZ(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 cZ(e){return{width:e.offsetWidth,height:e.offsetHeight}}function lZ(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function uZ(e,t){return{x:lZ(e.x,t[0][0],t[1][0]),y:lZ(e.y,t[0][1],t[1][1])}}function dZ(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function fZ(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function pZ(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!fZ(e)}function mZ(e){return pZ(e)&&`computedPosition`in e}function hZ(e){return!Number.isNaN(e)&&Number.isFinite(e)}function gZ(e){return hZ(e.width)&&hZ(e.height)&&hZ(e.x)&&hZ(e.y)}function _Z(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:PQ(e.data)?e.data:{},events:lt(PQ(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function vZ(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:PQ(e.data)?e.data:{},events:lt(PQ(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function yZ(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 bZ(...e){if(e.length===3){let[t,n,r]=e;return yZ(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>fZ(e)&&e.source===r).map(e=>n.find(t=>pZ(t)&&t.id===e.target))}function xZ(...e){if(e.length===3){let[t,n,r]=e;return yZ(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>fZ(e)&&e.target===r).map(e=>n.find(t=>pZ(t)&&t.id===e.source))}function SZ({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function CZ(e,t){return t.some(t=>fZ(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 wZ({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function TZ({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?_Q(s,o):s}function EZ(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 DZ({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function OZ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function kZ(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=EZ(t,DZ({...r.computedPosition,...r.dimensions}))}return OZ(t)}function AZ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...TZ(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 ZX(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=QX(n.code,e);return Array.isArray(e)?e.some(e=>XX(n[r],e,t,n.type===`keyup`)):XX(n[r],e,t,n.type===`keyup`)}}function QX(e,t){return t.includes(e)?`code`:`key`}function $X(e,t){let n=I(()=>Me(t?.target)??qX),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}),GW([`blur`,`contextmenu`],s),qW((...e)=>o(...e),e=>{let n=Me(t?.actInsideInputWithModifier)??!0,a=Me(t?.preventDefault)??!1;if(i=YX(e),(!i||i&&!n)&&JX(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}),qW((...e)=>o(...e),e=>{let n=Me(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&JX(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`?ZX(e,a):e}return r}var eZ=`vue-flow__node-desc`,tZ=`vue-flow__edge-desc`,nZ=`vue-flow__aria-live`,rZ=[`Enter`,` `,`Escape`],iZ={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function aZ(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function oZ(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 sZ(e){return{width:e.offsetWidth,height:e.offsetHeight}}function cZ(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function lZ(e,t){return{x:cZ(e.x,t[0][0],t[1][0]),y:cZ(e.y,t[0][1],t[1][1])}}function uZ(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function dZ(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function fZ(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!dZ(e)}function pZ(e){return fZ(e)&&`computedPosition`in e}function mZ(e){return!Number.isNaN(e)&&Number.isFinite(e)}function hZ(e){return mZ(e.width)&&mZ(e.height)&&mZ(e.x)&&mZ(e.y)}function gZ(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:NQ(e.data)?e.data:{},events:lt(NQ(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function _Z(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:NQ(e.data)?e.data:{},events:lt(NQ(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function vZ(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 yZ(...e){if(e.length===3){let[t,n,r]=e;return vZ(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>dZ(e)&&e.source===r).map(e=>n.find(t=>fZ(t)&&t.id===e.target))}function bZ(...e){if(e.length===3){let[t,n,r]=e;return vZ(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>dZ(e)&&e.target===r).map(e=>n.find(t=>fZ(t)&&t.id===e.source))}function xZ({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function SZ(e,t){return t.some(t=>dZ(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 CZ({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function wZ({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?gQ(s,o):s}function TZ(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 EZ({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function DZ({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function OZ(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=TZ(t,EZ({...r.computedPosition,...r.dimensions}))}return DZ(t)}function kZ(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...wZ(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`},dQ=class extends Error{constructor(e,...t){super(uQ[e]?.call(uQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function fQ(e){return`clientX`in e}function pQ(e){return`sourceEvent`in e}function mQ(e,t){let n=fQ(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 hQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function gQ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function _Q(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var vQ=()=>!0;function yQ(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function bQ(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())sZ(i,oZ(e))>0&&r.push(e);return r}var xQ=250;function SQ(e,t,n,r){let i=[],a=1/0,o=bQ(e,n,t+xQ);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}=aQ(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 CQ(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=vQ},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:_}=mQ(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=wQ(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===UX.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=DQ(t,e,a,p,n,!0)}return b}function wQ(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function TQ(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function EQ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function DQ(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===UX.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,...aQ(o,c,c.position,!0)}:c}var OQ={[BX.Left]:BX.Right,[BX.Right]:BX.Left,[BX.Top]:BX.Bottom,[BX.Bottom]:BX.Top},kQ=[`production`,`prod`];function AQ(e,...t){jQ()&&console.warn(`[Vue Flow]: ${e}`,...t)}function jQ(){return!kQ.includes(`production`)}function MQ(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,...cZ(t)}}):null}function NQ(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 PQ(e){return z(e)!==void 0}function FQ(e,t,n,r){if(!e||!e.source||!e.target)return n(new dQ(lQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=fZ(e)?e:{...e,id:SZ(e)},i=vZ(i,void 0,r),!CZ(i,t)&&i}function IQ(e,t,n,r,i){if(!t.source||!t.target)return i(new dQ(lQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new dQ(lQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?SZ(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(!pZ(o)){n(new dQ(lQ.NODE_INVALID,o?.id));continue}let s=_Z(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 dQ(lQ.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 RQ(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 zQ(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}`;RQ(`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`},uQ=class extends Error{constructor(e,...t){super(lQ[e]?.call(lQ,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function dQ(e){return`clientX`in e}function fQ(e){return`sourceEvent`in e}function pQ(e,t){let n=dQ(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 mQ=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function hQ(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function gQ(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var _Q=()=>!0;function vQ(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function yQ(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())oZ(i,aZ(e))>0&&r.push(e);return r}var bQ=250;function xQ(e,t,n,r){let i=[],a=1/0,o=yQ(e,n,t+bQ);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}=iQ(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 SQ(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=_Q},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:_}=pQ(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=CQ(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=EQ(t,e,a,p,n,!0)}return b}function CQ(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function wQ(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function TQ(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function EQ(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,...iQ(o,c,c.position,!0)}:c}var DQ={[zX.Left]:zX.Right,[zX.Right]:zX.Left,[zX.Top]:zX.Bottom,[zX.Bottom]:zX.Top},OQ=[`production`,`prod`];function kQ(e,...t){AQ()&&console.warn(`[Vue Flow]: ${e}`,...t)}function AQ(){return!OQ.includes(`production`)}function jQ(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,...sZ(t)}}):null}function MQ(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 NQ(e){return z(e)!==void 0}function PQ(e,t,n,r){if(!e||!e.source||!e.target)return n(new uQ(cQ.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=dZ(e)?e:{...e,id:xZ(e)},i=_Z(i,void 0,r),!SZ(i,t)&&i}function FQ(e,t,n,r,i){if(!t.source||!t.target)return i(new uQ(cQ.EDGE_INVALID,e.id)),!1;if(!n)return i(new uQ(cQ.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?xZ(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function IQ(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!fZ(o)){n(new uQ(cQ.NODE_INVALID,o?.id));continue}let s=gZ(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 uQ(cQ.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 LQ(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 RQ(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}`;LQ(`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 n2(e){let t=XB(e).toJS(),n=new Map;for(let r of AV(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 r2(e,t,n){let r=n2(e),i=n2(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 i2={class:`grid h-[calc(100dvh-17rem)] min-h-[26rem] grid-cols-[18rem_1fr] gap-3`},a2={class:`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,"aria-label":`Revisions`},o2=[`aria-current`,`onClick`],s2={class:`flex items-center gap-2 text-sm`},c2={class:`font-mono text-xs text-fg-subtle`},l2=[`title`],u2={key:0,class:`px-3 py-2 text-sm text-muted-foreground`},d2={key:0,class:`flex min-h-0 flex-col gap-2`},f2={class:`flex items-center gap-2`},p2={class:`text-xs text-muted-foreground`},m2={key:0,class:`rounded-lg border border-border p-4 text-sm text-muted-foreground`},h2={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},g2={class:`inline-block w-4 select-none text-fg-subtle`},_2={key:2,class:`grid min-h-0 flex-1 grid-cols-2 gap-3`},v2={class:`flex min-h-0 flex-col gap-1`},y2={class:`text-xs font-medium text-muted-foreground`},b2={class:`min-h-0 flex-1`},x2={class:`flex min-h-0 flex-col gap-1`},S2={class:`min-h-0 flex-1`},C2=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?[]:t2(s.value,n.current)),l=I(()=>s.value!==null&&s.value===n.current),u=I(()=>s.value===null?{}:r2(s.value,n.current,`removed`)),d=I(()=>s.value===null?{}:r2(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(R(),G(`div`,i2,[W(`ol`,a2,[(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`,s2,[W(`span`,c2,`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,l2)],10,o2)]))),128)),e.revisions.length?L(``,!0):(R(),G(`li`,u2,V(e.error||`No recorded changes`),1))]),o.value?(R(),G(`div`,d2,[W(`div`,f2,[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`,p2,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?`This revision removed the workflow`: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`,m2,`This revision removed the workflow.`)):a.value===`yaml`?(R(),G(`pre`,h2,[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`,g2,V(e.kind===`add`?`+`:e.kind===`del`?`-`:``),1),A(V(e.text),1)],2))),128))])])):(R(),G(`div`,_2,[W(`div`,v2,[W(`span`,y2,`v`+V(o.value.version),1),W(`div`,b2,[M(Z0,{yaml:s.value,marks:u.value},null,8,[`yaml`,`marks`])])]),W(`div`,x2,[n[5]||=W(`span`,{class:`text-xs font-medium text-muted-foreground`},`Current`,-1),W(`div`,S2,[M(Z0,{yaml:e.current,marks:d.value},null,8,[`yaml`,`marks`])])])]))])):L(``,!0)]))}}),w2=`workflow-definitions`;function T2(e){let t=me(),n=J([]),r=J(``);async function i(){try{n.value=await t.hist 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 t2(e){let t=YB(e).toJS(),n=new Map;for(let r of kV(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 n2(e,t,n){let r=t2(e),i=t2(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 r2={class:`grid h-[calc(100dvh-17rem)] min-h-[26rem] grid-cols-[18rem_1fr] gap-3`},i2={class:`min-h-0 divide-y divide-border overflow-y-auto rounded-lg border border-border`,"aria-label":`Revisions`},a2=[`aria-current`,`onClick`],o2={class:`flex items-center gap-2 text-sm`},s2={class:`font-mono text-xs text-fg-subtle`},c2=[`title`],l2={key:0,class:`px-3 py-2 text-sm text-muted-foreground`},u2={key:0,class:`flex min-h-0 flex-col gap-2`},d2={class:`flex items-center gap-2`},f2={class:`text-xs text-muted-foreground`},p2={key:0,class:`rounded-lg border border-border p-4 text-sm text-muted-foreground`},m2={key:1,class:`min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6`},h2={class:`inline-block w-4 select-none text-fg-subtle`},g2={key:2,class:`grid min-h-0 flex-1 grid-cols-2 gap-3`},_2={class:`flex min-h-0 flex-col gap-1`},v2={class:`text-xs font-medium text-muted-foreground`},y2={class:`min-h-0 flex-1`},b2={class:`flex min-h-0 flex-col gap-1`},x2={class:`min-h-0 flex-1`},S2=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?[]:e2(s.value,n.current)),l=I(()=>s.value!==null&&s.value===n.current),u=I(()=>s.value===null?{}:n2(s.value,n.current,`removed`)),d=I(()=>s.value===null?{}:n2(n.current,s.value,`added`)),f={added:`default`,edited:`secondary`,removed:`destructive`};return(t,n)=>(R(),G(`div`,r2,[W(`ol`,i2,[(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`,o2,[W(`span`,s2,`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,c2)],10,a2)]))),128)),e.revisions.length?L(``,!0):(R(),G(`li`,l2,V(e.error||`No recorded changes`),1))]),o.value?(R(),G(`div`,u2,[W(`div`,d2,[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`,f2,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?`This revision removed the workflow`: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`,p2,`Workflow removed in this revision.`)):a.value===`yaml`?(R(),G(`pre`,m2,[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`,h2,V(e.kind===`add`?`+`:e.kind===`del`?`-`:``),1),A(V(e.text),1)],2))),128))])])):(R(),G(`div`,g2,[W(`div`,_2,[W(`span`,v2,`v`+V(o.value.version),1),W(`div`,y2,[M(X0,{yaml:s.value,marks:u.value},null,8,[`yaml`,`marks`])])]),W(`div`,b2,[n[5]||=W(`span`,{class:`text-xs font-medium text-muted-foreground`},`Current`,-1),W(`div`,x2,[M(X0,{yaml:e.current,marks:d.value},null,8,[`yaml`,`marks`])])])]))])):L(``,!0)]))}}),C2=`workflow-definitions`;function w2(e){let t=me(),n=J([]),r=J(``);async function i(){try{n.value=await t.histo Line truncated
+1 -1
View File
@@ -5,7 +5,7 @@ import PageHeader from "./PageHeader.vue";
<template>
<div>
<PageHeader title="Page not found" />
<p class="mb-4 text-sm text-fg-muted">This address does not match a page.</p>
<p class="mb-4 text-sm text-fg-muted">No page at this address.</p>
<RouterLink to="/" class="text-sm underline">Return to dashboard</RouterLink>
</div>
</template>
+1 -1
View File
@@ -140,7 +140,7 @@ const title = computed(() => (props.binding ? "Edit binding" : "New binding"));
<DialogContent class="max-h-[85vh] overflow-y-auto sm:max-w-lg">
<DialogHeader>
<DialogTitle>{{ title }}</DialogTitle>
<DialogDescription>Editing returns this binding to pending approval.</DialogDescription>
<DialogDescription>Saving returns it to pending approval.</DialogDescription>
</DialogHeader>
<form @submit.prevent="emit('save', draft)">
+1 -1
View File
@@ -52,7 +52,7 @@ import { captures, enabled, error, loading } from "./state";
<EmptyHeader>
<EmptyMedia variant="icon"><Inbox /></EmptyMedia>
<EmptyTitle>No captures yet</EmptyTitle>
<EmptyDescription>Create a source above and point a sender at its URL.</EmptyDescription>
<EmptyDescription>No captures. Add a source.</EmptyDescription>
</EmptyHeader>
</Empty>
-2
View File
@@ -22,8 +22,6 @@ const PROMPTS = [
class="mx-auto mb-3 grid size-9 place-items-center rounded-xl border border-border-strong font-bold text-link"
>A</span
>
<h2 class="text-lg font-semibold tracking-[-0.02em]">What are we working on?</h2>
<p class="mt-2 mb-4 text-sm text-fg-muted">Ask Archie anything, or start with one of these prompts.</p>
<div class="grid gap-2">
<button
v-for="prompt in PROMPTS"
+3 -3
View File
@@ -47,7 +47,7 @@ async function later() {
<template>
<div class="text-sm">
<p v-if="!available.length">Archie is up to date.</p>
<p v-if="!available.length">Up to date</p>
<template v-else>
<p class="font-medium">An update is available</p>
<ul class="mt-1 space-y-0.5">
@@ -60,11 +60,11 @@ async function later() {
<Button v-if="update.can_install" size="sm" @click="install">Install</Button>
<Button size="sm" variant="ghost" @click="later">Not now</Button>
</div>
<p v-else-if="state === 'installing'" class="mt-2 text-fg-muted">Installing… this can take a few minutes.</p>
<p v-else-if="state === 'installing'" class="mt-2 text-fg-muted">Installing…</p>
<p v-else-if="state === 'deferred'" class="mt-2 text-fg-muted">Skipped until a newer release.</p>
<p v-else-if="state === 'done'" class="mt-2 text-ok">{{ result }}</p>
<p v-else class="mt-2 text-danger">{{ result }}</p>
<p v-if="state === 'idle' && !update.can_install" class="mt-2 text-xs text-fg-muted">This host has no install script, so the update can't be installed from here.</p>
<p v-if="state === 'idle' && !update.can_install" class="mt-2 text-xs text-fg-muted">No install script on this host.</p>
</template>
</div>
</template>
+1 -1
View File
@@ -75,7 +75,7 @@ function healthKind(status: string | undefined): StatusKind {
</ul>
<Empty v-else>
<EmptyHeader>
<EmptyTitle>No recorded activity yet</EmptyTitle>
<EmptyTitle>No activity</EmptyTitle>
</EmptyHeader>
</Empty>
</CardContent>
-1
View File
@@ -101,7 +101,6 @@ onMounted(load);
<Empty v-else-if="!curators.length">
<EmptyHeader>
<EmptyTitle>No curators registered</EmptyTitle>
<EmptyDescription>Curators are background agent loops that maintain memory and skills.</EmptyDescription>
</EmptyHeader>
</Empty>
<CuratorCard v-for="c in curators" v-else :key="c.name" :curator="c" />
+1 -1
View File
@@ -41,7 +41,7 @@ const pct = computed(() => {
<template>
<Card v-if="panel.kind === 'incomplete'">
<CardHeader>
<CardTitle>Finish setting up</CardTitle>
<CardTitle>Setup</CardTitle>
<CardAction>
<span class="text-lg font-semibold text-link">{{ pct }}%</span>
</CardAction>
+3 -3
View File
@@ -119,7 +119,7 @@ function scopes(binding: HarnessBinding): string {
<Empty v-else-if="unconfigured">
<EmptyHeader>
<EmptyTitle>Harness bindings are not configured</EmptyTitle>
<EmptyDescription>This process cannot read credential bindings or captured OAuth tokens.</EmptyDescription>
<EmptyDescription>Credential bindings and OAuth tokens unavailable.</EmptyDescription>
</EmptyHeader>
</Empty>
@@ -133,13 +133,13 @@ function scopes(binding: HarnessBinding): string {
<Card v-else class="mb-4">
<CardContent class="flex flex-wrap items-end gap-3">
<label class="flex flex-col gap-1 text-sm">
<span class="text-muted-foreground">Kit profile</span>
<span class="text-muted-foreground">Profile</span>
<NativeSelect
size="sm"
v-model="profile" class="min-w-48"
:disabled="!state.profiles.length"
>
<NativeSelectOption v-if="!state.profiles.length" value="">No Kit profiles configured</NativeSelectOption>
<NativeSelectOption v-if="!state.profiles.length" value="">No profiles configured</NativeSelectOption>
<NativeSelectOption v-for="name in state.profiles" :key="name" :value="name">
{{ name }}
</NativeSelectOption>
+8 -8
View File
@@ -35,7 +35,7 @@ export interface RetryModeMeta {
export const DEFAULT_STATUSES: StatusMeta[] = [
{ id: "queued", label: "Queued", kind: "idle" },
{ id: "running", label: "Working", kind: "info" },
{ id: "running", label: "Running", kind: "info" },
{
id: "waiting_human",
label: "Waiting for you",
@@ -46,7 +46,7 @@ export const DEFAULT_STATUSES: StatusMeta[] = [
{ id: "merged", label: "Merged", kind: "ok" },
{ id: "completed", label: "Done", kind: "ok" },
{ id: "parked", label: "Parked", kind: "warn", needs_you: true },
{ id: "dead", label: "Stopped (too many retries)", kind: "danger" },
{ id: "dead", label: "Stopped: retry cap", kind: "danger" },
{ id: "rejected", label: "Rejected", kind: "danger" },
{ id: "closed_wont_do", label: "Won't do", kind: "idle" },
];
@@ -56,13 +56,13 @@ export const DEFAULT_ACTIONS: ActionMeta[] = [
id: "cancel",
label: "Cancel",
kind: "quiet",
confirm: `Cancel "{title}"? This closes the forge issue.`,
confirm: `Cancel "{title}"? Closes the issue.`,
},
{
id: "stop",
label: "Stop",
kind: "primary",
confirm: `Stop "{title}"? Recoverable work will remain parked.`,
confirm: `Stop "{title}"? Work stays parked.`,
},
{ id: "approve", label: "Approve", kind: "primary" },
{ id: "rereview", label: "Re-review", kind: "quiet" },
@@ -70,14 +70,14 @@ export const DEFAULT_ACTIONS: ActionMeta[] = [
id: "reject",
label: "Reject",
kind: "quiet",
confirm: `Reject "{title}"? This closes the forge issue.`,
confirm: `Reject "{title}"? Closes the issue.`,
},
{ id: "retry", label: "Retry", kind: "primary" },
{
id: "abandon",
label: "Abandon",
kind: "quiet",
confirm: `Abandon "{title}"? Archie stops working on it; the forge issue stays open.`,
confirm: `Abandon "{title}"? The issue stays open.`,
},
{
id: "archive",
@@ -108,14 +108,14 @@ export const DEFAULT_RETRY_MODES: RetryModeMeta[] = [
id: "refresh_onto_base",
label: "Refresh onto base",
description:
"Start the retry from the current base branch, discarding work already pushed on this task's branch.",
"Retry from the current base; discards pushed commits.",
default: true,
},
{
id: "continue_pushed_work",
label: "Continue pushed work",
description:
"Resume the branch this task already pushed, keeping its commits.",
"Resume the pushed branch.",
requires_branch: true,
},
];
+1 -1
View File
@@ -40,7 +40,7 @@ function tools(profile: Profile, value: string | number) {
<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>
<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; leave Image empty when using a Kit."><Input :id="`${key}-kit`" v-model="profile.kit" placeholder="registry/kit@sha256:…" /></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>
+4 -4
View File
@@ -63,13 +63,13 @@ const pullPolicy = computed({
<p v-if="catalogError || error" class="mb-4 text-sm text-danger" role="alert">{{ catalogError || error }}</p>
<template v-if="runtime">
<SettingRow label="Image" for="cr-image" hint="Container image used for agent runs.">
<SettingRow label="Image" for="cr-image">
<div class="flex flex-wrap items-center gap-3">
<Input id="cr-image" v-model="runtime.image" class="font-mono" />
<DraftHint :kind="KIND" path="image" />
</div>
</SettingRow>
<SettingRow label="Pull policy" hint="When to refresh the agent image.">
<SettingRow label="Pull policy">
<div class="flex flex-wrap items-center gap-3">
<ToggleGroup type="single" variant="outline" size="sm" :model-value="pullPolicy" aria-label="Pull policy" @update:model-value="(value) => { if (value) pullPolicy = value as typeof pullPolicy; }">
<ToggleGroupItem v-for="option in pullPolicies" :key="option.value" :value="option.value">{{ option.label }}</ToggleGroupItem>
@@ -89,13 +89,13 @@ const pullPolicy = computed({
<DraftHint :kind="KIND" path="max_concurrency" />
</div>
</SettingRow>
<SettingRow label="Max uptime" for="cr-uptime" hint="Maximum time an agent container may run.">
<SettingRow label="Max uptime" for="cr-uptime" hint="Agent container time limit.">
<div class="flex flex-wrap items-center gap-3">
<DurationInput id="cr-uptime" v-model="runtime.max_uptime" :units="['m', 'h']" />
<DraftHint :kind="KIND" path="max_uptime" />
</div>
</SettingRow>
<SettingRow label="Volume retention" for="cr-ttl" hint="How long to retain volumes after a run.">
<SettingRow label="Volume retention" for="cr-ttl" hint="Volume retention.">
<div class="flex flex-wrap items-center gap-3">
<DurationInput id="cr-ttl" v-model="runtime.volume_ttl" :units="['h']" />
<DraftHint :kind="KIND" path="volume_ttl" />
+2 -2
View File
@@ -62,14 +62,14 @@ onMounted(load);
<template>
<section class="mb-8" aria-labelledby="personal-tokens">
<div class="mb-3 flex items-center justify-between gap-2">
<h2 id="personal-tokens" class="text-sm font-medium">Your API tokens</h2>
<h2 id="personal-tokens" class="text-sm font-medium">API tokens</h2>
<Button v-if="available" size="sm" :disabled="busy" @click="create"><Plus data-icon="inline-start" />New token</Button>
</div>
<p v-if="!available && !busy && !error" class="mb-3 text-sm text-fg-subtle">Personal tokens need a signed-in person.</p>
<p v-if="available" class="mb-3 text-xs text-fg-subtle">Send it as <code>Authorization: Bearer &lt;token&gt;</code>.</p>
<p v-if="error" role="alert" class="mb-3 text-sm text-danger">{{ error }}</p>
<div v-if="created" class="mb-3 rounded-lg border border-border bg-card p-3">
<p class="mb-2 text-xs">Copy this token now. It is not shown again.</p>
<p class="mb-2 text-xs">Not shown again.</p>
<Input :model-value="created" readonly aria-label="New token" @focus="($event.target as HTMLInputElement).select()" />
</div>
<p v-if="available && !tokens.length && !busy && !error" class="text-sm text-fg-subtle">No tokens yet.</p>
+2 -2
View File
@@ -41,7 +41,7 @@ const error = computed(() => store.pageErrorFor(KIND));
<SettingRow
label="Precision gate"
for="review-precision"
hint="Drop nitpicks and unverifiable findings before posting. Off favours recall."
hint="Filters weak findings before posting."
>
<div class="flex flex-wrap items-center gap-3">
<Switch id="review-precision" v-model="dials.precision_gate" aria-label="Precision gate" />
@@ -51,7 +51,7 @@ const error = computed(() => store.pageErrorFor(KIND));
<SettingRow
label="Approve before posting"
for="review-approve"
hint="Hold drafted reviews until someone approves them."
hint="Draft reviews require approval."
>
<div class="flex flex-wrap items-center gap-3">
<Switch id="review-approve" v-model="dials.approve_before_post" aria-label="Approve before posting" />
-1
View File
@@ -44,7 +44,6 @@ function chooseMotion(value: unknown): void {
<ConfigCard
title="Dashboard preferences"
description="Saved only in this browser and applied immediately."
>
<div class="grid gap-8 md:grid-cols-2 lg:grid-cols-4">
<section class="flex min-w-0 flex-col items-start">
+1 -1
View File
@@ -37,7 +37,7 @@ onUnmounted(() => clearInterval(timer));
<CardTitle>Startup settings</CardTitle>
</CardHeader>
<CardContent>
<p class="mb-2 text-fg-subtle">Read at startup. A change needs a restart.</p>
<p class="mb-2 text-fg-subtle">Restart required for changes.</p>
<Table>
<TableBody>
<TableRow v-for="(reason, key) in config.bootstrap" :key="key">
+1 -1
View File
@@ -179,7 +179,7 @@ onMounted(load);
: `Install ${updateable.map((c) => c.label || c.id).join(", ")}`
}}
</Button>
<p v-if="installing" class="text-xs text-fg-muted">You can leave this page; the restart continues here.</p>
<p v-if="installing" class="text-xs text-fg-muted">Restart continues in the background.</p>
</div>
<div
+2 -3
View File
@@ -44,19 +44,18 @@ const nothingRecorded = computed(
<Empty v-else-if="undecodable">
<EmptyHeader>
<EmptyTitle
>A change capture was recorded but could not be read</EmptyTitle
>Capture unreadable</EmptyTitle
>
</EmptyHeader>
</Empty>
<Empty v-else-if="nothingRecorded">
<EmptyHeader>
<EmptyTitle>No change capture recorded</EmptyTitle>
<EmptyTitle>No capture</EmptyTitle>
</EmptyHeader>
</Empty>
<div v-else class="flex flex-col">
<p class="mb-3 text-xs text-fg-muted">Whole attempt, not one stage.</p>
<ChangeCapture
v-for="(capture, i) in captures"
:key="`${capture.captured_at || ''}:${i}`"
+1 -1
View File
@@ -143,7 +143,7 @@ const startedAt = computed(() => {
</ol>
<Empty v-else>
<EmptyHeader>
<EmptyTitle>No stages recorded for this attempt</EmptyTitle>
<EmptyTitle>No stages</EmptyTitle>
</EmptyHeader>
</Empty>
</div>
+2 -2
View File
@@ -30,12 +30,12 @@ const copy = computed(() =>
? {
title: "Not a task id",
empty: `“${props.raw ?? ""}” is not a task id`,
detail: "A task id is a positive whole number. Nothing was requested.",
detail: "Task ids are positive whole numbers.",
}
: {
title: "Task not found",
empty: `Nothing is recorded for task ${props.raw ?? ""}`,
detail: "archied answered that this task does not exist.",
detail: "No such task.",
},
);
</script>
+3 -7
View File
@@ -151,7 +151,7 @@ const view = computed(() => {
if (state.found === false && !state.disabled) {
return {
kind: "nolog" as const,
status: "No log recorded for this attempt",
status: "No log",
};
}
// This process cannot read task logs at all. That IS about the deployment,
@@ -232,11 +232,7 @@ watch([() => route.hash, current], async () => {
<Empty v-else-if="view.kind === 'nolog'">
<EmptyHeader>
<EmptyTitle>No log recorded for this attempt</EmptyTitle>
<EmptyDescription
>This attempt produced no output, or it has not started writing
yet.</EmptyDescription
>
<EmptyTitle>No log</EmptyTitle>
</EmptyHeader>
</Empty>
@@ -244,7 +240,7 @@ watch([() => route.hash, current], async () => {
<EmptyHeader>
<EmptyTitle>No persisted log for this attempt</EmptyTitle>
<EmptyDescription
>The log service has no reader for this file.</EmptyDescription
>No reader for this file.</EmptyDescription
>
</EmptyHeader>
</Empty>
+1 -1
View File
@@ -155,7 +155,7 @@ const errorText = computed(() => {
if (error.value.kind === "session-expired")
return "Dashboard authentication is required.";
if (error.value.kind === "refused")
return `${error.value.message}. You can't do that.`;
return `${error.value.message}`;
return `${error.value.message}. Try again, or check the daemon.`;
});
+2 -2
View File
@@ -260,7 +260,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
<NativeSelect size="sm" v-if="sourceCaptures.length" id="bind-capture" v-model="captureId" class="w-full">
<NativeSelectOption v-for="c in sourceCaptures" :key="c.id" :value="c.id">#{{ c.id }} · {{ when(c.received_at) }}{{ c.event_type ? "" : " · unidentified" }}</NativeSelectOption>
</NativeSelect>
<p v-else class="text-xs text-fg-subtle" :title="`Send an event to ${hookURL} and it appears here`">Waiting for the first event</p>
<p v-else class="text-xs text-fg-subtle" :title="`Send an event to ${hookURL} and it appears here`">No events</p>
</section>
<section class="space-y-1.5">
@@ -314,7 +314,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
<p v-if="resolved(REPOSITORY_FIELD).failure" class="text-xs text-danger">{{ resolved(REPOSITORY_FIELD).failure }}</p>
<p v-else-if="resolved(REPOSITORY_FIELD).value !== undefined" class="truncate font-mono text-xs text-success">{{ resolved(REPOSITORY_FIELD).value }}</p>
</div>
<p v-if="!inputs.length && !repository" class="px-3 py-2 text-xs text-fg-subtle">The workflow declares no inputs.</p>
<p v-if="!inputs.length && !repository" class="px-3 py-2 text-xs text-fg-subtle">No inputs.</p>
</div>
</section>
+1 -1
View File
@@ -29,7 +29,7 @@ function started(taskId: number): void {
size="sm"
variant="outline"
:disabled="disabled"
:title="draft !== undefined ? 'Runs this draft once. Forge writes and pushes are skipped, including in called workflows; commands and tools still run' : disabled ? 'Save your changes first' : undefined"
:title="draft !== undefined ? 'Runs this draft once. Forge writes and pushes are skipped, including in called workflows; commands and tools still run' : disabled ? 'Save first' : undefined"
>
<component :is="draft !== undefined ? FlaskConical : Play" data-icon="inline-start" /> {{ draft !== undefined ? "Test" : "Run" }}</Button>
</DialogTrigger>
-1
View File
@@ -139,7 +139,6 @@ const scopedLogs = computed(() => logs.value ? { ...logs.value, entries: (logs.v
<h3 class="text-xs font-medium text-muted-foreground">Captured changes</h3>
<p v-if="changesError" role="alert" class="text-danger">{{ changesError }}</p>
<ChangeCapture v-for="(capture, i) in captures" :key="i" :capture="capture" :task="task" />
<p v-if="changes && !captures.length" class="text-xs text-muted-foreground">No changes captured for this step</p>
</section>
<section class="space-y-2">
<h3 class="text-xs font-medium text-muted-foreground">Log <span title="Only lines tagged with this stage are shown">· stage-tagged lines</span></h3>
-2
View File
@@ -4,7 +4,6 @@ import {
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
@@ -421,7 +420,6 @@ function syncScroll(event: Event): void {
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Delete the {{ selected }} workflow?</AlertDialogTitle>
<AlertDialogDescription>This removes its stored definition.</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
+1 -1
View File
@@ -60,7 +60,7 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr
<Button type="button" size="sm" variant="outline" class="ml-auto" :disabled="then === null || identical" :title="then === null ? 'This revision removed the workflow' : undefined" @click="emit('restore', then!)">
<RotateCcw data-icon="inline-start" /> Restore this version</Button>
</div>
<p v-if="then === null" class="rounded-lg border border-border p-4 text-sm text-muted-foreground">This revision removed the workflow.</p>
<p v-if="then === null" class="rounded-lg border border-border p-4 text-sm text-muted-foreground">Workflow removed in this revision.</p>
<pre v-else-if="mode === 'yaml'" class="min-h-0 flex-1 overflow-auto rounded-lg border border-border py-2 font-mono text-[13px] leading-6"><code><span
v-for="(line, i) in diff"
:key="i"