fix(ui): clean dependencies and add task table sorting

This commit is contained in:
sam committed 2026-10-09 12:46:05 +11:00
1 parent dd41d7a0cd
commit 583cc876f8
11 files changed
+317 -5588

No files matched your search

+5 -5
View File
@@ -1,4 +1,4 @@
import{A as e,D as t,Jt as n,O as r,Xt as i,at as a,b as o,ht as s,kn as c,lt as l,nr as u,s as d,t as f,v as p,x as m,xt as h,y as g,yn as _}from"./PageHeader.js";import{K as ee,b as te,r as ne,t as re,y as ie}from"./badge.js";import{a as ae,c as oe,d as se,f as ce,g as v,h as le,i as y,l as ue,m as de,n as fe,o as b,p as pe,r as me,s as he,t as ge,u as _e}from"./index.js";var x=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,S=(e,t)=>{for(var n in t)x(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,r)=>{for(var i=r>1?void 0:r?ve(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&x(t,n,i),i},w=(e,t)=>(n,r)=>t(n,r,e),ye=`Terminal input`,be={get:()=>ye,set:e=>ye=e},xe=`Too much output to announce, navigate to rows manually to read`,T={get:()=>xe,set:e=>xe=e};function Se(e){return e.replace(/\r?\n/g,`\r`)}function Ce(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function we(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Te(e,t,n,r){e.stopPropagation(),e.clipboardData&&Ee(e.clipboardData.getData(`text/plain`),t,n,r)}function Ee(e,t,n,r){e=Se(e),e=Ce(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function De(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function Oe(e,t,n,r,i){De(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ke(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Ae(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var je=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},Me=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Ne=``,Pe=` `,Fe=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ie}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){retuLine truncated
import{A as e,D as t,Jt as n,O as r,Xt as i,at as a,b as o,ht as s,kn as c,lt as l,nr as u,s as d,t as f,v as p,x as m,xt as h,y as g,yn as _}from"./PageHeader.js";import{K as ee,b as te,r as ne,t as re,y as ie}from"./badge.js";import{a as ae,c as oe,d as se,f as ce,g as v,h as le,i as y,l as ue,m as de,n as fe,o as b,p as pe,r as me,s as he,t as ge,u as _e}from"./index.js";var x=Object.defineProperty,ve=Object.getOwnPropertyDescriptor,S=(e,t)=>{for(var n in t)x(e,n,{get:t[n],enumerable:!0})},C=(e,t,n,r)=>{for(var i=r>1?void 0:r?ve(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&x(t,n,i),i},w=(e,t)=>(n,r)=>t(n,r,e),ye=`Terminal input`,be={get:()=>ye,set:e=>ye=e},xe=`Too much output to announce, navigate to rows manually to read`,T={get:()=>xe,set:e=>xe=e};function Se(e){return e.replace(/\r?\n/g,`\r`)}function Ce(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function we(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function Te(e,t,n,r){e.stopPropagation(),e.clipboardData&&Ee(e.clipboardData.getData(`text/plain`),t,n,r)}function Ee(e,t,n,r){e=Se(e),e=Ce(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function De(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function Oe(e,t,n,r,i){De(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function ke(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Ae(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var je=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},Me=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128||(c=(i&31)<<6|a&63,c<128)){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},Ne=``,Pe=` `,Fe=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Ie}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&5033164Line truncated
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var $e=E(`CharSizeService`),et=E(`CoreBrowserService`),tt=E(`MouseService`),nt=E(`RenderService`),rt=E(`SelectionService`),it=E(`CharacterJoinerService`),at=E(`ThemeService`),ot=E(`LinkProviderService`),st=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?pt.isErrorNoTelemetry(e)?new pt(e.message+`
@@ -6,11 +6,11 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function ct(e){ut(e)||st.onUnexpectedError(e)}var lt=`Canceled`;function ut(e){return e instanceof dt||e instanceof Error&&e.name===lt&&e.message===lt}var dt=class extends Error{constructor(){super(lt),this.name=this.message}};function ft(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var pt=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},mt=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function ht(e,t=0){return e[e.length-(1+t)]}var gt;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(gt||={});var _t=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||gt.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};_t.empty=new _t(e=>{});function vt(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var yt;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function ee(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=ee;async function te(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=te})(yt||={});var bt=null;function xt(e){return bt?.trackDisposable(e),e}function St(e){bt?.markAsDisposed(e)}function Ct(e,t){bt?.setParent(e,t)}function wt(e){return bt?.markAsSingleton(e),e}function Tt(e){if(yt.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function Et(...e){return k(()=>Tt(e))}function k(e){let t=xt({dispose:vt(()=>{St(t),e()})});return t}var Dt=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,xt(this)}dispose(){this._isDisposed||(St(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Tt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return Ct(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),Ct(e,null))}};Dt.DISABLE_DISPOSED_WARNING=!1;var Ot=Dt,A=class{constructor(){this._store=new Ot,xt(this),Ct(this._store,this)}dispose(){St(th Line truncated
`).slice(2).join(`
`))}},Vt=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},Ht=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},Ut=0,Wt=class{constructor(e){this.value=e,this.id=Ut++}},Gt=2,N=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Lt>0||this._options?.leakWarningThreshold?new zt(e?.onListenerError??ct,this._options?.leakWarningThreshold??Lt):void 0,this._perfMon=this._options?._profName?new It(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new Ht(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||ct)(n),A.None}if(this._disposed)return A.None;t&&(e=e.bind(t));let r=new Wt(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Bt.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Wt?(this._deliveryQueue??=new Kt,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=k(()=>{i?.(),this._removeListener(r)});return n instanceof Ot?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Gt<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||ct;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof Wt)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},Kt=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},qt=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new N,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};qt.INSTANCE=new qt;var Jt=qt;function Yt(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Jt.INSTANCE.onDidChangeZoomLevel;function Xt(e){return Jt.INSTANCE.getZoomFactor(e)}Jt.INSTANCE.onDidChangeFullscreen;var Zt=typeof navigator==`object`?navigator.userAgent:``,Qt=Zt.indexOf(`Firefox`)>=0,$t=Zt.indexOf(`AppleWebKit`)>=0,en=Zt.indexOf(`Chrome`)>=0,tn=!en&&Zt.indexOf(`Safari`)>=0;Zt.indexOf(`Electron/`),Zt.indexOf(`Android`);var nn=!1;if(typeof At.matchMedia==`function`){let e=At.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=At.matchMedia(`(display-mode: fullscreen)`);nn=e.matches,Yt(At,e,({matches:e})=>{nn&&t.matches||(nn=e)})}f Line truncated
`))}},Vt=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},Ht=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},Ut=0,Wt=class{constructor(e){this.value=e,this.id=Ut++}},Gt=2,N=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Lt>0||this._options?.leakWarningThreshold?new zt(e?.onListenerError??ct,this._options?.leakWarningThreshold??Lt):void 0,this._perfMon=this._options?._profName?new It(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new Ht(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||ct)(n),A.None}if(this._disposed)return A.None;t&&(e=e.bind(t));let r=new Wt(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Bt.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Wt?(this._deliveryQueue??=new Kt,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=k(()=>{i?.(),this._removeListener(r)});return n instanceof Ot?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Gt<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||ct;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof Wt)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},Kt=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},qt=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new N,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new N,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};qt.INSTANCE=new qt;var Jt=qt;function Yt(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Jt.INSTANCE.onDidChangeZoomLevel;function Xt(e){return Jt.INSTANCE.getZoomFactor(e)}Jt.INSTANCE.onDidChangeFullscreen;var Zt=typeof navigator==`object`?navigator.userAgent:``,Qt=Zt.indexOf(`Firefox`)>=0,$t=Zt.indexOf(`AppleWebKit`)>=0,en=Zt.indexOf(`Chrome`)>=0,tn=!en&&Zt.indexOf(`Safari`)>=0;Zt.indexOf(`Electron/`),Zt.indexOf(`Android`);var nn=!1;if(typeof At.matchMedia==`function`){let e=At.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=At.matchMedia(`(display-mode: fullscreen)`);nn=e.matches,Yt(At,e,({matches:e})=>{nn&&t.matches||(nn=e)})}func Line truncated
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};ri=C([w(2,D),w(3,et),w(4,Ue),w(5,at),w(6,O),w(7,nt)],ri);var ii=class extends A{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(k(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimLine truncated
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))(R||={});var ui;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(ui||={});var di;(e=>e.ST=`${R.ESC}\\`)(di||={});var fi=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${R.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};fi=C([w(2,D),w(3,O),w(4,We),w(5,nt)],fi);var z=0,B=0,V=0,H=0,pi={css:`#00000000`,rgba:0},U;(e=>{function t(e,t,n,r){return r===void 0?`#${hi(e)}${hi(t)}${hi(n)}`:`#${hi(e)}${hi(t)}${hi(n)}${hi(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(U||={});var W;(e=>{function t(e,t){if(H=(t.rgba&255)/255,H===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return z=a+Math.round((n-a)*H),B=o+Math.round((r-o)*H),V=s+Math.round((i-s)*H),{css:U.toCss(z,B,V),rgba:U.toRgba(z,B,V)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=mi.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return U.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[z,B,V]=mi.toChannels(t),{css:U.toCss(z,B,V),rgba:t}}e.opaque=i;function a(e,t){return H=Math.round(t*255),[z,B,V]=mi.toChannels(e.rgba),{css:U.toCss(z,B,V,H),rgba:U.toRgba(z,B,V,H)}}e.opacity=a;function o(e,t){return H=e.rgba&255,a(e,H*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(W||={});va Line truncated
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))(R||={});var ui;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(ui||={});var di;(e=>e.ST=`${R.ESC}\\`)(di||={});var fi=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${R.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};fi=C([w(2,D),w(3,O),w(4,We),w(5,nt)],fi);var z=0,B=0,V=0,H=0,pi={css:`#00000000`,rgba:0},U;(e=>{function t(e,t,n,r){return r===void 0?`#${hi(e)}${hi(t)}${hi(n)}`:`#${hi(e)}${hi(t)}${hi(n)}${hi(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(U||={});var W;(e=>{function t(e,t){if(H=(t.rgba&255)/255,H===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return z=a+Math.round((n-a)*H),B=o+Math.round((r-o)*H),V=s+Math.round((i-s)*H),{css:U.toCss(z,B,V),rgba:U.toRgba(z,B,V)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=mi.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return U.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[z,B,V]=mi.toChannels(t),{css:U.toCss(z,B,V),rgba:t}}e.opaque=i;function a(e,t){return H=Math.round(t*255),[z,B,V]=mi.toChannels(e.rgba),{css:U.toCss(z,B,V,H),rgba:U.toRgba(z,B,V,H)}}e.opacity=a;function o(e,t){return H=e.rgba&255,a(e,H*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(W||={});va Line truncated
`:`
`)}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
`)}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+=T.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 r Line truncated
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Es+1&&(this._liveRegion.textContent+=T.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 r 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 T.get()},set tooMuchOutput(e){T.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){let n=t.protocol===`https:`?`wss:`:`ws:`,r=new URLSearchParams({profile:e}).toString();return`${n}//${t.host}/api/harness/terminal?${r}`}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=_(null),i=_(`connecting`),c=null,u=null,f=null,h=null;function g(){try{f?.fit()}catch{}}return l(()=>{let e=r.value;if(!e)return;c=new Bs({convertEol:!0,cursorBlink:!0,fontFamily:`'IBM Plex Mono', ui-monospace, monospace`,fontSize:13,theme:{background:`#0b0f14`,foreground:`#e6edf3`,cursor:`#e6edf3`,selectionBackground:`#264f78`}}),f=new Us,c.loadAddon(f),c.open(e),g(),c.focus();let t=new WebSocket(Gs(n.profile,window.location));u=t,t.binaryType=`arraybuffer`,t.onopen=()=>{i.value=`open`},t.onmessage=e=>{c&&(typeof e.data==`string`?c.write(e.data):c.write(new Uint8Array(e.data)))},t.onerror=()=>{i.value=`failed`},t.onclose=()=>{i.value=`closed`},c.onData(e=>{t.readyState===WebSocket.OPEN&&t.send(e)}),h=new ResizeObserver(g),h.observe(e)}),a(()=>{h?.disconnect(),h=null,u?.close(),u=null,c?.dispose(),c=null,f=null}),(e,n)=>(s(),m(`div`,Ks,[i.value===`open`?o(``,!0):(s(),m(`p`,qs,[i.value===`connecting`?(s(),m(d,{key:0},[t(`Connecting…`)],64)):i.value===`closed`?(s(),m(d,{key:1},[t(`The terminal session ended.`)],64)):(s(),m(d,{key:2},[t(`Could not open the setup terminal.`)],64))])),p(`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=[`disabled`],$s={key:0,value:``},ec=[`value`],tc=e({__name:`HarnessPage`,setup(e){let a=_(null),x=_(!0),ve=_(null),S=_(!1),C=_(``),w=_(!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`}};l(be);async function be(){x.value=!0,ve.value=null,S.value=!1;try{let e=await te.harnessBindings();a.value={terminal:e.terminal,bindings:e.bindings??[],profiles:e.profiles??[]},C.value=a.value.profiles[0]??``}catch(e){let t=e instanceof ie?e.status:void 0;t===501||t===503?S.value=!0:ve.value=e instanceof Error?e.message:String(e),a.value=null}finally{x.value=!1}}function xe(){a.value?.terminal&&C.value&&(w.value=!0)}function T(e){if(!e)return`—`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function Se(e){return e.scopes?.length?e.scopes.join(`, `):`—`}return(e,l)=>(s(),m(`div`,null,[r(f,{title:`Harness`}),ve.value?(s(),m(`p`,Ys,u(ve.value),1)):o(``,!0),x.value?(s(),m(`div`,Xs,[r(c(ge),{class:`h-24 w-full`}),r(c(ge),{class:`h-40 w-full`})])):S.value?(s(),g(c(v),{key:2},{default:n(()=>[r(c(de),null,{default:n(()=>[r(c(pe),null,{default:n(()=>[...l[1]||=[t(`Harness bindings are not configured`,-1)]]),_:1} Line truncated
+1 -1
View File
@@ -1 +1 @@
import{A as e,Ct as t,D as n,Dn as r,En as i,Jt as a,O as o,Qn as s,R as c,Sn as l,Tn as u,U as d,Ut as f,V as p,Wt as m,Xt as h,Y as g,_,_n as v,an as y,b,dn as x,ht as S,kn as C,ln as w,lt as T,mn as E,nr as D,nt as O,on as ee,pn as te,pt as k,s as ne,v as A,wn as j,x as M,xt as re,y as ie,yn as N}from"./PageHeader.js";import{C as ae,E as oe,S as se,T as ce,a as le,c as ue,f as de,h as fe,l as pe,o as me,p as he,q as ge,r as _e,s as P,t as ve,u as F}from"./badge.js";var ye=typeof window<`u`,be,I=e=>be=e,xe=Symbol();function Se(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Ce=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function we(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function L(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){De(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Te(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function R(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var z=typeof navigator==`object`?navigator:{userAgent:``},Ee=/Macintosh/.test(z.userAgent)&&/AppleWebKit/.test(z.userAgent)&&!/Safari/.test(z.userAgent),De=ye?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Ee?Oe:`msSaveOrOpenBlob`in z?ke:Ae:()=>{};function Oe(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?R(r):Te(r.href)?L(e,t,n):(r.target=`_blank`,R(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){R(r)},0))}function ke(e,t=`download`,n){if(typeof e==`string`){if(Te(e))L(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){R(t)})}}else navigator.msSaveOrOpenBlob(we(e,n),t)}function Ae(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return L(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Ce.HTMLElement))||`safari`in Ce,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Ee)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:je}=Object;function Me(){let e=y(!0),t=e.run(()=>N({})),n=[],r=[],i=te({install(e){I(i),i._a=e,e.provide(xe,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var B=()=>{};function Ne(e,t,n,r=B){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&ee()&&E(i),i}function V(e,...t){e.forEach(e=>{e(...t)})}var Pe=e=>e(),Fe=Symbol(),H=Symbol();function U(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!Object.hasOwn(t,n))continue;let r=t[n],i=e[n];e[n]=Se(i)&&Se(r)&&Object.hasOwn(e,n)&&!x(r)&&!w(r)?U(i,r):r}return e}var Ie=Symbol();function Le(e){return!e||typeof e!=`object`||!Object.hasOwn(e,Ie)}var{assign:W}=Object;function Re(e){return!!(x(e)&&e.effect)}function ze(e,t,n,r){let{state:a,actions:o,getters:s}=t,c=n.state.value[e],l;function u(){return c||(n.state.value[e]=a?a():{}),W(i(n.state.value[e]),o,Object.keys(s||{}).reduce((t,r)=>(t[r]=te(_(()=>{I(n);let t=n._s.get(e);return s[r].call(t,t)})),t),{}))}return l=Be(e,u,t,n,r,!0),l}function Be(e,t,n={},r,i,a){let o,s=W({actions:{}},n),c={deep:!0},l,u,d=new Set,p=new Set,m,h=r.state.value[e];!a&&!h&&(r.state.value[e]={});let g;function _(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:`patch function`,storeId:e,events:m}):(U(r.state.value[e],t),n={type:`patch object`,payload:t,storeId:e,events:m});let i=g=Symbol();O().then(()=>{g===i&&(l=!0)}),u=!0,V(d,n,r.state.value[e])}let b=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{W(e,t)})}:B;function S(){o.stop(),d.clear(),p.clear(),r._s.delete(e)}let C=(t,n=``)=>{if(Fe in t)return t[H]=n,t;let i=function(){I(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(Line truncated
import{A as e,Ct as t,D as n,Dn as r,En as i,Jt as a,O as o,Qn as s,R as c,Sn as l,Tn as u,U as d,Ut as f,V as p,Wt as m,Xt as h,Y as g,_,_n as v,an as y,b,dn as x,ht as S,kn as C,ln as w,lt as T,mn as E,nr as D,nt as O,on as ee,pn as te,pt as k,s as ne,v as A,wn as j,x as M,xt as re,y as ie,yn as N}from"./PageHeader.js";import{C as ae,E as oe,S as se,T as ce,a as le,c as ue,f as de,h as fe,l as pe,o as me,p as he,q as ge,r as _e,s as P,t as ve,u as F}from"./badge.js";var ye=typeof window<`u`,be,I=e=>be=e,xe=Symbol();function Se(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var Ce=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function we(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function L(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){De(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function Te(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function R(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var z=typeof navigator==`object`?navigator:{userAgent:``},Ee=/Macintosh/.test(z.userAgent)&&/AppleWebKit/.test(z.userAgent)&&!/Safari/.test(z.userAgent),De=ye?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!Ee?Oe:`msSaveOrOpenBlob`in z?ke:Ae:()=>{};function Oe(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?R(r):Te(r.href)?L(e,t,n):(r.target=`_blank`,R(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){R(r)},0))}function ke(e,t=`download`,n){if(typeof e==`string`){if(Te(e))L(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){R(t)})}}else navigator.msSaveOrOpenBlob(we(e,n),t)}function Ae(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return L(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(Ce.HTMLElement))||`safari`in Ce,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||Ee)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:je}=Object;function Me(){let e=y(!0),t=e.run(()=>N({})),n=[],r=[],i=te({install(e){I(i),i._a=e,e.provide(xe,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var B=()=>{};function Ne(e,t,n,r=B){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&ee()&&E(i),i}function V(e,...t){e.forEach(e=>{e(...t)})}var Pe=e=>e(),Fe=Symbol(),H=Symbol();function U(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let n in t){if(!Object.hasOwn(t,n))continue;let r=t[n],i=e[n];e[n]=Se(i)&&Se(r)&&Object.hasOwn(e,n)&&!x(r)&&!w(r)?U(i,r):r}return e}var Ie=Symbol();function Le(e){return!e||typeof e!=`object`||!Object.hasOwn(e,Ie)}var{assign:W}=Object;function Re(e){return!!(x(e)&&e.effect)}function ze(e,t,n,r){let{state:a,actions:o,getters:s}=t,c=n.state.value[e],l;function u(){return c||(n.state.value[e]=a?a():{}),W(i(n.state.value[e]),o,Object.keys(s||{}).reduce((t,r)=>(t[r]=te(_(()=>{I(n);let t=n._s.get(e);return s[r].call(t,t)})),t),{}))}return l=Be(e,u,t,n,r,!0),l}function Be(e,t,n={},r,i,a){let o,s=W({actions:{}},n),c={deep:!0},l,u,d=new Set,p=new Set,m,h=r.state.value[e];!a&&!h&&(r.state.value[e]={});let g;function _(t){let n;l=u=!1,typeof t==`function`?(t(r.state.value[e]),n={type:`patch function`,storeId:e,events:m}):(U(r.state.value[e],t),n={type:`patch object`,payload:t,storeId:e,events:m});let i=g=Symbol();O().then(()=>{g===i&&(l=!0)}),u=!0,V(d,n,r.state.value[e])}let b=a?function(){let{state:e}=n,t=e?e():{};this.$patch(e=>{W(e,t)})}:B;function S(){o.stop(),d.clear(),p.clear(),r._s.delete(e)}let C=(t,n=``)=>{if(Fe in t)return t[H]=n,t;let i=function(){I(r);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(Line truncated
+2 -2
View File
@@ -1,3 +1,3 @@
function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>S(e)===`[object Map]`,p=e=>S(e)===`[object Set]`,m=e=>S(e)===`[object Date]`,h=e=>S(e)===`[object RegExp]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,ee=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),E=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,D=E(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,O=E(e=>e.replace(ne,`-$1`).toLowerCase()),re=E(e=>e.charAt(0).toUpperCase()+e.slice(1)),ie=E(e=>e?`on${re(e)}`:``),k=(e,t)=>!Object.is(e,t),A=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ae=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},oe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},se=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},ce,le=()=>ce||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ue=e(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function de(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?he(r):de(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var fe=/;(?![^(]*\))/g,pe=/:([^]+)/,me=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function he(e){let t={};return e.replace(me,e=>e.startsWith(`/*`)?``:e).split(fe).forEach(e=>{if(e){let n=e.split(pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ge(e){let t=``;if(_(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=ge(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function _e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_(t)&&(e.class=ge(t)),n&&(e.style=de(n)),e}var ve=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ye=e(ve);ve+``;function be(e){return!!e||e===``}function xe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Te(e[i],t[i],n);return r}function Se(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Te(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ce(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?Se(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Te(e[r],t[r],n))return!1}return String(e)===String(t)}function we(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Te(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?we(e,t,n,xe):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:we(e,t,n,Ce):String(e)===String(t))))}function Ee(e,t){return e.findIndex(e=>Te(e,t))}var De=e=>!!(e&&e.__v_isRef===!0),Oe=e=>_(e)?e:e==null?``:d(e)||y(e)&&(e.toString===x||!g(e.toString))?De(e)?Oe(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>De(t)?ke(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:v(t)?Ae(t):y(t)&&!d(t)&&!w(t)?String(t):t,Ae=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var j,Me=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&j&&(j.active?(this.parent=j,this.index=(j.scopes||(j.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=j;try{return j=this,e(Line truncated
function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>S(e)===`[object Map]`,p=e=>S(e)===`[object Set]`,m=e=>S(e)===`[object Date]`,h=e=>S(e)===`[object RegExp]`,g=e=>typeof e==`function`,_=e=>typeof e==`string`,v=e=>typeof e==`symbol`,y=e=>typeof e==`object`&&!!e,b=e=>(y(e)||g(e))&&g(e.then)&&g(e.catch),x=Object.prototype.toString,S=e=>x.call(e),C=e=>S(e).slice(8,-1),w=e=>S(e)===`[object Object]`,ee=e=>_(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),E=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,D=E(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,O=E(e=>e.replace(ne,`-$1`).toLowerCase()),re=E(e=>e.charAt(0).toUpperCase()+e.slice(1)),ie=E(e=>e?`on${re(e)}`:``),k=(e,t)=>!Object.is(e,t),A=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ae=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},oe=e=>{let t=parseFloat(e);return isNaN(t)?e:t},se=e=>{let t=_(e)?Number(e):NaN;return isNaN(t)?e:t},ce,le=()=>ce||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},ue=e(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function de(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=_(r)?he(r):de(r);if(i)for(let e in i)t[e]=i[e]}return t}if(_(e)||y(e))return e}var fe=/;(?![^(]*\))/g,pe=/:([^]+)/,me=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function he(e){let t={};return e.replace(me,e=>e.startsWith(`/*`)?``:e).split(fe).forEach(e=>{if(e){let n=e.split(pe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function ge(e){let t=``;if(_(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=ge(e[n]);r&&(t+=r+` `)}else if(y(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function _e(e){if(!e)return null;let{class:t,style:n}=e;return t&&!_(t)&&(e.class=ge(t)),n&&(e.style=de(n)),e}var ve=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,ye=e(ve);ve+``;function be(e){return!!e||e===``}function xe(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Te(e[i],t[i],n);return r}function Se(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Te(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ce(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?Se(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Te(e[r],t[r],n))return!1}return String(e)===String(t)}function we(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Te(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=v(e),i=v(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?we(e,t,n,xe):!1:(r=y(e),i=y(t),r||i?!r||!i?!1:we(e,t,n,Ce):String(e)===String(t))))}function Ee(e,t){return e.findIndex(e=>Te(e,t))}var De=e=>!!(e&&e.__v_isRef===!0),Oe=e=>_(e)?e:e==null?``:d(e)||y(e)&&(e.toString===x||!g(e.toString))?De(e)?Oe(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>De(t)?ke(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:v(t)?Ae(t):y(t)&&!d(t)&&!w(t)?String(t):t,Ae=(e,t=``)=>v(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof e==`string`?e===``?` `:e:String(e)}var j,Me=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&j&&(j.active?(this.parent=j,this.index=(j.scopes||(j.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=j;try{return j=this,e(Line truncated
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
`)&&(hi(e,0)||ai(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!T(o)||o[0]===`.`||t&&!T(o)||u&&u.includes(o)){if(fi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Qt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Q(x,n,t),h&&ur(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Yo(()=>{x&&Q(x,n,t),l&&g.enter(e),h&&ur(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Z(d[t]),g=h.type===Qo;e?(g&&!u&&t+1<p&&Z(d[t+1]).type===Qo&&(l(i(e.data.slice(h.children.length)),r,o(e)),e.data=h.children),e=f(e,h,a,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,hi(r,1)||ai()),n(null,h,r,null,a,s,ci(r),c))}return e},h=(e,t,n,r,i,a)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&li(f)&&f.data===`]`?o(t.anchor=f):(ai(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(_i(e,t)||ai(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,ci(d),a),r&&(r.vnode.el=t.el,co(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&li(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var di=new Set([`src`,`srcset`,`href`,`poster`]);function fi(e,t,n){return di.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var pi=`data-allow-mismatch`,mi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function hi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(pi);)e=e.parentElement;return gi(e&&e.getAttribute(pi),t)}function gi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(mi[t])}}function _i(e,t){return hi(e.parentElement,1)||vi(e)||yi(t)}function vi(e){return e.nodeType===1&&gi(e.getAttribute(pi),1)}function yi({props:e}){let t=e&&e[pi];return typeof t==`string`&&gi(t,1)}var bi=le().requestIdleCallback||(e=>setTimeout(e,1)),xi=le().cancelIdleCallback||(e=>clearTimeout(e)),Si=(e=1e4)=>t=>{let n=bi(t,{timeout:e});return()=>xi(n)};function Ci(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var wi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ci(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ti=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ei=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Di(e,t){if(li(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(li(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Oi=e=>!!e.type.__asyncLoader;function ki(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Xr({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Di(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=$;if(Qr(e),u)return()=>Ai(u,e);let t=t=>{l=null,Ln(t,e,13,!r)};if(s&&e.suspense||Ms)return p().then(t=>()=>Ai(t,e)).catch(e=>(t(e),()=>r?X(r,{error:e}):null));let a=nn(!1),c=nn(),d=nn(!!i),f,m;return qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&ji(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Ai(u,e);if(c.value&&r)return X(r,{error:c.value});if(n&&!d. Line truncated
`)&&(hi(e,0)||ai(),e.textContent=t.children)}if(d){if(_||b||!s||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let o in d)if(_&&(o.endsWith(`value`)||o===`indeterminate`)||a(o)&&!T(o)||o[0]===`.`||t&&!T(o)||u&&u.includes(o)){if(fi(e,o,d[o]))continue;r(e,o,null,d[o],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&Qt(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&Q(x,n,t),h&&ur(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Yo(()=>{x&&Q(x,n,t),l&&g.enter(e),h&&ur(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,a,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=Z(d[t]),g=h.type===Qo;e?(g&&!u&&t+1<p&&Z(d[t+1]).type===Qo&&(l(i(e.data.slice(h.children.length)),r,o(e)),e.data=h.children),e=f(e,h,a,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,hi(r,1)||ai()),n(null,h,r,null,a,s,ci(r),c))}return e},h=(e,t,n,r,i,a)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=s(e),f=m(o(e),t,d,n,r,i,a);return f&&li(f)&&f.data===`]`?o(t.anchor=f):(ai(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,a,l)=>{if(_i(e,t)||ai(),t.el=null,l){let t=_(e);for(;;){let n=o(e);if(n&&n!==t)c(n);else break}}let u=o(e),d=s(e);return c(e),n(null,t,d,u,r,i,ci(d),a),r&&(r.vnode.el=t.el,co(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=o(e),e&&li(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return o(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var di=new Set([`src`,`srcset`,`href`,`poster`]);function fi(e,t,n){return di.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var pi=`data-allow-mismatch`,mi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function hi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(pi);)e=e.parentElement;return gi(e&&e.getAttribute(pi),t)}function gi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(mi[t])}}function _i(e,t){return hi(e.parentElement,1)||vi(e)||yi(t)}function vi(e){return e.nodeType===1&&gi(e.getAttribute(pi),1)}function yi({props:e}){let t=e&&e[pi];return typeof t==`string`&&gi(t,1)}var bi=le().requestIdleCallback||(e=>setTimeout(e,1)),xi=le().cancelIdleCallback||(e=>clearTimeout(e)),Si=(e=1e4)=>t=>{let n=bi(t,{timeout:e});return()=>xi(n)};function Ci(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var wi=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Ci(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ti=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ei=(e=[])=>(t,n)=>{_(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Di(e,t){if(li(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(li(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Oi=e=>!!e.type.__asyncLoader;function ki(e){g(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return Xr({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Di(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=$;if(Qr(e),u)return()=>Ai(u,e);let t=t=>{l=null,Ln(t,e,13,!r)};if(s&&e.suspense||Ms)return p().then(t=>()=>Ai(t,e)).catch(e=>(t(e),()=>r?X(r,{error:e}):null));let a=nn(!1),c=nn(),d=nn(!!i),f,m;return qi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&ji(e.parent.vnode)&&e.parent.update())}).catch(n=>{e.isUnmounted?l=null:(t(n),c.value=n)}),()=>{if(a.value&&u)return Ai(u,e);if(c.value&&r)return X(r,{error:c.value});if(n&&!d.value)ret Line truncated
+1 -1
View File
@@ -1,3 +1,3 @@
import{$n as e,A as t,An as n,Bn as r,Bt as i,Dn as a,En as o,Et as s,Fn as c,Gn as l,Hn as u,In as d,Jn as f,Jt as p,Kn as m,Ln as h,Mn as g,Nn as ee,O as _,Pn as v,Qn as y,R as b,Rn as te,S as ne,Sn as x,St as S,U as re,Un as ie,Ut as C,V as ae,Vn as oe,Wn as w,Xn as T,Y as E,Yn as D,Zn as se,_ as O,_n as ce,dn as le,g as ue,ht as de,i as k,ir as A,jn as fe,kn as j,kt as M,l as pe,lt as me,m as he,mn as ge,mt as _e,n as ve,nt as ye,on as be,ot as xe,pt as Se,qn as N,r as Ce,s as we,tt as Te,w as Ee,wn as De,xn as Oe,y as ke,yt as Ae,z as je,zn as P}from"./PageHeader.js";var Me=void 0,Ne=typeof window<`u`&&window.trustedTypes;if(Ne)try{Me=Ne.createPolicy(`vue`,{createHTML:e=>e})}catch{}var Pe=Me?e=>Me.createHTML(e):e=>e,Fe=`http://www.w3.org/2000/svg`,Ie=`http://www.w3.org/1998/Math/MathML`,F=typeof document<`u`?document:null,Le=F&&F.createElement(`template`),Re={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?F.createElementNS(Fe,e):t===`mathml`?F.createElementNS(Ie,e):n?F.createElement(e,{is:n}):F.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>F.createTextNode(e),createComment:e=>F.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>F.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{Le.innerHTML=Pe(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=Le.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},I=`transition`,ze=`animation`,Be=Symbol(`_vtc`),Ve={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},He=v({},Ce,Ve),Ue=(e=>(e.displayName=`Transition`,e.props=He,e))((e,{slots:t})=>ae(ve,Ge(e),t)),L=(e,t=[])=>{P(e)?e.forEach(e=>e(...t)):e&&e(...t)},We=e=>e?P(e)?e.some(e=>e.length>1):e.length>1:!1;function Ge(e){let t={};for(let n in e)n in Ve||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=Ke(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:ee,onEnter:_,onEnterCancelled:y,onLeave:b,onLeaveCancelled:te,onBeforeAppear:ne=ee,onAppear:x=_,onAppearCancelled:S=y}=t,re=(e,t,n,r)=>{e._enterCancelled=r,z(e,t?u:s),z(e,t?l:o),n&&n()},ie=(e,t)=>{e._isLeaving=!1,z(e,d),z(e,p),z(e,f),t&&t()},C=e=>(t,n)=>{let i=e?x:_,o=()=>re(t,e,n);L(i,[t,o]),Je(()=>{z(t,e?c:a),R(t,e?u:s),We(i)||Xe(t,r,h,o)})};return v(t,{onBeforeEnter(e){L(ee,[e]),R(e,a),R(e,o)},onBeforeAppear(e){L(ne,[e]),R(e,c),R(e,l)},onEnter:C(!1),onAppear:C(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>ie(e,t);R(e,d),e._enterCancelled?(R(e,f),et(e)):(et(e),R(e,f)),Je(()=>{e._isLeaving&&(z(e,d),R(e,p),We(b)||Xe(e,r,g,n))}),L(b,[e,n])},onEnterCancelled(e){re(e,!1,void 0,!0),L(y,[e])},onAppearCancelled(e){re(e,!0,void 0,!0),L(S,[e])},onLeaveCancelled(e){ie(e),L(te,[e])}})}function Ke(e){if(e==null)return null;if(u(e))return[qe(e.enter),qe(e.leave)];{let t=qe(e);return[t,t]}}function qe(e){return A(e)}function R(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Be]||(e[Be]=new Set)).add(t)}function z(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Be];n&&(n.delete(t),n.size||(e[Be]=void 0))}function Je(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ye=0;function Xe(e,t,n,r){let i=e._endId=++Ye,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Ze(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Ze(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${I}Delay`),a=r(`${I}Duration`),o=Qe(i,a),s=r(`${ze}Delay`),c=r(`${ze}Duration`),l=Qe(s,c),u=null,d=0,f=0;t===I?o>0&&(u=I,d=o,f=a.length):t===ze?l>0&&(u=ze,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?I:ze:null,f=u?u===I?a.length:c.length:0);let p=u===I&&/\b(?:transform|all)(?:,|$)/.test(r(`${I}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Qe(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>$e(t)+$e(e[n])))}function $e(e)Line truncated
`))),e[H]=V(i);let a=r||i.props&&i.props.type===`number`;B(e,t?`change`:`input`,t=>{t.target.composing||e[H](rn(e.value,n,a))}),(n||a)&&B(e,`change`,()=>{e.value=rn(e.value,n,a)}),t||(B(e,`compositionstart`,en),B(e,`compositionend`,tn),B(e,`change`,tn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[nn];delete e[nn],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[H](rn(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[H]=V(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?se(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},on={deep:!0,created(e,t,n){e[H]=V(n),B(e,`change`,()=>{let t=e._modelValue,n=fn(e),r=e.checked,i=e[H];if(P(t)){let e=T(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(pn(e,r))})},mounted:sn,beforeUpdate(e,t,n){e[H]=V(n),sn(e,t,n)}};function sn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(P(t))i=T(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=D(t,pn(e,!0))}e.checked!==i&&(e.checked=i)}var cn={created(e,{value:t},n){e.checked=D(t,n.props.value),e[H]=V(n),B(e,`change`,()=>{e[H](fn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[H]=V(r),t!==n&&(e.checked=D(t,r.props.value))}},ln={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,B(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?se(fn(e)):fn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?P(i)?t.slice():t:i];try{e[H](i)}finally{ye(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[H]=V(r)},mounted(e,{value:t}){dn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[H]=V(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!un(t,n[1],n[0]))&&dn(e,t)}};function un(e,t,n){if(!n||P(e))return D(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function dn(e,t){let n=e.multiple,r=P(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=fn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):T(t,o)>-1}else a.selected=t.has(o)}else if(D(fn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function fn(e){return`_value`in e?e._value:e.value}function pn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var mn={created(e,t,n){gn(e,t,n,null,`created`)},mounted(e,t,n){gn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){gn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){gn(e,t,n,r,`updated`)}};function hn(e,t){switch(e){case`SELECT`:return ln;case`TEXTAREA`:return an;default:switch(t){case`checkbox`:return on;case`radio`:return cn;default:return an}}}function gn(e,t,n,r,i){let a=hn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function _n(){an.getSSRProps=({value:e})=>({value:e}),cn.getSSRProps=({value:e},t)=>{if(t.props&&D(t.props.value,e))return{checked:!0}},on.getSSRProps=({value:e},t)=>{if(P(e)){if(t.props&&T(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},mn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=hn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var vn=[`ctrl`,`shift`,`alt`,`meta`],yn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>vn.some(n=>e[`${n}Key`]&&!t.includes(n))},bn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=yn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},xn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Sn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||xn[e]===r))return e(n)}))},Cn=v({patchProp:Nt},Re),wn,Tn=!1;function En(){return wn||=Ee(Cn)}function Dn(){return wn=Tn?wn:ne(Cn),Tn=!0,wn}var On=((...e)=>{En().render(...e)}),kn=((...e)=>{Dn().hydrate(...e)}),An=((...e)=>{let t=En().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Nn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Mn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),jn=((...e)=>{let t=Dn().createApp(...e),{moun Line truncated
`))),e[H]=V(i);let a=r||i.props&&i.props.type===`number`;B(e,t?`change`:`input`,t=>{t.target.composing||e[H](rn(e.value,n,a))}),(n||a)&&B(e,`change`,()=>{e.value=rn(e.value,n,a)}),t||(B(e,`compositionstart`,en),B(e,`compositionend`,tn),B(e,`change`,tn))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[nn];delete e[nn],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[H](rn(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[H]=V(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?se(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},on={deep:!0,created(e,t,n){e[H]=V(n),B(e,`change`,()=>{let t=e._modelValue,n=fn(e),r=e.checked,i=e[H];if(P(t)){let e=T(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(l(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(pn(e,r))})},mounted:sn,beforeUpdate(e,t,n){e[H]=V(n),sn(e,t,n)}};function sn(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(P(t))i=T(t,r.props.value)>-1;else if(l(t))i=t.has(r.props.value);else{if(t===n)return;i=D(t,pn(e,!0))}e.checked!==i&&(e.checked=i)}var cn={created(e,{value:t},n){e.checked=D(t,n.props.value),e[H]=V(n),B(e,`change`,()=>{e[H](fn(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[H]=V(r),t!==n&&(e.checked=D(t,r.props.value))}},ln={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,B(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?se(fn(e)):fn(e)),r=e.multiple,i=r?l(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?P(i)?t.slice():t:i];try{e[H](i)}finally{ye(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[H]=V(r)},mounted(e,{value:t}){dn(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[H]=V(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!un(t,n[1],n[0]))&&dn(e,t)}};function un(e,t,n){if(!n||P(e))return D(e,t);if(l(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function dn(e,t){let n=e.multiple,r=P(t);if(!n||r||l(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=fn(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):T(t,o)>-1}else a.selected=t.has(o)}else if(D(fn(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function fn(e){return`_value`in e?e._value:e.value}function pn(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var mn={created(e,t,n){gn(e,t,n,null,`created`)},mounted(e,t,n){gn(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){gn(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){gn(e,t,n,r,`updated`)}};function hn(e,t){switch(e){case`SELECT`:return ln;case`TEXTAREA`:return an;default:switch(t){case`checkbox`:return on;case`radio`:return cn;default:return an}}}function gn(e,t,n,r,i){let a=hn(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function _n(){an.getSSRProps=({value:e})=>({value:e}),cn.getSSRProps=({value:e},t)=>{if(t.props&&D(t.props.value,e))return{checked:!0}},on.getSSRProps=({value:e},t)=>{if(P(e)){if(t.props&&T(e,t.props.value)>-1)return{checked:!0}}else if(l(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},mn.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=hn(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var vn=[`ctrl`,`shift`,`alt`,`meta`],yn={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>vn.some(n=>e[`${n}Key`]&&!t.includes(n))},bn=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=yn[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},xn={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Sn=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=d(n.key);if(t.some(e=>e===r||xn[e]===r))return e(n)}))},Cn=v({patchProp:Nt},Re),wn,Tn=!1;function En(){return wn||=Ee(Cn)}function Dn(){return wn=Tn?wn:ne(Cn),Tn=!0,wn}var On=((...e)=>{En().render(...e)}),kn=((...e)=>{Dn().hydrate(...e)}),An=((...e)=>{let t=En().createApp(...e),{mount:n}=t;return t.mount=e=>{let i=Nn(e);if(!i)return;let a=t._component;!r(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent=``);let o=n(i,!1,Mn(i));return i instanceof Element&&(i.removeAttribute(`v-cloak`),i.setAttribute(`data-v-app`,``)),o},t}),jn=((...e)=>{let t=Dn().createApp(...e),{moun Line truncated
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var ui;function di(e){ui=e}var fi=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function pi(e){let t=e instanceof fi?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function mi(e,t){let n=await fetch(e,t);if(ui?.(n.status===401),!n.ok)throw new fi(await li(n),n.status);return n}async function $(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=ci,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await mi(e,s);return a?await c.json():void 0}var hi={health:()=>$(`/health/detailed`),services:()=>$(`/api/services`),policies:()=>$(`/api/access/policies`),putPolicy:e=>$(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>$(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>$(`/api/orgs`),orgCreate:e=>$(`/api/orgs`,{method:`POST`,body:e}),org:e=>$(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>$(`/api/orgs/${encodeURIComponent(e)}/members`),setOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>$(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Q({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>$(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),summary:()=>$(`/api/summary`),tasks:()=>$(`/api/tasks`),taskPage:async e=>{let t=await mi(`/api/tasks`+Q(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(ci)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>$(`/api/task-meta`),task:e=>$(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>$(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/changes`+Q(t)),taskDebug:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/debug`+Q(t)),taskAction:(e,t,n)=>$(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>$(`/api/setup`),capabilities:()=>$(`/api/capabilities`),workflows:()=>$(`/api/workflows`),workflowEnabled:(e,t)=>$(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>$(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>$(`/api/skills`),channels:()=>$(`/api/channels`),curators:()=>$(`/api/curators`),channelReload:e=>$(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>$(`/api/config`),logs:e=>$(`/api/logs`+Q(e)),taskLogs:(e,t)=>$(`/api/tasks/${encodeURIComponent(e)}/logs`+Q(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>$(`/api/version`),updateSnapshot:()=>$(`/api/chat/update`),updateDefer:e=>$(`/api/chat/update/defer`,{method:`POST`,body:{snapshot:e}}),updateInstall:e=>$(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>$(`/api/captures`+Q({limit:e})),eventTypes:()=>$(`/api/event-types`),eventTypeCreate:e=>$(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>$(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>$(`/api/mappings`),mappingCreate:e=>$(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>$(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>$(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>$(`/api/bindings`),dispatches:(e,t)=>$(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>$(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>$(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>$(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),bindingPause:e=>$(`/api/bindings/${encodeURIComponent(e)}/pause`,{method:`POST`}),bindingResume:e=>$(`/api/bindings/${encodeURIComponent(e)}/resume`,{method:`POST`}),harnessBindings:()=>$(`/api/harness/bindings`),sources:()=>$(`/api/sources`),sourceCreate:e=>$(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>$(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>$(`/api/sources/${encodeURICompoLine truncated
+1 -1
View File
@@ -1 +1 @@
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--twLine truncated
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ringLine truncated
+70 -70
View File
@@ -1,70 +1,70 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AgentProfilesPage.js","assets/PageHeader.js","assets/badge.js","assets/HistoryLink.js","assets/CredentialBindingsPage.js","assets/PlaybooksPage.js","assets/HarnessPage.js","assets/HarnessPage.css","assets/NotFoundPage.js"])))=>i.map(i=>d[i]);
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as ee,Jt as C,K as w,Kt as T,L as te,Lt as E,M as D,Mn as ne,Mt as re,N as ie,Nn as ae,Nt as oe,O,On as se,Ot as ce,P as le,Pt as ue,Q as de,Qn as k,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as A,T as _e,Tn as ve,Tt as ye,U as be,Ut as j,V as xe,Vt as Se,W as Ce,Wt as we,X as Te,Xt as Ee,Y as De,Yt as Oe,Z as ke,Zt as Ae,_ as M,_n as je,_t as Me,a as Ne,an as Pe,at as Fe,b as N,bn as Ie,bt as Le,c as Re,cn as ze,ct as Be,d as Ve,dn as He,dt as Ue,en as We,er as Ge,et as Ke,f as qe,fn as Je,ft as Ye,g as Xe,gn as Ze,gt as Qe,h as $e,hn as et,ht as P,i as tt,in as nt,it as rt,j as it,jt as at,k as ot,kn as F,kt as st,l as ct,ln as lt,lt as I,m as ut,mn as dt,mt as ft,n as pt,nn as mt,nr as L,nt as ht,o as gt,on as _t,ot as vt,p as yt,pn as bt,pt as xt,q as St,qt as Ct,r as wt,rn as Tt,rr as Et,rt as Dt,s as R,sn as Ot,st as kt,t as At,tn as jt,tr as Mt,tt as z,u as Nt,un as Pt,ut as Ft,v as B,vn as It,vt as Lt,w as Rt,wn as zt,wt as Bt,x as V,xn as Vt,xt as H,y as U,yn as W,yt as Ht,z as Ut,zt as Wt}from"./PageHeader.js";import{A as Gt,B as Kt,D as qt,E as G,F as Jt,G as Yt,H as Xt,I as Zt,J as Qt,K as $t,L as en,M as tn,N as nn,O as rn,P as an,R as on,U as sn,V as cn,W as ln,X as un,Y as dn,_ as fn,b as K,d as pn,g as mn,i as hn,j as gn,k as _n,m as vn,n as yn,q as bn,r as q,t as xn,v as Sn,w as Cn,x as wn,y as Tn,z as En}from"./badge.js";import{C as Dn,S as On,T as kn,_ as An,a as jn,b as Mn,c as Nn,d as Pn,f as Fn,g as In,h as Ln,i as Rn,l as zn,m as Bn,n as Vn,o as Hn,p as Un,r as Wn,s as Gn,t as Kn,u as qn,v as J,w as Jn,x as Yn,y as Xn}from"./HistoryLink.js";var Zn=Object.defineProperty,Qn=(e,t)=>{let n={};for(var r in e)Zn(n,r,{get:e[r],enumerable:!0});return t||Zn(n,Symbol.toStringTag,{value:`Module`}),n};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var $n=Qn({BaseTransition:()=>pt,BaseTransitionPropsValidators:()=>wt,Comment:()=>tt,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Ne,ErrorTypeStrings:()=>gt,Fragment:()=>R,KeepAlive:()=>Re,ReactiveEffect:()=>We,Static:()=>ct,Suspense:()=>Nt,Teleport:()=>Ve,Text:()=>qe,TrackOpTypes:()=>jt,Transition:()=>qt,TransitionGroup:()=>rn,TriggerOpTypes:()=>mt,VueElement:()=>_n,assertNumber:()=>yt,callWithAsyncErrorHandling:()=>ut,callWithErrorHandling:()=>$e,camelize:()=>ne,capitalize:()=>ae,cloneVNode:()=>Xe,compatUtils:()=>null,compile:()=>er,computed:()=>M,createApp:()=>Gt,createBlock:()=>U,createCommentVNode:()=>N,createElementBlock:()=>V,createElementVNode:()=>B,createHydrationRenderer:()=>he,createPropsRestProxy:()=>o,createRenderer:()=>Rt,createSSRApp:()=>gn,createSlots:()=>_e,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>O,customRef:()=>Tt,defineAsyncComponent:()=>ot,defineComponent:()=>n,defineCustomElement:()=>tn,defineEmits:()=>it,defineExpose:()=>D,defineModel:()=>ie,defineOptions:()=>le,defineProps:()=>h,defineSSRCustomElement:()=>nn,defineSlots:()=>x,devtools:()=>te,effect:()=>nt,effectScope:()=>Pe,getCurrentInstance:()=>pe,getCurrentScope:()=>_t,getCurrentWatcher:()=>Ot,getTransitionRawChildren:()=>Ut,guardReactiveProps:()=>i,h:()=>xe,handleError:()=>y,hasInjectionContext:()=>be,hydrate:()=>an,hydrateOnIdle:()=>Ce,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>w,hydrateOnVisible:()=>St,initCustomFormatter:()=>ee,initDirectivesForSSR:()=>Jt,inject:()=>De,isMemoSame:()=>Te,isProxy:()=>ze,isReactive:()=>lt,isReadonly:()=>Pt,isRef:()=>He,isRuntimeOnly:()=>ke,isShallow:()=>Je,isVNode:()=>de,markRaw:()=>bt,mergeDefaults:()=>e,mergeModels:()=>Ke,mergeProps:()=>z,nextTick:()=>ht,nodeOps:()=>Zt,normalizeClass:()=>k,normalizeProps:()=>Ge,normalizeStyle:()=>Mt,onActivated:()=>Dt,onBeforeMount:()=>rt,onBeforeUnmount:()=>Fe,onBeforeUpdate:()=>vt,onDeactivated:()=>kt,onErrorCaptured:()=>Be,onMounted:()=>I,onRenderTracked:()=>Ft,onRenderTriggered:()=>Ue,onScopeDispose:()=>dt,onServerPrefetch:()=>Ye,onUnmounted:()=>xt,onUpdated:()=>ft,onWatcherCleanup:()=>et,openBlock:()=>P,patchProp:()=>en,popScopeId:()=>Qe,provide:()=>Me,proxyRefs:()=>Ze,pushScopeId:()=>Lt,queuePostFlushCb:()=>Ht,reactive:()=>je,readonly:()=>It,ref:()=>W,registerRuntimeCompiler:()=>Le,render:()=>on,renderList:()=>H,renderSlot:()=>A,resolveComponent:()=>c,resolveDirectLine truncated
import{$ as e,$t as t,A as n,At as r,B as i,Bt as a,C as o,Cn as s,Ct as c,D as l,Dn as u,Dt as d,E as f,En as p,Et as m,F as h,Ft as g,G as _,Gt as v,H as y,Ht as b,I as x,It as S,J as C,Jt as w,K as T,Kt as E,L as ee,Lt as te,M as D,Mn as ne,Mt as re,N as ie,Nn as ae,Nt as oe,O,On as se,Ot as ce,P as le,Pt as ue,Q as de,Qn as k,Qt as fe,R as pe,Rt as me,S as he,Sn as ge,St as A,T as _e,Tn as ve,Tt as ye,U as be,Ut as j,V as xe,Vt as Se,W as Ce,Wt as we,X as Te,Xt as Ee,Y as De,Yt as Oe,Z as ke,Zt as Ae,_ as M,_n as je,_t as Me,a as Ne,an as Pe,at as Fe,b as N,bn as Ie,bt as Le,c as Re,cn as ze,ct as Be,d as Ve,dn as He,dt as Ue,en as We,er as Ge,et as Ke,f as qe,fn as Je,ft as Ye,g as Xe,gn as Ze,gt as Qe,h as $e,hn as et,ht as P,i as tt,in as nt,it as rt,j as it,jt as at,k as ot,kn as F,kt as st,l as ct,ln as lt,lt as I,m as ut,mn as dt,mt as ft,n as pt,nn as mt,nr as L,nt as ht,o as gt,on as _t,ot as vt,p as yt,pn as bt,pt as xt,q as St,qt as Ct,r as wt,rn as Tt,rr as Et,rt as Dt,s as R,sn as Ot,st as kt,t as At,tn as jt,tr as Mt,tt as z,u as Nt,un as Pt,ut as Ft,v as B,vn as It,vt as Lt,w as Rt,wn as zt,wt as Bt,x as V,xn as Vt,xt as H,y as U,yn as W,yt as Ht,z as Ut,zt as Wt}from"./PageHeader.js";import{A as Gt,B as Kt,D as qt,E as G,F as Jt,G as Yt,H as Xt,I as Zt,J as Qt,K as $t,L as en,M as tn,N as nn,O as rn,P as an,R as on,U as sn,V as cn,W as ln,X as un,Y as dn,_ as fn,b as K,d as pn,g as mn,i as hn,j as gn,k as _n,m as vn,n as yn,q as bn,r as q,t as xn,v as Sn,w as Cn,x as wn,y as Tn,z as En}from"./badge.js";import{C as Dn,S as On,T as kn,_ as An,a as jn,b as Mn,c as Nn,d as Pn,f as Fn,g as In,h as Ln,i as Rn,l as zn,m as Bn,n as Vn,o as Hn,p as Un,r as Wn,s as Gn,t as Kn,u as qn,v as J,w as Jn,x as Yn,y as Xn}from"./HistoryLink.js";var Zn=Object.defineProperty,Qn=(e,t)=>{let n={};for(var r in e)Zn(n,r,{get:e[r],enumerable:!0});return t||Zn(n,Symbol.toStringTag,{value:`Module`}),n};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var $n=Qn({BaseTransition:()=>pt,BaseTransitionPropsValidators:()=>wt,Comment:()=>tt,DeprecationTypes:()=>null,EffectScope:()=>t,ErrorCodes:()=>Ne,ErrorTypeStrings:()=>gt,Fragment:()=>R,KeepAlive:()=>Re,ReactiveEffect:()=>We,Static:()=>ct,Suspense:()=>Nt,Teleport:()=>Ve,Text:()=>qe,TrackOpTypes:()=>jt,Transition:()=>qt,TransitionGroup:()=>rn,TriggerOpTypes:()=>mt,VueElement:()=>_n,assertNumber:()=>yt,callWithAsyncErrorHandling:()=>ut,callWithErrorHandling:()=>$e,camelize:()=>ne,capitalize:()=>ae,cloneVNode:()=>Xe,compatUtils:()=>null,compile:()=>er,computed:()=>M,createApp:()=>Gt,createBlock:()=>U,createCommentVNode:()=>N,createElementBlock:()=>V,createElementVNode:()=>B,createHydrationRenderer:()=>he,createPropsRestProxy:()=>o,createRenderer:()=>Rt,createSSRApp:()=>gn,createSlots:()=>_e,createStaticVNode:()=>f,createTextVNode:()=>l,createVNode:()=>O,customRef:()=>Tt,defineAsyncComponent:()=>ot,defineComponent:()=>n,defineCustomElement:()=>tn,defineEmits:()=>it,defineExpose:()=>D,defineModel:()=>ie,defineOptions:()=>le,defineProps:()=>h,defineSSRCustomElement:()=>nn,defineSlots:()=>x,devtools:()=>ee,effect:()=>nt,effectScope:()=>Pe,getCurrentInstance:()=>pe,getCurrentScope:()=>_t,getCurrentWatcher:()=>Ot,getTransitionRawChildren:()=>Ut,guardReactiveProps:()=>i,h:()=>xe,handleError:()=>y,hasInjectionContext:()=>be,hydrate:()=>an,hydrateOnIdle:()=>Ce,hydrateOnInteraction:()=>_,hydrateOnMediaQuery:()=>T,hydrateOnVisible:()=>St,initCustomFormatter:()=>C,initDirectivesForSSR:()=>Jt,inject:()=>De,isMemoSame:()=>Te,isProxy:()=>ze,isReactive:()=>lt,isReadonly:()=>Pt,isRef:()=>He,isRuntimeOnly:()=>ke,isShallow:()=>Je,isVNode:()=>de,markRaw:()=>bt,mergeDefaults:()=>e,mergeModels:()=>Ke,mergeProps:()=>z,nextTick:()=>ht,nodeOps:()=>Zt,normalizeClass:()=>k,normalizeProps:()=>Ge,normalizeStyle:()=>Mt,onActivated:()=>Dt,onBeforeMount:()=>rt,onBeforeUnmount:()=>Fe,onBeforeUpdate:()=>vt,onDeactivated:()=>kt,onErrorCaptured:()=>Be,onMounted:()=>I,onRenderTracked:()=>Ft,onRenderTriggered:()=>Ue,onScopeDispose:()=>dt,onServerPrefetch:()=>Ye,onUnmounted:()=>xt,onUpdated:()=>ft,onWatcherCleanup:()=>et,openBlock:()=>P,patchProp:()=>en,popScopeId:()=>Qe,provide:()=>Me,proxyRefs:()=>Ze,pushScopeId:()=>Lt,queuePostFlushCb:()=>Ht,reactive:()=>je,readonly:()=>It,ref:()=>W,registerRuntimeCompiler:()=>Le,render:()=>on,renderList:()=>H,renderSlot:()=>A,resolveComponent:()=>c,resolveDirectiLine truncated
`);d=n.pop()||``;for(let e of n){let t=e.split(`
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(Ci.value=n.session_id),n.type===`delta`&&(o+=n.text,Oi.value=Oi.value?{...Oi.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],Oi.value=Oi.value?{...Oi.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),Oi.value=Oi.value?{...Oi.value,ask:n.ask}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);wi.value=[...wi.value,{from:`assistant`,text:o,tool_calls:a}],Oi.value=null,Ei.value=`Ready`,await Ui()}catch(e){let t=e;t.name===`AbortError`&&!c?(Oi.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Ei.value=`Stopped`):(Oi.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?gi(r):void 0,isRetry:i},Ei.value=`Error — retry available`)}finally{clearTimeout(l),bi=null,Vi=null,Di.value=!1}}function na(){Ei.value=`Stopping…`,Ci.value&&K.chatCancel(Ci.value).catch(()=>{}),Hi()}function ra(){I(()=>{Ui().catch(e=>{Ei.value=e.message||`Chat unavailable`})}),xt(()=>{Hi()})}async function ia(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));await ta({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var aa=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],oa=n({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return G(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(P(),V(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":F(vi),onClick:i[0]||=e=>n(`toggle`)},[B(`span`,{"aria-hidden":`true`,class:k(r(!e.open))},[O(F(Ar),{size:22})],2),B(`span`,{"aria-hidden":`true`,class:k(r(e.open))},[O(F(oi),{size:22})],2)],8,aa))}});function sa(e){return typeof e==`string`?`'${e}'`:new da().serialize(e)}var ca=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,la=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[ca.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function ua(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&la[n]?la[n]:n+128,s=a<128&&la[a]?la[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var da=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?ua(e,t):n===`number`&&r===`number`?e-t:ua(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(ua),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$ArrLine truncated
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(wi.value=n.session_id),n.type===`delta`&&(o+=n.text,ki.value=ki.value?{...ki.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],ki.value=ki.value?{...ki.value,tools:a}:null),n.type===`ask`&&n.ask&&(clearTimeout(l),ki.value=ki.value?{...ki.value,ask:n.ask}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);Ti.value=[...Ti.value,{from:`assistant`,text:o,tool_calls:a}],ki.value=null,Di.value=`Ready`,await Wi()}catch(e){let t=e;t.name===`AbortError`&&!c?(ki.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},Di.value=`Stopped`):(ki.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?_i(r):void 0,isRetry:i},Di.value=`Error — retry available`)}finally{clearTimeout(l),xi=null,Hi=null,Oi.value=!1}}function ra(){Di.value=`Stopping…`,wi.value&&K.chatCancel(wi.value).catch(()=>{}),Ui()}function ia(){I(()=>{Wi().catch(e=>{Di.value=e.message||`Chat unavailable`})}),xt(()=>{Ui()})}async function aa(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));await na({textOverride:`🎤 Voice message`,voice:{data:btoa(n),mime_type:e.type||`audio/webm`}})}var oa=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],sa=n({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return G(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(P(),V(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":F(yi),onClick:i[0]||=e=>n(`toggle`)},[B(`span`,{"aria-hidden":`true`,class:k(r(!e.open))},[O(F(jr),{size:22})],2),B(`span`,{"aria-hidden":`true`,class:k(r(e.open))},[O(F(si),{size:22})],2)],8,oa))}});function ca(e){return typeof e==`string`?`'${e}'`:new fa().serialize(e)}var la=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,ua=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[la.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function da(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&ua[n]?ua[n]:n+128,s=a<128&&ua[a]?ua[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var fa=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?da(e,t):n===`number`&&r===`number`?e-t:da(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(da),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$ArrLine truncated
`)].join(`
`))}return()=>i.value||r.value||o.value?xe(t.default({present:o.value})[0],{ref:e=>{let t=Ua(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}});function cs(){let e=W();return{primitiveElement:e,currentElement:M(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Ua(e))}}var[ls,us]=ga(`CollapsibleRoot`),ds=n({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=io(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=p(r);return us({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Y(),(e,t)=>(P(),U(F(mn),{as:e.as,"as-child":r.asChild,"data-state":F(i)?`open`:`closed`,"data-disabled":F(a)?``:void 0},{default:C(()=>[A(e.$slots,`default`,{open:F(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),fs=n({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=ls();i.contentId||=Zo(void 0,`reka-collapsible-content`);let a=W(),{forwardRef:o,currentElement:s}=Y(),c=W(0),l=W(0),u=M(()=>i.open.value),d=W(u.value),f=W();j(()=>[u.value,a.value?.present],async()=>{await ht();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=M(()=>d.value&&i.open.value);return I(()=>{requestAnimationFrame(()=>{d.value=!1})}),Wa(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(P(),U(F(ss),{ref_key:`presentRef`,ref:a,present:e.forceMount||F(i).open.value,"force-mount":!0},{default:C(({present:t})=>[O(F(mn),z(e.$attrs,{id:F(i).contentId,ref:F(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:F(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:F(i).open.value?`open`:`closed`,"data-disabled":F(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:C(()=>[!F(i).unmountOnHide.value||t?A(e.$slots,`default`,{key:0}):N(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),ps=n({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Y();let n=ls();return(e,r)=>(P(),U(F(mn),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":F(n).contentId,"aria-expanded":F(n).open.value,"data-state":F(n).open.value?`open`:`closed`,"data-disabled":F(n).disabled?.value?``:void 0,disabled:F(n).disabled?.value,onClick:F(n).onOpenToggle},{default:C(()=>[A(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function ms({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function hs({type:e,defaultValue:t,modelValue:n}){return e||ms({type:e,defaultValue:t,modelValue:n})}function gs({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function _s(e,t){let n=M(()=>hs(e)),r=io(e,`modelValue`,t,{defaultValue:gs(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=fa(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(ba(t,e)){let n=t.findIndex(t=>fa(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:M(()=>n.value===`single`)}}var[vs,ys]=ga(`AccordionRoot`),bs=n({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,disabled:a,unmountOnHide:o}=p(n),s=wo(i),{modelValue:c,changeModelValue:l,isSingle:u}=_s(n,r),{forwardRef:d,currentElement:f}=Y();return ys({disabled:a,direction:s,orientation:n.orientation,parentElement:f,isSingle:u Line truncated
`))}return()=>i.value||r.value||o.value?xe(t.default({present:o.value})[0],{ref:e=>{let t=Wa(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}});function fs(){let e=W();return{primitiveElement:e,currentElement:M(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:Wa(e))}}var[ps,ms]=_a(`CollapsibleRoot`),hs=n({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=ao(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=p(r);return ms({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Y(),(t,n)=>(P(),U(F(mn),{as:e.as,"as-child":r.asChild,"data-state":F(i)?`open`:`closed`,"data-disabled":F(a)?``:void 0},{default:w(()=>[A(t.$slots,`default`,{open:F(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),gs=n({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=ps();i.contentId||=ts(void 0,`reka-collapsible-content`);let a=W(),{forwardRef:o,currentElement:s}=Y(),c=W(0),l=W(0),u=M(()=>i.open.value),d=W(u.value),f=W();j(()=>[u.value,a.value?.present],async()=>{await ht();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=M(()=>d.value&&i.open.value);return I(()=>{requestAnimationFrame(()=>{d.value=!1})}),Ga(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(t,r)=>(P(),U(F(ds),{ref_key:`presentRef`,ref:a,present:e.forceMount||F(i).open.value,"force-mount":!0},{default:w(({present:r})=>[O(F(mn),z(t.$attrs,{id:F(i).contentId,ref:F(o),"as-child":n.asChild,as:e.as,hidden:r?void 0:F(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:F(i).open.value?`open`:`closed`,"data-disabled":F(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:w(()=>[!F(i).unmountOnHide.value||r?A(t.$slots,`default`,{},void 0,void 0,0):N(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),_s=n({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Y();let n=ps();return(r,i)=>(P(),U(F(mn),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":F(n).contentId,"aria-expanded":F(n).open.value,"data-state":F(n).open.value?`open`:`closed`,"data-disabled":F(n).disabled?.value?``:void 0,disabled:F(n).disabled?.value,onClick:F(n).onOpenToggle},{default:w(()=>[A(r.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function vs({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function ys({type:e,defaultValue:t,modelValue:n}){return e||vs({type:e,defaultValue:t,modelValue:n})}function bs({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function xs(e,t){let n=M(()=>ys(e)),r=ao(e,`modelValue`,t,{defaultValue:bs(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=pa(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(xa(t,e)){let n=t.findIndex(t=>pa(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:M(()=>n.value===`single`)}}var[Ss,Cs]=_a(`AccordionRoot`),ws=n({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},orientation:{type:String,required:!1,default:`vertical`},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},type:{type:String,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{dir:i,disabled:a,unmountOnHide:o}=p(n),s=Oo(i),{modelValue:c,changeModelValue:l,isSingle:u}=xs(n,r),{forwardRef:d,currentElement:f}=Y();return Cs({disabled:a,direction:s,orientation:n.orientation,parentElement:f Line truncated
- a positive number
- less than the value passed to \`max\` (or ${tp} if no \`max\` prop is set)
- less than the value passed to \`max\` (or ${cp} if no \`max\` prop is set)
- \`null\` or \`undefined\` if the progress is indeterminate.
Defaulting to \`null\`.`),null)}function op(e){return ip(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 \`${tp}\`.`),tp)}var sp=n({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:tp},getValueLabel:{type:Function,required:!1,default:(e,t)=>ip(e)?`${Math.round(e/t*tp)}%`: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;Y();let i=io(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=io(n,`max`,r,{passive:n.max===void 0});j(()=>i.value,async e=>{let t=ap(e,n.max);t!==e&&(await ht(),i.value=t)},{immediate:!0}),j(()=>n.max,e=>{let t=op(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=M(()=>ya(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return rp({modelValue:i,max:a,progressState:o}),(e,t)=>(P(),U(F(mn),{"as-child":e.asChild,as:e.as,"aria-valuemax":F(a),"aria-valuemin":0,"aria-valuenow":ip(F(i))?F(i):void 0,"aria-valuetext":e.getValueText?.(F(i),F(a)),"aria-label":e.getValueLabel(F(i),F(a)),role:`progressbar`,"data-state":o.value,"data-value":F(i)??void 0,"data-max":F(a)},{default:C(()=>[A(e.$slots,`default`,{modelValue:F(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),cp=n({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=np();return Y(),(e,r)=>(P(),U(F(mn),z(t,{"data-state":F(n).progressState.value,"data-value":F(n).modelValue?.value??void 0,"data-max":F(n).max.value}),{default:C(()=>[A(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),lp=`radio.select`;function up(e,t,n){va(lp,n,{originalEvent:e,value:t})}var dp=n({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=io(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=p(n),{forwardRef:o,currentElement:s}=Y(),c=ko(s),l=Mo(),u=M(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||up(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(P(),V(R,null,[O(F(mn),z({id:e.id,ref:F(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":F(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":F(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:F(a),required:e.required,name:e.name},{...F(l),...e.$attrs},{onClick:un(d,[`stop`])}),{default:C(()=>[A(e.$slots,`default`,{checked:F(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),F(c)&&e.name?(P(),U(F(Ic),z({key:0,type:`radio`,tabindex:`-1`,value:F(a),checked:!!F(i),name:e.name,disabled:e.disabled,required:e.required},F(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):N(`v-if`,!0)],64))}}),[fp,pp]=ga(`RadioGroupRoot`),mp=n({__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}=Y(),o=io(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=p(n),m=wo(f),h=ko(a);return pp({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(P(),U(F(vd),{"as-child":``,orientation:F(l),dir:F(m),loop:F(c)},{default:C(()=>[O(F(mn),{ref:F(i),role:`radiogroup`,"data-disabled":F(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":F(l),"aria-required":F(d),dir:F(m)},{default:C(()=>[A(e.$slots,`default`,{modelValue:F(o)}),F(h)&&F(u)?(P(),U(F(Ic),{key:0,required:F(d),disabled:F(s),value:F(o),name:F(u)},null,8,[`required`,`disabled`,`value`,`name`])):N(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[hp,gp]=ga(`RadioGroupItem`),_p=n({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,Line truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Hg(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Hg(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=Wg(c),u=e+1<n.length?Wg(n[e+1]):null;if(l&&u&&Gg(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Wg(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Hg(e)),rows:r.map(e=>e.map(e=>Hg(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:Hg(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]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:Hg(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Wg(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 Gg(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var Kg={class:`[overflow-wrap:anywhere]`},qg={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},Jg={class:`font-mono text-[0.85em]`},Yg={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Xg={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Zg={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Qg={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},$g={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},e_={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},t_={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},n_={key:8,class:`mb-2.5 last:mb-0`},r_=n({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=M(()=>Ug(t.text));return(e,t)=>(P(),V(`div`,Kg,[(P(!0),V(R,null,H(n.value,(e,t)=>(P(),V(R,{key:t},[e.kind===`pre`?(P(),V(`pre`,qg,[B(`code`,Jg,L(e.code),1)])):e.kind===`table`?(P(),V(`table`,Yg,[B(`thead`,null,[B(`tr`,null,[(P(!0),V(R,null,H(e.head,(e,t)=>(P(),V(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])]),B(`tbody`,null,[(P(!0),V(R,null,H(e.rows,(e,t)=>(P(),V(`tr`,{key:t},[(P(!0),V(R,null,H(e,(e,t)=>(P(),V(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[O(Bg,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(P(),V(`blockquote`,Xg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(P(),V(`h1`,Zg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(P(),V(`h2`,Qg,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(P(),V(`h3`,$g,[O(Bg,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(P(),V(`ul`,e_,[(P(!0),V(R,null,H(e.items,(e,t)=>(P(),V(`li`,{key:t},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(P(),V(`ol`,t_,[(P(!0),V(R,null,H(e.items,(e,t)=>(P(),V(`li`,{key:t},[O(Bg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(P(),V(`p`,n_,[O(Bg,{inline:e.inline},null,8,[`inline`])])):N(``,!0)],64))),128))]))}}),i_={class:`truncate`},a_=n({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=c(`RouterLink`);return P(),U(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full 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:C(()=>[O(F(ir),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),B(`span`,i_,L(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),o_={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},s_={class:`font-semibold text-foreground`},c_={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},l_=n({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=M(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=M(()=>t.tool.parameters||t.tool.Parameters||``),i=M(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=M(()=>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?(P(),U(a_,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(P(),V(`div`,o_,[O(F(ai),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),B(`span`,s_,L(n.value),1),r.value?(P(),V(`code`,c_,L(r.value),1)):N(``,!0),B(`span`,{class:k(F(G)(`text-fg-muted`,i.value&&`text-danger`))},L(a.value),3)]))}}),u_={key:0,class:`mb-2 grid gap-0.5 text-xs`},d_={key:1,class:`mb-2 flex flex-wrap gap-1.5`},f_={key:3,class:`whitespace-pre-wrap`},p_=n({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(P(),V(`div`,{class:k([`flex`,e.assistant?`justify-start`:`justify-end`])},[B(`div`,{class:k(F(G)(`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?(P(),V(`div`,u_,[(P(!0),V(R,null,H(e.tools,(t,n)=>(P(),U(l_,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):N(``,!0),e.media.length?(P(),V(`div`,d_,[(P(!0),V(R,null,H(e.media,(e,t)=>(P(),U(Ng,{key:t,attachment:e},null,8,[`attachment`]))),128))])):N(``,!0),e.assistant?(P(),U(r_,{key:2,text:e.text},null,8,[`text`])):(P(),V(`div`,f_,L(e.text),1)),A(t.$slots,`default`)],2)],2))}}),m_={class:`text-sm`},h_={class:`font-medium`},g_={key:0,class:`mt-1 text-fg-muted`},__={key:1,class:`mt-2 flex flex-wrap gap-2`},v_=n({__name:`ChatChoLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>CS?`${n.slice(0,CS).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var TS=[`title`],ES=n({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>Zx(n.event)),a=M(()=>wS(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=M(()=>n.event.at?$b(n.event.at):`—`);return(e,t)=>(P(),U(F(xS),{class:k(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[dn(un(o,[`prevent`]),[`enter`]),dn(un(o,[`prevent`]),[`space`])]},{default:C(()=>[O(F(Z),{class:`font-medium`},{default:C(()=>[l(L(n.event.kind||n.event.type||`event`),1)]),_:1}),O(F(Z),{class:`font-mono`},{default:C(()=>[l(L(i.value>0?`#${i.value}`:`—`),1)]),_:1}),O(F(Z),{class:`w-[55%] max-w-0`},{default:C(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},L(a.value.text),9,TS)]),_:1}),O(F(Z),null,{default:C(()=>[l(L(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),DS=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function OS(e){return(Number(e?.task_id)||0)>0}function kS(e,t){return t===`tasks`?OS(e):t!==`system`||!OS(e)}function AS(e,t){return e.filter(e=>kS(e,t))}function jS(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function MS(e,t){return`${e}:${t??0}`}function NS(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=MS(wS(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var PS={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},FS={class:`max-h-[28rem] overflow-y-auto`},IS=[`aria-expanded`,`aria-label`,`onClick`],LS=[`title`],RS=n({__name:`LiveActivityCard`,setup(e){let t=rv(),{activity:n,streamKind:r,streamState:i}=kn(An()),a=W(`all`),o=M(()=>AS(n.value,a.value)),s=M(()=>jS(o.value.length,a.value)),c=je(new Set),u=M(()=>NS(o.value));function d(e){c.has(e)?c.delete(e):c.add(e)}function f(e){return c.has(e.key)}function p(e){return wS(e.representative)}function m(e){return e.representative.at?$b(e.representative.at):`—`}function h(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(P(),U(F(Kb),null,{default:C(()=>[O(F(Zb),null,{default:C(()=>[O(F(Qb),null,{default:C(()=>[...t[1]||=[l(`Live activity`,-1)]]),_:1}),O(F(qb),{class:`flex items-center gap-2`},{default:C(()=>[O(F(_S),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:F(DS)},null,8,[`modelValue`,`options`]),O(F(xn),{variant:F(r)},{default:C(()=>[l(L(F(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),O(F(Jb),null,{default:C(()=>[B(`div`,PS,[B(`div`,FS,[O(F(yS),null,{default:C(()=>[O(F(SS),{class:`sticky top-0 z-10 bg-card`},{default:C(()=>[O(F(xS),null,{default:C(()=>[O(F(Q),null,{default:C(()=>[...t[2]||=[l(`Event`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[3]||=[l(`Task`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[4]||=[l(`Detail`,-1)]]),_:1}),O(F(Q),null,{default:C(()=>[...t[5]||=[l(`When`,-1)]]),_:1})]),_:1})]),_:1}),O(F(bS),null,{default:C(()=>[o.value.length?N(``,!0):(P(),U(F(xS),{key:0},{default:C(()=>[O(F(Z),{colspan:`4`},{default:C(()=>[O(F(Lb),null,{default:C(()=>[O(F(Bb),null,{default:C(()=>[O(F(Ub),null,{default:C(()=>[l(L(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(P(!0),V(R,{key:1},H(u.value,e=>(P(),V(R,{key:e.key},[e.count===1?(P(),U(ES,{key:0,event:e.representative,onOpen:h},null,8,[`event`])):(P(),V(R,{key:1},[O(F(xS),{class:k(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&h(e.taskID),onKeydown:[dn(un(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`enter`]),dn(un(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`space`])]},{default:C(()=>[O(F(Z),{class:`font-medium`},{default:C(()=>[B(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":f(e),"aria-label":`${f(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:un(t=>d(e.key),[`stop`])},[f(e)?(P(),U(F(dr),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(P(),U(F(fr),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),l(` `+L(e.label)+` `,1),O(F(xn),{variant:`idle`},{default:C(()=>[l(`×`+L(e.count),1)]),_:2},1024)],8,IS)]),_:2},1024),O(F(Z),{class:`font-mono`},{default:C(()=>[l(L(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),O(F(Z),{class:`w-[55%] max-w-0`},{default:C(()=>[B(`span`,{class:`block truncate`,title:p(e).truncated?p(e).full:void 0},L(p(e).text),9,LS)]),_:2},1024),O(F(Z),null,{default:C(()=>[l(L(m(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),f(e)?(P(!0),V(R,{key:0},H(e.events,(t,n)=>(P(),U(ES,{key:`${e.key}:${n}`,event:t,onOpen: 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 iw(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 aw(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 ow(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 sw(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 cw=W([]),lw=W([]),uw=W(!0),dw=W(null),fw=W(null),pw=W(!1),mw=W(null);async function hw(){try{let e=await K.eventTypes();uw.value=e.enabled!==!1,cw.value=e.event_types||[],lw.value=e.proposals||[],dw.value=null}catch(e){dw.value=e.message||String(e)}}function gw(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function _w(e){mw.value=null,fw.value=e}function vw(e){let t=Ew.value.find(t=>String(t.id)===e.sample_id);_w({mode:`proposal`,id:null,source:e.source,name:``,rule:gw(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function yw(e=``){_w({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function bw(e){_w({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:gw(e.rule),headersText:``,body:``,exampleHeaders:{}})}function xw(){fw.value=null}async function Sw(){let e=fw.value;if(e){pw.value=!0;try{if(e.mode===`edit`&&e.id)await K.eventTypeUpdate(e.id,{name:e.name,rule:sw(e.rule)});else{let t=e.mode===`paste`?rw(e.headersText):e.exampleHeaders;await K.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:sw(e.rule),example:{headers:t,body:e.body}})}fw.value=null,await hw()}catch(e){mw.value=e.message||String(e)}finally{pw.value=!1}}}var Cw=W(null);async function ww(){let e=Cw.value;if(Cw.value=null,e)try{await K.eventTypeDelete(e.id),await hw()}catch(e){dw.value=e.message||String(e)}}var Tw=100,Ew=W([]),Dw=W(!0),Ow=W(null),kw=W(!0),Aw=W(null);async function jw(){try{let e=await K.captures(Tw);Dw.value=e.enabled!==!1,Ew.value=e.captures||[],Ow.value=null}catch(e){Ow.value=e.message||String(e)}finally{kw.value=!1}}function Mw(e){let t=Ew.value.find(t=>t.id===e);return t&&(Aw.value=t),!!t}function Nw(){Ew.value.length&&(Aw.value=Ew.value[0])}function Pw(){In(`captures`,()=>{jw(),hw()})}var Fw={key:0,class:`text-xs text-fg-muted`},Iw={key:1,class:`flex flex-col gap-1 text-xs`},Lw={key:1},Rw={key:2,class:`text-xs text-fg-muted`},zw=n({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=W([]),r=W(!1);j(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await K.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=c(`RouterLink`);return r.value?(P(),V(`p`,Fw,`Dispatches unavailable.`)):n.value.length?(P(),V(`ul`,Iw,[(P(!0),V(R,null,H(n.value,e=>(P(),V(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?N(``,!0):(P(),U(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:C(()=>[l(`binding `+L(e.binding_id.slice(0,8))+` v`+L(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?N(``,!0):(P(),U(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:C(()=>[l(`capture `+L(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?N(``,!0):(P(),V(R,{key:2},[e.task_id?(P(),U(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:C(()=>[l(`task #`+L(e.task_id),1)]),_:2},1032,[`to`])):(P(),V(`span`,Lw,L(e.reason||`claimed, no task recorded`),1))],64)),B(`span`,null,L(F($b)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?N(``,!0):(P(),V(`p`,Rw,` No dispatches yet. `))}}}),Bw=n({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(P(),U(F(Er),{role:`status`,"aria-label":`Loading`,class:k(F(G)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function Vw(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function Hw(e){return(e?.repository??`required`)!==`none`}function Uw(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function Ww(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var Gw={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},Kw={pending_approval:`warn`,armed:`ok`,paused:`idle`};function qw(e){ Line truncated
`)}};vB.defaultYaml={explicit:!1,version:`1.2`},vB.defaultTags={"!!":`tag:yaml.org,2002:`};function yB(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 bB(e){let t=new Set;return dB(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function xB(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function SB(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=bB(e);let a=xB(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(rB(t.node)||aB(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 CB(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=CB(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=CB(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=CB(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=CB(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function wB(e,t,n){if(Array.isArray(e))return e.map((e,t)=>wB(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!sB(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 TB=class{constructor(e){Object.defineProperty(this,Qz,{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(!eB(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=wB(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?CB(i,{"":o},``,o):o}},EB=class extends TB{constructor(e){super(Kz),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=[],dB(e,{Node:(e,t)=>{($z(t)||sB(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||=(wB(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=DB(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(yB(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 DB(e,t,n){if($z(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(aB(t)){let r=0;for(let i of t.items){let t=DB(e,i,n);t>r&&(r=t)}return r}if(nB(t)){let r=DB(e,t.key,n),i=DB(e,t.value,n);return Math.max(r,i)}return 1}var OB=e=>!e||typeof e!=`function`&&typeof e!=`object`,kB=class extends TB{constructor(e){super(Xz),this.value=e}toJSON(e,t){return t?.keep?this.value:wB(this.value,e,t)}toString(){return String(this.value)}};kB.BLOCK_FOLDED=`BLOCK_FOLDED`,kB.BLOCK_LITERAL=`BLOCK_LITERAL`,kB.PLAIN=`PLAIN`,kB.QUOTE_DOUBLE=`QUOTE_DOUBLE`,kB.QUOTE_SINGLE=`QUOTE_SINGLE`;var AB=`tag:yaml.org,2002:`;function jB(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 MB(e,t,n){if(eB(e)&&(e=e.contents),oB(e))return e;if(nB(e)){let t=n.schema[Jz].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 EB(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=AB+t.slice(2));let l=jB(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new kB(e);return c&&(c.node=t),t Line truncated
`)?LB(n,t):n.includes(`
Defaulting to \`null\`.`),null)}function pp(e){return dp(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 \`${cp}\`.`),cp)}var mp=n({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:cp},getValueLabel:{type:Function,required:!1,default:(e,t)=>dp(e)?`${Math.round(e/t*cp)}%`: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;Y();let i=ao(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=ao(n,`max`,r,{passive:n.max===void 0});j(()=>i.value,async e=>{let t=fp(e,n.max);t!==e&&(await ht(),i.value=t)},{immediate:!0}),j(()=>n.max,e=>{let t=pp(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=M(()=>ba(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return up({modelValue:i,max:a,progressState:o}),(t,n)=>(P(),U(F(mn),{"as-child":e.asChild,as:e.as,"aria-valuemax":F(a),"aria-valuemin":0,"aria-valuenow":dp(F(i))?F(i):void 0,"aria-valuetext":e.getValueText?.(F(i),F(a)),"aria-label":e.getValueLabel(F(i),F(a)),role:`progressbar`,"data-state":o.value,"data-value":F(i)??void 0,"data-max":F(a)},{default:w(()=>[A(t.$slots,`default`,{modelValue:F(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),hp=n({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=lp();return Y(),(e,r)=>(P(),U(F(mn),z(t,{"data-state":F(n).progressState.value,"data-value":F(n).modelValue?.value??void 0,"data-max":F(n).max.value}),{default:w(()=>[A(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),gp=`radio.select`;function _p(e,t,n){ya(gp,n,{originalEvent:e,value:t})}var vp=n({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=ao(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=p(n),{forwardRef:o,currentElement:s}=Y(),c=No(s),l=Io(),u=M(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||_p(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(t,n)=>(P(),V(R,null,[O(F(mn),z({id:e.id,ref:F(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":F(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":F(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:F(a),required:e.required,name:e.name},{...F(l),...t.$attrs},{onClick:un(d,[`stop`])}),{default:w(()=>[A(t.$slots,`default`,{checked:F(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),F(c)&&e.name?(P(),U(F(Wc),z({key:0,type:`radio`,tabindex:`-1`,value:F(a),checked:!!F(i),name:e.name,disabled:e.disabled,required:e.required},F(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):N(`v-if`,!0)],64))}}),[yp,bp]=_a(`RadioGroupRoot`),xp=n({__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}=Y(),o=ao(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=p(n),m=Oo(f),h=No(a);return bp({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(t,n)=>(P(),U(F(Td),{"as-child":``,orientation:F(l),dir:F(m),loop:F(c)},{default:w(()=>[O(F(mn),{ref:F(i),role:`radiogroup`,"data-disabled":F(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":F(l),"aria-required":F(d),dir:F(m)},{default:w(()=>[A(t.$slots,`default`,{modelValue:F(o)}),F(h)&&F(u)?(P(),U(F(Wc),{key:0,required:F(d),disabled:F(s),value:F(o),name:F(u)},null,8,[`required`,`disabled`,`value`,`name`])):N(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Sp,Cp]=_a(`RadioGroupItem`),wp=n({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:null,Line truncated
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:Yg(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>Yg(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=Zg(c),u=e+1<n.length?Zg(n[e+1]):null;if(l&&u&&Qg(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=Zg(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>Yg(e)),rows:r.map(e=>e.map(e=>Yg(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:Yg(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:Yg(c.replace(/^>\s?/,``))})):r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
`)}),t}function Zg(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 Qg(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var $g={class:`[overflow-wrap:anywhere]`},e_={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},t_={class:`font-mono text-[0.85em]`},n_={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},r_={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},i_={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},a_={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},o_={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},s_={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},c_={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},l_={key:8,class:`mb-2.5 last:mb-0`},u_=n({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=M(()=>Xg(t.text));return(e,t)=>(P(),V(`div`,$g,[(P(!0),V(R,null,H(n.value,(e,t)=>(P(),V(R,{key:t},[e.kind===`pre`?(P(),V(`pre`,e_,[B(`code`,t_,L(e.code),1)])):e.kind===`table`?(P(),V(`table`,n_,[B(`thead`,null,[B(`tr`,null,[(P(!0),V(R,null,H(e.head,(e,t)=>(P(),V(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[O(qg,{inline:e},null,8,[`inline`])]))),128))])]),B(`tbody`,null,[(P(!0),V(R,null,H(e.rows,(e,t)=>(P(),V(`tr`,{key:t},[(P(!0),V(R,null,H(e,(e,t)=>(P(),V(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[O(qg,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(P(),V(`blockquote`,r_,[O(qg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(P(),V(`h1`,i_,[O(qg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(P(),V(`h2`,a_,[O(qg,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(P(),V(`h3`,o_,[O(qg,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(P(),V(`ul`,s_,[(P(!0),V(R,null,H(e.items,(e,t)=>(P(),V(`li`,{key:t},[O(qg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(P(),V(`ol`,c_,[(P(!0),V(R,null,H(e.items,(e,t)=>(P(),V(`li`,{key:t},[O(qg,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(P(),V(`p`,l_,[O(qg,{inline:e.inline},null,8,[`inline`])])):N(``,!0)],64))),128))]))}}),d_={class:`truncate`},f_=n({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=c(`RouterLink`);return P(),U(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full 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:w(()=>[O(F(ar),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),B(`span`,d_,L(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),p_={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},m_={class:`font-semibold text-foreground`},h_={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},g_=n({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=M(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=M(()=>t.tool.parameters||t.tool.Parameters||``),i=M(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=M(()=>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?(P(),U(f_,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(P(),V(`div`,p_,[O(F(oi),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),B(`span`,m_,L(n.value),1),r.value?(P(),V(`code`,h_,L(r.value),1)):N(``,!0),B(`span`,{class:k(F(G)(`text-fg-muted`,i.value&&`text-danger`))},L(a.value),3)]))}}),__={key:0,class:`mb-2 grid gap-0.5 text-xs`},v_={key:1,class:`mb-2 flex flex-wrap gap-1.5`},y_={key:3,class:`whitespace-pre-wrap`},b_=n({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(P(),V(`div`,{class:k([`flex`,e.assistant?`justify-start`:`justify-end`])},[B(`div`,{class:k(F(G)(`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?(P(),V(`div`,__,[(P(!0),V(R,null,H(e.tools,(t,n)=>(P(),U(g_,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):N(``,!0),e.media.length?(P(),V(`div`,v_,[(P(!0),V(R,null,H(e.media,(e,t)=>(P(),U(Bg,{key:t,attachment:e},null,8,[`attachment`]))),128))])):N(``,!0),e.assistant?(P(),U(u_,{key:2,text:e.text},null,8,[`text`])):(P(),V(`div`,y_,L(e.text),1)),A(t.$slots,`default`)],2)],2))}}),x_={class:`text-sm`},S_={class:`font-medium`},C_={key:0,class:`mt-1 text-fg-muted`},w_={key:1,class:`mt-2 flex flex-wrap gap-2`},T_=n({__name:`ChatChoLine truncated
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>MS?`${n.slice(0,MS).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var PS=[`title`],FS=n({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>oS(n.event)),a=M(()=>NS(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=M(()=>n.event.at?cx(n.event.at):`—`);return(e,t)=>(P(),U(F(AS),{class:k(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[dn(un(o,[`prevent`]),[`enter`]),dn(un(o,[`prevent`]),[`space`])]},{default:w(()=>[O(F(Z),{class:`font-medium`},{default:w(()=>[l(L(n.event.kind||n.event.type||`event`),1)]),_:1}),O(F(Z),{class:`font-mono`},{default:w(()=>[l(L(i.value>0?`#${i.value}`:`—`),1)]),_:1}),O(F(Z),{class:`w-[55%] max-w-0`},{default:w(()=>[B(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},L(a.value.text),9,PS)]),_:1}),O(F(Z),null,{default:w(()=>[l(L(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),IS=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function LS(e){return(Number(e?.task_id)||0)>0}function RS(e,t){return t===`tasks`?LS(e):t!==`system`||!LS(e)}function zS(e,t){return e.filter(e=>RS(e,t))}function BS(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function VS(e,t){return`${e}:${t??0}`}function HS(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=VS(NS(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 US={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},WS={class:`max-h-[28rem] overflow-y-auto`},GS=[`aria-expanded`,`aria-label`,`onClick`],KS=[`title`],qS=n({__name:`LiveActivityCard`,setup(e){let t=dv(),{activity:n,streamKind:r,streamState:i}=kn(An()),a=W(`all`),o=M(()=>zS(n.value,a.value)),s=M(()=>BS(o.value.length,a.value)),c=je(new Set),u=M(()=>HS(o.value));function d(e){c.has(e)?c.delete(e):c.add(e)}function f(e){return c.has(e.key)}function p(e){return NS(e.representative)}function m(e){return e.representative.at?cx(e.representative.at):`—`}function h(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(P(),U(F(tx),null,{default:w(()=>[O(F(ox),null,{default:w(()=>[O(F(sx),null,{default:w(()=>[...t[1]||=[l(`Live activity`,-1)]]),_:1}),O(F(nx),{class:`flex items-center gap-2`},{default:w(()=>[O(F(ES),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:F(IS)},null,8,[`modelValue`,`options`]),O(F(xn),{variant:F(r)},{default:w(()=>[l(L(F(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),O(F(rx),null,{default:w(()=>[B(`div`,US,[B(`div`,WS,[O(F(OS),null,{default:w(()=>[O(F(jS),{class:`sticky top-0 z-10 bg-card`},{default:w(()=>[O(F(AS),null,{default:w(()=>[O(F(Q),null,{default:w(()=>[...t[2]||=[l(`Event`,-1)]]),_:1}),O(F(Q),null,{default:w(()=>[...t[3]||=[l(`Task`,-1)]]),_:1}),O(F(Q),null,{default:w(()=>[...t[4]||=[l(`Detail`,-1)]]),_:1}),O(F(Q),null,{default:w(()=>[...t[5]||=[l(`When`,-1)]]),_:1})]),_:1})]),_:1}),O(F(kS),null,{default:w(()=>[o.value.length?N(``,!0):(P(),U(F(AS),{key:0},{default:w(()=>[O(F(Z),{colspan:`4`},{default:w(()=>[O(F(Kb),null,{default:w(()=>[O(F(Yb),null,{default:w(()=>[O(F(Qb),null,{default:w(()=>[l(L(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(P(!0),V(R,{key:1},H(u.value,e=>(P(),V(R,{key:e.key},[e.count===1?(P(),U(FS,{key:0,event:e.representative,onOpen:h},null,8,[`event`])):(P(),V(R,{key:1},[O(F(AS),{class:k(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&h(e.taskID),onKeydown:[dn(un(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`enter`]),dn(un(t=>e.taskID>0&&h(e.taskID),[`prevent`]),[`space`])]},{default:w(()=>[O(F(Z),{class:`font-medium`},{default:w(()=>[B(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":f(e),"aria-label":`${f(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:un(t=>d(e.key),[`stop`])},[f(e)?(P(),U(F(fr),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(P(),U(F(pr),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),l(` `+L(e.label)+` `,1),O(F(xn),{variant:`idle`},{default:w(()=>[l(`×`+L(e.count),1)]),_:2},1024)],8,GS)]),_:2},1024),O(F(Z),{class:`font-mono`},{default:w(()=>[l(L(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),O(F(Z),{class:`w-[55%] max-w-0`},{default:w(()=>[B(`span`,{class:`block truncate`,title:p(e).truncated?p(e).full:void 0},L(p(e).text),9,KS)]),_:2},1024),O(F(Z),null,{default:w(()=>[l(L(m(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),f(e)?(P(!0),V(R,{key:0},H(e.events,(t,n)=>(P(),U(FS,{key:`${e.key}:${n}`,event:t,onOpen:h},null,8,[ 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 pw(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 mw(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 hw(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 gw(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 _w=W([]),vw=W([]),yw=W(!0),bw=W(null),xw=W(null),Sw=W(!1),Cw=W(null);async function ww(){try{let e=await K.eventTypes();yw.value=e.enabled!==!1,_w.value=e.event_types||[],vw.value=e.proposals||[],bw.value=null}catch(e){bw.value=e.message||String(e)}}function Tw(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function Ew(e){Cw.value=null,xw.value=e}function Dw(e){let t=Fw.value.find(t=>String(t.id)===e.sample_id);Ew({mode:`proposal`,id:null,source:e.source,name:``,rule:Tw(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function Ow(e=``){Ew({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function kw(e){Ew({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:Tw(e.rule),headersText:``,body:``,exampleHeaders:{}})}function Aw(){xw.value=null}async function jw(){let e=xw.value;if(e){Sw.value=!0;try{if(e.mode===`edit`&&e.id)await K.eventTypeUpdate(e.id,{name:e.name,rule:gw(e.rule)});else{let t=e.mode===`paste`?fw(e.headersText):e.exampleHeaders;await K.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:gw(e.rule),example:{headers:t,body:e.body}})}xw.value=null,await ww()}catch(e){Cw.value=e.message||String(e)}finally{Sw.value=!1}}}var Mw=W(null);async function Nw(){let e=Mw.value;if(Mw.value=null,e)try{await K.eventTypeDelete(e.id),await ww()}catch(e){bw.value=e.message||String(e)}}var Pw=100,Fw=W([]),Iw=W(!0),Lw=W(null),Rw=W(!0),zw=W(null);async function Bw(){try{let e=await K.captures(Pw);Iw.value=e.enabled!==!1,Fw.value=e.captures||[],Lw.value=null}catch(e){Lw.value=e.message||String(e)}finally{Rw.value=!1}}function Vw(e){let t=Fw.value.find(t=>t.id===e);return t&&(zw.value=t),!!t}function Hw(){Fw.value.length&&(zw.value=Fw.value[0])}function Uw(){In(`captures`,()=>{Bw(),ww()})}var Ww={key:0,class:`text-xs text-fg-muted`},Gw={key:1,class:`flex flex-col gap-1 text-xs`},Kw={key:1},qw={key:2,class:`text-xs text-fg-muted`},Jw=n({__name:`DispatchLinks`,props:{kind:{},id:{}},setup(e){let t=e,n=W([]),r=W(!1);j(()=>[t.kind,t.id],async()=>{r.value=!1;try{n.value=await K.dispatches(t.kind,t.id)}catch{n.value=[],r.value=!0}},{immediate:!0});let i=e=>({path:`/events`,query:{tab:`inspector`,capture:e}});return(e,a)=>{let o=c(`RouterLink`);return r.value?(P(),V(`p`,Ww,`Dispatches unavailable.`)):n.value.length?(P(),V(`ul`,Gw,[(P(!0),V(R,null,H(n.value,e=>(P(),V(`li`,{key:e.binding_id+e.capture_id,class:`flex flex-wrap items-center gap-x-2 font-mono text-fg-muted`},[t.kind===`bindings`?N(``,!0):(P(),U(o,{key:0,to:{path:`/events`,query:{tab:`bindings`}},class:`hover:text-foreground`},{default:w(()=>[l(`binding `+L(e.binding_id.slice(0,8))+` v`+L(e.binding_version),1)]),_:2},1024)),t.kind===`captures`?N(``,!0):(P(),U(o,{key:1,to:i(e.capture_id),class:`hover:text-foreground`},{default:w(()=>[l(`capture `+L(e.capture_id.slice(0,8)),1)]),_:2},1032,[`to`])),t.kind===`tasks`?N(``,!0):(P(),V(R,{key:2},[e.task_id?(P(),U(o,{key:0,to:`/tasks/${e.task_id}`,class:`text-foreground hover:underline`},{default:w(()=>[l(`task #`+L(e.task_id),1)]),_:2},1032,[`to`])):(P(),V(`span`,Kw,L(e.reason||`claimed, no task recorded`),1))],64)),B(`span`,null,L(F(cx)(e.dispatched_at)),1)]))),128))])):t.kind===`tasks`?N(``,!0):(P(),V(`p`,qw,` No dispatches yet. `))}}}),Yw=n({__name:`Spinner`,props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){let t=e;return(e,n)=>(P(),U(F(Dr),{role:`status`,"aria-label":`Loading`,class:k(F(G)(`size-4 animate-spin`,t.class))},null,8,[`class`]))}});function Xw(e,t){return t?e.filter(e=>e.event_type_id===t):[]}function Zw(e){return(e?.repository??`required`)!==`none`}function Qw(e,t){return e.filter(e=>t===`any`||e.type===`any`||e.type===t)}function $w(e,t){switch(t){case`string`:return e;case`number`:return e.trim()!==``&&!Number.isNaN(Number(e))?Number(e):e;case`bool`:return e===`true`||e!==`false`&&e;default:try{return JSON.parse(e)}catch{return e}}}var eT={pending_approval:`pending approval`,armed:`armed`,paused:`paused`},tT={pending_approval:`warn`,armed:`ok`,paused:`idle`};function nT(e){ Line truncated
`)}};mU.defaultYaml={explicit:!1,version:`1.2`},mU.defaultTags={"!!":`tag:yaml.org,2002:`};function hU(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 gU(e){let t=new Set;return sU(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function _U(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function vU(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=gU(e);let a=_U(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&($H(t.node)||tU(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 yU(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=yU(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=yU(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=yU(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=yU(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function bU(e,t,n){if(Array.isArray(e))return e.map((e,t)=>bU(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!rU(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 xU=class{constructor(e){Object.defineProperty(this,JH,{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(!XH(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=bU(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?yU(i,{"":o},``,o):o}},SU=class extends xU{constructor(e){super(HH),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=[],sU(e,{Node:(e,t)=>{(YH(t)||rU(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||=(bU(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=CU(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(hU(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 CU(e,t,n){if(YH(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(tU(t)){let r=0;for(let i of t.items){let t=CU(e,i,n);t>r&&(r=t)}return r}if(QH(t)){let r=CU(e,t.key,n),i=CU(e,t.value,n);return Math.max(r,i)}return 1}var wU=e=>!e||typeof e!=`function`&&typeof e!=`object`,TU=class extends xU{constructor(e){super(KH),this.value=e}toJSON(e,t){return t?.keep?this.value:bU(this.value,e,t)}toString(){return String(this.value)}};TU.BLOCK_FOLDED=`BLOCK_FOLDED`,TU.BLOCK_LITERAL=`BLOCK_LITERAL`,TU.PLAIN=`PLAIN`,TU.QUOTE_DOUBLE=`QUOTE_DOUBLE`,TU.QUOTE_SINGLE=`QUOTE_SINGLE`;var EU=`tag:yaml.org,2002:`;function DU(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 OU(e,t,n){if(XH(e)&&(e=e.contents),nU(e))return e;if(QH(e)){let t=n.schema[WH].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 SU(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=EU+t.slice(2));let l=DU(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new TU(e);return c&&(c.node=t),t Line truncated
`)?NU(n,t):n.includes(`
`)?`
`+LB(n,t):(e.endsWith(` `)?``:` `)+n,zB=`flow`,BB=`block`,VB=`quoted`;function HB(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=UB(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=UB(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
`+NU(n,t):(e.endsWith(` `)?``:` `)+n,FU=`flow`,IU=`block`,LU=`quoted`;function RU(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=zU(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=zU(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 UB(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 WB=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),GB=e=>/^(%|---|\.\.\.)/m.test(e);function KB(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 qB(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(GB(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 zU(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 BU=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),VU=e=>/^(%|---|\.\.\.)/m.test(e);function HU(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 UU(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(VU(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:HB(o,a,VB,WB(t,!1))}function JB(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return qB(e,t);let n=t.indent||(GB(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:HB(r,n,zB,WB(t,!1))}function YB(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=qB;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?JB:i&&!t?qB:n?JB:qB}return r(e,t)}var XB;try{XB=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:RU(o,a,LU,BU(t,!1))}function WU(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
`)||/[ \t]\n|\n[ \t]/.test(e))return UU(e,t);let n=t.indent||(VU(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:RU(r,n,FU,BU(t,!1))}function GU(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=UU;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?WU:i&&!t?UU:n?WU:UU}return r(e,t)}var KU;try{KU=RegExp(`(^|(?<!
))
+(?!
|$)`,`g`)}catch{XB=/\n+(?!\n|$)/g}function ZB({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 YB(n,r);let l=r.indent||(r.forceBlockIndent||GB(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===kB.BLOCK_FOLDED?!1:t===kB.BLOCK_LITERAL||!KB(n,c,l.length);if(!n)return u?`|
|$)`,`g`)}catch{KU=/\n+(?!\n|$)/g}function qU({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 GU(n,r);let l=r.indent||(r.forceBlockIndent||VU(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===TU.BLOCK_FOLDED?!1:t===TU.BLOCK_LITERAL||!HU(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(XB,`$&${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(KU,`$&${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=WB(r,!0);o!==`folded`&&t!==kB.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=HB(`${v}${e}${p}`,l,BB,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function QB(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 YB(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?YB(a,t):ZB(e,t,n,r);if(!s&&!u&&i!==kB.PLAIN&&a.includes(`
`))return ZB(e,t,n,r);if(GB(a)){if(c===``)return t.forceBlockIndent=!0,ZB(e,t,n,r);if(s&&c===l)return YB(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 YB(a,t)}return s?d:HB(d,c,zB,WB(t,!1))}function $B(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!==kB.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=kB.QUOTE_DOUBLE);let c=e=>{switch(e){case kB.BLOCK_FOLDED:case kB.BLOCK_LITERAL:return i||a?YB(o.value,t):ZB(o,t,n,r);case kB.QUOTE_DOUBLE:return qB(o.value,t);case kB.QUOTE_SINGLE:return JB(o.value,t);case kB.PLAIN:return QB(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 eV(e,t){let n=Object.assign({blockQuote:!0,commentString:IB,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 tV(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(rB(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 nV(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(rB(e)||aB(e))&&e.anchor;a&&yB(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 rV(e,t,n,r){if(nB(e))return e.toString(t,n,r);if($z(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=oB(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=tV(t.doc.schema.tags,a);let o=nV(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):rB(a)?$B(a,t,n,r):a.toString(t,n,r);return o?rB(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function iV({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=oB(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(aB(e)||!oB(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||aB(e)||(rB(e)?e.type===kB.BLOCK_FOLDED||e.type===kB.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=rV(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+=RB(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=RB(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=RB(g,n.indent,l(f))));let _,v,y;oB(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&&rB(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&iB(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=rV(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${LB(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=BU(r,!0);o!==`folded`&&t!==TU.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=RU(`${v}${e}${p}`,l,IU,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function JU(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 GU(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
`)?GU(a,t):qU(e,t,n,r);if(!s&&!u&&i!==TU.PLAIN&&a.includes(`
`))return qU(e,t,n,r);if(VU(a)){if(c===``)return t.forceBlockIndent=!0,qU(e,t,n,r);if(s&&c===l)return GU(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 GU(a,t)}return s?d:RU(d,c,FU,BU(t,!1))}function YU(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!==TU.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=TU.QUOTE_DOUBLE);let c=e=>{switch(e){case TU.BLOCK_FOLDED:case TU.BLOCK_LITERAL:return i||a?GU(o.value,t):qU(o,t,n,r);case TU.QUOTE_DOUBLE:return UU(o.value,t);case TU.QUOTE_SINGLE:return WU(o.value,t);case TU.PLAIN:return JU(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 XU(e,t){let n=Object.assign({blockQuote:!0,commentString:MU,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 ZU(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($H(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 QU(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=($H(e)||tU(e))&&e.anchor;a&&hU(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 $U(e,t,n,r){if(QH(e))return e.toString(t,n,r);if(YH(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=nU(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=ZU(t.doc.schema.tags,a);let o=QU(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):$H(a)?YU(a,t,n,r):a.toString(t,n,r);return o?$H(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function eW({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=nU(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(tU(e)||!nU(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||tU(e)||($H(e)?e.type===TU.BLOCK_FOLDED||e.type===TU.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=$U(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+=PU(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=PU(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=PU(g,n.indent,l(f))));let _,v,y;nU(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&&$H(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&eU(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=$U(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
`:``,v){let e=l(v);S+=`\n${NU(e,n.indent)}`}x===``&&!n.inFlow?S===`
`&&y&&(S=`
`):S+=`\n${n.indent}`}else if(!p&&aB(t)){let e=x[0],r=x.indexOf(`
`):S+=`\n${n.indent}`}else if(!p&&tU(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+=RB(g,n.indent,l(y)):h&&i&&i(),g}function aV(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var oV=`<<`,sV={identify:e=>e===oV||typeof e==`symbol`&&e.description===oV,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new kB(Symbol(oV)),{addToJSMap:lV}),stringify:()=>oV},cV=(e,t)=>(sV.identify(t)||rB(t)&&(!t.type||t.type===kB.PLAIN)&&sV.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===sV.tag&&e.default);function lV(e,t,n){let r=dV(e,n);if(iB(r))for(let n of r.items)uV(e,t,n);else if(Array.isArray(r))for(let n of r)uV(e,t,n);else uV(e,t,r)}function uV(e,t,n){let r=dV(e,n);if(!tB(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 dV(e,t){return e&&$z(t)?t.resolve(e.doc,e):t}function fV(e,t,{key:n,value:r}){if(oB(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(cV(e,n))lV(e,t,r);else{let i=wB(n,``,e);if(t instanceof Map)t.set(i,wB(r,i,e));else if(t instanceof Set)t.add(i);else{let a=pV(n,i,e),o=wB(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function pV(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(oB(e)&&n?.doc){let t=eV(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)+`..."`),aV(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 mV(e,t,n){return new hV(MB(e,void 0,n),MB(t,void 0,n))}var hV=class e{constructor(e,t=null){Object.defineProperty(this,Qz,{value:Yz}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return oB(n)&&(n=n.clone(t)),oB(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return fV(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?iV(this,e,t,n):JSON.stringify(this)}};function gV(e,t,n){return(t.inFlow??e.flow?vV:_V)(e,t,n)}function _V({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(oB(i))!d&&i.spaceBefore&&f.push(``),yV(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(nB(i)){let e=oB(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),yV(n,f,e.commentBefore,d))}d=!1;let s=rV(i,u,()=>o=null,()=>d=!0);o&&(s+=RB(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+=PU(g,n.indent,l(y)):h&&i&&i(),g}function tW(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var nW=`<<`,rW={identify:e=>e===nW||typeof e==`symbol`&&e.description===nW,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new TU(Symbol(nW)),{addToJSMap:aW}),stringify:()=>nW},iW=(e,t)=>(rW.identify(t)||$H(t)&&(!t.type||t.type===TU.PLAIN)&&rW.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===rW.tag&&e.default);function aW(e,t,n){let r=sW(e,n);if(eU(r))for(let n of r.items)oW(e,t,n);else if(Array.isArray(r))for(let n of r)oW(e,t,n);else oW(e,t,r)}function oW(e,t,n){let r=sW(e,n);if(!ZH(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 sW(e,t){return e&&YH(t)?t.resolve(e.doc,e):t}function cW(e,t,{key:n,value:r}){if(nU(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(iW(e,n))aW(e,t,r);else{let i=bU(n,``,e);if(t instanceof Map)t.set(i,bU(r,i,e));else if(t instanceof Set)t.add(i);else{let a=lW(n,i,e),o=bU(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function lW(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(nU(e)&&n?.doc){let t=XU(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)+`..."`),tW(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 uW(e,t,n){return new dW(OU(e,void 0,n),OU(t,void 0,n))}var dW=class e{constructor(e,t=null){Object.defineProperty(this,JH,{value:GH}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return nU(n)&&(n=n.clone(t)),nU(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return cW(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?eW(this,e,t,n):JSON.stringify(this)}};function fW(e,t,n){return(t.inFlow??e.flow?mW:pW)(e,t,n)}function pW({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(nU(i))!d&&i.spaceBefore&&f.push(``),hW(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(QH(i)){let e=nU(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),hW(n,f,e.commentBefore,d))}d=!1;let s=$U(i,u,()=>o=null,()=>d=!0);o&&(s+=PU(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+=`
`+LB(l(e),c),s&&s()):d&&o&&o(),p}function vV({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(oB(i))i.spaceBefore&&d.push(``),yV(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(nB(i)){let e=oB(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),yV(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=oB(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=rV(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+=RB(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 yV({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=LB(t(r),e);n.push(i.trimStart())}}function bV(e,t){let n=rB(t)?t.value:t;for(let r of e)if(nB(r)&&(r.key===t||r.key===n||rB(r.key)&&r.key.value===n))return r}var xV=class extends FB{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Jz,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(mV(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=nB(e)?e:!e||typeof e!=`object`||!(`key`in e)?new hV(e,e?.value):new hV(e.key,e.value);let r=bV(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);rB(r.value)&&OB(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=bV(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=bV(this.items,e)?.value;return(!t&&rB(n)?n.value:n)??void 0}has(e){return!!bV(this.items,e)}set(e,t){this.add(new hV(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)fV(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!nB(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})),gV(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},SV={collection:`map`,default:!0,nodeClass:xV,tag:`tag:yaml.org,2002:map`,resolve(e,t){return tB(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>xV.from(e,t,n)},CV=class extends FB{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Zz,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=wV(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=wV(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&rB(r)?r.value:r}has(e){let t=wV(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=wV(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];rB(r)&&OB(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(wB(e,String(r++),t));return n}toString(e,t,n){return e?gV(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(MB(a,void 0,n))}}return i}};function wV(e){let t=rB(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var TV={collection:`seq`,default:!0,nodeClass:CV,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return iB(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>CV.from(e,t,n)},EV={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),$B(e,t,n,r)}},DV={identify:e=>e==null,createNode:()=>new kB(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new kB(null),stringify:({source:e},t)=>typeof e==`string`&&DV.test.test(e)?e:t.options.nullStr},OV={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new kB(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&OV.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function kV({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 AV={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:kV},jV={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 $B({comment:e,type:t,value:s},r,i,a)}};function GV(e,t){if(iB(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!nB(r)){if(tB(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new hV(new kB(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]=nB(r)?r:new hV(r)}}else t(`Expected a sequence for this tag`);return e}function KV(e,t,n){let{replacer:r}=n,i=new CV(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(mV(o,s,n))}return i}var qV={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:GV,createNode:KV},JV=class e extends CV{constructor(){super(),this.add=xV.prototype.add.bind(this),this.delete=xV.prototype.delete.bind(this),this.get=xV.prototype.get.bind(this),this.has=xV.prototype.has.bind(this),this.set=xV.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(nB(e)?(r=wB(e.key,``,t),i=wB(e.value,r,t)):r=wB(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=KV(e,t,n),i=new this;return i.items=r.items,i}};JV.tag=`tag:yaml.org,2002:omap`;var YV={collection:`seq`,identify:e=>e instanceof Map,nodeClass:JV,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=GV(e,t),r=[];for(let{key:e}of n.items)rB(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new JV,n)},createNode:(e,t,n)=>JV.from(e,t,n)};function XV({value:e,source:t},n){return t&&(e?ZV:QV).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var ZV={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 kB(!0),stringify:XV},QV={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 kB(!1),stringify:XV},$V={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:kV},eH={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():kV(e)}},tH={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 kB(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:kV},nH=e=>typeof e==`bigint`||Number.isInteger(e);function rH(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 iH(e,t,n){let{value:r}=e;if(nH(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return kV(e)}var aH={identify:nH,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>rH(e,2,2,n),stringify:e=>iH(e,2,`0b`)},oH={identify:nH,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>rH(e,1,8,n),stringify:e=>iH(e,8,`0`)},sH={identify:nH,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>rH(e,0,10,n),stringify:kV},cH={identify:nH,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>rH(e,2,16,n),stringify:e=>iH(e,16,`0x`)},lH=class e extends xV{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=nB(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new hV(e.key,null):new hV(e,null),bV(this.items,t.key)||this.items.push(t)}get(e,t){let n=bV(this.items,e);return!t&&nB(n)?rB(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=bV(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new hV(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(LB(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(LB(a(t),``)))}return n.join(`
`+NU(l(e),c),s&&s()):d&&o&&o(),p}function mW({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(nU(i))i.spaceBefore&&d.push(``),hW(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(QH(i)){let e=nU(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),hW(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=nU(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=$U(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+=PU(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 hW({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=NU(t(r),e);n.push(i.trimStart())}}function gW(e,t){let n=$H(t)?t.value:t;for(let r of e)if(QH(r)&&(r.key===t||r.key===n||$H(r.key)&&r.key.value===n))return r}var _W=class extends jU{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(WH,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(uW(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=QH(e)?e:!e||typeof e!=`object`||!(`key`in e)?new dW(e,e?.value):new dW(e.key,e.value);let r=gW(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);$H(r.value)&&wU(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=gW(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=gW(this.items,e)?.value;return(!t&&$H(n)?n.value:n)??void 0}has(e){return!!gW(this.items,e)}set(e,t){this.add(new dW(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)cW(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!QH(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})),fW(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},vW={collection:`map`,default:!0,nodeClass:_W,tag:`tag:yaml.org,2002:map`,resolve(e,t){return ZH(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>_W.from(e,t,n)},yW=class extends jU{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(qH,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=bW(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=bW(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&$H(r)?r.value:r}has(e){let t=bW(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=bW(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];$H(r)&&wU(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(bU(e,String(r++),t));return n}toString(e,t,n){return e?fW(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(OU(a,void 0,n))}}return i}};function bW(e){let t=$H(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var xW={collection:`seq`,default:!0,nodeClass:yW,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return eU(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>yW.from(e,t,n)},SW={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),YU(e,t,n,r)}},CW={identify:e=>e==null,createNode:()=>new TU(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new TU(null),stringify:({source:e},t)=>typeof e==`string`&&CW.test.test(e)?e:t.options.nullStr},wW={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new TU(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&wW.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function TW({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 EW={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:TW},DW={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 YU({comment:e,type:t,value:s},r,i,a)}};function VW(e,t){if(eU(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!QH(r)){if(ZH(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new dW(new TU(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]=QH(r)?r:new dW(r)}}else t(`Expected a sequence for this tag`);return e}function HW(e,t,n){let{replacer:r}=n,i=new yW(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(uW(o,s,n))}return i}var UW={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:VW,createNode:HW},WW=class e extends yW{constructor(){super(),this.add=_W.prototype.add.bind(this),this.delete=_W.prototype.delete.bind(this),this.get=_W.prototype.get.bind(this),this.has=_W.prototype.has.bind(this),this.set=_W.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(QH(e)?(r=bU(e.key,``,t),i=bU(e.value,r,t)):r=bU(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=HW(e,t,n),i=new this;return i.items=r.items,i}};WW.tag=`tag:yaml.org,2002:omap`;var GW={collection:`seq`,identify:e=>e instanceof Map,nodeClass:WW,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=VW(e,t),r=[];for(let{key:e}of n.items)$H(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new WW,n)},createNode:(e,t,n)=>WW.from(e,t,n)};function KW({value:e,source:t},n){return t&&(e?qW:JW).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var qW={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 TU(!0),stringify:KW},JW={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 TU(!1),stringify:KW},YW={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:TW},XW={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():TW(e)}},ZW={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 TU(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:TW},QW=e=>typeof e==`bigint`||Number.isInteger(e);function $W(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 eG(e,t,n){let{value:r}=e;if(QW(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return TW(e)}var tG={identify:QW,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>$W(e,2,2,n),stringify:e=>eG(e,2,`0b`)},nG={identify:QW,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>$W(e,1,8,n),stringify:e=>eG(e,8,`0`)},rG={identify:QW,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>$W(e,0,10,n),stringify:TW},iG={identify:QW,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>$W(e,2,16,n),stringify:e=>eG(e,16,`0x`)},aG=class e extends _W{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=QH(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new dW(e.key,null):new dW(e,null),gW(this.items,t.key)||this.items.push(t)}get(e,t){let n=gW(this.items,e);return!t&&QH(n)?$H(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=gW(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new dW(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(NU(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(NU(a(t),``)))}return n.join(`
`)+`
`}var wH=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Qz,{value:qz});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new vB({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Qz]:{value:qz}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=oB(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){TH(this.contents)&&this.contents.add(e)}addIn(e,t){TH(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=bB(this);e.anchor=!t||n.has(t)?xB(t||`a`,n):t}return new EB(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}=SB(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=MB(e,l,p);return o&&aB(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new hV(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return TH(this.contents)?this.contents.delete(e):!1}deleteIn(e){return PB(e)?this.contents!=null&&(this.contents=null,!0):TH(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return aB(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return PB(e)?!t&&rB(this.contents)?this.contents.value:this.contents:aB(this.contents)?this.contents.getIn(e,t):void 0}has(e){return aB(this.contents)?this.contents.has(e):!1}hasIn(e){return PB(e)?this.contents!==void 0:aB(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=NB(this.schema,[e],t):TH(this.contents)&&this.contents.set(e,t)}setIn(e,t){PB(e)?this.contents=t:this.contents==null?this.contents=NB(this.schema,Array.from(e),t):TH(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 vB({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 vB({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 SH(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=wB(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`?CB(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 CH(this,e)}};function TH(e){if(aB(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var EH=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},DH=class extends EH{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},OH=class extends EH{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},kH=(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 AH(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],ee=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:ee,start:x??ee}}function jH(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(jH(t.key)||jH(t.value))return!0}return!1;default:return!0}}function MH(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&jH(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function NH(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||rB(e)&&rB(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var PH=`All mapping items must start at the same column`;function FH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??xV)(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=AH(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`,PH)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||jH(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`,PH);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&MH(r.indent,u,i),n.atKey=!1,NH(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=AH(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&&MH(r.indent,f,i),s=c.range[2];let l=new hV(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 hV(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 IH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??CV)(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=AH(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&&MH(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function LH(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 RH=`Block collections are not allowed within flow collections`,zH=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function BH({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?xV:CV))(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=AH(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&&jH(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];nB(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],zH(m)&&i(r.range,`BLOCK_IN_FLOW`,RH)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);zH(f)&&i(g.range,`BLOCK_IN_FLOW`,RH),n.atKey=!1;let _=AH(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?zH(m)&&i(v.range,`BLOCK_IN_FLOW`,RH):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new hV(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;NH(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new xV(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=LH(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 VH(e,t,n,r,i,a){let o=n.type===`block-map`?FH(e,t,n,r,a):n.type===`block-seq`?IH(e,t,n,r,a):BH(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function HH(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===xV.tagName&&s===`map`||o===CV.tagName&&s===`seq`)return VH(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),VH(e,t,n,i,o)}let l=VH(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=oB(u)?u:new kB(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function UH(e,t,n){let r=t.offset,i=WH(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?kB.BLOCK_FOLDED:kB.BLOCK_LITERAL,o=t.source?GH(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 bG=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,JH,{value:UH});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 mU({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[JH]:{value:UH}});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=nU(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){xG(this.contents)&&this.contents.add(e)}addIn(e,t){xG(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=gU(this);e.anchor=!t||n.has(t)?_U(t||`a`,n):t}return new SU(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}=vU(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=OU(e,l,p);return o&&tU(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new dW(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return xG(this.contents)?this.contents.delete(e):!1}deleteIn(e){return AU(e)?this.contents!=null&&(this.contents=null,!0):xG(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return tU(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return AU(e)?!t&&$H(this.contents)?this.contents.value:this.contents:tU(this.contents)?this.contents.getIn(e,t):void 0}has(e){return tU(this.contents)?this.contents.has(e):!1}hasIn(e){return AU(e)?this.contents!==void 0:tU(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=kU(this.schema,[e],t):xG(this.contents)&&this.contents.set(e,t)}setIn(e,t){AU(e)?this.contents=t:this.contents==null?this.contents=kU(this.schema,Array.from(e),t):xG(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 mU({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 mU({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 vG(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=bU(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`?yU(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 yG(this,e)}};function xG(e){if(tU(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var SG=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},CG=class extends SG{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},wG=class extends SG{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},TG=(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 EG(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 DG(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(DG(t.key)||DG(t.value))return!0}return!1;default:return!0}}function OG(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&DG(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function kG(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||$H(e)&&$H(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var AG=`All mapping items must start at the same column`;function jG({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??_W)(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=EG(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`,AG)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||DG(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`,AG);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&OG(r.indent,u,i),n.atKey=!1,kG(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=EG(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&&OG(r.indent,f,i),s=c.range[2];let l=new dW(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 dW(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 MG({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??yW)(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=EG(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&&OG(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function NG(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 PG=`Block collections are not allowed within flow collections`,FG=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function IG({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?_W:yW))(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=EG(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&&DG(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];QH(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],FG(m)&&i(r.range,`BLOCK_IN_FLOW`,PG)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);FG(f)&&i(g.range,`BLOCK_IN_FLOW`,PG),n.atKey=!1;let _=EG(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?FG(m)&&i(v.range,`BLOCK_IN_FLOW`,PG):_.comment&&(g.comment?g.comment+=`
`+_.comment:g.comment=_.comment);let y=new dW(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;kG(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new _W(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=NG(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 LG(e,t,n,r,i,a){let o=n.type===`block-map`?jG(e,t,n,r,a):n.type===`block-seq`?MG(e,t,n,r,a):IG(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function RG(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===_W.tagName&&s===`map`||o===yW.tagName&&s===`seq`)return LG(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),LG(e,t,n,i,o)}let l=LG(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=nU(u)?u:new TU(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function zG(e,t,n){let r=t.offset,i=BG(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?TU.BLOCK_FOLDED:TU.BLOCK_LITERAL,o=t.source?VG(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===kB.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===TU.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
`):t.length>c||r[0]===` `?(f===` `?f=`
`:!p&&f===`
`&&(f=`
@@ -77,59 +77,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 WH({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 GH(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 KH(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=kB.PLAIN,c=qH(a,l);break;case`single-quoted-scalar`:s=kB.QUOTE_SINGLE,c=JH(a,l);break;case`double-quoted-scalar`:s=kB.QUOTE_DOUBLE,c=XH(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=LH(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function qH(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}`),YH(e)}function JH(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),YH(e.slice(1,-1)).replace(/''/g,`'`)}function YH(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 BG({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 VG(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 HG(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=TU.PLAIN,c=UG(a,l);break;case`single-quoted-scalar`:s=TU.QUOTE_SINGLE,c=WG(a,l);break;case`double-quoted-scalar`:s=TU.QUOTE_DOUBLE,c=KG(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=NG(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function UG(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}`),GG(e)}function WG(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),GG(e.slice(1,-1)).replace(/''/g,`'`)}function GG(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 XH(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 KG(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}=ZH(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=QH[i];if(a)n+=a;else if(i===`
`){let{fold:t,offset:i}=qG(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=JG[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+=$H(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+=YG(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 ZH(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 qG(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 QH={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function $H(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 eU(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?UH(e,t,r):KH(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[Xz]:c?tU(e.schema,i,c,n,r):t.type===`scalar`?nU(e,i,t,r):e.schema[Xz];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=rB(a)?a:new kB(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new kB(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 tU(e,t,n,r,i){if(n===`!`)return e[Xz];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[Xz])}function nU({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[Xz];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Xz];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 rU(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 iU={composeNode:aU,composeEmptyNode:oU};function aU(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=sU(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=eU(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=HH(iU,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??=oU(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&&(!rB(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 oU(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=eU(e,{type:`scalar`,offset:rU(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 sU({options:e},{offset:t,source:n,end:r},i){let a=new EB(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=LH(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function cU(e,t,{offset:n,start:r,value:i,end:a},o){let s=new wH(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=AH(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?aU(c,i,l,o):oU(c,l.end,r,null,l,o);let u=s.contents.range[2],d=LH(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function lU(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 uU(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 JG={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
`,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function YG(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 XG(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?zG(e,t,r):HG(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[KH]:c?ZG(e.schema,i,c,n,r):t.type===`scalar`?QG(e,i,t,r):e.schema[KH];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=$H(a)?a:new TU(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new TU(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 ZG(e,t,n,r,i){if(n===`!`)return e[KH];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[KH])}function QG({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[KH];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[KH];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 $G(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 eK={composeNode:tK,composeEmptyNode:nK};function tK(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=rK(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=XG(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=RG(eK,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??=nK(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&&(!$H(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 nK(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=XG(e,{type:`scalar`,offset:$G(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 rK({options:e},{offset:t,source:n,end:r},i){let a=new SU(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=NG(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function iK(e,t,{offset:n,start:r,value:i,end:a},o){let s=new bG(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=EG(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?tK(c,i,l,o):nK(c,l.end,r,null,l,o);let u=s.contents.range[2],d=NG(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function aK(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 oK(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 dU=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=lU(e);r?this.warnings.push(new OH(i,t,n)):this.errors.push(new DH(i,t,n))},this.directives=new vB({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=uU(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(aB(i)&&!i.flow&&i.items.length>0){let e=i.items[0];nB(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:uU(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=lU(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=cU(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 DH(lU(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 DH(lU(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=LH(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 DH(lU(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 wH(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}}},fU=Symbol(`break visit`),pU=Symbol(`skip children`),mU=Symbol(`remove item`);function hU(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),gU(Object.freeze([]),e,t)}hU.BREAK=fU,hU.SKIP=pU,hU.REMOVE=mU,hU.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},hU.parentCollection=(e,t)=>{let n=hU.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 gU(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=gU(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===fU)return fU;else r===mU&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function _U(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 sK=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=aK(e);r?this.warnings.push(new wG(i,t,n)):this.errors.push(new CG(i,t,n))},this.directives=new mU({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=oK(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(tU(i)&&!i.flow&&i.items.length>0){let e=i.items[0];QH(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:oK(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=aK(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=iK(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 CG(aK(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 CG(aK(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=NG(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 CG(aK(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 bG(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}}},cK=Symbol(`break visit`),lK=Symbol(`skip children`),uK=Symbol(`remove item`);function dK(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),fK(Object.freeze([]),e,t)}dK.BREAK=cK,dK.SKIP=lK,dK.REMOVE=uK,dK.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},dK.parentCollection=(e,t)=>{let n=dK.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 fK(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=fK(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===cK)return cK;else r===uK&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function pK(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 vU(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var yU=new Set(`0123456789ABCDEFabcdef`),bU=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),xU=new Set(`,[]{}`),SU=new Set(` ,[]{}
\r `),CU=e=>!e||SU.has(e),wU=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 mK(e){switch(e){case void 0:case` `:case`
`:case`\r`:case` `:return!0;default:return!1}}var hK=new Set(`0123456789ABCDEFabcdef`),gK=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),_K=new Set(`,[]{}`),vK=new Set(` ,[]{}
\r `),yK=e=>!e||vK.has(e),bK=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===`...`)&&vU(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===`...`)&&vU(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&&!vU(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===`:`)&&vU(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(CU),`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(`...`))&&vU(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(CU),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||vU(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===`...`)&&mK(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===`...`)&&mK(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&&!mK(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===`:`)&&mK(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(yK),`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(`...`))&&mK(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(yK),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||mK(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=>vU(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=>mK(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(vU(r)||e&&xU.has(r))break;t=n}else if(vU(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(mK(r)||e&&_K.has(r))break;t=n}else if(mK(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
`?(n+=1,r=`
`,i=this.buffer[n+1]):t=n),i===`#`||e&&xU.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&xU.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(CU),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(vU(n)||t&&xU.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(;!vU(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(bU.has(t))t=this.buffer[++e];else if(t===`%`&&yU.has(this.buffer[e+1])&&yU.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&&_K.has(i))break;if(r===`
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&_K.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(yK),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(mK(n)||t&&_K.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(;!mK(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(gK.has(t))t=this.buffer[++e];else if(t===`%`&&hK.has(this.buffer[e+1])&&hK.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)}},TU=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 EU(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function DU(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 OU(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 kU(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 AU(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 jU(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 MU(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!EU(t.start,`explicit-key-ind`)&&!EU(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,OU(t.value)?t.value.end?jU(t.value.end,t.sep):t.value.end=t.sep:jU(t.start,t.sep),delete t.sep)}var NU=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 wU,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=_U(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});return}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`&&MU(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&&DU(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.i 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)}},xK=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 SK(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function CK(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 wK(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 TK(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 EK(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 DK(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 OK(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!SK(t.start,`explicit-key-ind`)&&!SK(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,wK(t.value)?t.value.end?DK(t.value.end,t.sep):t.value.end=t.sep:DK(t.start,t.sep),delete t.sep)}var kK=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 bK,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=pK(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`&&OK(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&&CK(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)){jU(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(EU(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=AU(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(EU(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(OU(t.key)&&!EU(t.sep,`newline`)){let e=AU(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]}):EU(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&&!EU(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)){jU(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||EU(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)){DK(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(SK(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=EK(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(SK(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(wK(t.key)&&!SK(t.sep,`newline`)){let e=EK(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]}):SK(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&&!SK(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)){DK(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||SK(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=AU(kU(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=AU(kU(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 PU(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new TU||null,prettyErrors:t}}function FU(e,t={}){let{lineCounter:n,prettyErrors:r}=PU(t),i=new NU(n?.addNewLine),a=new dU(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 DH(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(kH(e,n)),o.warnings.forEach(kH(e,n))),o}function IU(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=FU(e,n);if(!i)return null;if(i.warnings.forEach(e=>aV(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 LU(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 eB(e)&&!r?e.toString(n):new wH(e,r,n).toString(n)}function RU(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function zU(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var BU=140,VU=280,HU={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function UU(e){return HU[e]??e}var WU=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function GU(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function KU(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function qU(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,`‹$1›`).split(`
`).find(e=>e.trim())?.trim()}}function JU(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(WU)].map(e=>e[1]))]}function YU(e){let t=FU(e).toJS(),n=GU(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=GU(e)?e:{},f=typeof u.type==`string`?u.type:``,p=GU(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`,g=s?`${s}/${m||f}`:m||f;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||UU(f),type:f,detail:KU(f,p),summary:qU(p),when:typeof u.when==`string`?u.when:void 0,retry:GU(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,stage:g,occurrence:d(g),...c?{resume:c}:{}}}),m&&a.set(m,h);for(let e of JU(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(GU(t)&&GU(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i=[],a=0;n.forEach(([t,o],s)=>{let u=(s-(n.length-1)/2)*VU,d=c,m=c;(Array.isArray(o)?o:[]).forEach((i,o)=>{let c=f(i,`${e+1}-${t}-${o+1}`,u,(l+o)*BU,t,r,[`steps`,e,`parallel`,t,o]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],a=Math.max(a,o+1)}),i.push(...d)}),c=i,l+=Math.max(a,1);continue}let n=f(t,String(e+1),0,l*BU,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*BU-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`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 XU={agent:sr,command:Jr,repo:Cr,gate:Gr,forge:jr,human:ti,review:xr,workflow:ii},ZU={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function QU(e){return XU[e.split(`.`)[0]]??ii}function $U(e){return Object.keys(ZU).map(t=>({title:ZU[t],icon:XU[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function eW(e,t){let n=FU(e).getIn(t,!0);if(tB(n))return n.toJSON()}function tW(e,t,n){let r=FU(e);return r.setIn(t,r.createNode(sW(n))),r.toString()}function nW(e,t,n){let r=FU(e),i=r.get(`steps`,!0);if(iB(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!iB(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function rW(e,t){let n=FU(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!iB(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return tB(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function iW(e,t){let n=FU(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);iB(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function aW(e,t,n){let r=FU(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!iB(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function oW(e,t){let n=FU(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function sW(e){if(Array.isArray(e))return e.map(sW);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=sW(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function cW(e,t){let n=FU(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():FU(e).get(t)}function lW(e,t,n){let r=FU(e),i=sW({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function uW(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function dW(e,t=[]){let n=FU(e),r=n.errors[0];if(r)return{ok:!1,message:TW(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!EW(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};le Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:xW(e)}))}var yW=/^(\s*)(-\s+)?/,bW=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function xW(e){let{code:t,comment:n}=SW(e),r=CW(t);return n&&r.push({text:n,kind:`comment`}),r}function SW(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function CW(e){if(!e)return[];let t=[],n=yW.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=bW.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,...wW(i[4]??``)]):[...t,...wW(r)]}function wW(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 TW(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function EW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function DW(e){return typeof e==`string`&&e.trim()!==``}var OW={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},kW={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},AW={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},jW={class:`min-w-0 flex-1`},MW=[`value`,`placeholder`],NW={class:`truncate font-mono text-[11px] text-fg-subtle`},PW={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},FW={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},IW={key:1,class:`space-y-1.5`},LW=[`title`],RW=[`value`],zW=[`value`],BW={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},VW=[`onClick`],HW=[`onClick`],UW={key:2,class:`divide-y divide-border rounded-md border border-border`},WW=[`title`],GW=[`value`,`onChange`],KW=[`value`],qW=[`value`,`onInput`],JW=[`value`,`onFocus`,`onInput`],YW=[`title`],XW={key:0,class:`text-xs text-danger`},ZW={class:`space-y-2`},QW={class:`divide-y divide-border rounded-md border border-border`},$W={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},eG=[`value`],tG={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},nG=[`value`],rG={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},iG=[`value`],aG={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},oG={class:`flex items-center border-t border-border px-4 py-2.5`},sG=n({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>eW(n.yaml,n.path)??{}),a=M(()=>typeof i.value.type==`string`?i.value.type:``),o=M(()=>n.vocabulary.find(e=>e.name===a.value)),s=M(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=M(()=>oW(n.yaml,n.path)),u=M(()=>o.value?.settings&&i.value.settings?gW(i.value.settings,o.value.settings,`settings`):``),d=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],f=/mission|body|detail|plan|rules/;function p(e,t){return t.type===`string`?t.enum?`select`:f.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 m=M(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:p(e,t)})),t=e.filter(e=>d.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>d.indexOf(e.key)-d.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function h(e){let{id:t,type:i,...a}=e;r(`update:yaml`,tW(n.yaml,n.path,{id:t,type:i,...a}))}function g(e,t){h({...i.value,[e]:t})}function _(e){g(`retry`,{...i.value.retry,...e})}function v(e,t){h({...i.value,settings:{...s.value,[e]:t}})}let y=W(null);function b(e,t){let n=y.value??m.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;v(n,r?`${r.trimEnd()} ${i}`:i)}let x=W({});function S(e,t){try{v(e,t.trim()?IU(t):void 0),x.value={...x.value,[e]:``}}catch(t){x.value={...x.value,[e]:String(t.message).split(`
`)[0]}}}let ee=e=>e===void 0?``:LU(e).trimEnd(),w=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),T=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(P(),V(`aside`,OW,[B(`header`,kW,[B(`span`,AW,[(P(),U(ye(F(QU)(a.value)),{class:`size-4`}))]),B(`div`,jW,[B(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:F(UU)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>g(`id`,e.target.value)},null,40,MW),B(`div`,NW,L(a.value),1)]),O(F(q),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:C(()=>[O(F(oi))]),_:1})]),B(`div`,PW,[u.value?(P(),V(`p`,FW,L(u.value),1)):N(``,!0),m.value.lead?(P(),V(`section`,IW,[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:m.value.lead.schema.description},[l(L(w(m.value.lead.key,m.value.lead.schema))+` `,1),m.value.lead.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,LW),m.value.lead.kind===`select`?(P(),V(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:T(m.value.lead.key),onChange:t[2]||=e=>v(m.value.lead.key,e.target.value||void 0)},[t[13]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(m.value.lead.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,zW))),128))],40,RW)):m.value.lead.kind===`text`?(P(),U(F(mh),{key:1,"model-value":T(m.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[4]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])):(P(),U(F(J),{key:2,"model-value":T(m.value.lead.key),onFocus:t[5]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[6]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&m.value.lead.kind!==`select`?(P(),V(`div`,BW,[t[14]||=B(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(P(!0),V(R,null,H(c.value,e=>(P(),V(R,{key:e},[B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`summary`)},L(e),9,VW),B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`result`)},L(e)+`.result`,9,HW)],64))),128))])):N(``,!0)])):N(``,!0),m.value.compact.length?(P(),V(`section`,UW,[(P(!0),V(R,null,H(m.value.compact,e=>(P(),V(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[B(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[l(L(w(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,WW),e.kind===`boolean`?(P(),U(F(sb),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>v(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(P(),V(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:T(e.key),onChange:t=>v(e.key,t.target.value||void 0)},[t[15]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(e.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,KW))),128))],40,GW)):e.kind===`number`?(P(),V(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>v(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,qW)):(P(),V(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:T(e.key),onFocus:t=>y.value=e.key,onInput:t=>v(e.key,t.target.value)},null,40,JW))]))),128))])):N(``,!0),(P(!0),V(R,null,H(m.value.long,e=>(P(),V(`section`,{key:e.key,class:`space-y-1.5`},[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[l(L(w(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(_r),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,YW),e.kind===`text`?(P(),U(F(mh),{key:0,"model-value":T(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>y.value=e.key,"onUpdate:modelValue":t=>v(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(P(),U(F(mh),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`,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=EK(TK(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=EK(TK(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 AK(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new xK||null,prettyErrors:t}}function jK(e,t={}){let{lineCounter:n,prettyErrors:r}=AK(t),i=new kK(n?.addNewLine),a=new sK(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 CG(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(TG(e,n)),o.warnings.forEach(TG(e,n))),o}function MK(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=jK(e,n);if(!i)return null;if(i.warnings.forEach(e=>tW(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 NK(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 XH(e)&&!r?e.toString(n):new bG(e,r,n).toString(n)}function PK(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function FK(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var IK=140,LK=280,RK={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function zK(e){return RK[e]??e}var BK=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function VK(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function HK(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function UK(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,`‹$1›`).split(`
`).find(e=>e.trim())?.trim()}}function WK(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(BK)].map(e=>e[1]))]}function GK(e){let t=jK(e).toJS(),n=VK(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=VK(e)?e:{},f=typeof u.type==`string`?u.type:``,p=VK(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`,g=s?`${s}/${m||f}`:m||f;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||zK(f),type:f,detail:HK(f,p),summary:UK(p),when:typeof u.when==`string`?u.when:void 0,retry:VK(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,stage:g,occurrence:d(g),...c?{resume:c}:{}}}),m&&a.set(m,h);for(let e of WK(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(VK(t)&&VK(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i=[],a=0;n.forEach(([t,o],s)=>{let u=(s-(n.length-1)/2)*LK,d=c,m=c;(Array.isArray(o)?o:[]).forEach((i,o)=>{let c=f(i,`${e+1}-${t}-${o+1}`,u,(l+o)*IK,t,r,[`steps`,e,`parallel`,t,o]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],a=Math.max(a,o+1)}),i.push(...d)}),c=i,l+=Math.max(a,1);continue}let n=f(t,String(e+1),0,l*IK,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*IK-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`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 KK={agent:cr,command:Yr,repo:wr,gate:Kr,forge:Mr,human:ni,review:Sr,workflow:ai},qK={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function JK(e){return KK[e.split(`.`)[0]]??ai}function YK(e){return Object.keys(qK).map(t=>({title:qK[t],icon:KK[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function XK(e,t){let n=jK(e).getIn(t,!0);if(ZH(n))return n.toJSON()}function ZK(e,t,n){let r=jK(e);return r.setIn(t,r.createNode(rq(n))),r.toString()}function QK(e,t,n){let r=jK(e),i=r.get(`steps`,!0);if(eU(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!eU(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function $K(e,t){let n=jK(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!eU(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return ZH(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function eq(e,t){let n=jK(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);eU(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function tq(e,t,n){let r=jK(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!eU(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function nq(e,t){let n=jK(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function rq(e){if(Array.isArray(e))return e.map(rq);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=rq(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function iq(e,t){let n=jK(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():jK(e).get(t)}function aq(e,t,n){let r=jK(e),i=rq({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function oq(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function sq(e,t=[]){let n=jK(e),r=n.errors[0];if(r)return{ok:!1,message:xq(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!Sq(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};le Line truncated
`).map((e,t)=>({number:t+1,text:e,tokens:_q(e)}))}var hq=/^(\s*)(-\s+)?/,gq=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function _q(e){let{code:t,comment:n}=vq(e),r=yq(t);return n&&r.push({text:n,kind:`comment`}),r}function vq(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 yq(e){if(!e)return[];let t=[],n=hq.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=gq.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,...bq(i[4]??``)]):[...t,...bq(r)]}function bq(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 xq(e){return e.split(`
`)[0]?.trim()||`invalid YAML`}function Sq(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Cq(e){return typeof e==`string`&&e.trim()!==``}var wq={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},Tq={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},Eq={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},Dq={class:`min-w-0 flex-1`},Oq=[`value`,`placeholder`],kq={class:`truncate font-mono text-[11px] text-fg-subtle`},Aq={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},jq={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},Mq={key:1,class:`space-y-1.5`},Nq=[`title`],Pq=[`value`],Fq=[`value`],Iq={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},Lq=[`onClick`],Rq=[`onClick`],zq={key:2,class:`divide-y divide-border rounded-md border border-border`},Bq=[`title`],Vq=[`value`,`onChange`],Hq=[`value`],Uq=[`value`,`onInput`],Wq=[`value`,`onFocus`,`onInput`],Gq=[`title`],Kq={key:0,class:`text-xs text-danger`},qq={class:`space-y-2`},Jq={class:`divide-y divide-border rounded-md border border-border`},Yq={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},Xq=[`value`],Zq={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},Qq=[`value`],$q={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},eJ=[`value`],tJ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},nJ={class:`flex items-center border-t border-border px-4 py-2.5`},rJ=n({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=M(()=>XK(n.yaml,n.path)??{}),a=M(()=>typeof i.value.type==`string`?i.value.type:``),o=M(()=>n.vocabulary.find(e=>e.name===a.value)),s=M(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=M(()=>nq(n.yaml,n.path)),u=M(()=>o.value?.settings&&i.value.settings?fq(i.value.settings,o.value.settings,`settings`):``),d=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],f=/mission|body|detail|plan|rules/;function p(e,t){return t.type===`string`?t.enum?`select`:f.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 m=M(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:p(e,t)})),t=e.filter(e=>d.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>d.indexOf(e.key)-d.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function h(e){let{id:t,type:i,...a}=e;r(`update:yaml`,ZK(n.yaml,n.path,{id:t,type:i,...a}))}function g(e,t){h({...i.value,[e]:t})}function _(e){g(`retry`,{...i.value.retry,...e})}function v(e,t){h({...i.value,settings:{...s.value,[e]:t}})}let y=W(null);function b(e,t){let n=y.value??m.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;v(n,r?`${r.trimEnd()} ${i}`:i)}let x=W({});function S(e,t){try{v(e,t.trim()?MK(t):void 0),x.value={...x.value,[e]:``}}catch(t){x.value={...x.value,[e]:String(t.message).split(`
`)[0]}}}let C=e=>e===void 0?``:NK(e).trimEnd(),T=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),E=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(P(),V(`aside`,wq,[B(`header`,Tq,[B(`span`,Eq,[(P(),U(ye(F(JK)(a.value)),{class:`size-4`}))]),B(`div`,Dq,[B(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:F(zK)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>g(`id`,e.target.value)},null,40,Oq),B(`div`,kq,L(a.value),1)]),O(F(q),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:w(()=>[O(F(si))]),_:1})]),B(`div`,Aq,[u.value?(P(),V(`p`,jq,L(u.value),1)):N(``,!0),m.value.lead?(P(),V(`section`,Mq,[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:m.value.lead.schema.description},[l(L(T(m.value.lead.key,m.value.lead.schema))+` `,1),m.value.lead.schema.description?(P(),U(F(vr),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,Nq),m.value.lead.kind===`select`?(P(),V(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:E(m.value.lead.key),onChange:t[2]||=e=>v(m.value.lead.key,e.target.value||void 0)},[t[13]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(m.value.lead.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,Fq))),128))],40,Pq)):m.value.lead.kind===`text`?(P(),U(F(xh),{key:1,"model-value":E(m.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[4]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])):(P(),U(F(J),{key:2,"model-value":E(m.value.lead.key),onFocus:t[5]||=e=>y.value=m.value.lead.key,"onUpdate:modelValue":t[6]||=e=>v(m.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&m.value.lead.kind!==`select`?(P(),V(`div`,Iq,[t[14]||=B(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(P(!0),V(R,null,H(c.value,e=>(P(),V(R,{key:e},[B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`summary`)},L(e),9,Lq),B(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>b(e,`result`)},L(e)+`.result`,9,Rq)],64))),128))])):N(``,!0)])):N(``,!0),m.value.compact.length?(P(),V(`section`,zq,[(P(!0),V(R,null,H(m.value.compact,e=>(P(),V(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[B(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[l(L(T(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(vr),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,Bq),e.kind===`boolean`?(P(),U(F(gb),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>v(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(P(),V(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:E(e.key),onChange:t=>v(e.key,t.target.value||void 0)},[t[15]||=B(`option`,{value:``},`Default`,-1),(P(!0),V(R,null,H(e.schema.enum,e=>(P(),V(`option`,{key:e,value:e},L(e),9,Hq))),128))],40,Vq)):e.kind===`number`?(P(),V(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>v(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,Uq)):(P(),V(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:E(e.key),onFocus:t=>y.value=e.key,onInput:t=>v(e.key,t.target.value)},null,40,Wq))]))),128))])):N(``,!0),(P(!0),V(R,null,H(m.value.long,e=>(P(),V(`section`,{key:e.key,class:`space-y-1.5`},[B(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[l(L(T(e.key,e.schema))+` `,1),e.schema.description?(P(),U(F(vr),{key:0,class:`size-3 text-fg-subtle`})):N(``,!0)],8,Gq),e.kind===`text`?(P(),U(F(xh),{key:0,"model-value":E(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>y.value=e.key,"onUpdate:modelValue":t=>v(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(P(),U(F(xh),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>v(e.key,String(t).split(`
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(P(),V(R,{key:2},[O(F(mh),{"model-value":ee(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>S(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),x.value[e.key]?(P(),V(`span`,XW,L(x.value[e.key]),1)):N(``,!0)],64))]))),128)),B(`section`,ZW,[t[21]||=B(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),B(`div`,QW,[B(`label`,$W,[t[16]||=B(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),B(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>g(`when`,e.target.value)},null,40,eG)]),B(`label`,tG,[t[18]||=B(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),B(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>g(`on_failure`,e.target.value||void 0)},[...t[17]||=[B(`option`,{value:``},`Park the task`,-1),B(`option`,{value:`continue`},`Continue`,-1)]],40,nG)]),B(`label`,rG,[t[19]||=B(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),B(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>_({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,iG)]),B(`label`,aG,[t[20]||=B(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),O(F(Xy),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":t[10]||=e=>_({backoff:e||void 0})},null,8,[`model-value`])])])])]),B(`footer`,oG,[O(F(q),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[11]||=e=>r(`remove`)},{default:C(()=>[O(F(Xr)),t[22]||=l(` Delete step`,-1)]),_:1}),O(F(q),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[12]||=e=>r(`close`)},{default:C(()=>[...t[23]||=[l(`Done`,-1)]]),_:1})])]))}}),cG=`repository_path`;function lG(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:cG,path:n.trim(),type:`string`,required:!0}),r}function uG(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function dG(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=uG(Ww(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 fG(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:Ww(e.value,i.type??`string`)})}return n}function pG(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 mG(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...mG(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...mG(n,r)]}):[]}function hG(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function gG(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 _G(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var vG={class:`flex h-full flex-col`},yG={class:`flex items-center gap-2 border-b border-border px-4 py-3`},bG={class:`min-w-0 flex-1 truncate text-sm font-medium`},xG={key:0,class:`flex flex-1 items-center justify-center`},SG={class:`space-y-1.5`},CG=[`disabled`],wG=[`value`],TG={key:1,class:`space-y-1.5`},EG=[`value`],DG=[`title`],OG={class:`space-y-1.5`},kG={id:`bind-paths`},AG=[`value`],jG={class:`divide-y divide-border rounded-md border border-border`},MG={class:`flex items-center gap-1.5 text-xs`},NG={class:`font-mono`},PG={class:`text-fg-subtle`},FG={key:0,class:`text-danger`,title:`Required`},IG=[`title`,`aria-label`,`onClick`],LG=[`onUpdate:modelValue`,`aria-label`],RG=[`onUpdate:modelValue`,`aria-label`],zG={key:2,class:`text-xs text-danger`},BG=[`title`],VG={key:0,class:`space-y-1 px-3 py-2`},HG={key:0,class:`text-xs text-danger`},UG={key:1,class:`truncate font-mono text-xs text-success`},WG={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},GG={class:`space-y-2`},KG={key:0,role:`alert`,class:`text-xs text-danger`},qG={key:1,class:`teLine truncated
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(P(),V(R,{key:2},[O(F(xh),{"model-value":C(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>S(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),x.value[e.key]?(P(),V(`span`,Kq,L(x.value[e.key]),1)):N(``,!0)],64))]))),128)),B(`section`,qq,[t[21]||=B(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),B(`div`,Jq,[B(`label`,Yq,[t[16]||=B(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),B(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>g(`when`,e.target.value)},null,40,Xq)]),B(`label`,Zq,[t[18]||=B(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),B(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>g(`on_failure`,e.target.value||void 0)},[...t[17]||=[B(`option`,{value:``},`Park the task`,-1),B(`option`,{value:`continue`},`Continue`,-1)]],40,Qq)]),B(`label`,$q,[t[19]||=B(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),B(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>_({attempts:e.target.value===``?void 0:Number(e.target.value)})},null,40,eJ)]),B(`label`,tJ,[t[20]||=B(`span`,{class:`flex-1 text-[13px]`},`Retry backoff`,-1),O(F(ab),{"model-value":i.value.retry?.backoff??``,units:[`s`,`m`,`h`],"onUpdate:modelValue":t[10]||=e=>_({backoff:e||void 0})},null,8,[`model-value`])])])])]),B(`footer`,nJ,[O(F(q),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[11]||=e=>r(`remove`)},{default:w(()=>[O(F(Zr)),t[22]||=l(` Delete step`,-1)]),_:1}),O(F(q),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[12]||=e=>r(`close`)},{default:w(()=>[...t[23]||=[l(`Done`,-1)]]),_:1})])]))}}),iJ=`repository_path`;function aJ(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:iJ,path:n.trim(),type:`string`,required:!0}),r}function oJ(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function sJ(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=oJ($w(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 cJ(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:$w(e.value,i.type??`string`)})}return n}function lJ(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 uJ(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...uJ(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...uJ(n,r)]}):[]}function dJ(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function fJ(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 pJ(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var mJ={class:`flex h-full flex-col`},hJ={class:`flex items-center gap-2 border-b border-border px-4 py-3`},gJ={class:`min-w-0 flex-1 truncate text-sm font-medium`},_J={key:0,class:`flex flex-1 items-center justify-center`},vJ={class:`space-y-1.5`},yJ=[`disabled`],bJ=[`value`],xJ={key:1,class:`space-y-1.5`},SJ=[`value`],CJ=[`title`],wJ={class:`space-y-1.5`},TJ={id:`bind-paths`},EJ=[`value`],DJ={class:`divide-y divide-border rounded-md border border-border`},OJ={class:`flex items-center gap-1.5 text-xs`},kJ={class:`font-mono`},AJ={class:`text-fg-subtle`},jJ={key:0,class:`text-danger`,title:`Required`},MJ=[`title`,`aria-label`,`onClick`],NJ=[`onUpdate:modelValue`,`aria-label`],PJ=[`onUpdate:modelValue`,`aria-label`],FJ={key:2,class:`text-xs text-danger`},IJ=[`title`],LJ={key:0,class:`space-y-1 px-3 py-2`},RJ={key:0,class:`text-xs text-danger`},zJ={key:1,class:`truncate font-mono text-xs text-success`},BJ={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},VJ={class:`space-y-2`},HJ={key:0,role:`alert`,class:`text-xs text-danger`},UJ={key:1,class:`texLine 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 B$(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=V$(n.code,e);return Array.isArray(e)?e.some(e=>z$(n[r],e,t,n.type===`keyup`)):z$(n[r],e,t,n.type===`keyup`)}}function V$(e,t){return t.includes(e)?`code`:`key`}function H$(e,t){let n=M(()=>u(t?.target)??I$),r=ge(u(e)===!0),i=!1,a=new Set,o=c(u(e));j(()=>u(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),Pq([`blur`,`contextmenu`],s),Iq((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0,a=u(t?.preventDefault)??!1;if(i=R$(e),(!i||i&&!n)&&L$(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}),Iq((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&L$(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=u(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?B$(e,a):e}return r}var U$=`vue-flow__node-desc`,W$=`vue-flow__edge-desc`,G$=`vue-flow__aria-live`,K$=[`Enter`,` `,`Escape`],q$={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function J$(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Y$(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 X$(e){return{width:e.offsetWidth,height:e.offsetHeight}}function Z$(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function Q$(e,t){return{x:Z$(e.x,t[0][0],t[1][0]),y:Z$(e.y,t[0][1],t[1][1])}}function $$(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function e1(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function t1(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!e1(e)}function n1(e){return t1(e)&&`computedPosition`in e}function r1(e){return!Number.isNaN(e)&&Number.isFinite(e)}function i1(e){return r1(e.width)&&r1(e.height)&&r1(e.x)&&r1(e.y)}function a1(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:bt({width:0,height:0}),computedPosition:bt({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:x0(e.data)?e.data:{},events:bt(x0(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function o1(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:x0(e.data)?e.data:{},events:bt(x0(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function s1(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 c1(...e){if(e.length===3){let[t,n,r]=e;return s1(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>e1(e)&&e.source===r).map(e=>n.find(t=>t1(t)&&t.id===e.target))}function l1(...e){if(e.length===3){let[t,n,r]=e;return s1(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>e1(e)&&e.target===r).map(e=>n.find(t=>t1(t)&&t.id===e.source))}function u1({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function d1(e,t){return t.some(t=>e1(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 f1({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function p1({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?i0(s,o):s}function m1(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 h1({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function g1({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function _1(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=m1(t,h1({...r.computedPosition,...r.dimensions}))}return g1(t)}function v1(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...p1(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=!1}=t,c= 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 I2(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=L2(n.code,e);return Array.isArray(e)?e.some(e=>F2(n[r],e,t,n.type===`keyup`)):F2(n[r],e,t,n.type===`keyup`)}}function L2(e,t){return t.includes(e)?`code`:`key`}function R2(e,t){let n=M(()=>u(t?.target)??M2),r=ge(u(e)===!0),i=!1,a=new Set,o=c(u(e));j(()=>u(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),AX([`blur`,`contextmenu`],s),MX((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0,a=u(t?.preventDefault)??!1;if(i=P2(e),(!i||i&&!n)&&N2(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}),MX((...e)=>o(...e),e=>{let n=u(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&N2(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=u(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?I2(e,a):e}return r}var z2=`vue-flow__node-desc`,B2=`vue-flow__edge-desc`,V2=`vue-flow__aria-live`,H2=[`Enter`,` `,`Escape`],U2={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function W2(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function G2(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 K2(e){return{width:e.offsetWidth,height:e.offsetHeight}}function q2(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function J2(e,t){return{x:q2(e.x,t[0][0],t[1][0]),y:q2(e.y,t[0][1],t[1][1])}}function Y2(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function X2(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function Z2(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!X2(e)}function Q2(e){return Z2(e)&&`computedPosition`in e}function $2(e){return!Number.isNaN(e)&&Number.isFinite(e)}function e4(e){return $2(e.width)&&$2(e.height)&&$2(e.x)&&$2(e.y)}function t4(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:bt({width:0,height:0}),computedPosition:bt({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:_3(e.data)?e.data:{},events:bt(_3(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function n4(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:_3(e.data)?e.data:{},events:bt(_3(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function r4(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 i4(...e){if(e.length===3){let[t,n,r]=e;return r4(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>X2(e)&&e.source===r).map(e=>n.find(t=>Z2(t)&&t.id===e.target))}function a4(...e){if(e.length===3){let[t,n,r]=e;return r4(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>X2(e)&&e.target===r).map(e=>n.find(t=>Z2(t)&&t.id===e.source))}function o4({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function s4(e,t){return t.some(t=>X2(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 c4({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function l4({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?e3(s,o):s}function u4(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 d4({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function f4({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function p4(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=u4(t,d4({...r.computedPosition,...r.dimensions}))}return f4(t)}function m4(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...l4(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=!1}=t,c= 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}
@@ -149,4 +149,4 @@ 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`},Q1=class extends Error{constructor(e,...t){super(Z1[e]?.call(Z1,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function $1(e){return`clientX`in e}function e0(e){return`sourceEvent`in e}function t0(e,t){let n=$1(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 n0=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function r0(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function i0(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var a0=()=>!0;function o0(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function s0(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())Y$(i,J$(e))>0&&r.push(e);return r}var c0=250;function l0(e,t,n,r){let i=[],a=1/0,o=s0(e,n,t+c0);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}=K1(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 u0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=a0},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:_}=t0(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=d0(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===j$.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=m0(t,e,a,p,n,!0)}return b}function d0(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function f0(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function p0(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function m0(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===j$.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,...K1(o,c,c.position,!0)}:c}var h0={[O$.Left]:O$.Right,[O$.Right]:O$.Left,[O$.Top]:O$.Bottom,[O$.Bottom]:O$.Top},g0=[`production`,`prod`];function _0(e,...t){v0()&&console.warn(`[Vue Flow]: ${e}`,...t)}function v0(){return!g0.includes(`production`)}function y0(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,...X$(t)}}):null}function b0(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ht(()=>{o.blur()})):n([e])}function x0(e){return F(e)!==void 0}function S0(e,t,n,r){if(!e||!e.source||!e.target)return n(new Q1(X1.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=e1(e)?e:{...e,id:u1(e)},i=o1(i,void 0,r),!d1(i,t)&&i}function C0(e,t,n,r,i){if(!t.source||!t.target)return i(new Q1(X1.EDGE_INVALID,e.id)),!1;if(!n)return i(new Q1(X1.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?u1(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function w0(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!t1(o)){n(new Q1(X1.NODE_INVALID,o?.id));continue}let s=a1(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 Q1(X1.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 T0(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 E0(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}`;T0(`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`},J4=class extends Error{constructor(e,...t){super(q4[e]?.call(q4,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function Y4(e){return`clientX`in e}function X4(e){return`sourceEvent`in e}function Z4(e,t){let n=Y4(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 Q4=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function $4(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function e3(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var t3=()=>!0;function n3(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function r3(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())G2(i,W2(e))>0&&r.push(e);return r}var i3=250;function a3(e,t,n,r){let i=[],a=1/0,o=r3(e,n,t+i3);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}=H4(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 o3(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=t3},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:_}=Z4(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=s3(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===D2.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=u3(t,e,a,p,n,!0)}return b}function s3(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function c3(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function l3(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function u3(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===D2.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,...H4(o,c,c.position,!0)}:c}var d3={[w2.Left]:w2.Right,[w2.Right]:w2.Left,[w2.Top]:w2.Bottom,[w2.Bottom]:w2.Top},f3=[`production`,`prod`];function p3(e,...t){m3()&&console.warn(`[Vue Flow]: ${e}`,...t)}function m3(){return!f3.includes(`production`)}function h3(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,...K2(t)}}):null}function g3(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),ht(()=>{o.blur()})):n([e])}function _3(e){return F(e)!==void 0}function v3(e,t,n,r){if(!e||!e.source||!e.target)return n(new J4(K4.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=X2(e)?e:{...e,id:o4(e)},i=n4(i,void 0,r),!s4(i,t)&&i}function y3(e,t,n,r,i){if(!t.source||!t.target)return i(new J4(K4.EDGE_INVALID,e.id)),!1;if(!n)return i(new J4(K4.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?o4(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function b3(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!Z2(o)){n(new J4(K4.NODE_INVALID,o?.id));continue}let s=t4(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 J4(K4.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 x3(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 S3(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}`;x3(`source`,o,`${r}-${a}--Line truncated
+57 -5488
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -15,6 +15,7 @@
"@fontsource/ibm-plex-mono": "^5.3.0",
"@lucide/vue": "^1.48.0",
"@tailwindcss/vite": "^4.3.3",
"@tanstack/vue-table": "^9.2.8",
"@vue-flow/background": "^1.3.2",
"@vue-flow/controls": "^1.1.3",
"@vue-flow/core": "^1.48.2",
@@ -36,8 +37,7 @@
"@types/node": "^26.6.4",
"@vitejs/plugin-vue": "^6.0.8",
"@vue/tsconfig": "^0.9.1",
"shadcn-vue": "^2.8.2",
"typescript": "^7.0.2",
"typescript": "~6.0.3",
"vite": "^8.3.0",
"vue-tsc": "^3.3.11"
},
+96
View File
@@ -0,0 +1,96 @@
/* Local helpers for the vendored shadcn components. */
@theme inline {
@keyframes accordion-down {
from {
height: 0;
}
to {
height: var(
--reka-accordion-content-height,
var(--accordion-panel-height, auto)
);
}
}
@keyframes accordion-up {
from {
height: var(
--reka-accordion-content-height,
var(--accordion-panel-height, auto)
);
}
to {
height: 0;
}
}
}
/* Custom variants */
@custom-variant data-open {
&:where([data-state="open"]),
&:where([data-open]:not([data-open="false"])) {
@slot;
}
}
@custom-variant data-closed {
&:where([data-state="closed"]),
&:where([data-closed]:not([data-closed="false"])) {
@slot;
}
}
@custom-variant data-checked {
&:where([data-state="checked"]),
&:where([data-checked]:not([data-checked="false"])) {
@slot;
}
}
@custom-variant data-unchecked {
&:where([data-state="unchecked"]),
&:where([data-unchecked]:not([data-unchecked="false"])) {
@slot;
}
}
@custom-variant data-selected {
&:where([data-selected="true"]) {
@slot;
}
}
@custom-variant data-disabled {
&:where([data-disabled="true"]),
&:where([data-disabled]:not([data-disabled="false"])) {
@slot;
}
}
@custom-variant data-active {
&:where([data-state="active"]),
&:where([data-active]:not([data-active="false"])) {
@slot;
}
}
@custom-variant data-horizontal {
&:where([data-orientation="horizontal"]) {
@slot;
}
}
@custom-variant data-vertical {
&:where([data-orientation="vertical"]) {
@slot;
}
}
@utility no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
&::-webkit-scrollbar {
display: none;
}
}
+1 -1
View File
@@ -4,7 +4,7 @@
@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn-vue/tailwind.css";
@import "./shadcn.css";
/* ui/dist is committed, so nothing ignores it and Tailwind's automatic content
detection scans it. That makes every build an input to the next one: class
+81 -17
View File
@@ -1,5 +1,16 @@
<script setup lang="ts">
import { computed } from "vue";
import { ArrowDown, ArrowUp, ArrowUpDown } from "@lucide/vue";
import {
createColumnHelper,
createSortedRowModel,
rowSortingFeature,
sortFn_basic,
sortFn_text,
tableFeatures,
useTable,
} from "@tanstack/vue-table";
import { Button } from "@/components/ui/button";
import {
Table,
@@ -11,12 +22,6 @@ import {
} from "@/components/ui/table";
import TaskRow, { type Task } from "./TaskRow.vue";
/**
* The board. It renders the rows it is given and nothing else: which rows are
* visible, and which state stands in when none are, are the page's decisions.
* The `state` slot is drawn in the body's place so the columns stay announced
* while the table has no rows to show.
*/
const props = withDefaults(
defineProps<{ tasks: Task[]; showRepo?: boolean }>(),
{ showRepo: true },
@@ -24,6 +29,56 @@ const props = withDefaults(
const emit = defineEmits<{ done: [taskId: Task["id"]] }>();
const features = tableFeatures({
rowSortingFeature,
sortedRowModel: createSortedRowModel(),
sortFns: { text: sortFn_text, basic: sortFn_basic },
});
const columnHelper = createColumnHelper<typeof features, Task>();
const table = useTable({
features,
get data() {
return props.tasks;
},
getRowId: (task: Task) => String(task.id),
columns: columnHelper.columns([
columnHelper.accessor((task) => `${task.owner ?? ""}/${task.repo ?? ""}`, {
id: "repo",
header: "Repo",
sortFn: "text",
}),
columnHelper.accessor((task) => task.issue_number ?? 0, {
id: "issue",
header: "Issue",
sortFn: "basic",
}),
columnHelper.accessor((task) => task.title ?? "untitled task", {
id: "title",
header: "Title",
sortFn: "text",
}),
columnHelper.accessor((task) => task.status ?? "", {
id: "status",
header: "Status",
sortFn: "text",
}),
columnHelper.accessor((task) => task.workflow ?? "", {
id: "workflow",
header: "Workflow",
sortFn: "text",
}),
columnHelper.accessor((task) => Date.parse(task.updated_at ?? "") || 0, {
id: "activity",
header: "Last activity",
sortFn: "basic",
}),
]),
});
const headers = computed(() =>
table.getAllColumns().filter((column) => props.showRepo || column.id !== "repo"),
);
// shortcut: sorting covers loaded rows; use server sorting if all pages must be ordered.
const rows = computed(() => table.getRowModel().rows);
const columns = computed(() => (props.showRepo ? 7 : 6));
</script>
@@ -31,14 +86,23 @@ const columns = computed(() => (props.showRepo ? 7 : 6));
<Table>
<TableHeader>
<TableRow>
<TableHead v-if="props.showRepo">Repo</TableHead>
<TableHead>Issue</TableHead>
<!-- Title takes the slack: it is the only column that distinguishes one
row from another, so it should be the one that grows. -->
<TableHead class="w-full">Title</TableHead>
<TableHead>Status</TableHead>
<TableHead>Workflow</TableHead>
<TableHead>Last activity</TableHead>
<TableHead
v-for="column in headers"
:key="column.id"
:class="column.id === 'title' ? 'w-full' : undefined"
:aria-sort="
column.getIsSorted() === 'asc' ? 'ascending' :
column.getIsSorted() === 'desc' ? 'descending' : 'none'
"
>
<Button variant="ghost" size="sm" @click="column.toggleSorting()">
{{ column.columnDef.header }}
<component
:is="column.getIsSorted() === 'asc' ? ArrowUp : column.getIsSorted() === 'desc' ? ArrowDown : ArrowUpDown"
data-icon="inline-end"
/>
</Button>
</TableHead>
<TableHead>Action</TableHead>
</TableRow>
</TableHeader>
@@ -50,9 +114,9 @@ const columns = computed(() => (props.showRepo ? 7 : 6));
</TableRow>
<template v-else>
<TaskRow
v-for="task in props.tasks"
:key="task.id"
:task="task"
v-for="row in rows"
:key="row.id"
:task="row.original"
:show-repo="props.showRepo"
@done="emit('done', $event)"
/>