@truenine/memory-sync-cli 2026.10103.10509 → 2026.10106.107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,38 +1,38 @@
1
- import{createRequire as e}from"node:module";import t,{default as n}from"node:process";import*as r from"node:fs";import*as i from"node:path";import a from"node:path";import*as o from"node:os";import s from"picocolors";import{fileURLToPath as c}from"node:url";import{spawn as l}from"node:child_process";import{Buffer as u}from"node:buffer";import{createHash as d}from"node:crypto";var f=Object.create,p=Object.defineProperty,m=Object.getOwnPropertyDescriptor,h=Object.getOwnPropertyNames,g=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),y=(e,t)=>{let n={};for(var r in e)p(n,r,{get:e[r],enumerable:!0});return t&&p(n,Symbol.toStringTag,{value:`Module`}),n},b=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=h(t),a=0,o=i.length,s;a<o;a++)s=i[a],!_.call(e,s)&&s!==n&&p(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=m(t,s))||r.enumerable});return e},x=(e,t,n)=>(n=e==null?{}:f(g(e)),b(t||!e||!e.__esModule?p(n,`default`,{value:e,enumerable:!0}):n,e)),S=e(import.meta.url),C=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.splitWhen=e.flatten=void 0;function t(e){return e.reduce((e,t)=>[].concat(e,t),[])}e.flatten=t;function n(e,t){let n=[[]],r=0;for(let i of e)t(i)?(r++,n[r]=[]):n[r].push(i);return n}e.splitWhen=n})),w=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isEnoentCodeError=void 0;function t(e){return e.code===`ENOENT`}e.isEnoentCodeError=t})),T=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),E=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertPosixPathToPattern=e.convertWindowsPathToPattern=e.convertPathToPattern=e.escapePosixPath=e.escapeWindowsPath=e.escape=e.removeLeadingDotSegment=e.makeAbsolute=e.unixify=void 0;let t=S(`os`),n=S(`path`),r=t.platform()===`win32`,i=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,a=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,o=/^\\\\([.?])/,s=/\\(?![!()+@[\]{}])/g;function c(e){return e.replace(/\\/g,`/`)}e.unixify=c;function l(e,t){return n.resolve(e,t)}e.makeAbsolute=l;function u(e){if(e.charAt(0)===`.`){let t=e.charAt(1);if(t===`/`||t===`\\`)return e.slice(2)}return e}e.removeLeadingDotSegment=u,e.escape=r?d:f;function d(e){return e.replace(a,`\\$2`)}e.escapeWindowsPath=d;function f(e){return e.replace(i,`\\$2`)}e.escapePosixPath=f,e.convertPathToPattern=r?p:m;function p(e){return d(e).replace(o,`//$1`).replace(s,`/`)}e.convertWindowsPathToPattern=p;function m(e){return f(e)}e.convertPosixPathToPattern=m})),D=v(((e,t)=>{
1
+ import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./transformer-DWtwnW2T.mjs";import{createRequire as f}from"node:module";import p,{default as m}from"node:process";import*as h from"node:fs";import*as g from"node:path";import _ from"node:path";import*as v from"node:os";import y from"picocolors";import{fileURLToPath as b}from"node:url";import{spawn as x}from"node:child_process";import S from"remark-stringify";import C from"remark-mdx";import{Buffer as w}from"node:buffer";import{createHash as T}from"node:crypto";var E=Object.create,D=Object.defineProperty,O=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,A=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty,j=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),te=(e,t)=>{let n={};for(var r in e)D(n,r,{get:e[r],enumerable:!0});return t&&D(n,Symbol.toStringTag,{value:`Module`}),n},ne=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=k(t),a=0,o=i.length,s;a<o;a++)s=i[a],!ee.call(e,s)&&s!==n&&D(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=O(t,s))||r.enumerable});return e},re=(e,t,n)=>(n=e==null?{}:E(A(e)),ne(t||!e||!e.__esModule?D(n,`default`,{value:e,enumerable:!0}):n,e)),M=f(import.meta.url),ie=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.splitWhen=e.flatten=void 0;function t(e){return e.reduce((e,t)=>[].concat(e,t),[])}e.flatten=t;function n(e,t){let n=[[]],r=0;for(let i of e)t(i)?(r++,n[r]=[]):n[r].push(i);return n}e.splitWhen=n})),ae=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isEnoentCodeError=void 0;function t(e){return e.code===`ENOENT`}e.isEnoentCodeError=t})),oe=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),se=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertPosixPathToPattern=e.convertWindowsPathToPattern=e.convertPathToPattern=e.escapePosixPath=e.escapeWindowsPath=e.escape=e.removeLeadingDotSegment=e.makeAbsolute=e.unixify=void 0;let t=M(`os`),n=M(`path`),r=t.platform()===`win32`,i=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,a=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,o=/^\\\\([.?])/,s=/\\(?![!()+@[\]{}])/g;function c(e){return e.replace(/\\/g,`/`)}e.unixify=c;function l(e,t){return n.resolve(e,t)}e.makeAbsolute=l;function u(e){if(e.charAt(0)===`.`){let t=e.charAt(1);if(t===`/`||t===`\\`)return e.slice(2)}return e}e.removeLeadingDotSegment=u,e.escape=r?d:f;function d(e){return e.replace(a,`\\$2`)}e.escapeWindowsPath=d;function f(e){return e.replace(i,`\\$2`)}e.escapePosixPath=f,e.convertPathToPattern=r?p:m;function p(e){return d(e).replace(o,`//$1`).replace(s,`/`)}e.convertWindowsPathToPattern=p;function m(e){return f(e)}e.convertPosixPathToPattern=m})),ce=j(((e,t)=>{
2
2
  /*!
3
3
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
4
4
  *
5
5
  * Copyright (c) 2014-2016, Jon Schlinkert.
6
6
  * Licensed under the MIT License.
7
7
  */
8
- t.exports=function(e){if(typeof e!=`string`||e===``)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}})),O=v(((e,t)=>{
8
+ t.exports=function(e){if(typeof e!=`string`||e===``)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}})),le=j(((e,t)=>{
9
9
  /*!
10
10
  * is-glob <https://github.com/jonschlinkert/is-glob>
11
11
  *
12
12
  * Copyright (c) 2014-2017, Jon Schlinkert.
13
13
  * Released under the MIT License.
14
14
  */
15
- var n=D(),r={"{":`}`,"(":`)`,"[":`]`},i=function(e){if(e[0]===`!`)return!0;for(var t=0,n=-2,i=-2,a=-2,o=-2,s=-2;t<e.length;){if(e[t]===`*`||e[t+1]===`?`&&/[\].+)]/.test(e[t])||i!==-1&&e[t]===`[`&&e[t+1]!==`]`&&(i<t&&(i=e.indexOf(`]`,t)),i>t&&(s===-1||s>i||(s=e.indexOf(`\\`,t),s===-1||s>i)))||a!==-1&&e[t]===`{`&&e[t+1]!==`}`&&(a=e.indexOf(`}`,t),a>t&&(s=e.indexOf(`\\`,t),s===-1||s>a))||o!==-1&&e[t]===`(`&&e[t+1]===`?`&&/[:!=]/.test(e[t+2])&&e[t+3]!==`)`&&(o=e.indexOf(`)`,t),o>t&&(s=e.indexOf(`\\`,t),s===-1||s>o))||n!==-1&&e[t]===`(`&&e[t+1]!==`|`&&(n<t&&(n=e.indexOf(`|`,t)),n!==-1&&e[n+1]!==`)`&&(o=e.indexOf(`)`,n),o>n&&(s=e.indexOf(`\\`,n),s===-1||s>o))))return!0;if(e[t]===`\\`){var c=e[t+1];t+=2;var l=r[c];if(l){var u=e.indexOf(l,t);u!==-1&&(t=u+1)}if(e[t]===`!`)return!0}else t++}return!1},a=function(e){if(e[0]===`!`)return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]===`\\`){var n=e[t+1];t+=2;var i=r[n];if(i){var a=e.indexOf(i,t);a!==-1&&(t=a+1)}if(e[t]===`!`)return!0}else t++}return!1};t.exports=function(e,t){if(typeof e!=`string`||e===``)return!1;if(n(e))return!0;var r=i;return t&&t.strict===!1&&(r=a),r(e)}})),k=v(((e,t)=>{var n=O(),r=S(`path`).posix.dirname,i=S(`os`).platform()===`win32`,a=`/`,o=/\\/g,s=/[\{\[].*[\}\]]$/,c=/(^|[^\\])([\{\[]|\([^\)]+$)/,l=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&i&&e.indexOf(a)<0&&(e=e.replace(o,a)),s.test(e)&&(e+=a),e+=`a`;do e=r(e);while(n(e)||c.test(e));return e.replace(l,`$1`)}})),A=v((e=>{e.isInteger=e=>typeof e==`number`?Number.isInteger(e):typeof e==`string`&&e.trim()!==``?Number.isInteger(Number(e)):!1,e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||r.type===`open`||r.type===`close`)&&r.escaped!==!0&&(r.value=`\\`+r.value,r.escaped=!0)},e.encloseBrace=e=>e.type===`brace`?e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0):!1,e.isInvalidBrace=e=>e.type===`brace`?e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1:!1,e.isOpenOrClose=e=>e.type===`open`||e.type===`close`?!0:e.open===!0||e.close===!0,e.reduce=e=>e.reduce((e,t)=>(t.type===`text`&&e.push(t.value),t.type===`range`&&(t.type=`text`),e),[]),e.flatten=(...e)=>{let t=[],n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(Array.isArray(i)){n(i);continue}i!==void 0&&t.push(i)}return t};return n(e),t}})),ee=v(((e,t)=>{let n=A();t.exports=(e,t={})=>{let r=(e,i={})=>{let a=t.escapeInvalid&&n.isInvalidBrace(i),o=e.invalid===!0&&t.escapeInvalid===!0,s=``;if(e.value)return(a||o)&&n.isOpenOrClose(e)?`\\`+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=r(t);return s};return r(e)}})),te=v(((e,t)=>{t.exports=function(e){return typeof e==`number`?e-e===0:typeof e==`string`&&e.trim()!==``?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}})),j=v(((e,t)=>{let n=te(),r=(e,t,a)=>{if(n(e)===!1)throw TypeError(`toRegexRange: expected the first argument to be a number`);if(t===void 0||e===t)return String(e);if(n(t)===!1)throw TypeError(`toRegexRange: expected the second argument to be a number.`);let o={relaxZeros:!0,...a};typeof o.strictZeros==`boolean`&&(o.relaxZeros=o.strictZeros===!1);let c=String(o.relaxZeros),l=String(o.shorthand),u=String(o.capture),d=String(o.wrap),f=e+`:`+t+`=`+c+l+u+d;if(r.cache.hasOwnProperty(f))return r.cache[f].result;let p=Math.min(e,t),m=Math.max(e,t);if(Math.abs(p-m)===1){let n=e+`|`+t;return o.capture?`(${n})`:o.wrap===!1?n:`(?:${n})`}let h=g(e)||g(t),_={min:e,max:t,a:p,b:m},v=[],y=[];return h&&(_.isPadded=h,_.maxLen=String(_.max).length),p<0&&(y=s(m<0?Math.abs(m):1,Math.abs(p),_,o),p=_.a=0),m>=0&&(v=s(p,m,_,o)),_.negatives=y,_.positives=v,_.result=i(y,v,o),o.capture===!0?_.result=`(${_.result})`:o.wrap!==!1&&v.length+y.length>1&&(_.result=`(?:${_.result})`),r.cache[f]=_,_.result};function i(e,t,n){let r=c(e,t,`-`,!1,n)||[],i=c(t,e,``,!1,n)||[],a=c(e,t,`-?`,!0,n)||[];return r.concat(a).concat(i).join(`|`)}function a(e,t){let n=1,r=1,i=f(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=f(e,n);for(i=p(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=p(t+1,r)-1;return a=[...a],a.sort(u),a}function o(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=l(e,t),i=r.length,a=``,o=0;for(let e=0;e<i;e++){let[t,i]=r[e];t===i?a+=t:t!==`0`||i!==`9`?a+=h(t,i,n):o++}return o&&(a+=n.shorthand===!0?`\\d`:`[0-9]`),{pattern:a,count:[o],digits:i}}function s(e,t,n,r){let i=a(e,t),s=[],c=e,l;for(let e=0;e<i.length;e++){let t=i[e],a=o(String(c),String(t),r),u=``;if(!n.isPadded&&l&&l.pattern===a.pattern){l.count.length>1&&l.count.pop(),l.count.push(a.count[0]),l.string=l.pattern+m(l.count),c=t+1;continue}n.isPadded&&(u=_(t,n,r)),a.string=u+a.pattern+m(a.count),s.push(a),c=t+1,l=a}return s}function c(e,t,n,r,i){let a=[];for(let i of e){let{string:e}=i;!r&&!d(t,`string`,e)&&a.push(n+e),r&&d(t,`string`,e)&&a.push(n+e)}return a}function l(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function u(e,t){return e>t?1:t>e?-1:0}function d(e,t,n){return e.some(e=>e[t]===n)}function f(e,t){return Number(String(e).slice(0,-t)+`9`.repeat(t))}function p(e,t){return e-e%10**t}function m(e){let[t=0,n=``]=e;return n||t>1?`{${t+(n?`,`+n:``)}}`:``}function h(e,t,n){return`[${e}${t-e===1?``:`-`}${t}]`}function g(e){return/^-?(0+)\d/.test(e)}function _(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return``;case 1:return i?`0?`:`0`;case 2:return i?`0{0,2}`:`00`;default:return i?`0{0,${r}}`:`0{${r}}`}}r.cache={},r.clearCache=()=>r.cache={},t.exports=r})),ne=v(((e,t)=>{let n=S(`util`),r=j(),i=e=>typeof e==`object`&&!!e&&!Array.isArray(e),a=e=>t=>e===!0?Number(t):String(t),o=e=>typeof e==`number`||typeof e==`string`&&e!==``,s=e=>Number.isInteger(+e),c=e=>{let t=`${e}`,n=-1;if(t[0]===`-`&&(t=t.slice(1)),t===`0`)return!1;for(;t[++n]===`0`;);return n>0},l=(e,t,n)=>typeof e==`string`||typeof t==`string`?!0:n.stringify===!0,u=(e,t,n)=>{if(t>0){let n=e[0]===`-`?`-`:``;n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,`0`)}return n===!1?String(e):e},d=(e,t)=>{let n=e[0]===`-`?`-`:``;for(n&&(e=e.slice(1),t--);e.length<t;)e=`0`+e;return n?`-`+e:e},f=(e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r=t.capture?``:`?:`,i=``,a=``,o;return e.positives.length&&(i=e.positives.map(e=>d(String(e),n)).join(`|`)),e.negatives.length&&(a=`-(${r}${e.negatives.map(e=>d(String(e),n)).join(`|`)})`),o=i&&a?`${i}|${a}`:i||a,t.wrap?`(${r}${o})`:o},p=(e,t,n,i)=>{if(n)return r(e,t,{wrap:!1,...i});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},m=(e,t,n)=>{if(Array.isArray(e)){let t=n.wrap===!0,r=n.capture?``:`?:`;return t?`(${r}${e.join(`|`)})`:e.join(`|`)}return r(e,t,n)},h=(...e)=>RangeError(`Invalid range arguments: `+n.inspect(...e)),g=(e,t,n)=>{if(n.strictRanges===!0)throw h([e,t]);return[]},_=(e,t)=>{if(t.strictRanges===!0)throw TypeError(`Expected step "${e}" to be a number`);return[]},v=(e,t,n=1,r={})=>{let i=Number(e),o=Number(t);if(!Number.isInteger(i)||!Number.isInteger(o)){if(r.strictRanges===!0)throw h([e,t]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,g=String(e),_=String(t),v=String(n);n=Math.max(Math.abs(n),1);let y=c(g)||c(_)||c(v),b=y?Math.max(g.length,_.length,v.length):0,x=y===!1&&l(e,t,r)===!1,S=r.transform||a(x);if(r.toRegex&&n===1)return p(d(e,b),d(t,b),!0,r);let C={negatives:[],positives:[]},w=e=>C[e<0?`negatives`:`positives`].push(Math.abs(e)),T=[],E=0;for(;s?i>=o:i<=o;)r.toRegex===!0&&n>1?w(i):T.push(u(S(i,E),b,x)),i=s?i-n:i+n,E++;return r.toRegex===!0?n>1?f(C,r,b):m(T,null,{wrap:!1,...r}):T},y=(e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return g(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),c=a>o,l=Math.min(a,o),u=Math.max(a,o);if(r.toRegex&&n===1)return p(l,u,!1,r);let d=[],f=0;for(;c?a>=o:a<=o;)d.push(i(a,f)),a=c?a-n:a+n,f++;return r.toRegex===!0?m(d,null,{wrap:!1,options:r}):d},b=(e,t,n,r={})=>{if(t==null&&o(e))return[e];if(!o(e)||!o(t))return g(e,t,r);if(typeof n==`function`)return b(e,t,1,{transform:n});if(i(n))return b(e,t,0,n);let a={...r};return a.capture===!0&&(a.wrap=!0),n=n||a.step||1,s(n)?s(e)&&s(t)?v(e,t,n,a):y(e,t,Math.max(Math.abs(n),1),a):n!=null&&!i(n)?_(n,a):b(e,t,1,n)};t.exports=b})),re=v(((e,t)=>{let n=ne(),r=A();t.exports=(e,t={})=>{let i=(e,a={})=>{let o=r.isInvalidBrace(a),s=e.invalid===!0&&t.escapeInvalid===!0,c=o===!0||s===!0,l=t.escapeInvalid===!0?`\\`:``,u=``;if(e.isOpen===!0)return l+e.value;if(e.isClose===!0)return console.log(`node.isClose`,l,e.value),l+e.value;if(e.type===`open`)return c?l+e.value:`(`;if(e.type===`close`)return c?l+e.value:`)`;if(e.type===`comma`)return e.prev.type===`comma`?``:c?e.value:`|`;if(e.value)return e.value;if(e.nodes&&e.ranges>0){let i=r.reduce(e.nodes),a=n(...i,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(a.length!==0)return i.length>1&&a.length>1?`(${a})`:a}if(e.nodes)for(let t of e.nodes)u+=i(t,e);return u};return i(e)}})),ie=v(((e,t)=>{let n=ne(),r=ee(),i=A(),a=(e=``,t=``,n=!1)=>{let r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?i.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(a(e,t,n));else for(let e of t)n===!0&&typeof e==`string`&&(e=`{${e}}`),r.push(Array.isArray(e)?a(i,e,n):i+e);return i.flatten(r)};t.exports=(e,t={})=>{let o=t.rangeLimit===void 0?1e3:t.rangeLimit,s=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;l.type!==`brace`&&l.type!==`root`&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar){u.push(a(u.pop(),r(e,t)));return}if(e.type===`brace`&&e.invalid!==!0&&e.nodes.length===2){u.push(a(u.pop(),[`{}`]));return}if(e.nodes&&e.ranges>0){let s=i.reduce(e.nodes);if(i.exceedsLimit(...s,t.step,o))throw RangeError(`expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.`);let c=n(...s,t);c.length===0&&(c=r(e,t)),u.push(a(u.pop(),c)),e.nodes=[];return}let d=i.encloseBrace(e),f=e.queue,p=e;for(;p.type!==`brace`&&p.type!==`root`&&p.parent;)p=p.parent,f=p.queue;for(let t=0;t<e.nodes.length;t++){let n=e.nodes[t];if(n.type===`comma`&&e.type===`brace`){t===1&&f.push(``),f.push(``);continue}if(n.type===`close`){u.push(a(u.pop(),f,d));continue}if(n.value&&n.type!==`open`){f.push(a(f.pop(),n.value));continue}n.nodes&&s(n,e)}return f};return i.flatten(s(e))}})),ae=v(((e,t)=>{t.exports={MAX_LENGTH:1e4,CHAR_0:`0`,CHAR_9:`9`,CHAR_UPPERCASE_A:`A`,CHAR_LOWERCASE_A:`a`,CHAR_UPPERCASE_Z:`Z`,CHAR_LOWERCASE_Z:`z`,CHAR_LEFT_PARENTHESES:`(`,CHAR_RIGHT_PARENTHESES:`)`,CHAR_ASTERISK:`*`,CHAR_AMPERSAND:`&`,CHAR_AT:`@`,CHAR_BACKSLASH:`\\`,CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:`\r`,CHAR_CIRCUMFLEX_ACCENT:`^`,CHAR_COLON:`:`,CHAR_COMMA:`,`,CHAR_DOLLAR:`$`,CHAR_DOT:`.`,CHAR_DOUBLE_QUOTE:`"`,CHAR_EQUAL:`=`,CHAR_EXCLAMATION_MARK:`!`,CHAR_FORM_FEED:`\f`,CHAR_FORWARD_SLASH:`/`,CHAR_HASH:`#`,CHAR_HYPHEN_MINUS:`-`,CHAR_LEFT_ANGLE_BRACKET:`<`,CHAR_LEFT_CURLY_BRACE:`{`,CHAR_LEFT_SQUARE_BRACKET:`[`,CHAR_LINE_FEED:`
16
- `,CHAR_NO_BREAK_SPACE:`\xA0`,CHAR_PERCENT:`%`,CHAR_PLUS:`+`,CHAR_QUESTION_MARK:`?`,CHAR_RIGHT_ANGLE_BRACKET:`>`,CHAR_RIGHT_CURLY_BRACE:`}`,CHAR_RIGHT_SQUARE_BRACKET:`]`,CHAR_SEMICOLON:`;`,CHAR_SINGLE_QUOTE:`'`,CHAR_SPACE:` `,CHAR_TAB:` `,CHAR_UNDERSCORE:`_`,CHAR_VERTICAL_LINE:`|`,CHAR_ZERO_WIDTH_NOBREAK_SPACE:``}})),oe=v(((e,t)=>{let n=ee(),{MAX_LENGTH:r,CHAR_BACKSLASH:i,CHAR_BACKTICK:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_}=ae();t.exports=(e,t={})=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);let v=t||{},y=typeof v.maxLength==`number`?Math.min(r,v.maxLength):r;if(e.length>y)throw SyntaxError(`Input length (${e.length}), exceeds max characters (${y})`);let b={type:`root`,input:e,nodes:[]},x=[b],S=b,C=b,w=0,T=e.length,E=0,D=0,O,k=()=>e[E++],A=e=>{if(e.type===`text`&&C.type===`dot`&&(C.type=`text`),C&&C.type===`text`&&e.type===`text`){C.value+=e.value;return}return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e};for(A({type:`bos`});E<T;)if(S=x[x.length-1],O=k(),!(O===_||O===g)){if(O===i){A({type:`text`,value:(t.keepEscaping?O:``)+k()});continue}if(O===p){A({type:`text`,value:`\\`+O});continue}if(O===f){w++;let e;for(;E<T&&(e=k());){if(O+=e,e===f){w++;continue}if(e===i){O+=k();continue}if(e===p&&(w--,w===0))break}A({type:`text`,value:O});continue}if(O===c){S=A({type:`paren`,nodes:[]}),x.push(S),A({type:`text`,value:O});continue}if(O===l){if(S.type!==`paren`){A({type:`text`,value:O});continue}S=x.pop(),A({type:`text`,value:O}),S=x[x.length-1];continue}if(O===m||O===h||O===a){let e=O,n;for(t.keepQuotes!==!0&&(O=``);E<T&&(n=k());){if(n===i){O+=n+k();continue}if(n===e){t.keepQuotes===!0&&(O+=n);break}O+=n}A({type:`text`,value:O});continue}if(O===u){D++,S=A({type:`brace`,open:!0,close:!1,dollar:C.value&&C.value.slice(-1)===`$`||S.dollar===!0,depth:D,commas:0,ranges:0,nodes:[]}),x.push(S),A({type:`open`,value:O});continue}if(O===d){if(S.type!==`brace`){A({type:`text`,value:O});continue}S=x.pop(),S.close=!0,A({type:`close`,value:O}),D--,S=x[x.length-1];continue}if(O===o&&D>0){if(S.ranges>0){S.ranges=0;let e=S.nodes.shift();S.nodes=[e,{type:`text`,value:n(S)}]}A({type:`comma`,value:O}),S.commas++;continue}if(O===s&&D>0&&S.commas===0){let e=S.nodes;if(D===0||e.length===0){A({type:`text`,value:O});continue}if(C.type===`dot`){if(S.range=[],C.value+=O,C.type=`range`,S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,C.type=`text`;continue}S.ranges++,S.args=[];continue}if(C.type===`range`){e.pop();let t=e[e.length-1];t.value+=C.value+O,C=t,S.ranges--;continue}A({type:`dot`,value:O});continue}A({type:`text`,value:O})}do if(S=x.pop(),S.type!==`root`){S.nodes.forEach(e=>{e.nodes||(e.type===`open`&&(e.isOpen=!0),e.type===`close`&&(e.isClose=!0),e.nodes||(e.type=`text`),e.invalid=!0)});let e=x[x.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}while(x.length>0);return A({type:`eos`}),b}})),se=v(((e,t)=>{let n=ee(),r=re(),i=ie(),a=oe(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};o.parse=(e,t={})=>a(e,t),o.stringify=(e,t={})=>n(typeof e==`string`?o.parse(e,t):e,t),o.compile=(e,t={})=>(typeof e==`string`&&(e=o.parse(e,t)),r(e,t)),o.expand=(e,t={})=>{typeof e==`string`&&(e=o.parse(e,t));let n=i(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n},o.create=(e,t={})=>e===``||e.length<3?[e]:t.expand===!0?o.expand(e,t):o.compile(e,t),t.exports=o})),ce=v(((e,t)=>{let n=S(`util`),r=se(),i=S(`picomatch`),a=S(`picomatch/lib/utils`),o=e=>e===``||e===`./`,s=e=>{let t=e.indexOf(`{`);return t>-1&&e.indexOf(`}`,t)>-1},c=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,a=new Set,o=new Set,s=0,c=e=>{o.add(e.output),n&&n.onResult&&n.onResult(e)};for(let o=0;o<t.length;o++){let l=i(String(t[o]),{...n,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&s++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?r.add(e.output):(r.delete(e.output),a.add(e.output)))}}let l=(s===t.length?[...o]:[...a]).filter(e=>!r.has(e));if(n&&l.length===0){if(n.failglob===!0)throw Error(`No matches found for "${t.join(`, `)}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(e=>e.replace(/\\/g,``)):t}return l};c.match=c,c.matcher=(e,t)=>i(e,t),c.isMatch=(e,t,n)=>i(t,n)(e),c.any=c.isMatch,c.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=e=>{n.onResult&&n.onResult(e),i.push(e.output)},o=new Set(c(e,t,{...n,onResult:a}));for(let e of i)o.has(e)||r.add(e);return[...r]},c.contains=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>c.contains(e,t,r));if(typeof t==`string`){if(o(e)||o(t))return!1;if(e.includes(t)||e.startsWith(`./`)&&e.slice(2).includes(t))return!0}return c.isMatch(e,t,{...r,contains:!0})},c.matchKeys=(e,t,n)=>{if(!a.isObject(e))throw TypeError(`Expected the first argument to be an object`);let r=c(Object.keys(e),t,n),i={};for(let t of r)i[t]=e[t];return i},c.some=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(r.some(e=>t(e)))return!0}return!1},c.every=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(!r.every(e=>t(e)))return!1}return!0},c.all=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);return[].concat(t).every(t=>i(t,r)(e))},c.capture=(e,t,n)=>{let r=a.isWindows(n),o=i.makeRe(String(e),{...n,capture:!0}).exec(r?a.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>e===void 0?``:e)},c.makeRe=(...e)=>i.makeRe(...e),c.scan=(...e)=>i.scan(...e),c.parse=(e,t)=>{let n=[];for(let a of[].concat(e||[]))for(let e of r(String(a),t))n.push(i.parse(e,t));return n},c.braces=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return t&&t.nobrace===!0||!s(e)?[e]:r(e,t)},c.braceExpand=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return c.braces(e,{...t,expand:!0})},c.hasBraces=s,t.exports=c})),le=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isAbsolute=e.partitionAbsoluteAndRelative=e.removeDuplicateSlashes=e.matchAny=e.convertPatternsToRe=e.makeRe=e.getPatternParts=e.expandBraceExpansion=e.expandPatternsWithBraceExpansion=e.isAffectDepthOfReadingPattern=e.endsWithSlashGlobStar=e.hasGlobStar=e.getBaseDirectory=e.isPatternRelatedToParentDirectory=e.getPatternsOutsideCurrentDirectory=e.getPatternsInsideCurrentDirectory=e.getPositivePatterns=e.getNegativePatterns=e.isPositivePattern=e.isNegativePattern=e.convertToNegativePattern=e.convertToPositivePattern=e.isDynamicPattern=e.isStaticPattern=void 0;let t=S(`path`),n=k(),r=ce(),i=/[*?]|^!/,a=/\[[^[]*]/,o=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,s=/[!*+?@]\([^(]*\)/,c=/,|\.\./,l=/(?!^)\/{2,}/g;function u(e,t={}){return!d(e,t)}e.isStaticPattern=u;function d(e,t={}){return e===``?!1:!!(t.caseSensitiveMatch===!1||e.includes(`\\`)||i.test(e)||a.test(e)||o.test(e)||t.extglob!==!1&&s.test(e)||t.braceExpansion!==!1&&f(e))}e.isDynamicPattern=d;function f(e){let t=e.indexOf(`{`);if(t===-1)return!1;let n=e.indexOf(`}`,t+1);if(n===-1)return!1;let r=e.slice(t,n);return c.test(r)}function p(e){return h(e)?e.slice(1):e}e.convertToPositivePattern=p;function m(e){return`!`+e}e.convertToNegativePattern=m;function h(e){return e.startsWith(`!`)&&e[1]!==`(`}e.isNegativePattern=h;function g(e){return!h(e)}e.isPositivePattern=g;function _(e){return e.filter(h)}e.getNegativePatterns=_;function v(e){return e.filter(g)}e.getPositivePatterns=v;function y(e){return e.filter(e=>!x(e))}e.getPatternsInsideCurrentDirectory=y;function b(e){return e.filter(x)}e.getPatternsOutsideCurrentDirectory=b;function x(e){return e.startsWith(`..`)||e.startsWith(`./..`)}e.isPatternRelatedToParentDirectory=x;function C(e){return n(e,{flipBackslashes:!1})}e.getBaseDirectory=C;function w(e){return e.includes(`**`)}e.hasGlobStar=w;function T(e){return e.endsWith(`/**`)}e.endsWithSlashGlobStar=T;function E(e){let n=t.basename(e);return T(e)||u(n)}e.isAffectDepthOfReadingPattern=E;function D(e){return e.reduce((e,t)=>e.concat(O(t)),[])}e.expandPatternsWithBraceExpansion=D;function O(e){let t=r.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>e!==``)}e.expandBraceExpansion=O;function A(e,t){let{parts:n}=r.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return n.length===0&&(n=[e]),n[0].startsWith(`/`)&&(n[0]=n[0].slice(1),n.unshift(``)),n}e.getPatternParts=A;function ee(e,t){return r.makeRe(e,t)}e.makeRe=ee;function te(e,t){return e.map(e=>ee(e,t))}e.convertPatternsToRe=te;function j(e,t){return t.some(t=>t.test(e))}e.matchAny=j;function ne(e){return e.replace(l,`/`)}e.removeDuplicateSlashes=ne;function re(e){let t=[],n=[];for(let r of e)ie(r)?t.push(r):n.push(r);return[t,n]}e.partitionAbsoluteAndRelative=re;function ie(e){return t.isAbsolute(e)}e.isAbsolute=ie})),ue=v(((e,t)=>{let n=S(`stream`).PassThrough,r=Array.prototype.slice;t.exports=i;function i(){let e=[],t=r.call(arguments),i=!1,o=t[t.length-1];o&&!Array.isArray(o)&&o.pipe==null?t.pop():o={};let s=o.end!==!1,c=o.pipeError===!0;o.objectMode??=!0,o.highWaterMark??=64*1024;let l=n(o);function u(){for(let t=0,n=arguments.length;t<n;t++)e.push(a(arguments[t],o));return d(),this}function d(){if(i)return;i=!0;let t=e.shift();if(!t){process.nextTick(f);return}Array.isArray(t)||(t=[t]);let n=t.length+1;function r(){--n>0||(i=!1,d())}function a(e){function t(){e.removeListener(`merge2UnpipeEnd`,t),e.removeListener(`end`,t),c&&e.removeListener(`error`,n),r()}function n(e){l.emit(`error`,e)}if(e._readableState.endEmitted)return r();e.on(`merge2UnpipeEnd`,t),e.on(`end`,t),c&&e.on(`error`,n),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e<t.length;e++)a(t[e]);r()}function f(){i=!1,l.emit(`queueDrain`),s&&l.end()}return l.setMaxListeners(0),l.add=u,l.on(`unpipe`,function(e){e.emit(`merge2UnpipeEnd`)}),t.length&&u.apply(null,t),l}function a(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)e[n]=a(e[n],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(n(t))),!e._readableState||!e.pause||!e.pipe)throw Error(`Only readable stream can be merged.`);e.pause()}return e}})),de=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.merge=void 0;let t=ue();function n(e){let n=t(e);return e.forEach(e=>{e.once(`error`,e=>n.emit(`error`,e))}),n.once(`close`,()=>r(e)),n.once(`end`,()=>r(e)),n}e.merge=n;function r(e){e.forEach(e=>e.emit(`close`))}})),fe=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isEmpty=e.isString=void 0;function t(e){return typeof e==`string`}e.isString=t;function n(e){return e===``}e.isEmpty=n})),pe=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.string=e.stream=e.pattern=e.path=e.fs=e.errno=e.array=void 0,e.array=C(),e.errno=w(),e.fs=T(),e.path=E(),e.pattern=le(),e.stream=de(),e.string=fe()})),me=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertPatternGroupToTask=e.convertPatternGroupsToTasks=e.groupPatternsByBaseDirectory=e.getNegativePatternsAsPositive=e.getPositivePatterns=e.convertPatternsToTasks=e.generate=void 0;let t=pe();function n(e,n){let s=r(e,n),c=r(n.ignore,n),l=a(s),u=o(s,c),d=l.filter(e=>t.pattern.isStaticPattern(e,n)),f=l.filter(e=>t.pattern.isDynamicPattern(e,n)),p=i(d,u,!1),m=i(f,u,!0);return p.concat(m)}e.generate=n;function r(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes(`/`)?e:`**/${e}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function i(e,n,r){let i=[],a=t.pattern.getPatternsOutsideCurrentDirectory(e),o=t.pattern.getPatternsInsideCurrentDirectory(e),u=s(a),d=s(o);return i.push(...c(u,n,r)),`.`in d?i.push(l(`.`,o,n,r)):i.push(...c(d,n,r)),i}e.convertPatternsToTasks=i;function a(e){return t.pattern.getPositivePatterns(e)}e.getPositivePatterns=a;function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}e.getNegativePatternsAsPositive=o;function s(e){return e.reduce((e,n)=>{let r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}e.groupPatternsByBaseDirectory=s;function c(e,t,n){return Object.keys(e).map(r=>l(r,e[r],t,n))}e.convertPatternGroupsToTasks=c;function l(e,n,r,i){return{dynamic:i,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}e.convertPatternGroupToTask=l})),he=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.read=void 0;function t(e,t,i){t.fs.lstat(e,(a,o)=>{if(a!==null){n(i,a);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){r(i,o);return}t.fs.stat(e,(e,a)=>{if(e!==null){if(t.throwErrorOnBrokenSymbolicLink){n(i,e);return}r(i,o);return}t.markSymbolicLink&&(a.isSymbolicLink=()=>!0),r(i,a)})})}e.read=t;function n(e,t){e(t)}function r(e,t){e(null,t)}})),ge=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.read=void 0;function t(e,t){let n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}e.read=t})),_e=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;let t=S(`fs`);e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),ve=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=_e();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return e??t}}})),ye=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.statSync=e.stat=e.Settings=void 0;let t=he(),n=ge(),r=ve();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.stat=i;function a(e,t){let r=o(t);return n.read(e,r)}e.statSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),be=v(((e,t)=>{
15
+ var n=ce(),r={"{":`}`,"(":`)`,"[":`]`},i=function(e){if(e[0]===`!`)return!0;for(var t=0,n=-2,i=-2,a=-2,o=-2,s=-2;t<e.length;){if(e[t]===`*`||e[t+1]===`?`&&/[\].+)]/.test(e[t])||i!==-1&&e[t]===`[`&&e[t+1]!==`]`&&(i<t&&(i=e.indexOf(`]`,t)),i>t&&(s===-1||s>i||(s=e.indexOf(`\\`,t),s===-1||s>i)))||a!==-1&&e[t]===`{`&&e[t+1]!==`}`&&(a=e.indexOf(`}`,t),a>t&&(s=e.indexOf(`\\`,t),s===-1||s>a))||o!==-1&&e[t]===`(`&&e[t+1]===`?`&&/[:!=]/.test(e[t+2])&&e[t+3]!==`)`&&(o=e.indexOf(`)`,t),o>t&&(s=e.indexOf(`\\`,t),s===-1||s>o))||n!==-1&&e[t]===`(`&&e[t+1]!==`|`&&(n<t&&(n=e.indexOf(`|`,t)),n!==-1&&e[n+1]!==`)`&&(o=e.indexOf(`)`,n),o>n&&(s=e.indexOf(`\\`,n),s===-1||s>o))))return!0;if(e[t]===`\\`){var c=e[t+1];t+=2;var l=r[c];if(l){var u=e.indexOf(l,t);u!==-1&&(t=u+1)}if(e[t]===`!`)return!0}else t++}return!1},a=function(e){if(e[0]===`!`)return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]===`\\`){var n=e[t+1];t+=2;var i=r[n];if(i){var a=e.indexOf(i,t);a!==-1&&(t=a+1)}if(e[t]===`!`)return!0}else t++}return!1};t.exports=function(e,t){if(typeof e!=`string`||e===``)return!1;if(n(e))return!0;var r=i;return t&&t.strict===!1&&(r=a),r(e)}})),ue=j(((e,t)=>{var n=le(),r=M(`path`).posix.dirname,i=M(`os`).platform()===`win32`,a=`/`,o=/\\/g,s=/[\{\[].*[\}\]]$/,c=/(^|[^\\])([\{\[]|\([^\)]+$)/,l=/\\([\!\*\?\|\[\]\(\)\{\}])/g;t.exports=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&i&&e.indexOf(a)<0&&(e=e.replace(o,a)),s.test(e)&&(e+=a),e+=`a`;do e=r(e);while(n(e)||c.test(e));return e.replace(l,`$1`)}})),de=j((e=>{e.isInteger=e=>typeof e==`number`?Number.isInteger(e):typeof e==`string`&&e.trim()!==``?Number.isInteger(Number(e)):!1,e.find=(e,t)=>e.nodes.find(e=>e.type===t),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(e,t=0,n)=>{let r=e.nodes[t];r&&(n&&r.type===n||r.type===`open`||r.type===`close`)&&r.escaped!==!0&&(r.value=`\\`+r.value,r.escaped=!0)},e.encloseBrace=e=>e.type===`brace`?e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0):!1,e.isInvalidBrace=e=>e.type===`brace`?e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1:!1,e.isOpenOrClose=e=>e.type===`open`||e.type===`close`?!0:e.open===!0||e.close===!0,e.reduce=e=>e.reduce((e,t)=>(t.type===`text`&&e.push(t.value),t.type===`range`&&(t.type=`text`),e),[]),e.flatten=(...e)=>{let t=[],n=e=>{for(let r=0;r<e.length;r++){let i=e[r];if(Array.isArray(i)){n(i);continue}i!==void 0&&t.push(i)}return t};return n(e),t}})),fe=j(((e,t)=>{let n=de();t.exports=(e,t={})=>{let r=(e,i={})=>{let a=t.escapeInvalid&&n.isInvalidBrace(i),o=e.invalid===!0&&t.escapeInvalid===!0,s=``;if(e.value)return(a||o)&&n.isOpenOrClose(e)?`\\`+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(let t of e.nodes)s+=r(t);return s};return r(e)}})),pe=j(((e,t)=>{t.exports=function(e){return typeof e==`number`?e-e===0:typeof e==`string`&&e.trim()!==``?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}})),me=j(((e,t)=>{let n=pe(),r=(e,t,a)=>{if(n(e)===!1)throw TypeError(`toRegexRange: expected the first argument to be a number`);if(t===void 0||e===t)return String(e);if(n(t)===!1)throw TypeError(`toRegexRange: expected the second argument to be a number.`);let o={relaxZeros:!0,...a};typeof o.strictZeros==`boolean`&&(o.relaxZeros=o.strictZeros===!1);let c=String(o.relaxZeros),l=String(o.shorthand),u=String(o.capture),d=String(o.wrap),f=e+`:`+t+`=`+c+l+u+d;if(r.cache.hasOwnProperty(f))return r.cache[f].result;let p=Math.min(e,t),m=Math.max(e,t);if(Math.abs(p-m)===1){let n=e+`|`+t;return o.capture?`(${n})`:o.wrap===!1?n:`(?:${n})`}let h=g(e)||g(t),_={min:e,max:t,a:p,b:m},v=[],y=[];return h&&(_.isPadded=h,_.maxLen=String(_.max).length),p<0&&(y=s(m<0?Math.abs(m):1,Math.abs(p),_,o),p=_.a=0),m>=0&&(v=s(p,m,_,o)),_.negatives=y,_.positives=v,_.result=i(y,v,o),o.capture===!0?_.result=`(${_.result})`:o.wrap!==!1&&v.length+y.length>1&&(_.result=`(?:${_.result})`),r.cache[f]=_,_.result};function i(e,t,n){let r=c(e,t,`-`,!1,n)||[],i=c(t,e,``,!1,n)||[],a=c(e,t,`-?`,!0,n)||[];return r.concat(a).concat(i).join(`|`)}function a(e,t){let n=1,r=1,i=f(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=f(e,n);for(i=p(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=p(t+1,r)-1;return a=[...a],a.sort(u),a}function o(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=l(e,t),i=r.length,a=``,o=0;for(let e=0;e<i;e++){let[t,i]=r[e];t===i?a+=t:t!==`0`||i!==`9`?a+=h(t,i,n):o++}return o&&(a+=n.shorthand===!0?`\\d`:`[0-9]`),{pattern:a,count:[o],digits:i}}function s(e,t,n,r){let i=a(e,t),s=[],c=e,l;for(let e=0;e<i.length;e++){let t=i[e],a=o(String(c),String(t),r),u=``;if(!n.isPadded&&l&&l.pattern===a.pattern){l.count.length>1&&l.count.pop(),l.count.push(a.count[0]),l.string=l.pattern+m(l.count),c=t+1;continue}n.isPadded&&(u=_(t,n,r)),a.string=u+a.pattern+m(a.count),s.push(a),c=t+1,l=a}return s}function c(e,t,n,r,i){let a=[];for(let i of e){let{string:e}=i;!r&&!d(t,`string`,e)&&a.push(n+e),r&&d(t,`string`,e)&&a.push(n+e)}return a}function l(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function u(e,t){return e>t?1:t>e?-1:0}function d(e,t,n){return e.some(e=>e[t]===n)}function f(e,t){return Number(String(e).slice(0,-t)+`9`.repeat(t))}function p(e,t){return e-e%10**t}function m(e){let[t=0,n=``]=e;return n||t>1?`{${t+(n?`,`+n:``)}}`:``}function h(e,t,n){return`[${e}${t-e===1?``:`-`}${t}]`}function g(e){return/^-?(0+)\d/.test(e)}function _(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return``;case 1:return i?`0?`:`0`;case 2:return i?`0{0,2}`:`00`;default:return i?`0{0,${r}}`:`0{${r}}`}}r.cache={},r.clearCache=()=>r.cache={},t.exports=r})),he=j(((e,t)=>{let n=M(`util`),r=me(),i=e=>typeof e==`object`&&!!e&&!Array.isArray(e),a=e=>t=>e===!0?Number(t):String(t),o=e=>typeof e==`number`||typeof e==`string`&&e!==``,s=e=>Number.isInteger(+e),c=e=>{let t=`${e}`,n=-1;if(t[0]===`-`&&(t=t.slice(1)),t===`0`)return!1;for(;t[++n]===`0`;);return n>0},l=(e,t,n)=>typeof e==`string`||typeof t==`string`?!0:n.stringify===!0,u=(e,t,n)=>{if(t>0){let n=e[0]===`-`?`-`:``;n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,`0`)}return n===!1?String(e):e},d=(e,t)=>{let n=e[0]===`-`?`-`:``;for(n&&(e=e.slice(1),t--);e.length<t;)e=`0`+e;return n?`-`+e:e},f=(e,t,n)=>{e.negatives.sort((e,t)=>e<t?-1:e>t?1:0),e.positives.sort((e,t)=>e<t?-1:e>t?1:0);let r=t.capture?``:`?:`,i=``,a=``,o;return e.positives.length&&(i=e.positives.map(e=>d(String(e),n)).join(`|`)),e.negatives.length&&(a=`-(${r}${e.negatives.map(e=>d(String(e),n)).join(`|`)})`),o=i&&a?`${i}|${a}`:i||a,t.wrap?`(${r}${o})`:o},p=(e,t,n,i)=>{if(n)return r(e,t,{wrap:!1,...i});let a=String.fromCharCode(e);return e===t?a:`[${a}-${String.fromCharCode(t)}]`},m=(e,t,n)=>{if(Array.isArray(e)){let t=n.wrap===!0,r=n.capture?``:`?:`;return t?`(${r}${e.join(`|`)})`:e.join(`|`)}return r(e,t,n)},h=(...e)=>RangeError(`Invalid range arguments: `+n.inspect(...e)),g=(e,t,n)=>{if(n.strictRanges===!0)throw h([e,t]);return[]},_=(e,t)=>{if(t.strictRanges===!0)throw TypeError(`Expected step "${e}" to be a number`);return[]},v=(e,t,n=1,r={})=>{let i=Number(e),o=Number(t);if(!Number.isInteger(i)||!Number.isInteger(o)){if(r.strictRanges===!0)throw h([e,t]);return[]}i===0&&(i=0),o===0&&(o=0);let s=i>o,g=String(e),_=String(t),v=String(n);n=Math.max(Math.abs(n),1);let y=c(g)||c(_)||c(v),b=y?Math.max(g.length,_.length,v.length):0,x=y===!1&&l(e,t,r)===!1,S=r.transform||a(x);if(r.toRegex&&n===1)return p(d(e,b),d(t,b),!0,r);let C={negatives:[],positives:[]},w=e=>C[e<0?`negatives`:`positives`].push(Math.abs(e)),T=[],E=0;for(;s?i>=o:i<=o;)r.toRegex===!0&&n>1?w(i):T.push(u(S(i,E),b,x)),i=s?i-n:i+n,E++;return r.toRegex===!0?n>1?f(C,r,b):m(T,null,{wrap:!1,...r}):T},y=(e,t,n=1,r={})=>{if(!s(e)&&e.length>1||!s(t)&&t.length>1)return g(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),c=a>o,l=Math.min(a,o),u=Math.max(a,o);if(r.toRegex&&n===1)return p(l,u,!1,r);let d=[],f=0;for(;c?a>=o:a<=o;)d.push(i(a,f)),a=c?a-n:a+n,f++;return r.toRegex===!0?m(d,null,{wrap:!1,options:r}):d},b=(e,t,n,r={})=>{if(t==null&&o(e))return[e];if(!o(e)||!o(t))return g(e,t,r);if(typeof n==`function`)return b(e,t,1,{transform:n});if(i(n))return b(e,t,0,n);let a={...r};return a.capture===!0&&(a.wrap=!0),n=n||a.step||1,s(n)?s(e)&&s(t)?v(e,t,n,a):y(e,t,Math.max(Math.abs(n),1),a):n!=null&&!i(n)?_(n,a):b(e,t,1,n)};t.exports=b})),ge=j(((e,t)=>{let n=he(),r=de();t.exports=(e,t={})=>{let i=(e,a={})=>{let o=r.isInvalidBrace(a),s=e.invalid===!0&&t.escapeInvalid===!0,c=o===!0||s===!0,l=t.escapeInvalid===!0?`\\`:``,u=``;if(e.isOpen===!0)return l+e.value;if(e.isClose===!0)return console.log(`node.isClose`,l,e.value),l+e.value;if(e.type===`open`)return c?l+e.value:`(`;if(e.type===`close`)return c?l+e.value:`)`;if(e.type===`comma`)return e.prev.type===`comma`?``:c?e.value:`|`;if(e.value)return e.value;if(e.nodes&&e.ranges>0){let i=r.reduce(e.nodes),a=n(...i,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(a.length!==0)return i.length>1&&a.length>1?`(${a})`:a}if(e.nodes)for(let t of e.nodes)u+=i(t,e);return u};return i(e)}})),_e=j(((e,t)=>{let n=he(),r=fe(),i=de(),a=(e=``,t=``,n=!1)=>{let r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?i.flatten(t).map(e=>`{${e}}`):t;for(let i of e)if(Array.isArray(i))for(let e of i)r.push(a(e,t,n));else for(let e of t)n===!0&&typeof e==`string`&&(e=`{${e}}`),r.push(Array.isArray(e)?a(i,e,n):i+e);return i.flatten(r)};t.exports=(e,t={})=>{let o=t.rangeLimit===void 0?1e3:t.rangeLimit,s=(e,c={})=>{e.queue=[];let l=c,u=c.queue;for(;l.type!==`brace`&&l.type!==`root`&&l.parent;)l=l.parent,u=l.queue;if(e.invalid||e.dollar){u.push(a(u.pop(),r(e,t)));return}if(e.type===`brace`&&e.invalid!==!0&&e.nodes.length===2){u.push(a(u.pop(),[`{}`]));return}if(e.nodes&&e.ranges>0){let s=i.reduce(e.nodes);if(i.exceedsLimit(...s,t.step,o))throw RangeError(`expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.`);let c=n(...s,t);c.length===0&&(c=r(e,t)),u.push(a(u.pop(),c)),e.nodes=[];return}let d=i.encloseBrace(e),f=e.queue,p=e;for(;p.type!==`brace`&&p.type!==`root`&&p.parent;)p=p.parent,f=p.queue;for(let t=0;t<e.nodes.length;t++){let n=e.nodes[t];if(n.type===`comma`&&e.type===`brace`){t===1&&f.push(``),f.push(``);continue}if(n.type===`close`){u.push(a(u.pop(),f,d));continue}if(n.value&&n.type!==`open`){f.push(a(f.pop(),n.value));continue}n.nodes&&s(n,e)}return f};return i.flatten(s(e))}})),ve=j(((e,t)=>{t.exports={MAX_LENGTH:1e4,CHAR_0:`0`,CHAR_9:`9`,CHAR_UPPERCASE_A:`A`,CHAR_LOWERCASE_A:`a`,CHAR_UPPERCASE_Z:`Z`,CHAR_LOWERCASE_Z:`z`,CHAR_LEFT_PARENTHESES:`(`,CHAR_RIGHT_PARENTHESES:`)`,CHAR_ASTERISK:`*`,CHAR_AMPERSAND:`&`,CHAR_AT:`@`,CHAR_BACKSLASH:`\\`,CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:`\r`,CHAR_CIRCUMFLEX_ACCENT:`^`,CHAR_COLON:`:`,CHAR_COMMA:`,`,CHAR_DOLLAR:`$`,CHAR_DOT:`.`,CHAR_DOUBLE_QUOTE:`"`,CHAR_EQUAL:`=`,CHAR_EXCLAMATION_MARK:`!`,CHAR_FORM_FEED:`\f`,CHAR_FORWARD_SLASH:`/`,CHAR_HASH:`#`,CHAR_HYPHEN_MINUS:`-`,CHAR_LEFT_ANGLE_BRACKET:`<`,CHAR_LEFT_CURLY_BRACE:`{`,CHAR_LEFT_SQUARE_BRACKET:`[`,CHAR_LINE_FEED:`
16
+ `,CHAR_NO_BREAK_SPACE:`\xA0`,CHAR_PERCENT:`%`,CHAR_PLUS:`+`,CHAR_QUESTION_MARK:`?`,CHAR_RIGHT_ANGLE_BRACKET:`>`,CHAR_RIGHT_CURLY_BRACE:`}`,CHAR_RIGHT_SQUARE_BRACKET:`]`,CHAR_SEMICOLON:`;`,CHAR_SINGLE_QUOTE:`'`,CHAR_SPACE:` `,CHAR_TAB:` `,CHAR_UNDERSCORE:`_`,CHAR_VERTICAL_LINE:`|`,CHAR_ZERO_WIDTH_NOBREAK_SPACE:``}})),ye=j(((e,t)=>{let n=fe(),{MAX_LENGTH:r,CHAR_BACKSLASH:i,CHAR_BACKTICK:a,CHAR_COMMA:o,CHAR_DOT:s,CHAR_LEFT_PARENTHESES:c,CHAR_RIGHT_PARENTHESES:l,CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:d,CHAR_LEFT_SQUARE_BRACKET:f,CHAR_RIGHT_SQUARE_BRACKET:p,CHAR_DOUBLE_QUOTE:m,CHAR_SINGLE_QUOTE:h,CHAR_NO_BREAK_SPACE:g,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_}=ve();t.exports=(e,t={})=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);let v=t||{},y=typeof v.maxLength==`number`?Math.min(r,v.maxLength):r;if(e.length>y)throw SyntaxError(`Input length (${e.length}), exceeds max characters (${y})`);let b={type:`root`,input:e,nodes:[]},x=[b],S=b,C=b,w=0,T=e.length,E=0,D=0,O,k=()=>e[E++],A=e=>{if(e.type===`text`&&C.type===`dot`&&(C.type=`text`),C&&C.type===`text`&&e.type===`text`){C.value+=e.value;return}return S.nodes.push(e),e.parent=S,e.prev=C,C=e,e};for(A({type:`bos`});E<T;)if(S=x[x.length-1],O=k(),!(O===_||O===g)){if(O===i){A({type:`text`,value:(t.keepEscaping?O:``)+k()});continue}if(O===p){A({type:`text`,value:`\\`+O});continue}if(O===f){w++;let e;for(;E<T&&(e=k());){if(O+=e,e===f){w++;continue}if(e===i){O+=k();continue}if(e===p&&(w--,w===0))break}A({type:`text`,value:O});continue}if(O===c){S=A({type:`paren`,nodes:[]}),x.push(S),A({type:`text`,value:O});continue}if(O===l){if(S.type!==`paren`){A({type:`text`,value:O});continue}S=x.pop(),A({type:`text`,value:O}),S=x[x.length-1];continue}if(O===m||O===h||O===a){let e=O,n;for(t.keepQuotes!==!0&&(O=``);E<T&&(n=k());){if(n===i){O+=n+k();continue}if(n===e){t.keepQuotes===!0&&(O+=n);break}O+=n}A({type:`text`,value:O});continue}if(O===u){D++,S=A({type:`brace`,open:!0,close:!1,dollar:C.value&&C.value.slice(-1)===`$`||S.dollar===!0,depth:D,commas:0,ranges:0,nodes:[]}),x.push(S),A({type:`open`,value:O});continue}if(O===d){if(S.type!==`brace`){A({type:`text`,value:O});continue}S=x.pop(),S.close=!0,A({type:`close`,value:O}),D--,S=x[x.length-1];continue}if(O===o&&D>0){if(S.ranges>0){S.ranges=0;let e=S.nodes.shift();S.nodes=[e,{type:`text`,value:n(S)}]}A({type:`comma`,value:O}),S.commas++;continue}if(O===s&&D>0&&S.commas===0){let e=S.nodes;if(D===0||e.length===0){A({type:`text`,value:O});continue}if(C.type===`dot`){if(S.range=[],C.value+=O,C.type=`range`,S.nodes.length!==3&&S.nodes.length!==5){S.invalid=!0,S.ranges=0,C.type=`text`;continue}S.ranges++,S.args=[];continue}if(C.type===`range`){e.pop();let t=e[e.length-1];t.value+=C.value+O,C=t,S.ranges--;continue}A({type:`dot`,value:O});continue}A({type:`text`,value:O})}do if(S=x.pop(),S.type!==`root`){S.nodes.forEach(e=>{e.nodes||(e.type===`open`&&(e.isOpen=!0),e.type===`close`&&(e.isClose=!0),e.nodes||(e.type=`text`),e.invalid=!0)});let e=x[x.length-1],t=e.nodes.indexOf(S);e.nodes.splice(t,1,...S.nodes)}while(x.length>0);return A({type:`eos`}),b}})),be=j(((e,t)=>{let n=fe(),r=ge(),i=_e(),a=ye(),o=(e,t={})=>{let n=[];if(Array.isArray(e))for(let r of e){let e=o.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(o.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};o.parse=(e,t={})=>a(e,t),o.stringify=(e,t={})=>n(typeof e==`string`?o.parse(e,t):e,t),o.compile=(e,t={})=>(typeof e==`string`&&(e=o.parse(e,t)),r(e,t)),o.expand=(e,t={})=>{typeof e==`string`&&(e=o.parse(e,t));let n=i(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n},o.create=(e,t={})=>e===``||e.length<3?[e]:t.expand===!0?o.expand(e,t):o.compile(e,t),t.exports=o})),xe=j(((e,t)=>{let n=M(`util`),r=be(),i=M(`picomatch`),a=M(`picomatch/lib/utils`),o=e=>e===``||e===`./`,s=e=>{let t=e.indexOf(`{`);return t>-1&&e.indexOf(`}`,t)>-1},c=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,a=new Set,o=new Set,s=0,c=e=>{o.add(e.output),n&&n.onResult&&n.onResult(e)};for(let o=0;o<t.length;o++){let l=i(String(t[o]),{...n,onResult:c},!0),u=l.state.negated||l.state.negatedExtglob;u&&s++;for(let t of e){let e=l(t,!0);(u?!e.isMatch:e.isMatch)&&(u?r.add(e.output):(r.delete(e.output),a.add(e.output)))}}let l=(s===t.length?[...o]:[...a]).filter(e=>!r.has(e));if(n&&l.length===0){if(n.failglob===!0)throw Error(`No matches found for "${t.join(`, `)}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(e=>e.replace(/\\/g,``)):t}return l};c.match=c,c.matcher=(e,t)=>i(e,t),c.isMatch=(e,t,n)=>i(t,n)(e),c.any=c.isMatch,c.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=e=>{n.onResult&&n.onResult(e),i.push(e.output)},o=new Set(c(e,t,{...n,onResult:a}));for(let e of i)o.has(e)||r.add(e);return[...r]},c.contains=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);if(Array.isArray(t))return t.some(t=>c.contains(e,t,r));if(typeof t==`string`){if(o(e)||o(t))return!1;if(e.includes(t)||e.startsWith(`./`)&&e.slice(2).includes(t))return!0}return c.isMatch(e,t,{...r,contains:!0})},c.matchKeys=(e,t,n)=>{if(!a.isObject(e))throw TypeError(`Expected the first argument to be an object`);let r=c(Object.keys(e),t,n),i={};for(let t of r)i[t]=e[t];return i},c.some=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(r.some(e=>t(e)))return!0}return!1},c.every=(e,t,n)=>{let r=[].concat(e);for(let e of[].concat(t)){let t=i(String(e),n);if(!r.every(e=>t(e)))return!1}return!0},c.all=(e,t,r)=>{if(typeof e!=`string`)throw TypeError(`Expected a string: "${n.inspect(e)}"`);return[].concat(t).every(t=>i(t,r)(e))},c.capture=(e,t,n)=>{let r=a.isWindows(n),o=i.makeRe(String(e),{...n,capture:!0}).exec(r?a.toPosixSlashes(t):t);if(o)return o.slice(1).map(e=>e===void 0?``:e)},c.makeRe=(...e)=>i.makeRe(...e),c.scan=(...e)=>i.scan(...e),c.parse=(e,t)=>{let n=[];for(let a of[].concat(e||[]))for(let e of r(String(a),t))n.push(i.parse(e,t));return n},c.braces=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return t&&t.nobrace===!0||!s(e)?[e]:r(e,t)},c.braceExpand=(e,t)=>{if(typeof e!=`string`)throw TypeError(`Expected a string`);return c.braces(e,{...t,expand:!0})},c.hasBraces=s,t.exports=c})),Se=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isAbsolute=e.partitionAbsoluteAndRelative=e.removeDuplicateSlashes=e.matchAny=e.convertPatternsToRe=e.makeRe=e.getPatternParts=e.expandBraceExpansion=e.expandPatternsWithBraceExpansion=e.isAffectDepthOfReadingPattern=e.endsWithSlashGlobStar=e.hasGlobStar=e.getBaseDirectory=e.isPatternRelatedToParentDirectory=e.getPatternsOutsideCurrentDirectory=e.getPatternsInsideCurrentDirectory=e.getPositivePatterns=e.getNegativePatterns=e.isPositivePattern=e.isNegativePattern=e.convertToNegativePattern=e.convertToPositivePattern=e.isDynamicPattern=e.isStaticPattern=void 0;let t=M(`path`),n=ue(),r=xe(),i=/[*?]|^!/,a=/\[[^[]*]/,o=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,s=/[!*+?@]\([^(]*\)/,c=/,|\.\./,l=/(?!^)\/{2,}/g;function u(e,t={}){return!d(e,t)}e.isStaticPattern=u;function d(e,t={}){return e===``?!1:!!(t.caseSensitiveMatch===!1||e.includes(`\\`)||i.test(e)||a.test(e)||o.test(e)||t.extglob!==!1&&s.test(e)||t.braceExpansion!==!1&&f(e))}e.isDynamicPattern=d;function f(e){let t=e.indexOf(`{`);if(t===-1)return!1;let n=e.indexOf(`}`,t+1);if(n===-1)return!1;let r=e.slice(t,n);return c.test(r)}function p(e){return h(e)?e.slice(1):e}e.convertToPositivePattern=p;function m(e){return`!`+e}e.convertToNegativePattern=m;function h(e){return e.startsWith(`!`)&&e[1]!==`(`}e.isNegativePattern=h;function g(e){return!h(e)}e.isPositivePattern=g;function _(e){return e.filter(h)}e.getNegativePatterns=_;function v(e){return e.filter(g)}e.getPositivePatterns=v;function y(e){return e.filter(e=>!x(e))}e.getPatternsInsideCurrentDirectory=y;function b(e){return e.filter(x)}e.getPatternsOutsideCurrentDirectory=b;function x(e){return e.startsWith(`..`)||e.startsWith(`./..`)}e.isPatternRelatedToParentDirectory=x;function S(e){return n(e,{flipBackslashes:!1})}e.getBaseDirectory=S;function C(e){return e.includes(`**`)}e.hasGlobStar=C;function w(e){return e.endsWith(`/**`)}e.endsWithSlashGlobStar=w;function T(e){let n=t.basename(e);return w(e)||u(n)}e.isAffectDepthOfReadingPattern=T;function E(e){return e.reduce((e,t)=>e.concat(D(t)),[])}e.expandPatternsWithBraceExpansion=E;function D(e){let t=r.braces(e,{expand:!0,nodupes:!0,keepEscaping:!0});return t.sort((e,t)=>e.length-t.length),t.filter(e=>e!==``)}e.expandBraceExpansion=D;function O(e,t){let{parts:n}=r.scan(e,Object.assign(Object.assign({},t),{parts:!0}));return n.length===0&&(n=[e]),n[0].startsWith(`/`)&&(n[0]=n[0].slice(1),n.unshift(``)),n}e.getPatternParts=O;function k(e,t){return r.makeRe(e,t)}e.makeRe=k;function A(e,t){return e.map(e=>k(e,t))}e.convertPatternsToRe=A;function ee(e,t){return t.some(t=>t.test(e))}e.matchAny=ee;function j(e){return e.replace(l,`/`)}e.removeDuplicateSlashes=j;function te(e){let t=[],n=[];for(let r of e)ne(r)?t.push(r):n.push(r);return[t,n]}e.partitionAbsoluteAndRelative=te;function ne(e){return t.isAbsolute(e)}e.isAbsolute=ne})),Ce=j(((e,t)=>{let n=M(`stream`).PassThrough,r=Array.prototype.slice;t.exports=i;function i(){let e=[],t=r.call(arguments),i=!1,o=t[t.length-1];o&&!Array.isArray(o)&&o.pipe==null?t.pop():o={};let s=o.end!==!1,c=o.pipeError===!0;o.objectMode??=!0,o.highWaterMark??=64*1024;let l=n(o);function u(){for(let t=0,n=arguments.length;t<n;t++)e.push(a(arguments[t],o));return d(),this}function d(){if(i)return;i=!0;let t=e.shift();if(!t){process.nextTick(f);return}Array.isArray(t)||(t=[t]);let n=t.length+1;function r(){--n>0||(i=!1,d())}function a(e){function t(){e.removeListener(`merge2UnpipeEnd`,t),e.removeListener(`end`,t),c&&e.removeListener(`error`,n),r()}function n(e){l.emit(`error`,e)}if(e._readableState.endEmitted)return r();e.on(`merge2UnpipeEnd`,t),e.on(`end`,t),c&&e.on(`error`,n),e.pipe(l,{end:!1}),e.resume()}for(let e=0;e<t.length;e++)a(t[e]);r()}function f(){i=!1,l.emit(`queueDrain`),s&&l.end()}return l.setMaxListeners(0),l.add=u,l.on(`unpipe`,function(e){e.emit(`merge2UnpipeEnd`)}),t.length&&u.apply(null,t),l}function a(e,t){if(Array.isArray(e))for(let n=0,r=e.length;n<r;n++)e[n]=a(e[n],t);else{if(!e._readableState&&e.pipe&&(e=e.pipe(n(t))),!e._readableState||!e.pause||!e.pipe)throw Error(`Only readable stream can be merged.`);e.pause()}return e}})),we=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.merge=void 0;let t=Ce();function n(e){let n=t(e);return e.forEach(e=>{e.once(`error`,e=>n.emit(`error`,e))}),n.once(`close`,()=>r(e)),n.once(`end`,()=>r(e)),n}e.merge=n;function r(e){e.forEach(e=>e.emit(`close`))}})),Te=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isEmpty=e.isString=void 0;function t(e){return typeof e==`string`}e.isString=t;function n(e){return e===``}e.isEmpty=n})),Ee=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.string=e.stream=e.pattern=e.path=e.fs=e.errno=e.array=void 0,e.array=ie(),e.errno=ae(),e.fs=oe(),e.path=se(),e.pattern=Se(),e.stream=we(),e.string=Te()})),De=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.convertPatternGroupToTask=e.convertPatternGroupsToTasks=e.groupPatternsByBaseDirectory=e.getNegativePatternsAsPositive=e.getPositivePatterns=e.convertPatternsToTasks=e.generate=void 0;let t=Ee();function n(e,n){let s=r(e,n),c=r(n.ignore,n),l=a(s),u=o(s,c),d=l.filter(e=>t.pattern.isStaticPattern(e,n)),f=l.filter(e=>t.pattern.isDynamicPattern(e,n)),p=i(d,u,!1),m=i(f,u,!0);return p.concat(m)}e.generate=n;function r(e,n){let r=e;return n.braceExpansion&&(r=t.pattern.expandPatternsWithBraceExpansion(r)),n.baseNameMatch&&(r=r.map(e=>e.includes(`/`)?e:`**/${e}`)),r.map(e=>t.pattern.removeDuplicateSlashes(e))}function i(e,n,r){let i=[],a=t.pattern.getPatternsOutsideCurrentDirectory(e),o=t.pattern.getPatternsInsideCurrentDirectory(e),u=s(a),d=s(o);return i.push(...c(u,n,r)),`.`in d?i.push(l(`.`,o,n,r)):i.push(...c(d,n,r)),i}e.convertPatternsToTasks=i;function a(e){return t.pattern.getPositivePatterns(e)}e.getPositivePatterns=a;function o(e,n){return t.pattern.getNegativePatterns(e).concat(n).map(t.pattern.convertToPositivePattern)}e.getNegativePatternsAsPositive=o;function s(e){return e.reduce((e,n)=>{let r=t.pattern.getBaseDirectory(n);return r in e?e[r].push(n):e[r]=[n],e},{})}e.groupPatternsByBaseDirectory=s;function c(e,t,n){return Object.keys(e).map(r=>l(r,e[r],t,n))}e.convertPatternGroupsToTasks=c;function l(e,n,r,i){return{dynamic:i,positive:n,negative:r,base:e,patterns:[].concat(n,r.map(t.pattern.convertToNegativePattern))}}e.convertPatternGroupToTask=l})),Oe=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.read=void 0;function t(e,t,i){t.fs.lstat(e,(a,o)=>{if(a!==null){n(i,a);return}if(!o.isSymbolicLink()||!t.followSymbolicLink){r(i,o);return}t.fs.stat(e,(e,a)=>{if(e!==null){if(t.throwErrorOnBrokenSymbolicLink){n(i,e);return}r(i,o);return}t.markSymbolicLink&&(a.isSymbolicLink=()=>!0),r(i,a)})})}e.read=t;function n(e,t){e(t)}function r(e,t){e(null,t)}})),ke=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.read=void 0;function t(e,t){let n=t.fs.lstatSync(e);if(!n.isSymbolicLink()||!t.followSymbolicLink)return n;try{let n=t.fs.statSync(e);return t.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(e){if(!t.throwErrorOnBrokenSymbolicLink)return n;throw e}}e.read=t})),Ae=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;let t=M(`fs`);e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),je=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ae();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=t.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,t){return e??t}}})),Me=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.statSync=e.stat=e.Settings=void 0;let t=Oe(),n=ke(),r=je();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.stat=i;function a(e,t){let r=o(t);return n.read(e,r)}e.statSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),Ne=j(((e,t)=>{
17
17
  /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
18
- let n;t.exports=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:global):e=>(n||=Promise.resolve()).then(e).catch(e=>setTimeout(()=>{throw e},0))})),xe=v(((e,t)=>{
18
+ let n;t.exports=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:global):e=>(n||=Promise.resolve()).then(e).catch(e=>setTimeout(()=>{throw e},0))})),Pe=j(((e,t)=>{
19
19
  /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
20
- t.exports=r;let n=be();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}})),Se=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;let t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);let n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10);e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=n>10||n===10&&r>=10})),Ce=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),we=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fs=void 0,e.fs=Ce()})),Te=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=t})),Ee=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=ye(),n=xe(),r=Se(),i=we(),a=Te();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}e.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}n(s.map(e=>c(e,t)),(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}e.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}n(c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}}),(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}e.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}})),De=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=ye(),n=Se(),r=we(),i=Te();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}e.read=a;function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}e.readdirWithFileTypes=o;function s(e,n){return n.fs.readdirSync(e).map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}e.readdir=s})),Oe=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;let t=S(`fs`);e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),ke=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(`path`),n=ye(),r=Oe();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=r.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new n.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),Ae=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;let t=Ee(),n=De(),r=ke();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}e.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),je=v(((e,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n})),Me=v(((e,t)=>{var n=je();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){return new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})})}}t.exports=r,t.exports.promise=o})),Ne=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.joinPathSegments=e.replacePathSegmentSeparator=e.isAppliedFilter=e.isFatalError=void 0;function t(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}e.isFatalError=t;function n(e,t){return e===null||e(t)}e.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}e.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=i})),Pe=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ne();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}})),Fe=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(`events`),n=Ae(),r=Me(),i=Ne(),a=Pe();e.default=class extends a.default{constructor(e,i){super(e,i),this._settings=i,this._scandir=n.scandir,this._emitter=new t.EventEmitter,this._queue=r(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!i.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}}})),Ie=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fe();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{n(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{r(e,this._storage)}),this._reader.read()}};function n(e,t){e(t)}function r(e,t){e(null,t)}})),Le=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(`stream`),n=Fe();e.default=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new n.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}})),Re=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ae(),n=Ne(),r=Pe();e.default=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}})),ze=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Re();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}}})),Be=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(`path`),n=Ae();e.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new n.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),Ve=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;let t=Ie(),n=Le(),r=ze(),i=Be();e.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}e.walk=a;function o(e,t){let n=c(t);return new r.default(e,n).read()}e.walkSync=o;function s(e,t){let r=c(t);return new n.default(e,r).read()}e.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}})),He=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(`path`),n=ye(),r=pe();e.default=class{constructor(e){this._settings=e,this._fsStatSettings=new n.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:r.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!r.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}})),Ue=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(`stream`),n=ye(),r=Ve(),i=He();e.default=class extends i.default{constructor(){super(...arguments),this._walkStream=r.walkStream,this._stat=n.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,n){let r=e.map(this._getFullEntryPath,this),i=new t.PassThrough({objectMode:!0});i._write=(t,a,o)=>this._getEntry(r[t],e[t],n).then(e=>{e!==null&&n.entryFilter(e)&&i.push(e),t===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}}})),We=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ve(),n=He(),r=Ue();e.default=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}}})),Ge=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=pe();e.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}}})),Ke=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ge();e.default=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length||t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)}))return!0}return!1}}})),qe=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=pe(),n=Ke();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return this._isSkippedByPositivePatterns(a,r)?!1:this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep===1/0?!1:this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;return e===``?n:n-e.split(`/`).length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}}})),Je=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=pe();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let[r,i]=t.pattern.partitionAbsoluteAndRelative(n),a={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,a)}_filter(e,n){let r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(r),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!(!this._isMatchToPatterns(e,t.positive.all,n)||this._isMatchToPatterns(e,t.negative.relative,n)||this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(n.length===0)return!1;let i=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,n,r)}_isMatchToPatterns(e,n,r){if(n.length===0)return!1;let i=t.pattern.matchAny(e,n);return!i&&r?t.pattern.matchAny(e+`/`,n):i}}})),Ye=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=pe();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}})),Xe=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=pe();e.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}}})),Ze=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(`path`),n=qe(),r=Je(),i=Ye(),a=Xe();e.default=class{constructor(e){this._settings=e,this.errorFilter=new i.default(this._settings),this.entryFilter=new r.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new n.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}}})),Qe=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=We(),n=Ze();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),$e=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=S(`stream`),n=Ue(),r=Ze();e.default=class extends r.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){let n=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(n,e,r),a=new t.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),et=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=ye(),n=Ve(),r=He();e.default=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);i===null||!t.entryFilter(i)||n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}})),tt=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=et(),n=Ze();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),nt=v((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;let t=S(`fs`),n=S(`os`),r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}})),rt=x(v(((e,t)=>{let n=me(),r=Qe(),i=$e(),a=tt(),o=nt(),s=pe();async function c(e,t){u(e);let n=l(e,r.default,t),i=await Promise.all(n);return s.array.flatten(i)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(e,t){u(e);let n=l(e,a.default,t);return s.array.flatten(n)}e.sync=t;function r(e,t){u(e);let n=l(e,i.default,t);return s.stream.merge(n)}e.stream=r;function c(e,t){u(e);let r=[].concat(e),i=new o.default(t);return n.generate(r,i)}e.generateTasks=c;function d(e,t){u(e);let n=new o.default(t);return s.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=d;function f(e){return u(e),s.path.escape(e)}e.escapePath=f;function p(e){return u(e),s.path.convertPathToPattern(e)}e.convertPathToPattern=p,(function(e){function t(e){return u(e),s.path.escapePosixPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertPosixPathToPattern(e)}e.convertPathToPattern=n})(e.posix||={}),(function(e){function t(e){return u(e),s.path.escapeWindowsPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertWindowsPathToPattern(e)}e.convertPathToPattern=n})(e.win32||={})})(c||={});function l(e,t,r){let i=[].concat(e),a=new o.default(r),s=n.generate(i,a),c=new t(a);return s.map(c.read,c)}function u(e){if(![].concat(e).every(e=>s.string.isString(e)&&!s.string.isEmpty(e)))throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=c}))(),1);async function it(e,t){let n=[],r=[],i=[],a=[];for(let o of e)o.registerProjectOutputDirs&&n.push(...await o.registerProjectOutputDirs(t)),o.registerProjectOutputFiles&&r.push(...await o.registerProjectOutputFiles(t)),o.registerGlobalOutputDirs&&i.push(...await o.registerGlobalOutputDirs(t)),o.registerGlobalOutputFiles&&a.push(...await o.registerGlobalOutputFiles(t));return{projectDirs:n,projectFiles:r,globalDirs:i,globalFiles:a}}async function at(e,t){let n=new Map;for(let r of e)n.set(r.name,{project:await r.canCleanProject?.(t)??!0,global:await r.canCleanGlobal?.(t)??!0});return n}async function ot(e,t){for(let n of e)await n.onCleanComplete?.(t)}async function st(e,t){let n=new Map;for(let r of e){let e=await r.canWrite?.(t)??!0;n.set(r.name,{project:e,global:e})}return n}async function ct(e,t){let n=new Map;for(let r of e){let e=await r.writeProjectOutputs?.(t)??{files:[],dirs:[]},i=await r.writeGlobalOutputs?.(t)??{files:[],dirs:[]},a={files:[...e.files,...i.files],dirs:[...e.dirs,...i.dirs]};n.set(r.name,a),await r.onWriteComplete?.(t,a)}return n}async function lt(e,t,n){let r=[],i=[];for(let a of e){let e=t.get(a.name);if(e?.project){let e=await a.registerProjectOutputFiles?.(n)??[],t=await a.registerProjectOutputDirs?.(n)??[];r.push(...e.map(e=>e.getAbsolutePath())),i.push(...t.map(e=>e.getAbsolutePath()))}if(e?.global){let e=await a.registerGlobalOutputFiles?.(n)??[],t=await a.registerGlobalOutputDirs?.(n)??[];r.push(...e.map(e=>e.getAbsolutePath())),i.push(...t.map(e=>e.getAbsolutePath()))}}return{filesToDelete:r,dirsToDelete:i}}function ut(e,t){let n=0,a=[];for(let o of e){let e=i.isAbsolute(o)?o:i.resolve(o);try{r.existsSync(e)&&(r.unlinkSync(e),t.debug({action:`delete`,type:`file`,path:e}),n++)}catch(n){let r=n instanceof Error?n.message:String(n);t.warn(`failed to delete file`,{path:e,error:r}),a.push({path:e,type:`file`,error:n})}}return{deleted:n,errors:a}}function dt(e,t){let n=0,a=[],o=[...e].sort((e,t)=>t.length-e.length);for(let e of o){let o=i.isAbsolute(e)?e:i.resolve(e);try{r.existsSync(o)&&(r.rmSync(o,{recursive:!0,force:!0}),t.debug({action:`delete`,type:`directory`,path:o}),n++)}catch(e){let n=e instanceof Error?e.message:String(e);t.warn(`failed to delete directory`,{path:o,error:n}),a.push({path:o,type:`directory`,error:e})}}return{deleted:n,errors:a}}async function ft(e,t,n,r){let{executeHooks:i=!0}=r??{},a=await it(e,t);n.debug(`Collected outputs for cleanup`,{projectDirs:a.projectDirs.length,projectFiles:a.projectFiles.length,globalDirs:a.globalDirs.length,globalFiles:a.globalFiles.length});let{filesToDelete:o,dirsToDelete:s}=await lt(e,await at(e,t),t),c=ut(o,n),l=dt(s,n);return i&&await ot(e,t),{deletedFiles:c.deleted,deletedDirs:l.deleted,errors:[...c.errors,...l.errors]}}var pt=class{name=`clean`;async execute(e){let{logger:t,outputPlugins:n,createCleanContext:r}=e;t.info(`running clean pipeline`,{command:`clean`});let i=await ft(n,r(!1),t);return t.info(`clean complete`,{deletedFiles:i.deletedFiles,deletedDirs:i.deletedDirs}),{success:!0,filesAffected:i.deletedFiles,dirsAffected:i.deletedDirs}}};let mt=function(e){return e.Input=`Input`,e.Output=`Output`,e}({}),ht=function(e){return e.GlobalMemory=`GlobalMemory`,e.ProjectRootMemory=`ProjectRootMemory`,e.ProjectChildrenMemory=`ProjectChildrenMemory`,e.FastCommand=`FastCommand`,e.SubAgent=`SubAgent`,e.Skill=`Skill`,e.SkillChildDoc=`SkillChildDoc`,e.SkillResource=`SkillResource`,e.SkillMcpConfig=`SkillMcpConfig`,e.Readme=`Readme`,e}({}),gt=function(e){return e.Red=`Red`,e.Green=`Green`,e.Blue=`Blue`,e.Yellow=`Yellow`,e}({}),_t=function(e){return e.Read=`Read`,e.Write=`Write`,e.Edit=`Edit`,e.Grep=`Grep`,e}({}),vt=function(e){return e.CamelCase=`CamelCase`,e.PascalCase=`PascalCase`,e.SnakeCase=`SnakeCase`,e.KebabCase=`KebabCase`,e.UpperCase=`UpperCase`,e.LowerCase=`LowerCase`,e.Original=`Original`,e}({}),yt=function(e){return e.UserHome=`UserHome`,e.External=`External`,e}({}),M=function(e){return e.Relative=`Relative`,e.Absolute=`Absolute`,e.Root=`Root`,e}({}),N=function(e){return e.VSCode=`VSCode`,e.IntellijIDEA=`IntellijIDEA`,e.Git=`Git`,e.EditorConfig=`EditorConfig`,e.Original=`Original`,e}({});var bt=class extends Error{constructor(e){super(`Circular dependency detected: ${e.join(` -> `)}`),this.cycle=e,this.name=`CircularDependencyError`}},xt=class extends Error{constructor(e,t){super(`Plugin "${e}" depends on non-existent plugin "${t}"`),this.pluginName=e,this.missingDependency=t,this.name=`MissingDependencyError`}};const St=`.kt,.java,.py,.pyi,.pyx,.ts,.tsx,.js,.jsx,.mjs,.cjs,.go,.rs,.c,.cpp,.cc,.h,.hpp,.hxx,.cs,.fs,.fsx,.vb,.rb,.php,.swift,.scala,.groovy,.lua,.r,.R,.jl,.ex,.exs,.erl,.clj,.cljs,.hs,.ml,.mli,.nim,.zig,.v,.dart,.vue,.svelte,.sql,.json,.jsonc,.json5,.xml,.xsd,.xsl,.xslt,.yaml,.yml,.toml,.csv,.tsv,.graphql,.gql,.proto,.txt,.text,.rtf,.log,.ini,.conf,.cfg,.config,.properties,.env,.envrc,.editorconfig,.gitignore,.gitattributes,.npmrc,.nvmrc,.npmignore,.eslintrc,.prettierrc,.stylelintrc,.babelrc,.browserslistrc,.sh,.bash,.zsh,.fish,.ps1,.psm1,.psd1,.bat,.cmd,.html,.htm,.xhtml,.css,.scss,.sass,.less,.styl,.svg,.ejs,.hbs,.mustache,.pug,.jade,.jinja,.jinja2,.j2,.erb,.haml,.slim,.d.ts,.d.mts,.d.cts,.diff,.patch,.asm,.s,.makefile,.mk,.dockerfile,.tf,.tfvars,.prisma,.mdx`.split(`,`),Ct=`.docx,.doc,.xlsx,.xls,.pptx,.ppt,.pdf,.odt,.ods,.odp,.png,.jpg,.jpeg,.gif,.webp,.ico,.bmp,.tiff,.zip,.tar,.gz,.bz2,.7z,.rar,.pyd,.pyc,.pyo,.class,.jar,.war,.dll,.so,.dylib,.exe,.bin,.wasm,.ttf,.otf,.woff,.woff2,.eot,.mp3,.wav,.ogg,.mp4,.webm,.db,.sqlite,.sqlite3`.split(`,`),P={SRC:`src`,DIST:`dist`,SKILLS:`skills`,COMMANDS:`commands`,AGENTS:`agents`,APP:`app`,IDEA:`.idea`,IDEA_CODE_STYLES:`.idea/codeStyles`,VSCODE:`.vscode`},F={GLOBAL_MEMORY:`global.md`,GLOBAL_MEMORY_SRC:`global.cn.mdx`,EDITOR_CONFIG:`.editorconfig`,IDEA_GITIGNORE:`.idea/.gitignore`,IDEA_PROJECT_XML:`.idea/codeStyles/Project.xml`,IDEA_CODE_STYLE_CONFIG_XML:`.idea/codeStyles/codeStyleConfig.xml`,VSCODE_SETTINGS:`.vscode/settings.json`,VSCODE_EXTENSIONS:`.vscode/extensions.json`,QODER_IGNORE:`.qoderignore`,CURSOR_IGNORE:`.cursorignore`,WARP_INDEX_IGNORE:`.warpindexignore`},I={SRC_SKILLS:`src/skills`,SRC_COMMANDS:`src/commands`,SRC_AGENTS:`src/agents`,SRC_GLOBAL_MEMORY:`app/global.cn.mdx`,DIST_SKILLS:`dist/skills`,DIST_COMMANDS:`dist/commands`,DIST_AGENTS:`dist/agents`,DIST_APP:`dist/app`,DIST_GLOBAL_MEMORY:`dist/global.md`,APP:`app`},wt={src:{skills:{name:P.SKILLS,required:!1,description:`Skill source files (.cn.mdx)`},commands:{name:P.COMMANDS,required:!1,description:`Fast command source files (.cn.mdx)`},agents:{name:P.AGENTS,required:!1,description:`Sub-agent source files (.cn.mdx)`},globalMemoryFile:{name:F.GLOBAL_MEMORY_SRC,required:!1,description:`Global memory source file`}},dist:{skills:{name:P.SKILLS,required:!1,description:`Compiled skill files (.md)`},commands:{name:P.COMMANDS,required:!1,description:`Compiled fast command files (.md)`},agents:{name:P.AGENTS,required:!1,description:`Compiled sub-agent files (.md)`},globalMemoryFile:{name:F.GLOBAL_MEMORY,required:!1,description:`Compiled global memory file`},app:{name:P.APP,required:!1,description:`Compiled project-specific prompts`}},app:{name:P.APP,required:!1,description:`Project-specific prompts (standalone directory)`},ide:{idea:{name:P.IDEA,required:!1,description:`JetBrains IDE configuration directory`},ideaCodeStyles:{name:P.IDEA_CODE_STYLES,required:!1,description:`JetBrains IDE code styles directory`},vscode:{name:P.VSCODE,required:!1,description:`VS Code configuration directory`}},ideFiles:[{name:F.EDITOR_CONFIG,required:!1,description:`EditorConfig file`},{name:F.IDEA_GITIGNORE,required:!1,description:`JetBrains IDE .gitignore`},{name:F.IDEA_PROJECT_XML,required:!1,description:`JetBrains IDE Project.xml`},{name:F.IDEA_CODE_STYLE_CONFIG_XML,required:!1,description:`JetBrains IDE codeStyleConfig.xml`},{name:F.VSCODE_SETTINGS,required:!1,description:`VS Code settings.json`},{name:F.VSCODE_EXTENSIONS,required:!1,description:`VS Code extensions.json`}],ignoreFiles:[{name:F.QODER_IGNORE,required:!1,description:`Qoder ignore file`},{name:F.CURSOR_IGNORE,required:!1,description:`Cursor ignore file`},{name:F.WARP_INDEX_IGNORE,required:!1,description:`Warp index ignore file`}]};var Tt=class{name=`dry-run-clean`;async execute(e){let{logger:t,outputPlugins:n,createCleanContext:r}=e;t.info(`running clean pipeline`,{command:`dry-run-clean`,dryRun:!0});let i=r(!0),a=await it(n,i);t.info(`collected outputs for cleanup`,{dryRun:!0,projectDirs:a.projectDirs.length,projectFiles:a.projectFiles.length,globalDirs:a.globalDirs.length,globalFiles:a.globalFiles.length});let o=await at(n,i),{filesToDelete:s,dirsToDelete:c}=await this.collectDeletionTargets(e,o,i);return this.logDryRunFiles(s,t),this.logDryRunDirectories(c,t),await ot(n,i),t.info(`clean complete`,{dryRun:!0,filesAffected:s.length,dirsAffected:c.length}),{success:!0,filesAffected:s.length,dirsAffected:c.length,message:`Dry-run complete, no files were deleted`}}async collectDeletionTargets(e,t,n){let r=[],i=[];for(let a of e.outputPlugins){let e=t.get(a.name);if(e?.project){let e=await a.registerProjectOutputFiles?.(n)??[],t=await a.registerProjectOutputDirs?.(n)??[];r.push(...e.map(e=>e.getAbsolutePath())),i.push(...t.map(e=>e.getAbsolutePath()))}if(e?.global){let e=await a.registerGlobalOutputFiles?.(n)??[],t=await a.registerGlobalOutputDirs?.(n)??[];r.push(...e.map(e=>e.getAbsolutePath())),i.push(...t.map(e=>e.getAbsolutePath()))}}return{filesToDelete:r,dirsToDelete:i}}logDryRunFiles(e,t){for(let n of e){let e=i.isAbsolute(n)?n:i.resolve(n);t.info(`would delete file`,{path:e,dryRun:!0})}}logDryRunDirectories(e,t){let n=[...e].sort((e,t)=>t.length-e.length);for(let e of n){let n=i.isAbsolute(e)?e:i.resolve(e);t.info(`would delete directory`,{path:n,dryRun:!0})}}},Et=class{name=`dry-run-output`;async execute(e){let{logger:t,outputPlugins:n,createWriteContext:r}=e;t.info(`started`,{command:`dry-run-output`,dryRun:!0});let i=r(!0),a=await st(n,i),o=await ct(n.filter(e=>!!(a.get(e.name)?.project??!0)),i),s=0,c=0;for(let[e,n]of o)s+=n.files.length,c+=n.dirs.length,t.info(`plugin result`,{plugin:e,files:n.files.length,dirs:n.dirs.length,dryRun:!0});return t.info(`complete`,{command:`dry-run-output`,totalFiles:s,totalDirs:c,dryRun:!0}),{success:!0,filesAffected:s,dirsAffected:c,message:`Dry-run complete, no files were written`}}},Dt=class{name=`execute`;async execute(e){let{logger:t,outputPlugins:n,createCleanContext:r,createWriteContext:i}=e;t.info(`started`,{command:`execute`});let a=await ft(n,r(!1),t,{executeHooks:!1});t.info(`cleanup complete`,{deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs});let o=i(!1),s=await st(n,o),c=await ct(n.filter(e=>s.get(e.name)?.project??!0),o),l=0,u=0;for(let e of c.values())l+=e.files.length,u+=e.dirs.length;return t.info(`complete`,{command:`execute`,pluginCount:c.size}),{success:!0,filesAffected:l,dirsAffected:u}}};function Ot(){return`2026.10103.10509`}var kt=class{name=`version`;async execute(e){return e.logger.error(`tnmsc v${Ot()}`),{success:!0,filesAffected:0,dirsAffected:0,message:`Version displayed`}}};const L=`tnmsc`,At=`
21
- ${L} v${Ot()} - Memory Sync CLI
20
+ t.exports=r;let n=Ne();function r(e,t){let r,i,a,o=!0;Array.isArray(e)?(r=[],i=e.length):(a=Object.keys(e),r={},i=a.length);function s(e){function i(){t&&t(e,r),t=null}o?n(i):i()}function c(e,t,n){r[e]=n,(--i===0||t)&&s(t)}i?a?a.forEach(function(t){e[t](function(e,n){c(t,e,n)})}):e.forEach(function(e,t){e(function(e,n){c(t,e,n)})}):s(null),o=!1}})),Fe=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;let t=process.versions.node.split(`.`);if(t[0]===void 0||t[1]===void 0)throw Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);let n=Number.parseInt(t[0],10),r=Number.parseInt(t[1],10);e.IS_SUPPORT_READDIR_WITH_FILE_TYPES=n>10||n===10&&r>=10})),Ie=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createDirentFromStats=void 0;var t=class{constructor(e,t){this.name=e,this.isBlockDevice=t.isBlockDevice.bind(t),this.isCharacterDevice=t.isCharacterDevice.bind(t),this.isDirectory=t.isDirectory.bind(t),this.isFIFO=t.isFIFO.bind(t),this.isFile=t.isFile.bind(t),this.isSocket=t.isSocket.bind(t),this.isSymbolicLink=t.isSymbolicLink.bind(t)}};function n(e,n){return new t(e,n)}e.createDirentFromStats=n})),Le=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fs=void 0,e.fs=Ie()})),Re=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.joinPathSegments=void 0;function t(e,t,n){return e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=t})),ze=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=Me(),n=Pe(),r=Fe(),i=Le(),a=Re();function o(e,t,n){if(!t.stats&&r.IS_SUPPORT_READDIR_WITH_FILE_TYPES){s(e,t,n);return}l(e,t,n)}e.read=o;function s(e,t,r){t.fs.readdir(e,{withFileTypes:!0},(i,o)=>{if(i!==null){u(r,i);return}let s=o.map(n=>({dirent:n,name:n.name,path:a.joinPathSegments(e,n.name,t.pathSegmentSeparator)}));if(!t.followSymbolicLinks){d(r,s);return}n(s.map(e=>c(e,t)),(e,t)=>{if(e!==null){u(r,e);return}d(r,t)})})}e.readdirWithFileTypes=s;function c(e,t){return n=>{if(!e.dirent.isSymbolicLink()){n(null,e);return}t.fs.stat(e.path,(r,a)=>{if(r!==null){if(t.throwErrorOnBrokenSymbolicLink){n(r);return}n(null,e);return}e.dirent=i.fs.createDirentFromStats(e.name,a),n(null,e)})}}function l(e,r,o){r.fs.readdir(e,(s,c)=>{if(s!==null){u(o,s);return}n(c.map(n=>{let o=a.joinPathSegments(e,n,r.pathSegmentSeparator);return e=>{t.stat(o,r.fsStatSettings,(t,a)=>{if(t!==null){e(t);return}let s={name:n,path:o,dirent:i.fs.createDirentFromStats(n,a)};r.stats&&(s.stats=a),e(null,s)})}}),(e,t)=>{if(e!==null){u(o,e);return}d(o,t)})})}e.readdir=l;function u(e,t){e(t)}function d(e,t){e(null,t)}})),Be=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=Me(),n=Fe(),r=Le(),i=Re();function a(e,t){return!t.stats&&n.IS_SUPPORT_READDIR_WITH_FILE_TYPES?o(e,t):s(e,t)}e.read=a;function o(e,t){return t.fs.readdirSync(e,{withFileTypes:!0}).map(n=>{let a={dirent:n,name:n.name,path:i.joinPathSegments(e,n.name,t.pathSegmentSeparator)};if(a.dirent.isSymbolicLink()&&t.followSymbolicLinks)try{let e=t.fs.statSync(a.path);a.dirent=r.fs.createDirentFromStats(a.name,e)}catch(e){if(t.throwErrorOnBrokenSymbolicLink)throw e}return a})}e.readdirWithFileTypes=o;function s(e,n){return n.fs.readdirSync(e).map(a=>{let o=i.joinPathSegments(e,a,n.pathSegmentSeparator),s=t.statSync(o,n.fsStatSettings),c={name:a,path:o,dirent:r.fs.createDirentFromStats(a,s)};return n.stats&&(c.stats=s),c})}e.readdir=s})),Ve=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;let t=M(`fs`);e.FILE_SYSTEM_ADAPTER={lstat:t.lstat,stat:t.stat,lstatSync:t.lstatSync,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync};function n(t){return t===void 0?e.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},e.FILE_SYSTEM_ADAPTER),t)}e.createFileSystemAdapter=n})),He=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=M(`path`),n=Me(),r=Ve();e.default=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=r.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new n.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),Ue=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;let t=ze(),n=Be(),r=He();e.Settings=r.default;function i(e,n,r){if(typeof n==`function`){t.read(e,o(),n);return}t.read(e,o(n),r)}e.scandir=i;function a(e,t){let r=o(t);return n.read(e,r)}e.scandirSync=a;function o(e={}){return e instanceof r.default?e:new r.default(e)}})),We=j(((e,t)=>{function n(e){var t=new e,n=t;function r(){var r=t;return r.next?t=r.next:(t=new e,n=t),r.next=null,r}function i(e){n.next=e,n=e}return{get:r,release:i}}t.exports=n})),Ge=j(((e,t)=>{var n=We();function r(e,t,r){if(typeof e==`function`&&(r=t,t=e,e=null),!(r>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);var o=n(a),s=null,c=null,l=0,u=null,d={push:v,drain:i,saturated:i,pause:p,paused:!1,get concurrency(){return r},set concurrency(e){if(!(e>=1))throw Error(`fastqueue concurrency must be equal to or greater than 1`);if(r=e,!d.paused)for(;s&&l<r;)l++,b()},running:f,resume:g,idle:_,length:m,getQueue:h,unshift:y,empty:i,kill:x,killAndDrain:S,error:w,abort:C};return d;function f(){return l}function p(){d.paused=!0}function m(){for(var e=s,t=0;e;)e=e.next,t++;return t}function h(){for(var e=s,t=[];e;)t.push(e.value),e=e.next;return t}function g(){if(d.paused){if(d.paused=!1,s===null){l++,b();return}for(;s&&l<r;)l++,b()}}function _(){return l===0&&d.length()===0}function v(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?c?(c.next=f,c=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function y(n,a){var f=o.get();f.context=e,f.release=b,f.value=n,f.callback=a||i,f.errorHandler=u,l>=r||d.paused?s?(f.next=s,s=f):(s=f,c=f,d.saturated()):(l++,t.call(e,f.value,f.worked))}function b(n){n&&o.release(n);var i=s;i&&l<=r?d.paused?l--:(c===s&&(c=null),s=i.next,i.next=null,t.call(e,i.value,i.worked),c===null&&d.empty()):--l===0&&d.drain()}function x(){s=null,c=null,d.drain=i}function S(){s=null,c=null,d.drain(),d.drain=i}function C(){var e=s;for(s=null,c=null;e;){var t=e.next,n=e.callback,r=e.errorHandler,a=e.value,o=e.context;e.value=null,e.callback=i,e.errorHandler=null,r&&r(Error(`abort`),a),n.call(o,Error(`abort`)),e.release(e),e=t}d.drain=i}function w(e){u=e}}function i(){}function a(){this.value=null,this.callback=i,this.next=null,this.release=i,this.context=null,this.errorHandler=null;var e=this;this.worked=function(t,n){var r=e.callback,a=e.errorHandler,o=e.value;e.value=null,e.callback=i,e.errorHandler&&a(t,o),r.call(e.context,t,n),e.release(e)}}function o(e,t,n){typeof e==`function`&&(n=t,t=e,e=null);function a(e,n){t.call(this,e).then(function(e){n(null,e)},n)}var o=r(e,a,n),s=o.push,c=o.unshift;return o.push=l,o.unshift=u,o.drained=d,o;function l(e){var t=new Promise(function(t,n){s(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function u(e){var t=new Promise(function(t,n){c(e,function(e,r){if(e){n(e);return}t(r)})});return t.catch(i),t}function d(){return new Promise(function(e){process.nextTick(function(){if(o.idle())e();else{var t=o.drain;o.drain=function(){typeof t==`function`&&t(),e(),o.drain=t}}})})}}t.exports=r,t.exports.promise=o})),Ke=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.joinPathSegments=e.replacePathSegmentSeparator=e.isAppliedFilter=e.isFatalError=void 0;function t(e,t){return e.errorFilter===null?!0:!e.errorFilter(t)}e.isFatalError=t;function n(e,t){return e===null||e(t)}e.isAppliedFilter=n;function r(e,t){return e.split(/[/\\]/).join(t)}e.replacePathSegmentSeparator=r;function i(e,t,n){return e===``?t:e.endsWith(n)?e+t:e+n+t}e.joinPathSegments=i})),qe=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ke();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}})),Je=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=M(`events`),n=Ue(),r=Ge(),i=Ke(),a=qe();e.default=class extends a.default{constructor(e,i){super(e,i),this._settings=i,this._scandir=n.scandir,this._emitter=new t.EventEmitter,this._queue=r(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit(`end`)}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw Error(`The reader is already destroyed`);this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on(`entry`,e)}onError(e){this._emitter.once(`error`,e)}onEnd(e){this._emitter.once(`end`,e)}_pushToQueue(e,t){let n={directory:e,base:t};this._queue.push(n,e=>{e!==null&&this._handleError(e)})}_worker(e,t){this._scandir(e.directory,this._settings.fsScandirSettings,(n,r)=>{if(n!==null){t(n,void 0);return}for(let t of r)this._handleEntry(t,e.base);t(null,void 0)})}_handleError(e){this._isDestroyed||!i.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit(`error`,e))}_handleEntry(e,t){if(this._isDestroyed||this._isFatalError)return;let n=e.path;t!==void 0&&(e.path=i.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),i.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&i.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,t===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit(`entry`,e)}}})),Ye=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Je();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(t=>{n(e,t)}),this._reader.onEntry(e=>{this._storage.push(e)}),this._reader.onEnd(()=>{r(e,this._storage)}),this._reader.read()}};function n(e,t){e(t)}function r(e,t){e(null,t)}})),Xe=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=M(`stream`),n=Je();e.default=class{constructor(e,r){this._root=e,this._settings=r,this._reader=new n.default(this._root,this._settings),this._stream=new t.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit(`error`,e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}})),Ze=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ue(),n=Ke(),r=qe();e.default=class extends r.default{constructor(){super(...arguments),this._scandir=t.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,t){this._queue.add({directory:e,base:t})}_handleQueue(){for(let e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,t){try{let n=this._scandir(e,this._settings.fsScandirSettings);for(let e of n)this._handleEntry(e,t)}catch(e){this._handleError(e)}}_handleError(e){if(n.isFatalError(this._settings,e))throw e}_handleEntry(e,t){let r=e.path;t!==void 0&&(e.path=n.joinPathSegments(t,e.name,this._settings.pathSegmentSeparator)),n.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&n.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(r,t===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}})),Qe=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ze();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._reader=new t.default(this._root,this._settings)}read(){return this._reader.read()}}})),$e=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=M(`path`),n=Ue();e.default=class{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,1/0),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,t.sep),this.fsScandirSettings=new n.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,t){return e??t}}})),et=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;let t=Ye(),n=Xe(),r=Qe(),i=$e();e.Settings=i.default;function a(e,n,r){if(typeof n==`function`){new t.default(e,c()).read(n);return}new t.default(e,c(n)).read(r)}e.walk=a;function o(e,t){let n=c(t);return new r.default(e,n).read()}e.walkSync=o;function s(e,t){let r=c(t);return new n.default(e,r).read()}e.walkStream=s;function c(e={}){return e instanceof i.default?e:new i.default(e)}})),tt=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=M(`path`),n=Me(),r=Ee();e.default=class{constructor(e){this._settings=e,this._fsStatSettings=new n.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return t.resolve(this._settings.cwd,e)}_makeEntry(e,t){let n={name:t,path:t,dirent:r.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!r.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}})),nt=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=M(`stream`),n=Me(),r=et(),i=tt();e.default=class extends i.default{constructor(){super(...arguments),this._walkStream=r.walkStream,this._stat=n.stat}dynamic(e,t){return this._walkStream(e,t)}static(e,n){let r=e.map(this._getFullEntryPath,this),i=new t.PassThrough({objectMode:!0});i._write=(t,a,o)=>this._getEntry(r[t],e[t],n).then(e=>{e!==null&&n.entryFilter(e)&&i.push(e),t===r.length-1&&i.end(),o()}).catch(o);for(let e=0;e<r.length;e++)i.write(e);return i}_getEntry(e,t,n){return this._getStat(e).then(e=>this._makeEntry(e,t)).catch(e=>{if(n.errorFilter(e))return null;throw e})}_getStat(e){return new Promise((t,n)=>{this._stat(e,this._fsStatSettings,(e,r)=>e===null?t(r):n(e))})}}})),rt=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=et(),n=tt(),r=nt();e.default=class extends n.default{constructor(){super(...arguments),this._walkAsync=t.walk,this._readerStream=new r.default(this._settings)}dynamic(e,t){return new Promise((n,r)=>{this._walkAsync(e,t,(e,t)=>{e===null?n(t):r(e)})})}async static(e,t){let n=[],r=this._readerStream.static(e,t);return new Promise((e,t)=>{r.once(`error`,t),r.on(`data`,e=>n.push(e)),r.once(`end`,()=>e(n))})}}})),it=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ee();e.default=class{constructor(e,t,n){this._patterns=e,this._settings=t,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(let e of this._patterns){let t=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(t);this._storage.push({complete:n.length<=1,pattern:e,segments:t,sections:n})}}_getPatternSegments(e){return t.pattern.getPatternParts(e,this._micromatchOptions).map(e=>t.pattern.isDynamicPattern(e,this._settings)?{dynamic:!0,pattern:e,patternRe:t.pattern.makeRe(e,this._micromatchOptions)}:{dynamic:!1,pattern:e})}_splitSegmentsIntoSections(e){return t.array.splitWhen(e,e=>e.dynamic&&t.pattern.hasGlobStar(e.pattern))}}})),at=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=it();e.default=class extends t.default{match(e){let t=e.split(`/`),n=t.length,r=this._storage.filter(e=>!e.complete||e.segments.length>n);for(let e of r){let r=e.sections[0];if(!e.complete&&n>r.length||t.every((t,n)=>{let r=e.segments[n];return!!(r.dynamic&&r.patternRe.test(t)||!r.dynamic&&r.pattern===t)}))return!0}return!1}}})),ot=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ee(),n=at();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t}getFilter(e,t,n){let r=this._getMatcher(t),i=this._getNegativePatternsRe(n);return t=>this._filter(e,t,r,i)}_getMatcher(e){return new n.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){let n=e.filter(t.pattern.isAffectDepthOfReadingPattern);return t.pattern.convertPatternsToRe(n,this._micromatchOptions)}_filter(e,n,r,i){if(this._isSkippedByDeep(e,n.path)||this._isSkippedSymbolicLink(n))return!1;let a=t.path.removeLeadingDotSegment(n.path);return this._isSkippedByPositivePatterns(a,r)?!1:this._isSkippedByNegativePatterns(a,i)}_isSkippedByDeep(e,t){return this._settings.deep===1/0?!1:this._getEntryLevel(e,t)>=this._settings.deep}_getEntryLevel(e,t){let n=t.split(`/`).length;return e===``?n:n-e.split(`/`).length}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,t){return!this._settings.baseNameMatch&&!t.match(e)}_isSkippedByNegativePatterns(e,n){return!t.pattern.matchAny(e,n)}}})),st=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ee();e.default=class{constructor(e,t){this._settings=e,this._micromatchOptions=t,this.index=new Map}getFilter(e,n){let[r,i]=t.pattern.partitionAbsoluteAndRelative(n),a={positive:{all:t.pattern.convertPatternsToRe(e,this._micromatchOptions)},negative:{absolute:t.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0})),relative:t.pattern.convertPatternsToRe(i,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}))}};return e=>this._filter(e,a)}_filter(e,n){let r=t.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(r)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e))return!1;let i=this._isMatchToPatternsSet(r,n,e.dirent.isDirectory());return this._settings.unique&&i&&this._createIndexRecord(r),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isMatchToPatternsSet(e,t,n){return!(!this._isMatchToPatterns(e,t.positive.all,n)||this._isMatchToPatterns(e,t.negative.relative,n)||this._isMatchToAbsoluteNegative(e,t.negative.absolute,n))}_isMatchToAbsoluteNegative(e,n,r){if(n.length===0)return!1;let i=t.path.makeAbsolute(this._settings.cwd,e);return this._isMatchToPatterns(i,n,r)}_isMatchToPatterns(e,n,r){if(n.length===0)return!1;let i=t.pattern.matchAny(e,n);return!i&&r?t.pattern.matchAny(e+`/`,n):i}}})),ct=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ee();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}})),lt=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Ee();e.default=class{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let n=e.path;return this._settings.absolute&&(n=t.path.makeAbsolute(this._settings.cwd,n),n=t.path.unixify(n)),this._settings.markDirectories&&e.dirent.isDirectory()&&(n+=`/`),this._settings.objectMode?Object.assign(Object.assign({},e),{path:n}):n}}})),ut=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=M(`path`),n=ot(),r=st(),i=ct(),a=lt();e.default=class{constructor(e){this._settings=e,this.errorFilter=new i.default(this._settings),this.entryFilter=new r.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new n.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new a.default(this._settings)}_getRootDirectory(e){return t.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){let t=e.base===`.`?``:e.base;return{basePath:t,pathSegmentSeparator:`/`,concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(t,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}}})),dt=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=rt(),n=ut();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}async read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(t,e,n)).map(e=>n.transform(e))}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),ft=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=M(`stream`),n=nt(),r=ut();e.default=class extends r.default{constructor(){super(...arguments),this._reader=new n.default(this._settings)}read(e){let n=this._getRootDirectory(e),r=this._getReaderOptions(e),i=this.api(n,e,r),a=new t.Readable({objectMode:!0,read:()=>{}});return i.once(`error`,e=>a.emit(`error`,e)).on(`data`,e=>a.emit(`data`,r.transform(e))).once(`end`,()=>a.emit(`end`)),a.once(`close`,()=>i.destroy()),a}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),pt=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Me(),n=et(),r=tt();e.default=class extends r.default{constructor(){super(...arguments),this._walkSync=n.walkSync,this._statSync=t.statSync}dynamic(e,t){return this._walkSync(e,t)}static(e,t){let n=[];for(let r of e){let e=this._getFullEntryPath(r),i=this._getEntry(e,r,t);i===null||!t.entryFilter(i)||n.push(i)}return n}_getEntry(e,t,n){try{let n=this._getStat(e);return this._makeEntry(n,t)}catch(e){if(n.errorFilter(e))return null;throw e}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}})),mt=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=pt(),n=ut();e.default=class extends n.default{constructor(){super(...arguments),this._reader=new t.default(this._settings)}read(e){let t=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(t,e,n).map(n.transform)}api(e,t,n){return t.dynamic?this._reader.dynamic(e,n):this._reader.static(t.patterns,n)}}})),ht=j((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;let t=M(`fs`),n=M(`os`),r=Math.max(n.cpus().length,1);e.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:t.lstat,lstatSync:t.lstatSync,stat:t.stat,statSync:t.statSync,readdir:t.readdir,readdirSync:t.readdirSync},e.default=class{constructor(e={}){this._options=e,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,r),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(e,t){return e===void 0?t:e}_getFileSystemMethods(t={}){return Object.assign(Object.assign({},e.DEFAULT_FILE_SYSTEM_ADAPTER),t)}}})),gt=re(j(((e,t)=>{let n=De(),r=dt(),i=ft(),a=mt(),o=ht(),s=Ee();async function c(e,t){u(e);let n=l(e,r.default,t),i=await Promise.all(n);return s.array.flatten(i)}(function(e){e.glob=e,e.globSync=t,e.globStream=r,e.async=e;function t(e,t){u(e);let n=l(e,a.default,t);return s.array.flatten(n)}e.sync=t;function r(e,t){u(e);let n=l(e,i.default,t);return s.stream.merge(n)}e.stream=r;function c(e,t){u(e);let r=[].concat(e),i=new o.default(t);return n.generate(r,i)}e.generateTasks=c;function d(e,t){u(e);let n=new o.default(t);return s.pattern.isDynamicPattern(e,n)}e.isDynamicPattern=d;function f(e){return u(e),s.path.escape(e)}e.escapePath=f;function p(e){return u(e),s.path.convertPathToPattern(e)}e.convertPathToPattern=p,(function(e){function t(e){return u(e),s.path.escapePosixPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertPosixPathToPattern(e)}e.convertPathToPattern=n})(e.posix||={}),(function(e){function t(e){return u(e),s.path.escapeWindowsPath(e)}e.escapePath=t;function n(e){return u(e),s.path.convertWindowsPathToPattern(e)}e.convertPathToPattern=n})(e.win32||={})})(c||={});function l(e,t,r){let i=[].concat(e),a=new o.default(r),s=n.generate(i,a),c=new t(a);return s.map(c.read,c)}function u(e){if(![].concat(e).every(e=>s.string.isString(e)&&!s.string.isEmpty(e)))throw TypeError(`Patterns must be a string (non empty) or an array of strings`)}t.exports=c}))(),1);async function _t(e,t){let n=[],r=[],i=[],a=[];for(let o of e)o.registerProjectOutputDirs&&n.push(...await o.registerProjectOutputDirs(t)),o.registerProjectOutputFiles&&r.push(...await o.registerProjectOutputFiles(t)),o.registerGlobalOutputDirs&&i.push(...await o.registerGlobalOutputDirs(t)),o.registerGlobalOutputFiles&&a.push(...await o.registerGlobalOutputFiles(t));return{projectDirs:n,projectFiles:r,globalDirs:i,globalFiles:a}}async function vt(e,t){let n=new Map;for(let r of e)n.set(r.name,{project:await r.canCleanProject?.(t)??!0,global:await r.canCleanGlobal?.(t)??!0});return n}async function yt(e,t){for(let n of e)await n.onCleanComplete?.(t)}async function bt(e,t){let n=new Map;for(let r of e){let e=await r.canWrite?.(t)??!0;n.set(r.name,{project:e,global:e})}return n}async function xt(e,t){let n=new Map;for(let r of e){let e=await r.writeProjectOutputs?.(t)??{files:[],dirs:[]},i=await r.writeGlobalOutputs?.(t)??{files:[],dirs:[]},a={files:[...e.files,...i.files],dirs:[...e.dirs,...i.dirs]};n.set(r.name,a),await r.onWriteComplete?.(t,a)}return n}async function St(e,t,n){let r=[],i=[];for(let a of e){let e=t.get(a.name);if(e?.project){let e=await a.registerProjectOutputFiles?.(n)??[],t=await a.registerProjectOutputDirs?.(n)??[];r.push(...e.map(e=>e.getAbsolutePath())),i.push(...t.map(e=>e.getAbsolutePath()))}if(e?.global){let e=await a.registerGlobalOutputFiles?.(n)??[],t=await a.registerGlobalOutputDirs?.(n)??[];r.push(...e.map(e=>e.getAbsolutePath())),i.push(...t.map(e=>e.getAbsolutePath()))}}return{filesToDelete:r,dirsToDelete:i}}function Ct(e,t){let n=0,r=[];for(let i of e){let e=g.isAbsolute(i)?i:g.resolve(i);try{h.existsSync(e)&&(h.unlinkSync(e),t.debug({action:`delete`,type:`file`,path:e}),n++)}catch(n){let i=n instanceof Error?n.message:String(n);t.warn(`failed to delete file`,{path:e,error:i}),r.push({path:e,type:`file`,error:n})}}return{deleted:n,errors:r}}function wt(e,t){let n=0,r=[],i=[...e].sort((e,t)=>t.length-e.length);for(let e of i){let i=g.isAbsolute(e)?e:g.resolve(e);try{h.existsSync(i)&&(h.rmSync(i,{recursive:!0,force:!0}),t.debug({action:`delete`,type:`directory`,path:i}),n++)}catch(e){let n=e instanceof Error?e.message:String(e);t.warn(`failed to delete directory`,{path:i,error:n}),r.push({path:i,type:`directory`,error:e})}}return{deleted:n,errors:r}}async function Tt(e,t,n,r){let{executeHooks:i=!0}=r??{},a=await _t(e,t);n.debug(`Collected outputs for cleanup`,{projectDirs:a.projectDirs.length,projectFiles:a.projectFiles.length,globalDirs:a.globalDirs.length,globalFiles:a.globalFiles.length});let{filesToDelete:o,dirsToDelete:s}=await St(e,await vt(e,t),t),c=Ct(o,n),l=wt(s,n);return i&&await yt(e,t),{deletedFiles:c.deleted,deletedDirs:l.deleted,errors:[...c.errors,...l.errors]}}var Et=class{name=`clean`;async execute(e){let{logger:t,outputPlugins:n,createCleanContext:r}=e;t.info(`running clean pipeline`,{command:`clean`});let i=await Tt(n,r(!1),t);return t.info(`clean complete`,{deletedFiles:i.deletedFiles,deletedDirs:i.deletedDirs}),{success:!0,filesAffected:i.deletedFiles,dirsAffected:i.deletedDirs}}};let Dt=function(e){return e.Input=`Input`,e.Output=`Output`,e}({}),Ot=function(e){return e.GlobalMemory=`GlobalMemory`,e.ProjectRootMemory=`ProjectRootMemory`,e.ProjectChildrenMemory=`ProjectChildrenMemory`,e.FastCommand=`FastCommand`,e.SubAgent=`SubAgent`,e.Skill=`Skill`,e.SkillChildDoc=`SkillChildDoc`,e.SkillResource=`SkillResource`,e.SkillMcpConfig=`SkillMcpConfig`,e.Readme=`Readme`,e}({}),kt=function(e){return e.Red=`Red`,e.Green=`Green`,e.Blue=`Blue`,e.Yellow=`Yellow`,e}({}),At=function(e){return e.Read=`Read`,e.Write=`Write`,e.Edit=`Edit`,e.Grep=`Grep`,e}({}),jt=function(e){return e.CamelCase=`CamelCase`,e.PascalCase=`PascalCase`,e.SnakeCase=`SnakeCase`,e.KebabCase=`KebabCase`,e.UpperCase=`UpperCase`,e.LowerCase=`LowerCase`,e.Original=`Original`,e}({}),Mt=function(e){return e.UserHome=`UserHome`,e.External=`External`,e}({}),N=function(e){return e.Relative=`Relative`,e.Absolute=`Absolute`,e.Root=`Root`,e}({}),P=function(e){return e.VSCode=`VSCode`,e.IntellijIDEA=`IntellijIDEA`,e.Git=`Git`,e.EditorConfig=`EditorConfig`,e.Original=`Original`,e}({});function Nt(e,t){let{requiredFields:n,optionalDefaults:r,filePath:i}=t,a=[],o=[];for(let t of n){let n=String(t);if(!(n in e)||e[n]==null){let e=i==null?`Missing required field "${n}"`:`Missing required field "${n}" in ${i}`;a.push(e)}}if(r!=null){for(let[t,n]of Object.entries(r))if(!(t in e)||e[t]==null){let e=i==null?`Using default value for optional field "${t}": ${JSON.stringify(n)}`:`Using default value for optional field "${t}": ${JSON.stringify(n)} in ${i}`;o.push(e)}}return{valid:a.length===0,errors:a,warnings:o}}function Pt(e,t){return Nt(e,{requiredFields:[`name`,`description`],optionalDefaults:{enabled:!0,keywords:[]},filePath:t})}function Ft(e,t){return Nt(e,{requiredFields:[],optionalDefaults:{},filePath:t})}function It(e,t){return Nt(e,{requiredFields:[`name`,`description`],optionalDefaults:{},filePath:t})}function Lt(e,t){let n={...e};for(let[e,r]of Object.entries(t))(!(e in n)||n[e]==null)&&(n[e]=r);return n}const Rt=`.kt,.java,.py,.pyi,.pyx,.ts,.tsx,.js,.jsx,.mjs,.cjs,.go,.rs,.c,.cpp,.cc,.h,.hpp,.hxx,.cs,.fs,.fsx,.vb,.rb,.php,.swift,.scala,.groovy,.lua,.r,.R,.jl,.ex,.exs,.erl,.clj,.cljs,.hs,.ml,.mli,.nim,.zig,.v,.dart,.vue,.svelte,.sql,.json,.jsonc,.json5,.xml,.xsd,.xsl,.xslt,.yaml,.yml,.toml,.csv,.tsv,.graphql,.gql,.proto,.txt,.text,.rtf,.log,.ini,.conf,.cfg,.config,.properties,.env,.envrc,.editorconfig,.gitignore,.gitattributes,.npmrc,.nvmrc,.npmignore,.eslintrc,.prettierrc,.stylelintrc,.babelrc,.browserslistrc,.sh,.bash,.zsh,.fish,.ps1,.psm1,.psd1,.bat,.cmd,.html,.htm,.xhtml,.css,.scss,.sass,.less,.styl,.svg,.ejs,.hbs,.mustache,.pug,.jade,.jinja,.jinja2,.j2,.erb,.haml,.slim,.d.ts,.d.mts,.d.cts,.diff,.patch,.asm,.s,.makefile,.mk,.dockerfile,.tf,.tfvars,.prisma,.mdx`.split(`,`),zt=`.docx,.doc,.xlsx,.xls,.pptx,.ppt,.pdf,.odt,.ods,.odp,.png,.jpg,.jpeg,.gif,.webp,.ico,.bmp,.tiff,.zip,.tar,.gz,.bz2,.7z,.rar,.pyd,.pyc,.pyo,.class,.jar,.war,.dll,.so,.dylib,.exe,.bin,.wasm,.ttf,.otf,.woff,.woff2,.eot,.mp3,.wav,.ogg,.mp4,.webm,.db,.sqlite,.sqlite3`.split(`,`),F={SRC:`src`,DIST:`dist`,SKILLS:`skills`,COMMANDS:`commands`,AGENTS:`agents`,APP:`app`,IDEA:`.idea`,IDEA_CODE_STYLES:`.idea/codeStyles`,VSCODE:`.vscode`},I={GLOBAL_MEMORY:`global.mdx`,GLOBAL_MEMORY_SRC:`global.cn.mdx`,EDITOR_CONFIG:`.editorconfig`,IDEA_GITIGNORE:`.idea/.gitignore`,IDEA_PROJECT_XML:`.idea/codeStyles/Project.xml`,IDEA_CODE_STYLE_CONFIG_XML:`.idea/codeStyles/codeStyleConfig.xml`,VSCODE_SETTINGS:`.vscode/settings.json`,VSCODE_EXTENSIONS:`.vscode/extensions.json`,QODER_IGNORE:`.qoderignore`,CURSOR_IGNORE:`.cursorignore`,WARP_INDEX_IGNORE:`.warpindexignore`},L={SRC_SKILLS:`src/skills`,SRC_COMMANDS:`src/commands`,SRC_AGENTS:`src/agents`,SRC_GLOBAL_MEMORY:`app/global.cn.mdx`,DIST_SKILLS:`dist/skills`,DIST_COMMANDS:`dist/commands`,DIST_AGENTS:`dist/agents`,DIST_APP:`dist/app`,DIST_GLOBAL_MEMORY:`dist/global.mdx`,APP:`app`},Bt={src:{skills:{name:F.SKILLS,required:!1,description:`Skill source files (.cn.mdx)`},commands:{name:F.COMMANDS,required:!1,description:`Fast command source files (.cn.mdx)`},agents:{name:F.AGENTS,required:!1,description:`Sub-agent source files (.cn.mdx)`},globalMemoryFile:{name:I.GLOBAL_MEMORY_SRC,required:!1,description:`Global memory source file`}},dist:{skills:{name:F.SKILLS,required:!1,description:`Compiled skill files (.mdx)`},commands:{name:F.COMMANDS,required:!1,description:`Compiled fast command files (.mdx)`},agents:{name:F.AGENTS,required:!1,description:`Compiled sub-agent files (.mdx)`},globalMemoryFile:{name:I.GLOBAL_MEMORY,required:!1,description:`Compiled global memory file`},app:{name:F.APP,required:!1,description:`Compiled project-specific prompts`}},app:{name:F.APP,required:!1,description:`Project-specific prompts (standalone directory)`},ide:{idea:{name:F.IDEA,required:!1,description:`JetBrains IDE configuration directory`},ideaCodeStyles:{name:F.IDEA_CODE_STYLES,required:!1,description:`JetBrains IDE code styles directory`},vscode:{name:F.VSCODE,required:!1,description:`VS Code configuration directory`}},ideFiles:[{name:I.EDITOR_CONFIG,required:!1,description:`EditorConfig file`},{name:I.IDEA_GITIGNORE,required:!1,description:`JetBrains IDE .gitignore`},{name:I.IDEA_PROJECT_XML,required:!1,description:`JetBrains IDE Project.xml`},{name:I.IDEA_CODE_STYLE_CONFIG_XML,required:!1,description:`JetBrains IDE codeStyleConfig.xml`},{name:I.VSCODE_SETTINGS,required:!1,description:`VS Code settings.json`},{name:I.VSCODE_EXTENSIONS,required:!1,description:`VS Code extensions.json`}],ignoreFiles:[{name:I.QODER_IGNORE,required:!1,description:`Qoder ignore file`},{name:I.CURSOR_IGNORE,required:!1,description:`Cursor ignore file`},{name:I.WARP_INDEX_IGNORE,required:!1,description:`Warp index ignore file`}]};var Vt=class{name=`dry-run-clean`;async execute(e){let{logger:t,outputPlugins:n,createCleanContext:r}=e;t.info(`running clean pipeline`,{command:`dry-run-clean`,dryRun:!0});let i=r(!0),a=await _t(n,i);t.info(`collected outputs for cleanup`,{dryRun:!0,projectDirs:a.projectDirs.length,projectFiles:a.projectFiles.length,globalDirs:a.globalDirs.length,globalFiles:a.globalFiles.length});let o=await vt(n,i),{filesToDelete:s,dirsToDelete:c}=await this.collectDeletionTargets(e,o,i);return this.logDryRunFiles(s,t),this.logDryRunDirectories(c,t),await yt(n,i),t.info(`clean complete`,{dryRun:!0,filesAffected:s.length,dirsAffected:c.length}),{success:!0,filesAffected:s.length,dirsAffected:c.length,message:`Dry-run complete, no files were deleted`}}async collectDeletionTargets(e,t,n){let r=[],i=[];for(let a of e.outputPlugins){let e=t.get(a.name);if(e?.project){let e=await a.registerProjectOutputFiles?.(n)??[],t=await a.registerProjectOutputDirs?.(n)??[];r.push(...e.map(e=>e.getAbsolutePath())),i.push(...t.map(e=>e.getAbsolutePath()))}if(e?.global){let e=await a.registerGlobalOutputFiles?.(n)??[],t=await a.registerGlobalOutputDirs?.(n)??[];r.push(...e.map(e=>e.getAbsolutePath())),i.push(...t.map(e=>e.getAbsolutePath()))}}return{filesToDelete:r,dirsToDelete:i}}logDryRunFiles(e,t){for(let n of e){let e=g.isAbsolute(n)?n:g.resolve(n);t.info(`would delete file`,{path:e,dryRun:!0})}}logDryRunDirectories(e,t){let n=[...e].sort((e,t)=>t.length-e.length);for(let e of n){let n=g.isAbsolute(e)?e:g.resolve(e);t.info(`would delete directory`,{path:n,dryRun:!0})}}},Ht=class{name=`dry-run-output`;async execute(e){let{logger:t,outputPlugins:n,createWriteContext:r}=e;t.info(`started`,{command:`dry-run-output`,dryRun:!0});let i=r(!0),a=await bt(n,i),o=await xt(n.filter(e=>!!(a.get(e.name)?.project??!0)),i),s=0,c=0;for(let[e,n]of o)s+=n.files.length,c+=n.dirs.length,t.info(`plugin result`,{plugin:e,files:n.files.length,dirs:n.dirs.length,dryRun:!0});return t.info(`complete`,{command:`dry-run-output`,totalFiles:s,totalDirs:c,dryRun:!0}),{success:!0,filesAffected:s,dirsAffected:c,message:`Dry-run complete, no files were written`}}},Ut=class{name=`execute`;async execute(e){let{logger:t,outputPlugins:n,createCleanContext:r,createWriteContext:i}=e;t.info(`started`,{command:`execute`});let a=await Tt(n,r(!1),t,{executeHooks:!1});t.info(`cleanup complete`,{deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs});let o=i(!1),s=await bt(n,o),c=await xt(n.filter(e=>s.get(e.name)?.project??!0),o),l=0,u=0;for(let e of c.values())l+=e.files.length,u+=e.dirs.length;return t.info(`complete`,{command:`execute`,pluginCount:c.size}),{success:!0,filesAffected:l,dirsAffected:u}}};function Wt(){return`2026.10106.107`}var Gt=class{name=`version`;async execute(e){return e.logger.error(`tnmsc v${Wt()}`),{success:!0,filesAffected:0,dirsAffected:0,message:`Version displayed`}}};const R=`tnmsc`,Kt=`
21
+ ${R} v${Wt()} - Memory Sync CLI
22
22
 
23
23
  Synchronize AI memory and configuration files across projects.
24
24
 
25
25
  USAGE:
26
- ${L} Run the sync pipeline (default)
27
- ${L} help Show this help message
28
- ${L} version Show version information
29
- ${L} outdated Check for version updates
30
- ${L} init Initialize directories and files
31
- ${L} dry-run Preview what would be written
32
- ${L} clean Remove all generated files
33
- ${L} clean --dry-run Preview what would be cleaned
34
- ${L} --set key=value Set configuration value
35
- ${L} set key=value Set configuration value (same as --set)
26
+ ${R} Run the sync pipeline (default)
27
+ ${R} help Show this help message
28
+ ${R} version Show version information
29
+ ${R} outdated Check for version updates
30
+ ${R} init Initialize directories and files
31
+ ${R} dry-run Preview what would be written
32
+ ${R} clean Remove all generated files
33
+ ${R} clean --dry-run Preview what would be cleaned
34
+ ${R} --set key=value Set configuration value
35
+ ${R} set key=value Set configuration value (same as --set)
36
36
 
37
37
  SUBCOMMANDS:
38
38
  help Show this help message
@@ -44,10 +44,10 @@ SUBCOMMANDS:
44
44
  set Set configuration values in global config file
45
45
 
46
46
  ALIASES:
47
- ${L} --help, ${L} -h Same as '${L} help'
48
- ${L} --version, ${L} -v Same as '${L} version'
49
- ${L} clean -n Same as '${L} clean --dry-run'
50
- ${L} set key=value Same as '${L} --set key=value'
47
+ ${R} --help, ${R} -h Same as '${R} help'
48
+ ${R} --version, ${R} -v Same as '${R} version'
49
+ ${R} clean -n Same as '${R} clean --dry-run'
50
+ ${R} set key=value Same as '${R} --set key=value'
51
51
 
52
52
  LOG LEVEL OPTIONS:
53
53
  --trace Most verbose output
@@ -66,30 +66,36 @@ SET OPTIONS:
66
66
  shadowProjectsDir, logLevel
67
67
 
68
68
  Examples:
69
- ${L} --set workspaceDir=~/my-project
70
- ${L} --set logLevel=debug
71
- ${L} set workspaceDir=~/workspace
69
+ ${R} --set workspaceDir=~/my-project
70
+ ${R} --set logLevel=debug
71
+ ${R} set workspaceDir=~/workspace
72
72
 
73
73
  CONFIGURATION:
74
74
  Configure via plugin.config.ts in your project root.
75
75
  See documentation for detailed configuration options.
76
- `.trim();var jt=class{name=`help`;async execute(e){return console.log(At),{success:!0,filesAffected:0,dirsAffected:0,message:`Help displayed`}}};const Mt={USER_HOME:`~`,WORKSPACE:`$WORKSPACE`,SHADOW_SOURCE_PROJECT:`$SHADOW_SOURCE_PROJECT`},Nt=JSON.parse(`{
76
+ `.trim();var qt=class{name=`help`;async execute(e){return console.log(Kt),{success:!0,filesAffected:0,dirsAffected:0,message:`Help displayed`}}};const Jt={USER_HOME:`~`,WORKSPACE:`$WORKSPACE`,SHADOW_SOURCE_PROJECT:`$SHADOW_SOURCE_PROJECT`},Yt=JSON.parse(`{
77
77
  "workspaceDir": "~/project",
78
78
  "shadowSourceProjectDir": "$WORKSPACE/aindex",
79
79
  "shadowSkillSourceDir": "$SHADOW_SOURCE_PROJECT/dist/skills",
80
80
  "shadowFastCommandDir": "$SHADOW_SOURCE_PROJECT/dist/commands",
81
81
  "shadowSubAgentDir": "$SHADOW_SOURCE_PROJECT/dist/agents",
82
- "globalMemoryFile": "$SHADOW_SOURCE_PROJECT/dist/global.md",
82
+ "globalMemoryFile": "$SHADOW_SOURCE_PROJECT/dist/global.mdx",
83
83
  "shadowProjectsDir": "$SHADOW_SOURCE_PROJECT/dist/app",
84
84
  "externalProjects": [],
85
85
  "excludePatterns": {},
86
- "logLevel": "info"
86
+ "logLevel": "info",
87
+ "profile": {
88
+ "name": "Your Name",
89
+ "username": "your_username",
90
+ "gender": "male",
91
+ "birthday": "1990-01-01"
92
+ }
87
93
  }
88
- `);function Pt(e,t){let n=i.join(e,`.git`),a=r.existsSync(n);return a?t?.info(`version control detected`,{path:n}):t?.warn(`no version control detected, please use git to manage your shadow source project`,{path:e}),{hasGit:a,gitPath:n}}function Ft(e,t=wt){let n=[];It(e,P.SRC,t.src.skills,n),It(e,P.SRC,t.src.commands,n),It(e,P.SRC,t.src.agents,n),Rt(e,I.SRC_GLOBAL_MEMORY,t.src.globalMemoryFile,n),It(e,P.DIST,t.dist.skills,n),It(e,P.DIST,t.dist.commands,n),It(e,P.DIST,t.dist.agents,n),It(e,P.DIST,t.dist.app,n),Rt(e,I.DIST_GLOBAL_MEMORY,t.dist.globalMemoryFile,n),Lt(e,t.app,n),Lt(e,t.ide.idea,n),Lt(e,t.ide.ideaCodeStyles,n),Lt(e,t.ide.vscode,n);for(let r of t.ideFiles)zt(e,r,n);for(let r of t.ignoreFiles)zt(e,r,n);let r=n.filter(e=>!e.exists&&e.required),i=n.filter(e=>!e.exists&&!e.required);return{valid:r.length===0,rootPath:e,items:n,missingRequired:r,missingOptional:i}}function It(e,t,n,a){let o=i.join(e,t,n.name);a.push({path:o,exists:r.existsSync(o)&&r.statSync(o).isDirectory(),required:n.required,type:`directory`})}function Lt(e,t,n){let a=i.join(e,t.name);n.push({path:a,exists:r.existsSync(a)&&r.statSync(a).isDirectory(),required:t.required,type:`directory`})}function Rt(e,t,n,a){let o=i.join(e,t);a.push({path:o,exists:r.existsSync(o)&&r.statSync(o).isFile(),required:n.required,type:`file`})}function zt(e,t,n){let a=i.join(e,t.name);n.push({path:a,exists:r.existsSync(a)&&r.statSync(a).isFile(),required:t.required,type:`file`})}function Bt(e,t={}){let{sourceDir:n,logger:a}=t,o=[],s=[],c=[],l=[],u=(e,t)=>{if(n!=null){let t=i.join(n,e);if(r.existsSync(t)&&r.statSync(t).isFile())return a?.debug(`copying from source`,{path:t}),r.readFileSync(t,`utf-8`)}return t},d=e=>{r.existsSync(e)?(c.push(e),a?.debug(`directory exists`,{path:e})):(r.mkdirSync(e,{recursive:!0}),o.push(e),a?.info(`created directory`,{path:e}))},f=(e,t,n)=>{let c=i.dirname(e);if(r.existsSync(c)||(r.mkdirSync(c,{recursive:!0}),o.push(c),a?.info(`created directory`,{path:c})),r.existsSync(e))l.push(e),a?.debug(`file exists`,{path:e});else{let i=u(t,n);r.writeFileSync(e,i,`utf-8`),s.push(e),a?.info(`created file`,{path:e})}};return d(e),d(i.join(e,I.SRC_SKILLS)),d(i.join(e,I.SRC_COMMANDS)),d(i.join(e,I.SRC_AGENTS)),d(i.join(e,I.APP)),f(i.join(e,I.SRC_GLOBAL_MEMORY),I.SRC_GLOBAL_MEMORY,`# Global Memory
94
+ `);function Xt(e,t){let n=g.join(e,`.git`),r=h.existsSync(n);return r?t?.info(`version control detected`,{path:n}):t?.warn(`no version control detected, please use git to manage your shadow source project`,{path:e}),{hasGit:r,gitPath:n}}function Zt(e,t=Bt){let n=[];Qt(e,F.SRC,t.src.skills,n),Qt(e,F.SRC,t.src.commands,n),Qt(e,F.SRC,t.src.agents,n),en(e,L.SRC_GLOBAL_MEMORY,t.src.globalMemoryFile,n),Qt(e,F.DIST,t.dist.skills,n),Qt(e,F.DIST,t.dist.commands,n),Qt(e,F.DIST,t.dist.agents,n),Qt(e,F.DIST,t.dist.app,n),en(e,L.DIST_GLOBAL_MEMORY,t.dist.globalMemoryFile,n),$t(e,t.app,n),$t(e,t.ide.idea,n),$t(e,t.ide.ideaCodeStyles,n),$t(e,t.ide.vscode,n);for(let r of t.ideFiles)tn(e,r,n);for(let r of t.ignoreFiles)tn(e,r,n);let r=n.filter(e=>!e.exists&&e.required),i=n.filter(e=>!e.exists&&!e.required);return{valid:r.length===0,rootPath:e,items:n,missingRequired:r,missingOptional:i}}function Qt(e,t,n,r){let i=g.join(e,t,n.name);r.push({path:i,exists:h.existsSync(i)&&h.statSync(i).isDirectory(),required:n.required,type:`directory`})}function $t(e,t,n){let r=g.join(e,t.name);n.push({path:r,exists:h.existsSync(r)&&h.statSync(r).isDirectory(),required:t.required,type:`directory`})}function en(e,t,n,r){let i=g.join(e,t);r.push({path:i,exists:h.existsSync(i)&&h.statSync(i).isFile(),required:n.required,type:`file`})}function tn(e,t,n){let r=g.join(e,t.name);n.push({path:r,exists:h.existsSync(r)&&h.statSync(r).isFile(),required:t.required,type:`file`})}function nn(e,t={}){let{sourceDir:n,logger:r}=t,i=[],a=[],o=[],s=[],c=(e,t)=>{if(n!=null){let t=g.join(n,e);if(h.existsSync(t)&&h.statSync(t).isFile())return r?.debug(`copying from source`,{path:t}),h.readFileSync(t,`utf-8`)}return t},l=e=>{h.existsSync(e)?(o.push(e),r?.debug(`directory exists`,{path:e})):(h.mkdirSync(e,{recursive:!0}),i.push(e),r?.info(`created directory`,{path:e}))},u=(e,t,n)=>{let o=g.dirname(e);if(h.existsSync(o)||(h.mkdirSync(o,{recursive:!0}),i.push(o),r?.info(`created directory`,{path:o})),h.existsSync(e))s.push(e),r?.debug(`file exists`,{path:e});else{let i=c(t,n);h.writeFileSync(e,i,`utf-8`),a.push(e),r?.info(`created file`,{path:e})}};return l(e),l(g.join(e,L.SRC_SKILLS)),l(g.join(e,L.SRC_COMMANDS)),l(g.join(e,L.SRC_AGENTS)),l(g.join(e,L.APP)),u(g.join(e,L.SRC_GLOBAL_MEMORY),L.SRC_GLOBAL_MEMORY,`# Global Memory
89
95
 
90
- `),d(i.join(e,I.DIST_SKILLS)),d(i.join(e,I.DIST_COMMANDS)),d(i.join(e,I.DIST_AGENTS)),d(i.join(e,I.DIST_APP)),f(i.join(e,I.DIST_GLOBAL_MEMORY),I.DIST_GLOBAL_MEMORY,`# Global Memory
96
+ `),l(g.join(e,L.DIST_SKILLS)),l(g.join(e,L.DIST_COMMANDS)),l(g.join(e,L.DIST_AGENTS)),l(g.join(e,L.DIST_APP)),u(g.join(e,L.DIST_GLOBAL_MEMORY),L.DIST_GLOBAL_MEMORY,`# Global Memory
91
97
 
92
- `),d(i.join(e,P.IDEA_CODE_STYLES)),d(i.join(e,P.VSCODE)),f(i.join(e,F.EDITOR_CONFIG),F.EDITOR_CONFIG,Vt()),f(i.join(e,F.IDEA_GITIGNORE),F.IDEA_GITIGNORE,Ht()),f(i.join(e,F.IDEA_PROJECT_XML),F.IDEA_PROJECT_XML,Ut()),f(i.join(e,F.IDEA_CODE_STYLE_CONFIG_XML),F.IDEA_CODE_STYLE_CONFIG_XML,Wt()),f(i.join(e,F.VSCODE_SETTINGS),F.VSCODE_SETTINGS,Gt()),f(i.join(e,F.VSCODE_EXTENSIONS),F.VSCODE_EXTENSIONS,Kt()),f(i.join(e,F.QODER_IGNORE),F.QODER_IGNORE,qt()),f(i.join(e,F.CURSOR_IGNORE),F.CURSOR_IGNORE,qt()),f(i.join(e,F.WARP_INDEX_IGNORE),F.WARP_INDEX_IGNORE,qt()),{success:!0,rootPath:e,createdDirs:o,createdFiles:s,existedDirs:c,existedFiles:l}}function Vt(){return`root = true
98
+ `),l(g.join(e,F.IDEA_CODE_STYLES)),l(g.join(e,F.VSCODE)),u(g.join(e,I.EDITOR_CONFIG),I.EDITOR_CONFIG,rn()),u(g.join(e,I.IDEA_GITIGNORE),I.IDEA_GITIGNORE,an()),u(g.join(e,I.IDEA_PROJECT_XML),I.IDEA_PROJECT_XML,on()),u(g.join(e,I.IDEA_CODE_STYLE_CONFIG_XML),I.IDEA_CODE_STYLE_CONFIG_XML,sn()),u(g.join(e,I.VSCODE_SETTINGS),I.VSCODE_SETTINGS,cn()),u(g.join(e,I.VSCODE_EXTENSIONS),I.VSCODE_EXTENSIONS,ln()),u(g.join(e,I.QODER_IGNORE),I.QODER_IGNORE,un()),u(g.join(e,I.CURSOR_IGNORE),I.CURSOR_IGNORE,un()),u(g.join(e,I.WARP_INDEX_IGNORE),I.WARP_INDEX_IGNORE,un()),{success:!0,rootPath:e,createdDirs:i,createdFiles:a,existedDirs:o,existedFiles:s}}function rn(){return`root = true
93
99
 
94
100
  [*]
95
101
  indent_style = space
@@ -101,68 +107,68 @@ insert_final_newline = true
101
107
 
102
108
  [*.md]
103
109
  trim_trailing_whitespace = false
104
- `}function Ht(){return`# Default ignored files
110
+ `}function an(){return`# Default ignored files
105
111
  /shelf/
106
112
  /workspace.xml
107
- `}function Ut(){return`<component name="ProjectCodeStyleConfiguration">
113
+ `}function on(){return`<component name="ProjectCodeStyleConfiguration">
108
114
  <state>
109
115
  <option name="USE_PER_PROJECT_SETTINGS" value="true" />
110
116
  </state>
111
117
  </component>
112
- `}function Wt(){return`<component name="ProjectCodeStyleConfiguration">
118
+ `}function sn(){return`<component name="ProjectCodeStyleConfiguration">
113
119
  <code_scheme name="Project" version="173">
114
120
  <option name="LINE_SEPARATOR" value="&#10;" />
115
121
  <option name="SOFT_MARGINS" value="80,120" />
116
122
  </code_scheme>
117
123
  </component>
118
- `}function Gt(){return JSON.stringify({"editor.formatOnSave":!0,"editor.tabSize":2,"files.eol":`
119
- `,"files.trimTrailingWhitespace":!0,"files.insertFinalNewline":!0},null,2)}function Kt(){return JSON.stringify({recommendations:[]},null,2)}function qt(){return`# Dependencies
124
+ `}function cn(){return JSON.stringify({"editor.formatOnSave":!0,"editor.tabSize":2,"files.eol":`
125
+ `,"files.trimTrailingWhitespace":!0,"files.insertFinalNewline":!0},null,2)}function ln(){return JSON.stringify({recommendations:[]},null,2)}function un(){return`logs/
126
+ CLAUDE.md
127
+ GEMINI.md
128
+ AGENTS.md
129
+ WARP.md
130
+ .claude/
131
+ .factory/
132
+ .cursor/
133
+ .codebuddy/
134
+ .qoder/
135
+ .windsurf/
136
+ .kiro/
137
+ .cache/
138
+ .skills/
139
+ .google-devtools-mcp/
140
+ nul
120
141
  node_modules/
121
-
122
- # Build outputs
123
- dist/
124
- build/
125
- out/
126
-
127
- # IDE
128
- .idea/
129
- .vscode/
130
-
131
- # OS
132
- .DS_Store
133
- Thumbs.db
134
-
135
- # Logs
136
- *.log
137
- `}function Jt(e,t,n){let r=e;return r=r.replace(Mt.SHADOW_SOURCE_PROJECT,n),r=r.replace(Mt.WORKSPACE,t),r.startsWith(`~`)&&(r=i.join(o.homedir(),r.slice(1))),i.normalize(r)}var Yt=class{name=`init`;async execute(e){let{logger:t,userConfigOptions:n}=e;t.info(`initializing shadow source project structure`,{command:`init`});let r=Jt(n.workspaceDir,``,``),i=Bt(Jt(n.shadowSourceProjectDir,r,``),{logger:t}),a=i.createdDirs.length===0&&i.createdFiles.length===0?`All ${i.existedDirs.length} directories and ${i.existedFiles.length} files already exist`:`Created ${i.createdDirs.length} directories and ${i.createdFiles.length} files (${i.existedDirs.length} dirs, ${i.existedFiles.length} files already existed)`;return t.info(`initialization complete`,{dirsCreated:i.createdDirs.length,filesCreated:i.createdFiles.length,dirsExisted:i.existedDirs.length,filesExisted:i.existedFiles.length}),{success:i.success,filesAffected:i.createdFiles.length,dirsAffected:i.createdDirs.length,message:a}}};function Xt(){return`@truenine/memory-sync-cli`}function Zt(){return`https://registry.npmjs.org/${Xt()}/latest`}function Qt(e){let t=e.replace(/^v/,``),n=/^(\d+)\.(\d+)\.(\d+)/.exec(t);return n==null?null:[Number.parseInt(n[1],10),Number.parseInt(n[2],10),Number.parseInt(n[3],10)]}function $t(e,t){let n=Qt(e),r=Qt(t);if(n==null||r==null)return 0;for(let e=0;e<3;e++){if(n[e]<r[e])return-1;if(n[e]>r[e])return 1}return 0}const en=3e3;async function tn(){let e=new AbortController,t=setTimeout(()=>e.abort(),en);typeof t==`object`&&`unref`in t&&t.unref();try{let n=await fetch(Zt(),{headers:{Accept:`application/json`},signal:e.signal});if(clearTimeout(t),!n.ok)return{error:`HTTP ${n.status}: ${n.statusText}`};let r=await n.json();return r.version==null?{error:`Invalid response: missing version field`}:{version:r.version}}catch(e){return clearTimeout(t),e instanceof Error?e.name===`TimeoutError`||e.name===`AbortError`?{error:`Request timeout after ${en}ms`}:{error:e.message}:{error:`Unknown network error`}}}function nn(){return`2026.10103.10509`}async function rn(){let e=nn();if(e===`dev`)return{status:`development`,localVersion:e,remoteVersion:null};let t=await tn();if(`error`in t)return{status:`current`,localVersion:e,remoteVersion:null,error:t.error};let n=t.version,r=$t(e,n);return r<0?{status:`outdated`,localVersion:e,remoteVersion:n}:r>0?{status:`development`,localVersion:e,remoteVersion:n}:{status:`current`,localVersion:e,remoteVersion:n}}function an(e,t){let{status:n,localVersion:r,remoteVersion:i}=e;switch(n){case`outdated`:t.warn(`Version outdated: ${r} → ${i}. Run 'npm i -g ${Xt()}@latest' to update.`);break;case`current`:e.error==null?t.info(`Version ${r} is up to date.`):t.error(`Version check failed: ${e.error}`);break;case`development`:i==null?t.debug(`Running in development mode, version check skipped.`):t.info(`Development version detected: ${r} > ${i}. Thanks for contributing!`);break}}function on(){return new Date().getMinutes()%2==0}function sn(e){on()&&rn().then(t=>{(t.status===`outdated`||t.error!=null)&&an(t,e)}).catch(t=>{let n=t instanceof Error?t.message:`Unknown error`;e.error(`Version check failed: ${n}`)})}var cn=class{name=`outdated`;async execute(e){let t=await rn();return an(t,e.logger),{success:!0,filesAffected:0,dirsAffected:0,message:`Version status: ${t.status}`}}};let ln;function un(e){ln=e}function dn(){return ln}const fn={error:s.red,warn:s.yellow,info:s.cyan,debug:s.magenta,trace:s.gray,fatal:s.bgRed},pn={silent:0,fatal:1,error:2,warn:3,info:4,debug:5,trace:6};function mn(e){return e===null?s.dim(`null`):e===void 0?s.dim(`undefined`):typeof e==`boolean`?s.yellow(String(e)):typeof e==`number`?s.blue(String(e)):typeof e==`string`?s.green(`"${e}"`):Array.isArray(e)?e.length===0?`[]`:`[${e.map(e=>mn(e)).join(`,`)}]`:typeof e==`object`?hn(e):String(e)}function hn(e){let t=Object.entries(e);return t.length===0?`{}`:`{${t.map(([e,t])=>`${/^[\w$]+$/.test(e)?s.magenta(e):s.yellow(`"${e}"`)}:${mn(t)}`).join(`,`)}}`}function gn(){let e=new Date;return`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}.${String(e.getMilliseconds()).padStart(3,`0`)}`}function _n(e,t,n,r){let i=gn(),a=fn[e]??s.white,o={$:[i,e,t],_:r!=null&&Object.keys(r).length>0?{[String(n)]:r}:n},c={$:[i,a(e.toUpperCase()),t]},l=r!=null&&Object.keys(r).length>0?{[String(n)]:r}:n,u=hn({...c,_:l});return console.log(u),o}function vn(e,t,n){let r=pn[e],i=pn[n];return(n,...a)=>r>i?{$:[gn(),e,t],_:n}:typeof n==`string`?_n(e,t,n,a.length===1&&typeof a[0]==`object`&&a[0]!==null?a[0]:a.length>0?{args:a}:void 0):typeof n==`object`&&n?_n(e,t,``,n):_n(e,t,n)}function yn(e,t){let r=t??ln??n.env.LOG_LEVEL??`info`;return{error:vn(`error`,e,r),warn:vn(`warn`,e,r),info:vn(`info`,e,r),debug:vn(`debug`,e,r),trace:vn(`trace`,e,r),fatal:vn(`fatal`,e,r)}}const bn=`.tnmsc.json`,xn=`.aindex`;function Sn(){return i.join(o.homedir(),xn,bn)}function Cn(){return{...Nt}}function wn(e,t){let n=Sn(),a=i.dirname(n);r.existsSync(a)||r.mkdirSync(a,{recursive:!0}),r.writeFileSync(n,`${JSON.stringify(e,null,2)}\n`,`utf-8`),t.info(`global config created`,{path:n})}var Tn=class{configFileName;searchCwd;searchGlobal;customSearchPaths;logger;constructor(e={}){this.configFileName=e.configFileName??bn,this.searchCwd=e.searchCwd??!0,this.searchGlobal=e.searchGlobal??!0,this.customSearchPaths=e.searchPaths??[],this.logger=yn(`ConfigLoader`)}getSearchPaths(e=n.cwd()){let t=[];for(let e of this.customSearchPaths)t.push(this.resolveTilde(e));return this.searchCwd&&t.push(i.join(e,this.configFileName)),this.searchGlobal&&t.push(i.join(o.homedir(),xn,this.configFileName)),t}loadFromFile(e){let t=this.resolveTilde(e);try{if(!r.existsSync(t))return{config:{},source:null,found:!1};let e=r.readFileSync(t,`utf-8`),n=this.parseConfig(e,t);return this.logger.debug(`loaded`,{source:t}),{config:n,source:t,found:!0}}catch(e){return this.logger.warn(`load failed`,{path:t,error:e}),{config:{},source:null,found:!1}}}load(e=n.cwd()){let t=this.getSearchPaths(e),r=[];for(let e of t){let t=this.loadFromFile(e);t.found&&r.push(t)}return{config:this.mergeConfigs(r.map(e=>e.config)),sources:r.map(e=>e.source).filter(e=>e!==null),found:r.length>0}}parseConfig(e,t){try{let n=JSON.parse(e);if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`Config must be a JSON object`);return this.validateConfig(n,t)}catch(e){throw e instanceof SyntaxError?Error(`Invalid JSON in ${t}: ${e.message}`):e}}validateConfig(e,t){let n={},r=[];for(let t of[`workspaceDir`,`shadowSourceProjectDir`,`shadowSkillSourceDir`,`shadowFastCommandDir`,`shadowSubAgentDir`,`globalMemoryFile`,`shadowProjectsDir`])t in e&&(typeof e[t]==`string`?n[t]=e[t]:r.push(`${t} must be a string`));if(`logLevel`in e){let t=[`trace`,`debug`,`info`,`warn`,`error`],i=e.logLevel;typeof i==`string`&&t.includes(i)?n.logLevel=i:r.push(`logLevel must be one of: ${t.join(`, `)}`)}if(`externalProjects`in e){let t=e.externalProjects;Array.isArray(t)?t.every(e=>typeof e==`string`)?n.externalProjects=t:r.push(`externalProjects must be an array of strings`):r.push(`externalProjects must be an array`)}if(`excludePatterns`in e){let t=e.excludePatterns;if(typeof t==`object`&&t){let e=t,i={},a=!0;for(let[t,n]of Object.entries(e))Array.isArray(n)&&n.every(e=>typeof e==`string`)?i[t]=n:(r.push(`excludePatterns.${t} must be an array of strings`),a=!1);a&&(n.excludePatterns=i)}else r.push(`excludePatterns must be an object`)}return r.length>0&&this.logger.warn(`validation warnings`,{path:t,errors:r}),n}mergeConfigs(e){if(e.length===0)return{};let t=e[0];return e.length===1&&t!=null?t:[...e].reverse().reduce((e,t)=>{let n=[...e.externalProjects??[],...t.externalProjects??[]],r=this.mergeExcludePatterns(e.excludePatterns,t.excludePatterns);return{...e,...t,...n.length>0?{externalProjects:n}:{},...r==null?{}:{excludePatterns:r}}},{})}mergeExcludePatterns(e,t){if(e==null&&t==null)return null;if(e==null)return t??null;if(t==null)return e;let n={...e};for(let[e,r]of Object.entries(t))n[e]=[...n[e]??[],...r];return n}resolveTilde(e){return e.startsWith(`~`)?i.join(o.homedir(),e.slice(1)):e}};let En=null;function Dn(e){return(e||!En)&&(En=new Tn(e)),En}function On(e){return Dn().load(e)}function kn(){let e=yn(`ConfigLoader`),t=Sn();if(!r.existsSync(t))return e.warn(`global config not found, creating default config`,{path:t}),wn(Cn(),e),{valid:!0,exists:!1,errors:[],shouldExit:!1};let n;try{n=r.readFileSync(t,`utf-8`)}catch(n){let r=n instanceof Error?n.message:String(n);return e.error(`failed to read global config`,{path:t,error:r}),jn(t,e,[`Failed to read config: ${r}`])}let i;try{i=JSON.parse(n)}catch(n){let r=n instanceof Error?n.message:String(n);return e.error(`invalid JSON in global config`,{path:t,error:r}),jn(t,e,[`Invalid JSON: ${r}`])}if(typeof i!=`object`||!i||Array.isArray(i))return e.error(`global config must be a JSON object`,{path:t}),jn(t,e,[`Config must be a JSON object`]);let a=An(i);if(a.length>0){for(let n of a)e.error(`config validation error`,{path:t,error:n});return jn(t,e,a)}return{valid:!0,exists:!0,errors:[],shouldExit:!1}}function An(e){let t=[];for(let n of[`workspaceDir`,`shadowSourceProjectDir`,`shadowSkillSourceDir`,`shadowFastCommandDir`,`shadowSubAgentDir`,`globalMemoryFile`,`shadowProjectsDir`])n in e&&typeof e[n]!=`string`&&t.push(`${n} must be a string`);if(`logLevel`in e){let n=[`trace`,`debug`,`info`,`warn`,`error`],r=e.logLevel;(typeof r!=`string`||!n.includes(r))&&t.push(`logLevel must be one of: ${n.join(`, `)}`)}if(`externalProjects`in e){let n=e.externalProjects;Array.isArray(n)?n.every(e=>typeof e==`string`)||t.push(`externalProjects must be an array of strings`):t.push(`externalProjects must be an array`)}if(`excludePatterns`in e){let n=e.excludePatterns;if(typeof n!=`object`||!n||Array.isArray(n))t.push(`excludePatterns must be an object`);else{let e=n;for(let[n,r]of Object.entries(e))(!Array.isArray(r)||!r.every(e=>typeof e==`string`))&&t.push(`excludePatterns.${n} must be an array of strings`)}}return t}function jn(e,t,n){try{r.unlinkSync(e),t.info(`deleted invalid config`,{path:e})}catch{t.warn(`failed to delete invalid config`,{path:e})}return wn(Cn(),t),t.error(`recreated default config, please review and restart`,{path:e}),{valid:!1,exists:!0,errors:n,shouldExit:!0}}const Mn=[`workspaceDir`,`shadowSourceProjectDir`,`shadowSkillSourceDir`,`shadowFastCommandDir`,`shadowSubAgentDir`,`globalMemoryFile`,`shadowProjectsDir`,`logLevel`];function Nn(e){return Mn.includes(e)}function Pn(e){return[`trace`,`debug`,`info`,`warn`,`error`].includes(e)}function Fn(){return i.join(o.homedir(),xn,bn)}function In(){let e=Fn();if(!r.existsSync(e))return{};try{let t=r.readFileSync(e,`utf-8`);return JSON.parse(t)}catch{return{}}}function Ln(e){let t=Fn(),n=i.dirname(t);r.existsSync(n)||r.mkdirSync(n,{recursive:!0}),r.writeFileSync(t,`${JSON.stringify(e,null,2)}\n`,`utf-8`)}var Rn=class{name=`set`;constructor(e){this.options=e}async execute(e){let{logger:t}=e;if(this.options.length===0)return t.error(`No configuration key-value pairs provided`),t.info(`Usage: tnmsc --set key=value or tnmsc set key=value`),t.info(`Valid keys: ${Mn.join(`, `)}`),{success:!1,filesAffected:0,dirsAffected:0,message:`No options provided`};let n=In(),r=[],i=[];for(let[e,a]of this.options){if(!Nn(e)){r.push(`Invalid key: ${e} (valid keys: ${Mn.join(`, `)})`);continue}if(e===`logLevel`&&!Pn(a)){r.push(`Invalid logLevel value: ${a} (must be: trace, debug, info, warn, or error)`);continue}let o=n[e];n[e]=a,o!==a&&i.push(`${e}=${a}`),t.info(`configuration updated`,{key:e,value:a})}if(i.length>0&&(Ln(n),t.info(`global config written`,{path:Fn()})),r.length>0)for(let e of r)t.error(e);let a=r.length===0,o=a?`Configuration updated: ${i.join(`, `)}`:`Partial update: ${i.join(`, `)}. Errors: ${r.join(`, `)}`;return{success:a,filesAffected:i.length>0?1:0,dirsAffected:0,message:o}}},zn=class{name=`unknown`;constructor(e){this.unknownCmd=e}async execute(e){return console.error(`Unknown command: ${this.unknownCmd}`),console.error(`Run "tnmsc help" for available commands.`),{success:!1,filesAffected:0,dirsAffected:0}}};function Bn(e){let t=[...e],n=t[0];n!=null&&Vn(n)&&t.shift();let r=t[0];return r!=null&&Hn(r)&&t.shift(),t}function Vn(e){let t=[`node`,`nodejs`,`bun`,`deno`,`tsx`,`ts-node`,`npx`,`pnpx`,`yarn`,`pnpm`],n=e.toLowerCase().replace(/\\/g,`/`);return t.some(e=>RegExp(`(?:^|/)${e}(?:\\.exe|\\.cmd|\\.ps1)?$`,`i`).test(n)||n===e)}function Hn(e){return!!(/\.(?:m?[jt]s|cjs)$/.test(e)||/[/\\]/.test(e)&&!e.startsWith(`-`)||/^(?:@[\w-]+\/)?[\w-]+$/.test(e)&&!e.startsWith(`-`))}const Un=new Set([`help`,`version`,`outdated`,`init`,`dry-run`,`clean`,`set`]),Wn=new Map([[`--trace`,`trace`],[`--debug`,`debug`],[`--info`,`info`],[`--warn`,`warn`],[`--error`,`error`]]),Gn=new Map([[`trace`,0],[`debug`,1],[`info`,2],[`warn`,3],[`error`,4]]);function Kn(e){let{logLevelFlags:t}=e;if(t.length===0)return;let n=t[0],r=Gn.get(n)??4;for(let e of t){let t=Gn.get(e)??4;t<r&&(r=t,n=e)}return n}function qn(e){let{helpFlag:t,versionFlag:n,subcommand:r,dryRun:i,unknownCommand:a,setOption:o,positional:s}=e;if(n)return new kt;if(t)return new jt;if(a!=null)return new zn(a);if(r===`version`)return new kt;if(r===`help`)return new jt;if(r===`outdated`)return new cn;if(r===`init`)return new Yt;if(r===`dry-run`)return new Et;if(r===`clean`)return i?new Tt:new pt;if(r===`set`||o.length>0){let e=[];for(let t of s){let n=t.indexOf(`=`);n>0&&e.push([t.slice(0,n),t.slice(n+1)])}return new Rn([...o,...e])}return new Dt}function Jn(e){let t={subcommand:void 0,helpFlag:!1,versionFlag:!1,dryRun:!1,logLevel:void 0,logLevelFlags:[],setOption:[],unknownCommand:void 0,positional:[],unknown:[]},n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i!=null){if(i===`--`){t.positional.push(...e.slice(r+1).filter(e=>e!=null));break}if(i.startsWith(`--`)){let n=i.split(`=`),a=n[0]??``,o=Wn.get(a);if(o!=null){t.logLevelFlags.push(o),t.logLevel=o;continue}switch(a){case`--help`:t.helpFlag=!0;break;case`--version`:t.versionFlag=!0;break;case`--dry-run`:t.dryRun=!0;break;case`--set`:if(n.length>1){let e=n.slice(1).join(`=`),r=e.indexOf(`=`);r>0&&t.setOption.push([e.slice(0,r),e.slice(r+1)])}else{let n=e[r+1];if(n!=null){let e=n.indexOf(`=`);e>0&&(t.setOption.push([n.slice(0,e),n.slice(e+1)]),r++)}}break;default:t.unknown.push(i)}continue}if(i.startsWith(`-`)&&i.length>1){let e=i.slice(1);for(let n of e)switch(n){case`h`:t.helpFlag=!0;break;case`v`:t.versionFlag=!0;break;case`n`:t.dryRun=!0;break;default:t.unknown.push(`-${n}`)}continue}if(!n){n=!0,Un.has(i)?t.subcommand=i:t.unknownCommand=i;continue}t.positional.push(i)}}return t}var Yn=class{logger;args;outputPlugins=[];constructor(...e){this.args=Jn(Bn(e.filter(e=>e!=null)));let t=Kn(this.args);t!=null&&un(t),this.logger=yn(`PluginPipeline`,t),this.logger.debug(`initialized`,{args:this.args})}registerOutputPlugins(e){return this.outputPlugins.push(...e),this}async run(e){sn(this.logger);let{context:t,outputPlugins:n,userConfigOptions:r}=e;this.registerOutputPlugins([...n]);let i=this.resolveCommand(),a=this.createCommandContext(t,r);await i.execute(a)}resolveCommand(){return qn(this.args)}createCommandContext(e,t){return{logger:this.logger,outputPlugins:this.outputPlugins,collectedInputContext:e,userConfigOptions:t,createCleanContext:t=>this.createCleanContext(e,t),createWriteContext:t=>this.createWriteContext(e,t)}}createCleanContext(e,t){return{logger:this.logger,fs:r,path:i,glob:rt.default,collectedInputContext:e,dryRun:t}}createWriteContext(e,t){return{logger:this.logger,fs:r,path:i,glob:rt.default,collectedInputContext:e,dryRun:t,registeredPluginNames:this.outputPlugins.map(e=>e.name)}}buildDependencyGraph(e){let t=new Map;for(let n of e){let e=n.dependsOn??[];t.set(n.name,[...e])}return t}validateDependencies(e){let t=new Set(e.map(e=>e.name));for(let n of e){let e=n.dependsOn??[];for(let r of e)if(!t.has(r))throw new xt(n.name,r)}}topologicalSort(e){this.validateDependencies(e);let t=new Map;for(let n of e)t.set(n.name,n);let n=new Map;for(let t of e)n.set(t.name,0);let r=new Map;for(let t of e)r.set(t.name,[]);for(let t of e){let e=t.dependsOn??[];for(let i of e){n.set(t.name,(n.get(t.name)??0)+1);let e=r.get(i)??[];e.push(t.name),r.set(i,e)}}let i=[];for(let t of e)n.get(t.name)===0&&i.push(t.name);let a=[];for(;i.length>0;){let o=i.shift(),s=t.get(o);a.push(s);let c=(r.get(o)??[]).sort((t,n)=>e.findIndex(e=>e.name===t)-e.findIndex(e=>e.name===n));for(let e of c){let t=(n.get(e)??0)-1;n.set(e,t),t===0&&i.push(e)}}if(a.length!==e.length)throw new bt(this.findCyclePath(e,n));return a}findCyclePath(e,t){let n=new Set;for(let[e,r]of t)r>0&&n.add(e);let r=new Map;for(let t of e)if(n.has(t.name)){let e=(t.dependsOn??[]).filter(e=>n.has(e));r.set(t.name,e)}let i=new Set,a=[],o=e=>{if(a.includes(e))return a.push(e),!0;if(i.has(e))return!1;i.add(e),a.push(e);for(let t of r.get(e)??[])if(o(t))return!0;return a.pop(),!1};for(let e of n){if(o(e)){let e=a.indexOf(a[a.length-1]);return a.slice(e)}i.clear(),a.length=0}return Array.from(n)}async executePluginsInOrder(e,t,n=!1){if(e.length===0)return{};let r=this.topologicalSort(e),i=new Map,a={};for(let e of r){let r=this.buildDependencyContext(e,i),o={...t,dependencyContext:r},s=e;s.executeEffects!=null&&await s.executeEffects(o,n);let c=e.collect(o);i.set(e.name,c),a=this.mergeContexts(a,c)}return a}buildDependencyContext(e,t){if((e.dependsOn??[]).length===0)return{};let n=this.collectTransitiveDependencies(e,t),r={};for(let e of n){let n=t.get(e);n!=null&&(r=this.mergeContexts(r,n))}return r}collectTransitiveDependencies(e,t){let n=new Set,r=[];return(e=>{for(let i of e)n.has(i)||(n.add(i),t.get(i)!=null&&r.push(i))})(e.dependsOn??[]),r}mergeContexts(e,t){let n=e.workspace;if(t.workspace!=null)if(n!=null){let e=new Map;for(let t of n.projects)e.set(t.name,t);for(let n of t.workspace.projects)e.set(n.name,n);n={directory:t.workspace.directory??n.directory,projects:Array.from(e.values())}}else n=t.workspace;let r=t.externalProjects==null?e.externalProjects:[...e.externalProjects??[],...t.externalProjects],i=t.ideConfigFiles==null?e.ideConfigFiles:[...e.ideConfigFiles??[],...t.ideConfigFiles],a=t.fastCommands==null?e.fastCommands:[...e.fastCommands??[],...t.fastCommands],o=t.subAgents==null?e.subAgents:[...e.subAgents??[],...t.subAgents],s=t.skills==null?e.skills:[...e.skills??[],...t.skills],c=t.aiAgentIgnoreConfigFiles==null?e.aiAgentIgnoreConfigFiles:[...e.aiAgentIgnoreConfigFiles??[],...t.aiAgentIgnoreConfigFiles],l=t.globalMemory??e.globalMemory,u=t.shadowSourceProjectDir??e.shadowSourceProjectDir,d=t.readmePrompts==null?e.readmePrompts:[...e.readmePrompts??[],...t.readmePrompts];return{...n==null?{}:{workspace:n},...r==null?{}:{externalProjects:r},...i==null?{}:{ideConfigFiles:i},...a==null?{}:{fastCommands:a},...o==null?{}:{subAgents:o},...s==null?{}:{skills:s},...c==null?{}:{aiAgentIgnoreConfigFiles:c},...l==null?{}:{globalMemory:l},...u==null?{}:{shadowSourceProjectDir:u},...d==null?{}:{readmePrompts:d}}}};const Xn={...Nt,externalProjects:[],excludePatterns:{},fastCommandSeriesOptions:{},plugins:[]};function Zn(e){return{...e.workspaceDir==null?{}:{workspaceDir:e.workspaceDir},...e.shadowSourceProjectDir==null?{}:{shadowSourceProjectDir:e.shadowSourceProjectDir},...e.shadowSkillSourceDir==null?{}:{shadowSkillSourceDir:e.shadowSkillSourceDir},...e.shadowFastCommandDir==null?{}:{shadowFastCommandDir:e.shadowFastCommandDir},...e.shadowSubAgentDir==null?{}:{shadowSubAgentDir:e.shadowSubAgentDir},...e.globalMemoryFile==null?{}:{globalMemoryFile:e.globalMemoryFile},...e.shadowProjectsDir==null?{}:{shadowProjectsDir:e.shadowProjectsDir},...e.externalProjects==null?{}:{externalProjects:e.externalProjects},...e.excludePatterns==null?{}:{excludePatterns:e.excludePatterns},...e.fastCommandSeriesOptions==null?{}:{fastCommandSeriesOptions:e.fastCommandSeriesOptions},...e.logLevel==null?{}:{logLevel:e.logLevel}}}function Qn(...e){return e.reduce((e,t)=>$n(e,t),{...Xn})}function $n(e,t){let n=t.externalProjects,r=t.plugins,i=t.excludePatterns,a=t.fastCommandSeriesOptions;return{...e,...t,externalProjects:[...e.externalProjects,...n??[]],plugins:[...e.plugins,...r??[]],excludePatterns:er(e.excludePatterns,i),fastCommandSeriesOptions:tr(e.fastCommandSeriesOptions,a)}}function er(e,t){let n={...e};if(t)for(let[e,r]of Object.entries(t))n[e]=[...n[e]??[],...r];return n}function tr(e,t){if(t==null)return e??{};if(e==null)return t;let n={};if(e.pluginOverrides!=null)for(let[t,r]of Object.entries(e.pluginOverrides))n[t]={...r};if(t.pluginOverrides!=null)for(let[e,r]of Object.entries(t.pluginOverrides))n[e]={...n[e],...r};let r=t.includeSeriesPrefix??e.includeSeriesPrefix,i=Object.keys(n).length>0;return r!=null&&i?{includeSeriesPrefix:r,pluginOverrides:n}:r==null?i?{pluginOverrides:n}:{}:{includeSeriesPrefix:r}}function nr(e){return`pluginOptions`in e||`configLoaderOptions`in e||`loadUserConfig`in e}async function rr(e={}){kn().shouldExit&&n.exit(1);let t,a,o;nr(e)?(t=e.pluginOptions??{},a=e.loadUserConfig??!0,o=e.cwd):(t=e,a=!0);let s={},c=!1,l=[];if(a){let e=On(o);c=e.found,l=e.sources,e.found&&(s=Zn(e.config))}let u=Qn(s,t),{plugins:d=[],logLevel:f}=u,p=yn(`defineConfig`,f);c?p.info(`user config loaded`,{sources:l}):p.info(`no user config found, using defaults`,{workspaceDir:Xn.workspaceDir,shadowSourceProjectDir:Xn.shadowSourceProjectDir,shadowSkillSourceDir:Xn.shadowSkillSourceDir,shadowFastCommandDir:Xn.shadowFastCommandDir,shadowSubAgentDir:Xn.shadowSubAgentDir,globalMemoryFile:Xn.globalMemoryFile,shadowProjectsDir:Xn.shadowProjectsDir,logLevel:Xn.logLevel});let m={logger:p,userConfigOptions:u,fs:r,path:i,glob:rt.default},h=d.filter(e=>e.type===mt.Input),g=d.filter(e=>e.type===mt.Output),_=await new Yn().executePluginsInOrder(h,m);if(_.workspace==null)throw Error(`Workspace not initialized by any plugin`);let v={workspace:_.workspace,ideConfigFiles:_.ideConfigFiles??[],..._.externalProjects!=null&&{externalProjects:_.externalProjects},..._.fastCommands!=null&&{fastCommands:_.fastCommands},..._.subAgents!=null&&{subAgents:_.subAgents},..._.skills!=null&&{skills:_.skills},..._.globalMemory!=null&&{globalMemory:_.globalMemory},..._.aiAgentIgnoreConfigFiles!=null&&{aiAgentIgnoreConfigFiles:_.aiAgentIgnoreConfigFiles},..._.shadowSourceProjectDir!=null&&{shadowSourceProjectDir:_.shadowSourceProjectDir},..._.readmePrompts!=null&&{readmePrompts:_.readmePrompts}};return _.shadowSourceProjectDir!=null&&Pt(_.shadowSourceProjectDir,p),{context:v,outputPlugins:g,userConfigOptions:u}}const R=dr(/[A-Za-z]/),z=dr(/[\dA-Za-z]/),ir=dr(/[#-'*+\--9=?A-Z^-~]/);function ar(e){return e!==null&&(e<32||e===127)}const or=dr(/\d/),sr=dr(/[\dA-Fa-f]/),cr=dr(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function V(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}const lr=dr(/\p{P}|\p{S}/u),ur=dr(/\s/);function dr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var fr=x(v(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1);const pr=Object.assign(mr(Error),{eval:mr(EvalError),range:mr(RangeError),reference:mr(ReferenceError),syntax:mr(SyntaxError),type:mr(TypeError),uri:mr(URIError)});function mr(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,fr.default)(t,...n))}}const hr={}.hasOwnProperty,gr={yaml:`-`,toml:`+`};function _r(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=vr(r[n]);return t}function vr(e){let t=e;if(typeof t==`string`){if(!hr.call(gr,t))throw pr("Missing matter definition for `%s`",t);t={type:t,marker:gr[t]}}else if(typeof t!=`object`)throw pr("Expected matter to be an object, not `%j`",t);if(!hr.call(t,`type`))throw pr("Missing `type` in matter `%j`",t);if(!hr.call(t,`fence`)&&!hr.call(t,`marker`))throw pr("Missing `marker` or `fence` in matter `%j`",t);return t}function yr(e){let t=_r(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=xr(e,`open`).charCodeAt(0),a=br(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function br(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=xr(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),H(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return H(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return B(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=xr(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||B(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||B(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),H(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return H(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||B(i)?(e.exit(r),t(i)):n(i)}}}function xr(e,t){return e.marker?Sr(e.marker,t).repeat(3):Sr(e.fence,t)}function Sr(e,t){return typeof e==`string`?e:e[t]}function Cr(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function wr(e){let t=_r(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=Tr(e),r[e.type]=Er,r[e.type+`Value`]=Dr}return{enter:n,exit:r}}function Tr(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function Er(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function Dr(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Or(e){let t=[],n={},r=_r(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=kr(e);let a=Ar(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:Cr(a.charAt(1))})}return{unsafe:t,handlers:n}}function kr(e){let t=Ar(e,`open`),n=Ar(e,`close`);return r;function r(e){return t+(e.value?`
142
+ pnpm-lock.yaml
143
+ `}function dn(e,t,n){let r=e;return r=r.replace(Jt.SHADOW_SOURCE_PROJECT,n),r=r.replace(Jt.WORKSPACE,t),r.startsWith(`~`)&&(r=g.join(v.homedir(),r.slice(1))),g.normalize(r)}var fn=class{name=`init`;async execute(e){let{logger:t,userConfigOptions:n}=e;t.info(`initializing shadow source project structure`,{command:`init`});let r=dn(n.workspaceDir,``,``),i=nn(dn(n.shadowSourceProjectDir,r,``),{logger:t}),a=i.createdDirs.length===0&&i.createdFiles.length===0?`All ${i.existedDirs.length} directories and ${i.existedFiles.length} files already exist`:`Created ${i.createdDirs.length} directories and ${i.createdFiles.length} files (${i.existedDirs.length} dirs, ${i.existedFiles.length} files already existed)`;return t.info(`initialization complete`,{dirsCreated:i.createdDirs.length,filesCreated:i.createdFiles.length,dirsExisted:i.existedDirs.length,filesExisted:i.existedFiles.length}),{success:i.success,filesAffected:i.createdFiles.length,dirsAffected:i.createdDirs.length,message:a}}};function pn(){return`@truenine/memory-sync-cli`}function mn(){return`https://registry.npmjs.org/${pn()}/latest`}function hn(e){let t=e.replace(/^v/,``),n=/^(\d+)\.(\d+)\.(\d+)/.exec(t);return n==null?null:[Number.parseInt(n[1],10),Number.parseInt(n[2],10),Number.parseInt(n[3],10)]}function gn(e,t){let n=hn(e),r=hn(t);if(n==null||r==null)return 0;for(let e=0;e<3;e++){if(n[e]<r[e])return-1;if(n[e]>r[e])return 1}return 0}const _n=3e3;async function vn(){let e=new AbortController,t=setTimeout(()=>e.abort(),_n);typeof t==`object`&&`unref`in t&&t.unref();try{let n=await fetch(mn(),{headers:{Accept:`application/json`},signal:e.signal});if(clearTimeout(t),!n.ok)return{error:`HTTP ${n.status}: ${n.statusText}`};let r=await n.json();return r.version==null?{error:`Invalid response: missing version field`}:{version:r.version}}catch(e){return clearTimeout(t),e instanceof Error?e.name===`TimeoutError`||e.name===`AbortError`?{error:`Request timeout after ${_n}ms`}:{error:e.message}:{error:`Unknown network error`}}}function yn(){return`2026.10106.107`}async function bn(){let e=yn();if(e===`dev`)return{status:`development`,localVersion:e,remoteVersion:null};let t=await vn();if(`error`in t)return{status:`current`,localVersion:e,remoteVersion:null,error:t.error};let n=t.version,r=gn(e,n);return r<0?{status:`outdated`,localVersion:e,remoteVersion:n}:r>0?{status:`development`,localVersion:e,remoteVersion:n}:{status:`current`,localVersion:e,remoteVersion:n}}function xn(e,t){let{status:n,localVersion:r,remoteVersion:i}=e;switch(n){case`outdated`:t.warn(`Version outdated: ${r} → ${i}. Run 'npm i -g ${pn()}@latest' to update.`);break;case`current`:e.error==null?t.info(`Version ${r} is up to date.`):t.error(`Version check failed: ${e.error}`);break;case`development`:i==null?t.debug(`Running in development mode, version check skipped.`):t.info(`Development version detected: ${r} > ${i}. Thanks for contributing!`);break}}function Sn(){return new Date().getMinutes()%2==0}function Cn(e){Sn()&&bn().then(t=>{(t.status===`outdated`||t.error!=null)&&xn(t,e)}).catch(t=>{let n=t instanceof Error?t.message:`Unknown error`;e.error(`Version check failed: ${n}`)})}var wn=class{name=`outdated`;async execute(e){let t=await bn();return xn(t,e.logger),{success:!0,filesAffected:0,dirsAffected:0,message:`Version status: ${t.status}`}}};let Tn;function En(e){Tn=e}function Dn(){return Tn}const On={error:y.red,warn:y.yellow,info:y.cyan,debug:y.magenta,trace:y.gray,fatal:y.bgRed},kn={silent:0,fatal:1,error:2,warn:3,info:4,debug:5,trace:6};function An(e){return e===null?y.dim(`null`):e===void 0?y.dim(`undefined`):typeof e==`boolean`?y.yellow(String(e)):typeof e==`number`?y.blue(String(e)):typeof e==`string`?y.green(`"${e}"`):Array.isArray(e)?e.length===0?`[]`:`[${e.map(e=>An(e)).join(`,`)}]`:typeof e==`object`?jn(e):String(e)}function jn(e){let t=Object.entries(e);return t.length===0?`{}`:`{${t.map(([e,t])=>`${/^[\w$]+$/.test(e)?y.magenta(e):y.yellow(`"${e}"`)}:${An(t)}`).join(`,`)}}`}function Mn(){let e=new Date;return`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}:${String(e.getSeconds()).padStart(2,`0`)}.${String(e.getMilliseconds()).padStart(3,`0`)}`}function Nn(e,t,n,r){let i=Mn(),a=On[e]??y.white,o={$:[i,e,t],_:r!=null&&Object.keys(r).length>0?{[String(n)]:r}:n},s={$:[i,a(e.toUpperCase()),t]},c=r!=null&&Object.keys(r).length>0?{[String(n)]:r}:n,l=jn({...s,_:c});return console.log(l),o}function Pn(e,t,n){let r=kn[e],i=kn[n];return(n,...a)=>r>i?{$:[Mn(),e,t],_:n}:typeof n==`string`?Nn(e,t,n,a.length===1&&typeof a[0]==`object`&&a[0]!==null?a[0]:a.length>0?{args:a}:void 0):typeof n==`object`&&n?Nn(e,t,``,n):Nn(e,t,n)}function Fn(e,t){let n=t??Tn??m.env.LOG_LEVEL??`info`;return{error:Pn(`error`,e,n),warn:Pn(`warn`,e,n),info:Pn(`info`,e,n),debug:Pn(`debug`,e,n),trace:Pn(`trace`,e,n),fatal:Pn(`fatal`,e,n)}}const In=`.tnmsc.json`,Ln=`.aindex`;function Rn(){return g.join(v.homedir(),Ln,In)}function zn(){return{...Yt}}function Bn(e,t){let n=Rn(),r=g.dirname(n);h.existsSync(r)||h.mkdirSync(r,{recursive:!0}),h.writeFileSync(n,`${JSON.stringify(e,null,2)}\n`,`utf-8`),t.info(`global config created`,{path:n})}var Vn=class{configFileName;searchCwd;searchGlobal;customSearchPaths;logger;constructor(e={}){this.configFileName=e.configFileName??In,this.searchCwd=e.searchCwd??!0,this.searchGlobal=e.searchGlobal??!0,this.customSearchPaths=e.searchPaths??[],this.logger=Fn(`ConfigLoader`)}getSearchPaths(e=m.cwd()){let t=[];for(let e of this.customSearchPaths)t.push(this.resolveTilde(e));return this.searchCwd&&t.push(g.join(e,this.configFileName)),this.searchGlobal&&t.push(g.join(v.homedir(),Ln,this.configFileName)),t}loadFromFile(e){let t=this.resolveTilde(e);try{if(!h.existsSync(t))return{config:{},source:null,found:!1};let e=h.readFileSync(t,`utf-8`),n=this.parseConfig(e,t);return this.logger.debug(`loaded`,{source:t}),{config:n,source:t,found:!0}}catch(e){return this.logger.warn(`load failed`,{path:t,error:e}),{config:{},source:null,found:!1}}}load(e=m.cwd()){let t=this.getSearchPaths(e),n=[];for(let e of t){let t=this.loadFromFile(e);t.found&&n.push(t)}return{config:this.mergeConfigs(n.map(e=>e.config)),sources:n.map(e=>e.source).filter(e=>e!==null),found:n.length>0}}parseConfig(e,t){try{let n=JSON.parse(e);if(typeof n!=`object`||!n||Array.isArray(n))throw Error(`Config must be a JSON object`);return this.validateConfig(n,t)}catch(e){throw e instanceof SyntaxError?Error(`Invalid JSON in ${t}: ${e.message}`):e}}validateConfig(e,t){let n={},r=[];for(let t of[`workspaceDir`,`shadowSourceProjectDir`,`shadowSkillSourceDir`,`shadowFastCommandDir`,`shadowSubAgentDir`,`globalMemoryFile`,`shadowProjectsDir`])t in e&&(typeof e[t]==`string`?n[t]=e[t]:r.push(`${t} must be a string`));if(`logLevel`in e){let t=[`trace`,`debug`,`info`,`warn`,`error`],i=e.logLevel;typeof i==`string`&&t.includes(i)?n.logLevel=i:r.push(`logLevel must be one of: ${t.join(`, `)}`)}if(`externalProjects`in e){let t=e.externalProjects;Array.isArray(t)?t.every(e=>typeof e==`string`)?n.externalProjects=t:r.push(`externalProjects must be an array of strings`):r.push(`externalProjects must be an array`)}if(`excludePatterns`in e){let t=e.excludePatterns;if(typeof t==`object`&&t){let e=t,i={},a=!0;for(let[t,n]of Object.entries(e))Array.isArray(n)&&n.every(e=>typeof e==`string`)?i[t]=n:(r.push(`excludePatterns.${t} must be an array of strings`),a=!1);a&&(n.excludePatterns=i)}else r.push(`excludePatterns must be an object`)}if(`profile`in e){let t=e.profile;typeof t==`object`&&t&&!Array.isArray(t)?n.profile=t:r.push(`profile must be an object`)}if(`tool`in e){let t=e.tool;if(typeof t==`object`&&t&&!Array.isArray(t)){let e=t,i={},a=!0;for(let[t,n]of Object.entries(e))typeof n==`string`||n===void 0?i[t]=n:(r.push(`tool.${t} must be a string`),a=!1);a&&(n.tool=i)}else r.push(`tool must be an object`)}return r.length>0&&this.logger.warn(`validation warnings`,{path:t,errors:r}),n}mergeConfigs(e){if(e.length===0)return{};let t=e[0];return e.length===1&&t!=null?t:[...e].reverse().reduce((e,t)=>{let n=[...e.externalProjects??[],...t.externalProjects??[]],r=this.mergeExcludePatterns(e.excludePatterns,t.excludePatterns);return{...e,...t,...n.length>0?{externalProjects:n}:{},...r==null?{}:{excludePatterns:r}}},{})}mergeExcludePatterns(e,t){if(e==null&&t==null)return null;if(e==null)return t??null;if(t==null)return e;let n={...e};for(let[e,r]of Object.entries(t))n[e]=[...n[e]??[],...r];return n}resolveTilde(e){return e.startsWith(`~`)?g.join(v.homedir(),e.slice(1)):e}};let Hn=null;function Un(e){return(e||!Hn)&&(Hn=new Vn(e)),Hn}function Wn(e){return Un().load(e)}function Gn(){let e=Fn(`ConfigLoader`),t=Rn();if(!h.existsSync(t))return e.warn(`global config not found, creating default config`,{path:t}),Bn(zn(),e),{valid:!0,exists:!1,errors:[],shouldExit:!1};let n;try{n=h.readFileSync(t,`utf-8`)}catch(n){let r=n instanceof Error?n.message:String(n);return e.error(`failed to read global config`,{path:t,error:r}),qn(t,e,[`Failed to read config: ${r}`])}let r;try{r=JSON.parse(n)}catch(n){let r=n instanceof Error?n.message:String(n);return e.error(`invalid JSON in global config`,{path:t,error:r}),qn(t,e,[`Invalid JSON: ${r}`])}if(typeof r!=`object`||!r||Array.isArray(r))return e.error(`global config must be a JSON object`,{path:t}),qn(t,e,[`Config must be a JSON object`]);let i=Kn(r);if(i.length>0){for(let n of i)e.error(`config validation error`,{path:t,error:n});return qn(t,e,i)}return{valid:!0,exists:!0,errors:[],shouldExit:!1}}function Kn(e){let t=[];for(let n of[`workspaceDir`,`shadowSourceProjectDir`,`shadowSkillSourceDir`,`shadowFastCommandDir`,`shadowSubAgentDir`,`globalMemoryFile`,`shadowProjectsDir`])n in e&&typeof e[n]!=`string`&&t.push(`${n} must be a string`);if(`logLevel`in e){let n=[`trace`,`debug`,`info`,`warn`,`error`],r=e.logLevel;(typeof r!=`string`||!n.includes(r))&&t.push(`logLevel must be one of: ${n.join(`, `)}`)}if(`externalProjects`in e){let n=e.externalProjects;Array.isArray(n)?n.every(e=>typeof e==`string`)||t.push(`externalProjects must be an array of strings`):t.push(`externalProjects must be an array`)}if(`excludePatterns`in e){let n=e.excludePatterns;if(typeof n!=`object`||!n||Array.isArray(n))t.push(`excludePatterns must be an object`);else{let e=n;for(let[n,r]of Object.entries(e))(!Array.isArray(r)||!r.every(e=>typeof e==`string`))&&t.push(`excludePatterns.${n} must be an array of strings`)}}if(`profile`in e){let n=e.profile;(typeof n!=`object`||!n||Array.isArray(n))&&t.push(`profile must be an object`)}if(`tool`in e){let n=e.tool;if(typeof n!=`object`||!n||Array.isArray(n))t.push(`tool must be an object`);else{let e=n;for(let[n,r]of Object.entries(e))typeof r!=`string`&&r!==void 0&&t.push(`tool.${n} must be a string`)}}return t}function qn(e,t,n){try{h.unlinkSync(e),t.info(`deleted invalid config`,{path:e})}catch{t.warn(`failed to delete invalid config`,{path:e})}return Bn(zn(),t),t.error(`recreated default config, please review and restart`,{path:e}),{valid:!1,exists:!0,errors:n,shouldExit:!0}}const Jn=[`workspaceDir`,`shadowSourceProjectDir`,`shadowSkillSourceDir`,`shadowFastCommandDir`,`shadowSubAgentDir`,`globalMemoryFile`,`shadowProjectsDir`,`logLevel`];function Yn(e){return Jn.includes(e)}function Xn(e){return[`trace`,`debug`,`info`,`warn`,`error`].includes(e)}function Zn(){return g.join(v.homedir(),Ln,In)}function Qn(){let e=Zn();if(!h.existsSync(e))return{};try{let t=h.readFileSync(e,`utf-8`);return JSON.parse(t)}catch{return{}}}function $n(e){let t=Zn(),n=g.dirname(t);h.existsSync(n)||h.mkdirSync(n,{recursive:!0}),h.writeFileSync(t,`${JSON.stringify(e,null,2)}\n`,`utf-8`)}var er=class{name=`set`;constructor(e){this.options=e}async execute(e){let{logger:t}=e;if(this.options.length===0)return t.error(`No configuration key-value pairs provided`),t.info(`Usage: tnmsc --set key=value or tnmsc set key=value`),t.info(`Valid keys: ${Jn.join(`, `)}`),{success:!1,filesAffected:0,dirsAffected:0,message:`No options provided`};let n=Qn(),r=[],i=[];for(let[e,a]of this.options){if(!Yn(e)){r.push(`Invalid key: ${e} (valid keys: ${Jn.join(`, `)})`);continue}if(e===`logLevel`&&!Xn(a)){r.push(`Invalid logLevel value: ${a} (must be: trace, debug, info, warn, or error)`);continue}let o=n[e];n[e]=a,o!==a&&i.push(`${e}=${a}`),t.info(`configuration updated`,{key:e,value:a})}if(i.length>0&&($n(n),t.info(`global config written`,{path:Zn()})),r.length>0)for(let e of r)t.error(e);let a=r.length===0,o=a?`Configuration updated: ${i.join(`, `)}`:`Partial update: ${i.join(`, `)}. Errors: ${r.join(`, `)}`;return{success:a,filesAffected:i.length>0?1:0,dirsAffected:0,message:o}}},tr=class{name=`unknown`;constructor(e){this.unknownCmd=e}async execute(e){return console.error(`Unknown command: ${this.unknownCmd}`),console.error(`Run "tnmsc help" for available commands.`),{success:!1,filesAffected:0,dirsAffected:0}}};const nr={default:{websearch:`web_search`,webfetch:`web_fetch`,readFile:`read_file`,writeFile:`write_file`,executeCommand:`execute_command`,todolistWrite:`todolist_write`,grep:`grep`},claudeCode:{readFile:`Read`,writeFile:`Write`,executeCommand:`Execute`,todolistWrite:`TodoWrite`},kiro:{websearch:`remote_web_search`,webfetch:`webFetch`,readFile:`readFile`,writeFile:`fsWrite`,executeCommand:`executeBash`,todolistWrite:`todolistWrite`,grep:`grepSearch`}};let rr=function(e){return e.Bash=`bash`,e.Zsh=`zsh`,e.Fish=`fish`,e.Sh=`sh`,e.PowerShell=`powershell`,e.Pwsh=`pwsh`,e.Cmd=`cmd`,e.Unknown=`unknown`,e}({}),ir=function(e){return e.Win=`win`,e.Mac=`mac`,e.Linux=`linux`,e.Unknown=`unknown`,e}({});var ar=class{userConfig;toolPreset;constructor(e={}){this.userConfig=e.userConfig,this.toolPreset=e.toolPreset??`default`}collect(){return{os:this.collectOsInfo(),env:this.collectEnvContext(),profile:this.collectProfile(),tool:this.collectToolReferences()}}collectOsInfo(){let e=v.platform();return{platform:e,arch:v.arch(),hostname:v.hostname(),homedir:v.homedir(),tmpdir:v.tmpdir(),type:v.type(),release:v.release(),shellKind:this.detectShellKind(),kind:this.detectOsKind(e)}}detectOsKind(e){switch(e){case`win32`:return ir.Win;case`darwin`:return ir.Mac;case`linux`:case`freebsd`:case`openbsd`:case`sunos`:case`aix`:return ir.Linux;default:return ir.Unknown}}detectShellKind(){let e=(m.env.SHELL??m.env.ComSpec??``).toLowerCase();return e.includes(`bash`)?rr.Bash:e.includes(`zsh`)?rr.Zsh:e.includes(`fish`)?rr.Fish:e.includes(`pwsh`)?rr.Pwsh:e.includes(`powershell`)?rr.PowerShell:e.includes(`cmd`)?rr.Cmd:e.endsWith(`/sh`)?rr.Sh:rr.Unknown}collectEnvContext(){return{...m.env}}collectProfile(){return this.userConfig?.profile==null?{}:this.userConfig.profile}collectToolReferences(){let e={...nr.default};return this.toolPreset===`claudeCode`?{...e,...nr.claudeCode}:this.toolPreset===`kiro`?{...e,...nr.kiro}:e}};let or=function(e){return e[e.SystemDefault=0]=`SystemDefault`,e[e.UserConfig=10]=`UserConfig`,e[e.PluginRegistered=20]=`PluginRegistered`,e[e.CompileTime=30]=`CompileTime`,e}({});var sr=class{registrations=[];globalScope=null;setGlobalScope(e){this.globalScope=e}getGlobalScope(){return this.globalScope}register(e,t,n=or.PluginRegistered){this.registrations.push({namespace:e,values:t,priority:n})}getRegistrations(){return this.registrations}merge(e){let t={};this.globalScope!=null&&(t.os={...this.globalScope.os},t.env={...this.globalScope.env},t.profile={...this.globalScope.profile},t.tool={...this.globalScope.tool});let n=[...this.registrations].sort((e,t)=>e.priority-t.priority);for(let e of n)t[e.namespace]=this.deepMerge(t[e.namespace],e.values);if(e!=null)for(let[n,r]of Object.entries(e))typeof r==`object`&&r&&!Array.isArray(r)?t[n]=this.deepMerge(t[n],r):t[n]=r;return t}deepMerge(e,t){if(e==null)return{...t};let n={...e};for(let[e,r]of Object.entries(t))typeof r==`object`&&r&&!Array.isArray(r)&&typeof n[e]==`object`&&n[e]!==null&&!Array.isArray(n[e])?n[e]=this.deepMerge(n[e],r):n[e]=r;return n}clear(){this.registrations.length=0,this.globalScope=null}};function cr(e){let t=[...e],n=t[0];n!=null&&lr(n)&&t.shift();let r=t[0];return r!=null&&ur(r)&&t.shift(),t}function lr(e){let t=[`node`,`nodejs`,`bun`,`deno`,`tsx`,`ts-node`,`npx`,`pnpx`,`yarn`,`pnpm`],n=e.toLowerCase().replace(/\\/g,`/`);return t.some(e=>RegExp(`(?:^|/)${e}(?:\\.exe|\\.cmd|\\.ps1)?$`,`i`).test(n)||n===e)}function ur(e){return!!(/\.(?:m?[jt]s|cjs)$/.test(e)||/[/\\]/.test(e)&&!e.startsWith(`-`)||/^(?:@[\w-]+\/)?[\w-]+$/.test(e)&&!e.startsWith(`-`))}const dr=new Set([`help`,`version`,`outdated`,`init`,`dry-run`,`clean`,`set`]),fr=new Map([[`--trace`,`trace`],[`--debug`,`debug`],[`--info`,`info`],[`--warn`,`warn`],[`--error`,`error`]]),pr=new Map([[`trace`,0],[`debug`,1],[`info`,2],[`warn`,3],[`error`,4]]);function mr(e){let{logLevelFlags:t}=e;if(t.length===0)return;let n=t[0],r=pr.get(n)??4;for(let e of t){let t=pr.get(e)??4;t<r&&(r=t,n=e)}return n}function hr(e){let{helpFlag:t,versionFlag:n,subcommand:r,dryRun:i,unknownCommand:a,setOption:o,positional:s}=e;if(n)return new Gt;if(t)return new qt;if(a!=null)return new tr(a);if(r===`version`)return new Gt;if(r===`help`)return new qt;if(r===`outdated`)return new wn;if(r===`init`)return new fn;if(r===`dry-run`)return new Ht;if(r===`clean`)return i?new Vt:new Et;if(r===`set`||o.length>0){let e=[];for(let t of s){let n=t.indexOf(`=`);n>0&&e.push([t.slice(0,n),t.slice(n+1)])}return new er([...o,...e])}return new Ut}function gr(e){let t={subcommand:void 0,helpFlag:!1,versionFlag:!1,dryRun:!1,logLevel:void 0,logLevelFlags:[],setOption:[],unknownCommand:void 0,positional:[],unknown:[]},n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(i!=null){if(i===`--`){t.positional.push(...e.slice(r+1).filter(e=>e!=null));break}if(i.startsWith(`--`)){let n=i.split(`=`),a=n[0]??``,o=fr.get(a);if(o!=null){t.logLevelFlags.push(o),t.logLevel=o;continue}switch(a){case`--help`:t.helpFlag=!0;break;case`--version`:t.versionFlag=!0;break;case`--dry-run`:t.dryRun=!0;break;case`--set`:if(n.length>1){let e=n.slice(1).join(`=`),r=e.indexOf(`=`);r>0&&t.setOption.push([e.slice(0,r),e.slice(r+1)])}else{let n=e[r+1];if(n!=null){let e=n.indexOf(`=`);e>0&&(t.setOption.push([n.slice(0,e),n.slice(e+1)]),r++)}}break;default:t.unknown.push(i)}continue}if(i.startsWith(`-`)&&i.length>1){let e=i.slice(1);for(let n of e)switch(n){case`h`:t.helpFlag=!0;break;case`v`:t.versionFlag=!0;break;case`n`:t.dryRun=!0;break;default:t.unknown.push(`-${n}`)}continue}if(!n){n=!0,dr.has(i)?t.subcommand=i:t.unknownCommand=i;continue}t.positional.push(i)}}return t}var _r=class{logger;args;outputPlugins=[];constructor(...e){this.args=gr(cr(e.filter(e=>e!=null)));let t=mr(this.args);t!=null&&En(t),this.logger=Fn(`PluginPipeline`,t),this.logger.debug(`initialized`,{args:this.args})}registerOutputPlugins(e){return this.outputPlugins.push(...e),this}async run(e){Cn(this.logger);let{context:t,outputPlugins:n,userConfigOptions:r}=e;this.registerOutputPlugins([...n]);let i=this.resolveCommand(),a=this.createCommandContext(t,r);await i.execute(a)}resolveCommand(){return hr(this.args)}createCommandContext(e,t){return{logger:this.logger,outputPlugins:this.outputPlugins,collectedInputContext:e,userConfigOptions:t,createCleanContext:t=>this.createCleanContext(e,t),createWriteContext:t=>this.createWriteContext(e,t)}}createCleanContext(e,t){return{logger:this.logger,fs:h,path:g,glob:gt.default,collectedInputContext:e,dryRun:t}}createWriteContext(e,t){return{logger:this.logger,fs:h,path:g,glob:gt.default,collectedInputContext:e,dryRun:t,registeredPluginNames:this.outputPlugins.map(e=>e.name)}}buildDependencyGraph(e){let t=new Map;for(let n of e){let e=n.dependsOn??[];t.set(n.name,[...e])}return t}validateDependencies(e){let t=new Set(e.map(e=>e.name));for(let n of e){let e=n.dependsOn??[];for(let r of e)if(!t.has(r))throw new a(n.name,r)}}topologicalSort(t){this.validateDependencies(t);let n=new Map;for(let e of t)n.set(e.name,e);let r=new Map;for(let e of t)r.set(e.name,0);let i=new Map;for(let e of t)i.set(e.name,[]);for(let e of t){let t=e.dependsOn??[];for(let n of t){r.set(e.name,(r.get(e.name)??0)+1);let t=i.get(n)??[];t.push(e.name),i.set(n,t)}}let a=[];for(let e of t)r.get(e.name)===0&&a.push(e.name);let o=[];for(;a.length>0;){let e=a.shift(),s=n.get(e);o.push(s);let c=(i.get(e)??[]).sort((e,n)=>t.findIndex(t=>t.name===e)-t.findIndex(e=>e.name===n));for(let e of c){let t=(r.get(e)??0)-1;r.set(e,t),t===0&&a.push(e)}}if(o.length!==t.length)throw new e(this.findCyclePath(t,r));return o}findCyclePath(e,t){let n=new Set;for(let[e,r]of t)r>0&&n.add(e);let r=new Map;for(let t of e)if(n.has(t.name)){let e=(t.dependsOn??[]).filter(e=>n.has(e));r.set(t.name,e)}let i=new Set,a=[],o=e=>{if(a.includes(e))return a.push(e),!0;if(i.has(e))return!1;i.add(e),a.push(e);for(let t of r.get(e)??[])if(o(t))return!0;return a.pop(),!1};for(let e of n){if(o(e)){let e=a.indexOf(a[a.length-1]);return a.slice(e)}i.clear(),a.length=0}return Array.from(n)}async executePluginsInOrder(e,t,n=!1,r){if(e.length===0)return{};let i=this.topologicalSort(e),a=new ar({userConfig:r}).collect(),o=new sr;o.setGlobalScope(a),this.logger.debug(`global scope collected`,{osInfo:{platform:a.os.platform,arch:a.os.arch,shellKind:a.os.shellKind},hasProfile:Object.keys(a.profile).length>0,hasTool:Object.keys(a.tool).length>0});let s=new Map,c={};for(let e of i){let r=this.buildDependencyContext(e,s),i={...t,dependencyContext:r,globalScope:a,scopeRegistry:o},l=e;l.executeEffects!=null&&await l.executeEffects(i,n);let u=await e.collect(i);s.set(e.name,u),c=this.mergeContexts(c,u);let d=e;if(d.getRegisteredScopes!=null){let t=d.getRegisteredScopes();for(let{namespace:n,values:r}of t)o.register(n,r,or.PluginRegistered),this.logger.debug(`plugin scope registered`,{plugin:e.name,namespace:n,keys:Object.keys(r)})}}return c}buildDependencyContext(e,t){if((e.dependsOn??[]).length===0)return{};let n=this.collectTransitiveDependencies(e,t),r={};for(let e of n){let n=t.get(e);n!=null&&(r=this.mergeContexts(r,n))}return r}collectTransitiveDependencies(e,t){let n=new Set,r=[];return(e=>{for(let i of e)n.has(i)||(n.add(i),t.get(i)!=null&&r.push(i))})(e.dependsOn??[]),r}mergeContexts(e,t){let n=e.workspace;if(t.workspace!=null)if(n!=null){let e=new Map;for(let t of n.projects)e.set(t.name,t);for(let n of t.workspace.projects)e.set(n.name,n);n={directory:t.workspace.directory??n.directory,projects:Array.from(e.values())}}else n=t.workspace;let r=t.externalProjects==null?e.externalProjects:[...e.externalProjects??[],...t.externalProjects],i=t.ideConfigFiles==null?e.ideConfigFiles:[...e.ideConfigFiles??[],...t.ideConfigFiles],a=t.fastCommands==null?e.fastCommands:[...e.fastCommands??[],...t.fastCommands],o=t.subAgents==null?e.subAgents:[...e.subAgents??[],...t.subAgents],s=t.skills==null?e.skills:[...e.skills??[],...t.skills],c=t.aiAgentIgnoreConfigFiles==null?e.aiAgentIgnoreConfigFiles:[...e.aiAgentIgnoreConfigFiles??[],...t.aiAgentIgnoreConfigFiles],l=t.globalMemory??e.globalMemory,u=t.shadowSourceProjectDir??e.shadowSourceProjectDir,d=t.readmePrompts==null?e.readmePrompts:[...e.readmePrompts??[],...t.readmePrompts];return{...n==null?{}:{workspace:n},...r==null?{}:{externalProjects:r},...i==null?{}:{ideConfigFiles:i},...a==null?{}:{fastCommands:a},...o==null?{}:{subAgents:o},...s==null?{}:{skills:s},...c==null?{}:{aiAgentIgnoreConfigFiles:c},...l==null?{}:{globalMemory:l},...u==null?{}:{shadowSourceProjectDir:u},...d==null?{}:{readmePrompts:d}}}};const vr={...Yt,externalProjects:[],excludePatterns:{},fastCommandSeriesOptions:{},plugins:[]};function yr(e){return{...e.workspaceDir==null?{}:{workspaceDir:e.workspaceDir},...e.shadowSourceProjectDir==null?{}:{shadowSourceProjectDir:e.shadowSourceProjectDir},...e.shadowSkillSourceDir==null?{}:{shadowSkillSourceDir:e.shadowSkillSourceDir},...e.shadowFastCommandDir==null?{}:{shadowFastCommandDir:e.shadowFastCommandDir},...e.shadowSubAgentDir==null?{}:{shadowSubAgentDir:e.shadowSubAgentDir},...e.globalMemoryFile==null?{}:{globalMemoryFile:e.globalMemoryFile},...e.shadowProjectsDir==null?{}:{shadowProjectsDir:e.shadowProjectsDir},...e.externalProjects==null?{}:{externalProjects:e.externalProjects},...e.excludePatterns==null?{}:{excludePatterns:e.excludePatterns},...e.fastCommandSeriesOptions==null?{}:{fastCommandSeriesOptions:e.fastCommandSeriesOptions},...e.logLevel==null?{}:{logLevel:e.logLevel}}}function br(...e){return e.reduce((e,t)=>xr(e,t),{...vr})}function xr(e,t){let n=t.externalProjects,r=t.plugins,i=t.excludePatterns,a=t.fastCommandSeriesOptions;return{...e,...t,externalProjects:[...e.externalProjects,...n??[]],plugins:[...e.plugins,...r??[]],excludePatterns:Sr(e.excludePatterns,i),fastCommandSeriesOptions:Cr(e.fastCommandSeriesOptions,a)}}function Sr(e,t){let n={...e};if(t)for(let[e,r]of Object.entries(t))n[e]=[...n[e]??[],...r];return n}function Cr(e,t){if(t==null)return e??{};if(e==null)return t;let n={};if(e.pluginOverrides!=null)for(let[t,r]of Object.entries(e.pluginOverrides))n[t]={...r};if(t.pluginOverrides!=null)for(let[e,r]of Object.entries(t.pluginOverrides))n[e]={...n[e],...r};let r=t.includeSeriesPrefix??e.includeSeriesPrefix,i=Object.keys(n).length>0;return r!=null&&i?{includeSeriesPrefix:r,pluginOverrides:n}:r==null?i?{pluginOverrides:n}:{}:{includeSeriesPrefix:r}}function wr(e){return`pluginOptions`in e||`configLoaderOptions`in e||`loadUserConfig`in e}async function Tr(e={}){Gn().shouldExit&&m.exit(1);let t,n,r;wr(e)?(t=e.pluginOptions??{},n=e.loadUserConfig??!0,r=e.cwd):(t=e,n=!0);let i={},a=!1,o=[],s;if(n){let e=Wn(r);a=e.found,o=e.sources,e.found&&(i=yr(e.config),s=e.config)}let c=br(i,t),{plugins:l=[],logLevel:u}=c,d=Fn(`defineConfig`,u);a?d.info(`user config loaded`,{sources:o}):d.info(`no user config found, using defaults`,{workspaceDir:vr.workspaceDir,shadowSourceProjectDir:vr.shadowSourceProjectDir,shadowSkillSourceDir:vr.shadowSkillSourceDir,shadowFastCommandDir:vr.shadowFastCommandDir,shadowSubAgentDir:vr.shadowSubAgentDir,globalMemoryFile:vr.globalMemoryFile,shadowProjectsDir:vr.shadowProjectsDir,logLevel:vr.logLevel});let f={logger:d,userConfigOptions:c,fs:h,path:g,glob:gt.default},p=l.filter(e=>e.type===Dt.Input),_=l.filter(e=>e.type===Dt.Output),v=await new _r().executePluginsInOrder(p,f,!1,s);if(v.workspace==null)throw Error(`Workspace not initialized by any plugin`);let y={workspace:v.workspace,ideConfigFiles:v.ideConfigFiles??[],...v.externalProjects!=null&&{externalProjects:v.externalProjects},...v.fastCommands!=null&&{fastCommands:v.fastCommands},...v.subAgents!=null&&{subAgents:v.subAgents},...v.skills!=null&&{skills:v.skills},...v.globalMemory!=null&&{globalMemory:v.globalMemory},...v.aiAgentIgnoreConfigFiles!=null&&{aiAgentIgnoreConfigFiles:v.aiAgentIgnoreConfigFiles},...v.shadowSourceProjectDir!=null&&{shadowSourceProjectDir:v.shadowSourceProjectDir},...v.readmePrompts!=null&&{readmePrompts:v.readmePrompts}};return v.shadowSourceProjectDir!=null&&Xt(v.shadowSourceProjectDir,d),{context:y,outputPlugins:_,userConfigOptions:c}}const z=Nr(/[A-Za-z]/),B=Nr(/[\dA-Za-z]/),Er=Nr(/[#-'*+\--9=?A-Z^-~]/);function Dr(e){return e!==null&&(e<32||e===127)}const Or=Nr(/\d/),kr=Nr(/[\dA-Fa-f]/),Ar=Nr(/[!-/:-@[-`{-~]/);function V(e){return e!==null&&e<-2}function H(e){return e!==null&&(e<0||e===32)}function U(e){return e===-2||e===-1||e===32}const jr=Nr(/\p{P}|\p{S}/u),Mr=Nr(/\s/);function Nr(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var Pr=re(j(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1);const Fr=Object.assign(Ir(Error),{eval:Ir(EvalError),range:Ir(RangeError),reference:Ir(ReferenceError),syntax:Ir(SyntaxError),type:Ir(TypeError),uri:Ir(URIError)});function Ir(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,Pr.default)(t,...n))}}const Lr={}.hasOwnProperty,Rr={yaml:`-`,toml:`+`};function zr(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=Br(r[n]);return t}function Br(e){let t=e;if(typeof t==`string`){if(!Lr.call(Rr,t))throw Fr("Missing matter definition for `%s`",t);t={type:t,marker:Rr[t]}}else if(typeof t!=`object`)throw Fr("Expected matter to be an object, not `%j`",t);if(!Lr.call(t,`type`))throw Fr("Missing `type` in matter `%j`",t);if(!Lr.call(t,`fence`)&&!Lr.call(t,`marker`))throw Fr("Missing `marker` or `fence` in matter `%j`",t);return t}function Vr(e){let t=zr(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=Ur(e,`open`).charCodeAt(0),a=Hr(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function Hr(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=Ur(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),U(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return U(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return V(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=Ur(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||V(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||V(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),U(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return U(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||V(i)?(e.exit(r),t(i)):n(i)}}}function Ur(e,t){return e.marker?Wr(e.marker,t).repeat(3):Wr(e.fence,t)}function Wr(e,t){return typeof e==`string`?e:e[t]}function Gr(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Kr(e){let t=zr(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=qr(e),r[e.type]=Jr,r[e.type+`Value`]=Yr}return{enter:n,exit:r}}function qr(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function Jr(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function Yr(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Xr(e){let t=[],n={},r=zr(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=Zr(e);let a=Qr(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:Gr(a.charAt(1))})}return{unsafe:t,handlers:n}}function Zr(e){let t=Qr(e,`open`),n=Qr(e,`close`);return r;function r(e){return t+(e.value?`
138
144
  `+e.value:``)+`
139
- `+n}}function Ar(e,t){return e.marker?jr(e.marker,t).repeat(3):jr(e.fence,t)}function jr(e,t){return typeof e==`string`?e:e[t]}function Mr(e){let t=this,n=e||`yaml`,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yr(n)),a.push(wr(n)),o.push(Or(n))}function Nr(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const Pr=(function(e){if(e==null)return zr;if(typeof e==`function`)return Rr(e);if(typeof e==`object`)return Array.isArray(e)?Fr(e):Ir(e);if(typeof e==`string`)return Lr(e);throw Error(`Expected function, string, or object as test`)});function Fr(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Pr(e[n]);return Rr(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Ir(e){let t=e;return Rr(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Lr(e){return Rr(t);function t(t){return t&&t.type===e}}function Rr(e){return t;function t(t,n,r){return!!(Br(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function zr(){return!0}function Br(e){return typeof e==`object`&&!!e&&`type`in e}function Vr(e){return`\x1B[33m`+e+`\x1B[39m`}const Hr=[];function Ur(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Pr(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Vr(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Hr,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Wr(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Wr(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Hr:[e]}function Gr(e,t,n){let r=Pr((n||{}).ignore||[]),i=Kr(t),a=-1;for(;++a<i.length;)Ur(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function Kr(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([qr(e[0]),Jr(e[1])])}return t}function qr(e){return typeof e==`string`?new RegExp(Cr(e),`g`):e}function Jr(e){return typeof e==`function`?e:function(){return e}}const Yr=`phrasing`,Xr=[`autolink`,`link`,`image`,`label`];function Zr(){return{transforms:[ai],enter:{literalAutolink:$r,literalAutolinkEmail:ei,literalAutolinkHttp:ei,literalAutolinkWww:ei},exit:{literalAutolink:ii,literalAutolinkEmail:ri,literalAutolinkHttp:ti,literalAutolinkWww:ni}}}function Qr(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Yr,notInConstruct:Xr},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Yr,notInConstruct:Xr},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Yr,notInConstruct:Xr}]}}function $r(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function ei(e){this.config.enter.autolinkProtocol.call(this,e)}function ti(e){this.config.exit.autolinkProtocol.call(this,e)}function ni(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function ri(e){this.config.exit.autolinkEmail.call(this,e)}function ii(e){this.exit(e)}function ai(e){Gr(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,oi],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,si]],{ignore:[`link`,`linkReference`]})}function oi(e,t,n,r,i){let a=``;if(!ui(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!ci(n)))return!1;let o=li(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function si(e,t,n,r){return!ui(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function ci(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function li(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Nr(e,`(`),a=Nr(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function ui(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||ur(n)||lr(n))&&(!t||n!==47)}function di(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}xi.peek=bi;function fi(){this.buffer()}function pi(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function mi(){this.buffer()}function hi(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function gi(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=di(this.sliceSerialize(e)).toLowerCase(),n.label=t}function _i(e){this.exit(e)}function vi(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=di(this.sliceSerialize(e)).toLowerCase(),n.label=t}function yi(e){this.exit(e)}function bi(){return`[`}function xi(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Si(){return{enter:{gfmFootnoteCallString:fi,gfmFootnoteCall:pi,gfmFootnoteDefinitionLabelString:mi,gfmFootnoteDefinition:hi},exit:{gfmFootnoteCallString:gi,gfmFootnoteCall:_i,gfmFootnoteDefinitionLabelString:vi,gfmFootnoteDefinition:yi}}}function Ci(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:xi},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
140
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Ti:wi))),s(),o}}function wi(e,t,n){return t===0?e:Ti(e,t,n)}function Ti(e,t,n){return(n?``:` `)+e}const Ei=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];ji.peek=Mi;function Di(){return{canContainEols:[`delete`],enter:{strikethrough:ki},exit:{strikethrough:Ai}}}function Oi(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Ei}],handlers:{delete:ji}}}function ki(e){this.enter({type:`delete`,children:[]},e)}function Ai(e){this.exit(e)}function ji(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function Mi(){return`~`}function Ni(e){return e.length}function Pi(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ni,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Fi(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Ii(r[d]);else{let e=Ii(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
141
- `)}function Fi(e){return e==null?``:String(e)}function Ii(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Li(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Ri);return i(),o}function Ri(e,t,n){return`>`+(n?``:` `)+e}function zi(e,t){return Bi(e,t.inConstruct,!0)&&!Bi(e,t.notInConstruct,!1)}function Bi(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Vi(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
142
- `&&zi(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
143
- `}function Hi(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ui(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Wi(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Gi(e,t,n,r){let i=Wi(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Ui(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Ki);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Hi(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
145
+ `+n}}function Qr(e,t){return e.marker?$r(e.marker,t).repeat(3):$r(e.fence,t)}function $r(e,t){return typeof e==`string`?e:e[t]}function ei(e){let t=this,n=e||`yaml`,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Vr(n)),a.push(Kr(n)),o.push(Xr(n))}function ti(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const ni=(function(e){if(e==null)return si;if(typeof e==`function`)return oi(e);if(typeof e==`object`)return Array.isArray(e)?ri(e):ii(e);if(typeof e==`string`)return ai(e);throw Error(`Expected function, string, or object as test`)});function ri(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ni(e[n]);return oi(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function ii(e){let t=e;return oi(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function ai(e){return oi(t);function t(t){return t&&t.type===e}}function oi(e){return t;function t(t,n,r){return!!(ci(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function si(){return!0}function ci(e){return typeof e==`object`&&!!e&&`type`in e}function li(e){return`\x1B[33m`+e+`\x1B[39m`}const ui=[];function di(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=ni(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+li(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=ui,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=fi(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function fi(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?ui:[e]}function pi(e,t,n){let r=ni((n||{}).ignore||[]),i=mi(t),a=-1;for(;++a<i.length;)di(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function mi(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([hi(e[0]),gi(e[1])])}return t}function hi(e){return typeof e==`string`?new RegExp(Gr(e),`g`):e}function gi(e){return typeof e==`function`?e:function(){return e}}const _i=`phrasing`,vi=[`autolink`,`link`,`image`,`label`];function yi(){return{transforms:[Di],enter:{literalAutolink:xi,literalAutolinkEmail:Si,literalAutolinkHttp:Si,literalAutolinkWww:Si},exit:{literalAutolink:Ei,literalAutolinkEmail:Ti,literalAutolinkHttp:Ci,literalAutolinkWww:wi}}}function bi(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:_i,notInConstruct:vi},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:_i,notInConstruct:vi},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:_i,notInConstruct:vi}]}}function xi(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Si(e){this.config.enter.autolinkProtocol.call(this,e)}function Ci(e){this.config.exit.autolinkProtocol.call(this,e)}function wi(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function Ti(e){this.config.exit.autolinkEmail.call(this,e)}function Ei(e){this.exit(e)}function Di(e){pi(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Oi],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ki]],{ignore:[`link`,`linkReference`]})}function Oi(e,t,n,r,i){let a=``;if(!Mi(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Ai(n)))return!1;let o=ji(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function ki(e,t,n,r){return!Mi(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Ai(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function ji(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=ti(e,`(`),a=ti(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function Mi(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Mr(n)||jr(n))&&(!t||n!==47)}function Ni(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}Ui.peek=Hi;function Pi(){this.buffer()}function Fi(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Ii(){this.buffer()}function Li(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Ri(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ni(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zi(e){this.exit(e)}function Bi(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ni(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Vi(e){this.exit(e)}function Hi(){return`[`}function Ui(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function Wi(){return{enter:{gfmFootnoteCallString:Pi,gfmFootnoteCall:Fi,gfmFootnoteDefinitionLabelString:Ii,gfmFootnoteDefinition:Li},exit:{gfmFootnoteCallString:Ri,gfmFootnoteCall:zi,gfmFootnoteDefinitionLabelString:Bi,gfmFootnoteDefinition:Vi}}}function Gi(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ui},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
146
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?qi:Ki))),s(),o}}function Ki(e,t,n){return t===0?e:qi(e,t,n)}function qi(e,t,n){return(n?``:` `)+e}const Ji=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];$i.peek=ea;function Yi(){return{canContainEols:[`delete`],enter:{strikethrough:Zi},exit:{strikethrough:Qi}}}function Xi(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Ji}],handlers:{delete:$i}}}function Zi(e){this.enter({type:`delete`,children:[]},e)}function Qi(e){this.exit(e)}function $i(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function ea(){return`~`}function ta(e){return e.length}function na(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ta,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=ra(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=ia(r[d]);else{let e=ia(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
147
+ `)}function ra(e){return e==null?``:String(e)}function ia(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function aa(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),oa);return i(),o}function oa(e,t,n){return`>`+(n?``:` `)+e}function sa(e,t){return ca(e,t.inConstruct,!0)&&!ca(e,t.notInConstruct,!1)}function ca(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function la(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
148
+ `&&sa(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
149
+ `}function ua(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function da(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function fa(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function pa(e,t,n,r){let i=fa(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(da(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,ma);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(ua(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
144
150
  `,encode:["`"],...s.current()})),t()}return u+=s.move(`
145
151
  `),a&&(u+=s.move(a+`
146
- `)),u+=s.move(c),l(),u}function Ki(e,t,n){return(n?``:` `)+e}function qi(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Ji(e,t,n,r){let i=qi(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
147
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Yi(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Xi(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Zi(e){if(e===null||V(e)||ur(e))return 1;if(lr(e))return 2}function Qi(e,t,n){let r=Zi(e),i=Zi(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}$i.peek=ea;function $i(e,t,n,r){let i=Yi(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Qi(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Xi(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Qi(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Xi(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function ea(e,t,n){return n.options.emphasis||`*`}function ta(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Ur(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const na={};function ra(e,t){let n=t||na;return ia(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function ia(e,t,n){if(oa(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return aa(e.children,t,n)}return Array.isArray(e)?aa(e,t,n):``}function aa(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=ia(e[i],t,n);return r.join(``)}function oa(e){return!!(e&&typeof e==`object`)}function sa(e,t){let n=!1;return ta(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&ra(e)&&(t.options.setext||n))}function ca(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(sa(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
152
+ `)),u+=s.move(c),l(),u}function ma(e,t,n){return(n?``:` `)+e}function ha(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function ga(e,t,n,r){let i=ha(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
153
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function _a(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function va(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function ya(e){if(e===null||H(e)||Mr(e))return 1;if(jr(e))return 2}function ba(e,t,n){let r=ya(e),i=ya(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}xa.peek=Sa;function xa(e,t,n,r){let i=_a(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=ba(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=va(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=ba(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+va(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Sa(e,t,n){return n.options.emphasis||`*`}function Ca(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),di(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}const wa={};function Ta(e,t){let n=t||wa;return Ea(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Ea(e,t,n){if(Oa(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Da(e.children,t,n)}return Array.isArray(e)?Da(e,t,n):``}function Da(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Ea(e[i],t,n);return r.join(``)}function Oa(e){return!!(e&&typeof e==`object`)}function ka(e,t){let n=!1;return Ca(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ta(e)&&(t.options.setext||n))}function Aa(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ka(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
148
154
  `,after:`
149
155
  `});return r(),t(),o+`
150
156
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
151
157
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
152
- `,...a.current()});return/^[\t ]/.test(l)&&(l=Xi(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}la.peek=ua;function la(e){return e.value||``}function ua(){return`<`}da.peek=fa;function da(e,t,n,r){let i=qi(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function fa(){return`!`}pa.peek=ma;function pa(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function ma(){return`!`}ha.peek=ga;function ha(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function ga(){return"`"}function _a(e,t){let n=ra(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}va.peek=ya;function va(e,t,n,r){let i=qi(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(_a(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function ya(e,t,n){return _a(e,n)?`<`:`[`}ba.peek=xa;function ba(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function xa(){return`[`}function Sa(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Ca(e){let t=Sa(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function wa(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ta(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ea(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?wa(n):Sa(n),s=e.ordered?o===`.`?`)`:`.`:Ca(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Ta(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Da(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Oa(e,t,n,r){let i=Da(n),a=n.bulletCurrent||Sa(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function ka(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const Aa=Pr([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function ja(e,t,n,r){return(e.children.some(function(e){return Aa(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ma(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Na.peek=Pa;function Na(e,t,n,r){let i=Ma(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Qi(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Xi(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Qi(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Xi(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Pa(e,t,n){return n.options.strong||`*`}function Fa(e,t,n,r){return n.safe(e.value,r)}function Ia(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function La(e,t,n){let r=(Ta(n)+(n.options.ruleSpaces?` `:``)).repeat(Ia(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ra={blockquote:Li,break:Vi,code:Gi,definition:Ji,emphasis:$i,hardBreak:Vi,heading:ca,html:la,image:da,imageReference:pa,inlineCode:ha,link:va,linkReference:ba,list:Ea,listItem:Oa,paragraph:ka,root:ja,strong:Na,text:Fa,thematicBreak:La},za={AElig:`Æ`,AMP:`&`,Aacute:`Á`,Abreve:`Ă`,Acirc:`Â`,Acy:`А`,Afr:`𝔄`,Agrave:`À`,Alpha:`Α`,Amacr:`Ā`,And:`⩓`,Aogon:`Ą`,Aopf:`𝔸`,ApplyFunction:`⁡`,Aring:`Å`,Ascr:`𝒜`,Assign:`≔`,Atilde:`Ã`,Auml:`Ä`,Backslash:`∖`,Barv:`⫧`,Barwed:`⌆`,Bcy:`Б`,Because:`∵`,Bernoullis:`ℬ`,Beta:`Β`,Bfr:`𝔅`,Bopf:`𝔹`,Breve:`˘`,Bscr:`ℬ`,Bumpeq:`≎`,CHcy:`Ч`,COPY:`©`,Cacute:`Ć`,Cap:`⋒`,CapitalDifferentialD:`ⅅ`,Cayleys:`ℭ`,Ccaron:`Č`,Ccedil:`Ç`,Ccirc:`Ĉ`,Cconint:`∰`,Cdot:`Ċ`,Cedilla:`¸`,CenterDot:`·`,Cfr:`ℭ`,Chi:`Χ`,CircleDot:`⊙`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,Colon:`∷`,Colone:`⩴`,Congruent:`≡`,Conint:`∯`,ContourIntegral:`∮`,Copf:`ℂ`,Coproduct:`∐`,CounterClockwiseContourIntegral:`∳`,Cross:`⨯`,Cscr:`𝒞`,Cup:`⋓`,CupCap:`≍`,DD:`ⅅ`,DDotrahd:`⤑`,DJcy:`Ђ`,DScy:`Ѕ`,DZcy:`Џ`,Dagger:`‡`,Darr:`↡`,Dashv:`⫤`,Dcaron:`Ď`,Dcy:`Д`,Del:`∇`,Delta:`Δ`,Dfr:`𝔇`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,Diamond:`⋄`,DifferentialD:`ⅆ`,Dopf:`𝔻`,Dot:`¨`,DotDot:`⃜`,DotEqual:`≐`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,Downarrow:`⇓`,Dscr:`𝒟`,Dstrok:`Đ`,ENG:`Ŋ`,ETH:`Ð`,Eacute:`É`,Ecaron:`Ě`,Ecirc:`Ê`,Ecy:`Э`,Edot:`Ė`,Efr:`𝔈`,Egrave:`È`,Element:`∈`,Emacr:`Ē`,EmptySmallSquare:`◻`,EmptyVerySmallSquare:`▫`,Eogon:`Ę`,Eopf:`𝔼`,Epsilon:`Ε`,Equal:`⩵`,EqualTilde:`≂`,Equilibrium:`⇌`,Escr:`ℰ`,Esim:`⩳`,Eta:`Η`,Euml:`Ë`,Exists:`∃`,ExponentialE:`ⅇ`,Fcy:`Ф`,Ffr:`𝔉`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,Fopf:`𝔽`,ForAll:`∀`,Fouriertrf:`ℱ`,Fscr:`ℱ`,GJcy:`Ѓ`,GT:`>`,Gamma:`Γ`,Gammad:`Ϝ`,Gbreve:`Ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,Gcy:`Г`,Gdot:`Ġ`,Gfr:`𝔊`,Gg:`⋙`,Gopf:`𝔾`,GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,Gt:`≫`,HARDcy:`Ъ`,Hacek:`ˇ`,Hat:`^`,Hcirc:`Ĥ`,Hfr:`ℌ`,HilbertSpace:`ℋ`,Hopf:`ℍ`,HorizontalLine:`─`,Hscr:`ℋ`,Hstrok:`Ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,IEcy:`Е`,IJlig:`IJ`,IOcy:`Ё`,Iacute:`Í`,Icirc:`Î`,Icy:`И`,Idot:`İ`,Ifr:`ℑ`,Igrave:`Ì`,Im:`ℑ`,Imacr:`Ī`,ImaginaryI:`ⅈ`,Implies:`⇒`,Int:`∬`,Integral:`∫`,Intersection:`⋂`,InvisibleComma:`⁣`,InvisibleTimes:`⁢`,Iogon:`Į`,Iopf:`𝕀`,Iota:`Ι`,Iscr:`ℐ`,Itilde:`Ĩ`,Iukcy:`І`,Iuml:`Ï`,Jcirc:`Ĵ`,Jcy:`Й`,Jfr:`𝔍`,Jopf:`𝕁`,Jscr:`𝒥`,Jsercy:`Ј`,Jukcy:`Є`,KHcy:`Х`,KJcy:`Ќ`,Kappa:`Κ`,Kcedil:`Ķ`,Kcy:`К`,Kfr:`𝔎`,Kopf:`𝕂`,Kscr:`𝒦`,LJcy:`Љ`,LT:`<`,Lacute:`Ĺ`,Lambda:`Λ`,Lang:`⟪`,Laplacetrf:`ℒ`,Larr:`↞`,Lcaron:`Ľ`,Lcedil:`Ļ`,Lcy:`Л`,LeftAngleBracket:`⟨`,LeftArrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,LeftRightArrow:`↔`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,Leftarrow:`⇐`,Leftrightarrow:`⇔`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,LessLess:`⪡`,LessSlantEqual:`⩽`,LessTilde:`≲`,Lfr:`𝔏`,Ll:`⋘`,Lleftarrow:`⇚`,Lmidot:`Ŀ`,LongLeftArrow:`⟵`,LongLeftRightArrow:`⟷`,LongRightArrow:`⟶`,Longleftarrow:`⟸`,Longleftrightarrow:`⟺`,Longrightarrow:`⟹`,Lopf:`𝕃`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,Lscr:`ℒ`,Lsh:`↰`,Lstrok:`Ł`,Lt:`≪`,Map:`⤅`,Mcy:`М`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,MinusPlus:`∓`,Mopf:`𝕄`,Mscr:`ℳ`,Mu:`Μ`,NJcy:`Њ`,Nacute:`Ń`,Ncaron:`Ň`,Ncedil:`Ņ`,Ncy:`Н`,NegativeMediumSpace:`​`,NegativeThickSpace:`​`,NegativeThinSpace:`​`,NegativeVeryThinSpace:`​`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
153
- `,Nfr:`𝔑`,NoBreak:`⁠`,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,Not:`⫬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,Nscr:`𝒩`,Ntilde:`Ñ`,Nu:`Ν`,OElig:`Œ`,Oacute:`Ó`,Ocirc:`Ô`,Ocy:`О`,Odblac:`Ő`,Ofr:`𝔒`,Ograve:`Ò`,Omacr:`Ō`,Omega:`Ω`,Omicron:`Ο`,Oopf:`𝕆`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,Or:`⩔`,Oscr:`𝒪`,Oslash:`Ø`,Otilde:`Õ`,Otimes:`⨷`,Ouml:`Ö`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,PartialD:`∂`,Pcy:`П`,Pfr:`𝔓`,Phi:`Φ`,Pi:`Π`,PlusMinus:`±`,Poincareplane:`ℌ`,Popf:`ℙ`,Pr:`⪻`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,Prime:`″`,Product:`∏`,Proportion:`∷`,Proportional:`∝`,Pscr:`𝒫`,Psi:`Ψ`,QUOT:`"`,Qfr:`𝔔`,Qopf:`ℚ`,Qscr:`𝒬`,RBarr:`⤐`,REG:`®`,Racute:`Ŕ`,Rang:`⟫`,Rarr:`↠`,Rarrtl:`⤖`,Rcaron:`Ř`,Rcedil:`Ŗ`,Rcy:`Р`,Re:`ℜ`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,Rfr:`ℜ`,Rho:`Ρ`,RightAngleBracket:`⟩`,RightArrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,Rightarrow:`⇒`,Ropf:`ℝ`,RoundImplies:`⥰`,Rrightarrow:`⇛`,Rscr:`ℛ`,Rsh:`↱`,RuleDelayed:`⧴`,SHCHcy:`Щ`,SHcy:`Ш`,SOFTcy:`Ь`,Sacute:`Ś`,Sc:`⪼`,Scaron:`Š`,Scedil:`Ş`,Scirc:`Ŝ`,Scy:`С`,Sfr:`𝔖`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,ShortRightArrow:`→`,ShortUpArrow:`↑`,Sigma:`Σ`,SmallCircle:`∘`,Sopf:`𝕊`,Sqrt:`√`,Square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,Sscr:`𝒮`,Star:`⋆`,Sub:`⋐`,Subset:`⋐`,SubsetEqual:`⊆`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,SuchThat:`∋`,Sum:`∑`,Sup:`⋑`,Superset:`⊃`,SupersetEqual:`⊇`,Supset:`⋑`,THORN:`Þ`,TRADE:`™`,TSHcy:`Ћ`,TScy:`Ц`,Tab:` `,Tau:`Τ`,Tcaron:`Ť`,Tcedil:`Ţ`,Tcy:`Т`,Tfr:`𝔗`,Therefore:`∴`,Theta:`Θ`,ThickSpace:`  `,ThinSpace:` `,Tilde:`∼`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,Topf:`𝕋`,TripleDot:`⃛`,Tscr:`𝒯`,Tstrok:`Ŧ`,Uacute:`Ú`,Uarr:`↟`,Uarrocir:`⥉`,Ubrcy:`Ў`,Ubreve:`Ŭ`,Ucirc:`Û`,Ucy:`У`,Udblac:`Ű`,Ufr:`𝔘`,Ugrave:`Ù`,Umacr:`Ū`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,Uopf:`𝕌`,UpArrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,UpEquilibrium:`⥮`,UpTee:`⊥`,UpTeeArrow:`↥`,Uparrow:`⇑`,Updownarrow:`⇕`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,Upsilon:`Υ`,Uring:`Ů`,Uscr:`𝒰`,Utilde:`Ũ`,Uuml:`Ü`,VDash:`⊫`,Vbar:`⫫`,Vcy:`В`,Vdash:`⊩`,Vdashl:`⫦`,Vee:`⋁`,Verbar:`‖`,Vert:`‖`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,Vopf:`𝕍`,Vscr:`𝒱`,Vvdash:`⊪`,Wcirc:`Ŵ`,Wedge:`⋀`,Wfr:`𝔚`,Wopf:`𝕎`,Wscr:`𝒲`,Xfr:`𝔛`,Xi:`Ξ`,Xopf:`𝕏`,Xscr:`𝒳`,YAcy:`Я`,YIcy:`Ї`,YUcy:`Ю`,Yacute:`Ý`,Ycirc:`Ŷ`,Ycy:`Ы`,Yfr:`𝔜`,Yopf:`𝕐`,Yscr:`𝒴`,Yuml:`Ÿ`,ZHcy:`Ж`,Zacute:`Ź`,Zcaron:`Ž`,Zcy:`З`,Zdot:`Ż`,ZeroWidthSpace:`​`,Zeta:`Ζ`,Zfr:`ℨ`,Zopf:`ℤ`,Zscr:`𝒵`,aacute:`á`,abreve:`ă`,ac:`∾`,acE:`∾̳`,acd:`∿`,acirc:`â`,acute:`´`,acy:`а`,aelig:`æ`,af:`⁡`,afr:`𝔞`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,alpha:`α`,amacr:`ā`,amalg:`⨿`,amp:`&`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,aogon:`ą`,aopf:`𝕒`,ap:`≈`,apE:`⩰`,apacir:`⩯`,ape:`≊`,apid:`≋`,apos:`'`,approx:`≈`,approxeq:`≊`,aring:`å`,ascr:`𝒶`,ast:`*`,asymp:`≈`,asympeq:`≍`,atilde:`ã`,auml:`ä`,awconint:`∳`,awint:`⨑`,bNot:`⫭`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,barvee:`⊽`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,bcy:`б`,bdquo:`„`,becaus:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,beta:`β`,beth:`ℶ`,between:`≬`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bnot:`⌐`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxDL:`╗`,boxDR:`╔`,boxDl:`╖`,boxDr:`╓`,boxH:`═`,boxHD:`╦`,boxHU:`╩`,boxHd:`╤`,boxHu:`╧`,boxUL:`╝`,boxUR:`╚`,boxUl:`╜`,boxUr:`╙`,boxV:`║`,boxVH:`╬`,boxVL:`╣`,boxVR:`╠`,boxVh:`╫`,boxVl:`╢`,boxVr:`╟`,boxbox:`⧉`,boxdL:`╕`,boxdR:`╒`,boxdl:`┐`,boxdr:`┌`,boxh:`─`,boxhD:`╥`,boxhU:`╨`,boxhd:`┬`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxuL:`╛`,boxuR:`╘`,boxul:`┘`,boxur:`└`,boxv:`│`,boxvH:`╪`,boxvL:`╡`,boxvR:`╞`,boxvh:`┼`,boxvl:`┤`,boxvr:`├`,bprime:`‵`,breve:`˘`,brvbar:`¦`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,bumpeq:`≏`,cacute:`ć`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,ccaps:`⩍`,ccaron:`č`,ccedil:`ç`,ccirc:`ĉ`,ccups:`⩌`,ccupssm:`⩐`,cdot:`ċ`,cedil:`¸`,cemptyv:`⦲`,cent:`¢`,centerdot:`·`,cfr:`𝔠`,chcy:`ч`,check:`✓`,checkmark:`✓`,chi:`χ`,cir:`○`,cirE:`⧃`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledR:`®`,circledS:`Ⓢ`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,clubs:`♣`,clubsuit:`♣`,colon:`:`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,conint:`∮`,copf:`𝕔`,coprod:`∐`,copy:`©`,copysr:`℗`,crarr:`↵`,cross:`✗`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,cup:`∪`,cupbrcap:`⩈`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,dArr:`⇓`,dHar:`⥥`,dagger:`†`,daleth:`ℸ`,darr:`↓`,dash:`‐`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,dcaron:`ď`,dcy:`д`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,ddotseq:`⩷`,deg:`°`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,dfr:`𝔡`,dharl:`⇃`,dharr:`⇂`,diam:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,dopf:`𝕕`,dot:`˙`,doteq:`≐`,doteqdot:`≑`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,downarrow:`↓`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,dscr:`𝒹`,dscy:`ѕ`,dsol:`⧶`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,dzcy:`џ`,dzigrarr:`⟿`,eDDot:`⩷`,eDot:`≑`,eacute:`é`,easter:`⩮`,ecaron:`ě`,ecir:`≖`,ecirc:`ê`,ecolon:`≕`,ecy:`э`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,efr:`𝔢`,eg:`⪚`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,emacr:`ē`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,emsp13:` `,emsp14:` `,emsp:` `,eng:`ŋ`,ensp:` `,eogon:`ę`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,equals:`=`,equest:`≟`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erDot:`≓`,erarr:`⥱`,escr:`ℯ`,esdot:`≐`,esim:`≂`,eta:`η`,eth:`ð`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,expectation:`ℰ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,ffr:`𝔣`,filig:`fi`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,fopf:`𝕗`,forall:`∀`,fork:`⋔`,forkv:`⫙`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,fscr:`𝒻`,gE:`≧`,gEl:`⪌`,gacute:`ǵ`,gamma:`γ`,gammad:`ϝ`,gap:`⪆`,gbreve:`ğ`,gcirc:`ĝ`,gcy:`г`,gdot:`ġ`,ge:`≥`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,gfr:`𝔤`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,gjcy:`ѓ`,gl:`≷`,glE:`⪒`,gla:`⪥`,glj:`⪤`,gnE:`≩`,gnap:`⪊`,gnapprox:`⪊`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,gopf:`𝕘`,grave:"`",gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,hArr:`⇔`,hairsp:` `,half:`½`,hamilt:`ℋ`,hardcy:`ъ`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,hbar:`ℏ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,hfr:`𝔥`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,hopf:`𝕙`,horbar:`―`,hscr:`𝒽`,hslash:`ℏ`,hstrok:`ħ`,hybull:`⁃`,hyphen:`‐`,iacute:`í`,ic:`⁣`,icirc:`î`,icy:`и`,iecy:`е`,iexcl:`¡`,iff:`⇔`,ifr:`𝔦`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,ijlig:`ij`,imacr:`ī`,image:`ℑ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,int:`∫`,intcal:`⊺`,integers:`ℤ`,intercal:`⊺`,intlarhk:`⨗`,intprod:`⨼`,iocy:`ё`,iogon:`į`,iopf:`𝕚`,iota:`ι`,iprod:`⨼`,iquest:`¿`,iscr:`𝒾`,isin:`∈`,isinE:`⋹`,isindot:`⋵`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:`⁢`,itilde:`ĩ`,iukcy:`і`,iuml:`ï`,jcirc:`ĵ`,jcy:`й`,jfr:`𝔧`,jmath:`ȷ`,jopf:`𝕛`,jscr:`𝒿`,jsercy:`ј`,jukcy:`є`,kappa:`κ`,kappav:`ϰ`,kcedil:`ķ`,kcy:`к`,kfr:`𝔨`,kgreen:`ĸ`,khcy:`х`,kjcy:`ќ`,kopf:`𝕜`,kscr:`𝓀`,lAarr:`⇚`,lArr:`⇐`,lAtail:`⤛`,lBarr:`⤎`,lE:`≦`,lEg:`⪋`,lHar:`⥢`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,lambda:`λ`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,laquo:`«`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,lcaron:`ľ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,le:`≤`,leftarrow:`←`,leftarrowtail:`↢`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,leftthreetimes:`⋋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,lessgtr:`≶`,lesssim:`≲`,lfisht:`⥼`,lfloor:`⌊`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,ljcy:`љ`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,llhard:`⥫`,lltri:`◺`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnE:`≨`,lnap:`⪉`,lnapprox:`⪉`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,longleftarrow:`⟵`,longleftrightarrow:`⟷`,longmapsto:`⟼`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:`‎`,lrtri:`⊿`,lsaquo:`‹`,lscr:`𝓁`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,lstrok:`ł`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltrPar:`⦖`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,mDDot:`∺`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,mcy:`м`,mdash:`—`,measuredangle:`∡`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,mopf:`𝕞`,mp:`∓`,mscr:`𝓂`,mstpos:`∾`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nGg:`⋙̸`,nGt:`≫⃒`,nGtv:`≫̸`,nLeftarrow:`⇍`,nLeftrightarrow:`⇎`,nLl:`⋘̸`,nLt:`≪⃒`,nLtv:`≪̸`,nRightarrow:`⇏`,nVDash:`⊯`,nVdash:`⊮`,nabla:`∇`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,ncaron:`ň`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,ncy:`н`,ndash:`–`,ne:`≠`,neArr:`⇗`,nearhk:`⤤`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,nexist:`∄`,nexists:`∄`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,ngsim:`≵`,ngt:`≯`,ngtr:`≯`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,njcy:`њ`,nlArr:`⇍`,nlE:`≦̸`,nlarr:`↚`,nldr:`‥`,nle:`≰`,nleftarrow:`↚`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nlsim:`≴`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nmid:`∤`,nopf:`𝕟`,not:`¬`,notin:`∉`,notinE:`⋹̸`,notindot:`⋵̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvDash:`⊭`,nvHarr:`⤄`,nvap:`≍⃒`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwArr:`⇖`,nwarhk:`⤣`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,oS:`Ⓢ`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,ocirc:`ô`,ocy:`о`,odash:`⊝`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,oelig:`œ`,ofcir:`⦿`,ofr:`𝔬`,ogon:`˛`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,omacr:`ō`,omega:`ω`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,oopf:`𝕠`,opar:`⦷`,operp:`⦹`,oplus:`⊕`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oscr:`ℴ`,oslash:`ø`,osol:`⊘`,otilde:`õ`,otimes:`⊗`,otimesas:`⨶`,ouml:`ö`,ovbar:`⌽`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,pfr:`𝔭`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,pointint:`⨕`,popf:`𝕡`,pound:`£`,pr:`≺`,prE:`⪳`,prap:`⪷`,prcue:`≼`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,prime:`′`,primes:`ℙ`,prnE:`⪵`,prnap:`⪹`,prnsim:`⋨`,prod:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,pscr:`𝓅`,psi:`ψ`,puncsp:` `,qfr:`𝔮`,qint:`⨌`,qopf:`𝕢`,qprime:`⁗`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,quot:`"`,rAarr:`⇛`,rArr:`⇒`,rAtail:`⤜`,rBarr:`⤏`,rHar:`⥤`,race:`∽̱`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,rarrtl:`↣`,rarrw:`↝`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,rcaron:`ř`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,reg:`®`,rfisht:`⥽`,rfloor:`⌋`,rfr:`𝔯`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,rho:`ρ`,rhov:`ϱ`,rightarrow:`→`,rightarrowtail:`↣`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,rightthreetimes:`⋌`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:`‏`,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,rsaquo:`›`,rscr:`𝓇`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,ruluhar:`⥨`,rx:`℞`,sacute:`ś`,sbquo:`‚`,sc:`≻`,scE:`⪴`,scap:`⪸`,scaron:`š`,sccue:`≽`,sce:`⪰`,scedil:`ş`,scirc:`ŝ`,scnE:`⪶`,scnap:`⪺`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,seArr:`⇘`,searhk:`⤥`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,shchcy:`щ`,shcy:`ш`,shortmid:`∣`,shortparallel:`∥`,shy:`­`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,square:`□`,squarf:`▪`,squf:`▪`,srarr:`→`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,sub:`⊂`,subE:`⫅`,subdot:`⪽`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,sum:`∑`,sung:`♪`,sup1:`¹`,sup2:`²`,sup3:`³`,sup:`⊃`,supE:`⫆`,supdot:`⪾`,supdsub:`⫘`,supe:`⊇`,supedot:`⫄`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swArr:`⇙`,swarhk:`⤦`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,target:`⌖`,tau:`τ`,tbrk:`⎴`,tcaron:`ť`,tcedil:`ţ`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,tfr:`𝔱`,there4:`∴`,therefore:`∴`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,thinsp:` `,thkap:`≈`,thksim:`∼`,thorn:`þ`,tilde:`˜`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,tscr:`𝓉`,tscy:`ц`,tshcy:`ћ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,uArr:`⇑`,uHar:`⥣`,uacute:`ú`,uarr:`↑`,ubrcy:`ў`,ubreve:`ŭ`,ucirc:`û`,ucy:`у`,udarr:`⇅`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,ufr:`𝔲`,ugrave:`ù`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,umacr:`ū`,uml:`¨`,uogon:`ų`,uopf:`𝕦`,uparrow:`↑`,updownarrow:`↕`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,upsi:`υ`,upsih:`ϒ`,upsilon:`υ`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,uring:`ů`,urtri:`◹`,uscr:`𝓊`,utdot:`⋰`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,uuml:`ü`,uwangle:`⦧`,vArr:`⇕`,vBar:`⫨`,vBarv:`⫩`,vDash:`⊨`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,vcy:`в`,vdash:`⊢`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,verbar:`|`,vert:`|`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,vzigzag:`⦚`,wcirc:`ŵ`,wedbar:`⩟`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,wfr:`𝔴`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,yacute:`ý`,yacy:`я`,ycirc:`ŷ`,ycy:`ы`,yen:`¥`,yfr:`𝔶`,yicy:`ї`,yopf:`𝕪`,yscr:`𝓎`,yucy:`ю`,yuml:`ÿ`,zacute:`ź`,zcaron:`ž`,zcy:`з`,zdot:`ż`,zeetrf:`ℨ`,zeta:`ζ`,zfr:`𝔷`,zhcy:`ж`,zigrarr:`⇝`,zopf:`𝕫`,zscr:`𝓏`,zwj:`‍`,zwnj:`‌`},Ba={}.hasOwnProperty;function Va(e){return Ba.call(za,e)?za[e]:!1}function Ha(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}const Ua=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Wa(e){return e.replace(Ua,Ga)}function Ga(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ha(n.slice(t?2:1),t?16:10)}return Va(n)||e}function Ka(){return{enter:{table:qa,tableData:Za,tableHeader:Za,tableRow:Ya},exit:{codeText:Qa,table:Ja,tableData:Xa,tableHeader:Xa,tableRow:Xa}}}function qa(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function Ja(e){this.exit(e),this.data.inTable=void 0}function Ya(e){this.enter({type:`tableRow`,children:[]},e)}function Xa(e){this.exit(e)}function Za(e){this.enter({type:`tableCell`,children:[]},e)}function Qa(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,$a));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function $a(e,t){return t===`|`?t:e}function eo(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
158
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=va(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ja.peek=Ma;function ja(e){return e.value||``}function Ma(){return`<`}Na.peek=Pa;function Na(e,t,n,r){let i=ha(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function Pa(){return`!`}Fa.peek=Ia;function Fa(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ia(){return`!`}La.peek=Ra;function La(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function Ra(){return"`"}function za(e,t){let n=Ta(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Ba.peek=Va;function Ba(e,t,n,r){let i=ha(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(za(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Va(e,t,n){return za(e,n)?`<`:`[`}Ha.peek=Ua;function Ha(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Ua(){return`[`}function Wa(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Ga(e){let t=Wa(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Ka(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function qa(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Ja(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Ka(n):Wa(n),s=e.ordered?o===`.`?`)`:`.`:Ga(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),qa(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Ya(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Xa(e,t,n,r){let i=Ya(n),a=n.bulletCurrent||Wa(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Za(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const Qa=ni([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function $a(e,t,n,r){return(e.children.some(function(e){return Qa(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function eo(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}to.peek=no;function to(e,t,n,r){let i=eo(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=ba(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=va(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=ba(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+va(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function no(e,t,n){return n.options.strong||`*`}function ro(e,t,n,r){return n.safe(e.value,r)}function io(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function ao(e,t,n){let r=(qa(n)+(n.options.ruleSpaces?` `:``)).repeat(io(n));return n.options.ruleSpaces?r.slice(0,-1):r}const oo={blockquote:aa,break:la,code:pa,definition:ga,emphasis:xa,hardBreak:la,heading:Aa,html:ja,image:Na,imageReference:Fa,inlineCode:La,link:Ba,linkReference:Ha,list:Ja,listItem:Xa,paragraph:Za,root:$a,strong:to,text:ro,thematicBreak:ao},so={AElig:`Æ`,AMP:`&`,Aacute:`Á`,Abreve:`Ă`,Acirc:`Â`,Acy:`А`,Afr:`𝔄`,Agrave:`À`,Alpha:`Α`,Amacr:`Ā`,And:`⩓`,Aogon:`Ą`,Aopf:`𝔸`,ApplyFunction:`⁡`,Aring:`Å`,Ascr:`𝒜`,Assign:`≔`,Atilde:`Ã`,Auml:`Ä`,Backslash:`∖`,Barv:`⫧`,Barwed:`⌆`,Bcy:`Б`,Because:`∵`,Bernoullis:`ℬ`,Beta:`Β`,Bfr:`𝔅`,Bopf:`𝔹`,Breve:`˘`,Bscr:`ℬ`,Bumpeq:`≎`,CHcy:`Ч`,COPY:`©`,Cacute:`Ć`,Cap:`⋒`,CapitalDifferentialD:`ⅅ`,Cayleys:`ℭ`,Ccaron:`Č`,Ccedil:`Ç`,Ccirc:`Ĉ`,Cconint:`∰`,Cdot:`Ċ`,Cedilla:`¸`,CenterDot:`·`,Cfr:`ℭ`,Chi:`Χ`,CircleDot:`⊙`,CircleMinus:`⊖`,CirclePlus:`⊕`,CircleTimes:`⊗`,ClockwiseContourIntegral:`∲`,CloseCurlyDoubleQuote:`”`,CloseCurlyQuote:`’`,Colon:`∷`,Colone:`⩴`,Congruent:`≡`,Conint:`∯`,ContourIntegral:`∮`,Copf:`ℂ`,Coproduct:`∐`,CounterClockwiseContourIntegral:`∳`,Cross:`⨯`,Cscr:`𝒞`,Cup:`⋓`,CupCap:`≍`,DD:`ⅅ`,DDotrahd:`⤑`,DJcy:`Ђ`,DScy:`Ѕ`,DZcy:`Џ`,Dagger:`‡`,Darr:`↡`,Dashv:`⫤`,Dcaron:`Ď`,Dcy:`Д`,Del:`∇`,Delta:`Δ`,Dfr:`𝔇`,DiacriticalAcute:`´`,DiacriticalDot:`˙`,DiacriticalDoubleAcute:`˝`,DiacriticalGrave:"`",DiacriticalTilde:`˜`,Diamond:`⋄`,DifferentialD:`ⅆ`,Dopf:`𝔻`,Dot:`¨`,DotDot:`⃜`,DotEqual:`≐`,DoubleContourIntegral:`∯`,DoubleDot:`¨`,DoubleDownArrow:`⇓`,DoubleLeftArrow:`⇐`,DoubleLeftRightArrow:`⇔`,DoubleLeftTee:`⫤`,DoubleLongLeftArrow:`⟸`,DoubleLongLeftRightArrow:`⟺`,DoubleLongRightArrow:`⟹`,DoubleRightArrow:`⇒`,DoubleRightTee:`⊨`,DoubleUpArrow:`⇑`,DoubleUpDownArrow:`⇕`,DoubleVerticalBar:`∥`,DownArrow:`↓`,DownArrowBar:`⤓`,DownArrowUpArrow:`⇵`,DownBreve:`̑`,DownLeftRightVector:`⥐`,DownLeftTeeVector:`⥞`,DownLeftVector:`↽`,DownLeftVectorBar:`⥖`,DownRightTeeVector:`⥟`,DownRightVector:`⇁`,DownRightVectorBar:`⥗`,DownTee:`⊤`,DownTeeArrow:`↧`,Downarrow:`⇓`,Dscr:`𝒟`,Dstrok:`Đ`,ENG:`Ŋ`,ETH:`Ð`,Eacute:`É`,Ecaron:`Ě`,Ecirc:`Ê`,Ecy:`Э`,Edot:`Ė`,Efr:`𝔈`,Egrave:`È`,Element:`∈`,Emacr:`Ē`,EmptySmallSquare:`◻`,EmptyVerySmallSquare:`▫`,Eogon:`Ę`,Eopf:`𝔼`,Epsilon:`Ε`,Equal:`⩵`,EqualTilde:`≂`,Equilibrium:`⇌`,Escr:`ℰ`,Esim:`⩳`,Eta:`Η`,Euml:`Ë`,Exists:`∃`,ExponentialE:`ⅇ`,Fcy:`Ф`,Ffr:`𝔉`,FilledSmallSquare:`◼`,FilledVerySmallSquare:`▪`,Fopf:`𝔽`,ForAll:`∀`,Fouriertrf:`ℱ`,Fscr:`ℱ`,GJcy:`Ѓ`,GT:`>`,Gamma:`Γ`,Gammad:`Ϝ`,Gbreve:`Ğ`,Gcedil:`Ģ`,Gcirc:`Ĝ`,Gcy:`Г`,Gdot:`Ġ`,Gfr:`𝔊`,Gg:`⋙`,Gopf:`𝔾`,GreaterEqual:`≥`,GreaterEqualLess:`⋛`,GreaterFullEqual:`≧`,GreaterGreater:`⪢`,GreaterLess:`≷`,GreaterSlantEqual:`⩾`,GreaterTilde:`≳`,Gscr:`𝒢`,Gt:`≫`,HARDcy:`Ъ`,Hacek:`ˇ`,Hat:`^`,Hcirc:`Ĥ`,Hfr:`ℌ`,HilbertSpace:`ℋ`,Hopf:`ℍ`,HorizontalLine:`─`,Hscr:`ℋ`,Hstrok:`Ħ`,HumpDownHump:`≎`,HumpEqual:`≏`,IEcy:`Е`,IJlig:`IJ`,IOcy:`Ё`,Iacute:`Í`,Icirc:`Î`,Icy:`И`,Idot:`İ`,Ifr:`ℑ`,Igrave:`Ì`,Im:`ℑ`,Imacr:`Ī`,ImaginaryI:`ⅈ`,Implies:`⇒`,Int:`∬`,Integral:`∫`,Intersection:`⋂`,InvisibleComma:`⁣`,InvisibleTimes:`⁢`,Iogon:`Į`,Iopf:`𝕀`,Iota:`Ι`,Iscr:`ℐ`,Itilde:`Ĩ`,Iukcy:`І`,Iuml:`Ï`,Jcirc:`Ĵ`,Jcy:`Й`,Jfr:`𝔍`,Jopf:`𝕁`,Jscr:`𝒥`,Jsercy:`Ј`,Jukcy:`Є`,KHcy:`Х`,KJcy:`Ќ`,Kappa:`Κ`,Kcedil:`Ķ`,Kcy:`К`,Kfr:`𝔎`,Kopf:`𝕂`,Kscr:`𝒦`,LJcy:`Љ`,LT:`<`,Lacute:`Ĺ`,Lambda:`Λ`,Lang:`⟪`,Laplacetrf:`ℒ`,Larr:`↞`,Lcaron:`Ľ`,Lcedil:`Ļ`,Lcy:`Л`,LeftAngleBracket:`⟨`,LeftArrow:`←`,LeftArrowBar:`⇤`,LeftArrowRightArrow:`⇆`,LeftCeiling:`⌈`,LeftDoubleBracket:`⟦`,LeftDownTeeVector:`⥡`,LeftDownVector:`⇃`,LeftDownVectorBar:`⥙`,LeftFloor:`⌊`,LeftRightArrow:`↔`,LeftRightVector:`⥎`,LeftTee:`⊣`,LeftTeeArrow:`↤`,LeftTeeVector:`⥚`,LeftTriangle:`⊲`,LeftTriangleBar:`⧏`,LeftTriangleEqual:`⊴`,LeftUpDownVector:`⥑`,LeftUpTeeVector:`⥠`,LeftUpVector:`↿`,LeftUpVectorBar:`⥘`,LeftVector:`↼`,LeftVectorBar:`⥒`,Leftarrow:`⇐`,Leftrightarrow:`⇔`,LessEqualGreater:`⋚`,LessFullEqual:`≦`,LessGreater:`≶`,LessLess:`⪡`,LessSlantEqual:`⩽`,LessTilde:`≲`,Lfr:`𝔏`,Ll:`⋘`,Lleftarrow:`⇚`,Lmidot:`Ŀ`,LongLeftArrow:`⟵`,LongLeftRightArrow:`⟷`,LongRightArrow:`⟶`,Longleftarrow:`⟸`,Longleftrightarrow:`⟺`,Longrightarrow:`⟹`,Lopf:`𝕃`,LowerLeftArrow:`↙`,LowerRightArrow:`↘`,Lscr:`ℒ`,Lsh:`↰`,Lstrok:`Ł`,Lt:`≪`,Map:`⤅`,Mcy:`М`,MediumSpace:` `,Mellintrf:`ℳ`,Mfr:`𝔐`,MinusPlus:`∓`,Mopf:`𝕄`,Mscr:`ℳ`,Mu:`Μ`,NJcy:`Њ`,Nacute:`Ń`,Ncaron:`Ň`,Ncedil:`Ņ`,Ncy:`Н`,NegativeMediumSpace:`​`,NegativeThickSpace:`​`,NegativeThinSpace:`​`,NegativeVeryThinSpace:`​`,NestedGreaterGreater:`≫`,NestedLessLess:`≪`,NewLine:`
159
+ `,Nfr:`𝔑`,NoBreak:`⁠`,NonBreakingSpace:`\xA0`,Nopf:`ℕ`,Not:`⫬`,NotCongruent:`≢`,NotCupCap:`≭`,NotDoubleVerticalBar:`∦`,NotElement:`∉`,NotEqual:`≠`,NotEqualTilde:`≂̸`,NotExists:`∄`,NotGreater:`≯`,NotGreaterEqual:`≱`,NotGreaterFullEqual:`≧̸`,NotGreaterGreater:`≫̸`,NotGreaterLess:`≹`,NotGreaterSlantEqual:`⩾̸`,NotGreaterTilde:`≵`,NotHumpDownHump:`≎̸`,NotHumpEqual:`≏̸`,NotLeftTriangle:`⋪`,NotLeftTriangleBar:`⧏̸`,NotLeftTriangleEqual:`⋬`,NotLess:`≮`,NotLessEqual:`≰`,NotLessGreater:`≸`,NotLessLess:`≪̸`,NotLessSlantEqual:`⩽̸`,NotLessTilde:`≴`,NotNestedGreaterGreater:`⪢̸`,NotNestedLessLess:`⪡̸`,NotPrecedes:`⊀`,NotPrecedesEqual:`⪯̸`,NotPrecedesSlantEqual:`⋠`,NotReverseElement:`∌`,NotRightTriangle:`⋫`,NotRightTriangleBar:`⧐̸`,NotRightTriangleEqual:`⋭`,NotSquareSubset:`⊏̸`,NotSquareSubsetEqual:`⋢`,NotSquareSuperset:`⊐̸`,NotSquareSupersetEqual:`⋣`,NotSubset:`⊂⃒`,NotSubsetEqual:`⊈`,NotSucceeds:`⊁`,NotSucceedsEqual:`⪰̸`,NotSucceedsSlantEqual:`⋡`,NotSucceedsTilde:`≿̸`,NotSuperset:`⊃⃒`,NotSupersetEqual:`⊉`,NotTilde:`≁`,NotTildeEqual:`≄`,NotTildeFullEqual:`≇`,NotTildeTilde:`≉`,NotVerticalBar:`∤`,Nscr:`𝒩`,Ntilde:`Ñ`,Nu:`Ν`,OElig:`Œ`,Oacute:`Ó`,Ocirc:`Ô`,Ocy:`О`,Odblac:`Ő`,Ofr:`𝔒`,Ograve:`Ò`,Omacr:`Ō`,Omega:`Ω`,Omicron:`Ο`,Oopf:`𝕆`,OpenCurlyDoubleQuote:`“`,OpenCurlyQuote:`‘`,Or:`⩔`,Oscr:`𝒪`,Oslash:`Ø`,Otilde:`Õ`,Otimes:`⨷`,Ouml:`Ö`,OverBar:`‾`,OverBrace:`⏞`,OverBracket:`⎴`,OverParenthesis:`⏜`,PartialD:`∂`,Pcy:`П`,Pfr:`𝔓`,Phi:`Φ`,Pi:`Π`,PlusMinus:`±`,Poincareplane:`ℌ`,Popf:`ℙ`,Pr:`⪻`,Precedes:`≺`,PrecedesEqual:`⪯`,PrecedesSlantEqual:`≼`,PrecedesTilde:`≾`,Prime:`″`,Product:`∏`,Proportion:`∷`,Proportional:`∝`,Pscr:`𝒫`,Psi:`Ψ`,QUOT:`"`,Qfr:`𝔔`,Qopf:`ℚ`,Qscr:`𝒬`,RBarr:`⤐`,REG:`®`,Racute:`Ŕ`,Rang:`⟫`,Rarr:`↠`,Rarrtl:`⤖`,Rcaron:`Ř`,Rcedil:`Ŗ`,Rcy:`Р`,Re:`ℜ`,ReverseElement:`∋`,ReverseEquilibrium:`⇋`,ReverseUpEquilibrium:`⥯`,Rfr:`ℜ`,Rho:`Ρ`,RightAngleBracket:`⟩`,RightArrow:`→`,RightArrowBar:`⇥`,RightArrowLeftArrow:`⇄`,RightCeiling:`⌉`,RightDoubleBracket:`⟧`,RightDownTeeVector:`⥝`,RightDownVector:`⇂`,RightDownVectorBar:`⥕`,RightFloor:`⌋`,RightTee:`⊢`,RightTeeArrow:`↦`,RightTeeVector:`⥛`,RightTriangle:`⊳`,RightTriangleBar:`⧐`,RightTriangleEqual:`⊵`,RightUpDownVector:`⥏`,RightUpTeeVector:`⥜`,RightUpVector:`↾`,RightUpVectorBar:`⥔`,RightVector:`⇀`,RightVectorBar:`⥓`,Rightarrow:`⇒`,Ropf:`ℝ`,RoundImplies:`⥰`,Rrightarrow:`⇛`,Rscr:`ℛ`,Rsh:`↱`,RuleDelayed:`⧴`,SHCHcy:`Щ`,SHcy:`Ш`,SOFTcy:`Ь`,Sacute:`Ś`,Sc:`⪼`,Scaron:`Š`,Scedil:`Ş`,Scirc:`Ŝ`,Scy:`С`,Sfr:`𝔖`,ShortDownArrow:`↓`,ShortLeftArrow:`←`,ShortRightArrow:`→`,ShortUpArrow:`↑`,Sigma:`Σ`,SmallCircle:`∘`,Sopf:`𝕊`,Sqrt:`√`,Square:`□`,SquareIntersection:`⊓`,SquareSubset:`⊏`,SquareSubsetEqual:`⊑`,SquareSuperset:`⊐`,SquareSupersetEqual:`⊒`,SquareUnion:`⊔`,Sscr:`𝒮`,Star:`⋆`,Sub:`⋐`,Subset:`⋐`,SubsetEqual:`⊆`,Succeeds:`≻`,SucceedsEqual:`⪰`,SucceedsSlantEqual:`≽`,SucceedsTilde:`≿`,SuchThat:`∋`,Sum:`∑`,Sup:`⋑`,Superset:`⊃`,SupersetEqual:`⊇`,Supset:`⋑`,THORN:`Þ`,TRADE:`™`,TSHcy:`Ћ`,TScy:`Ц`,Tab:` `,Tau:`Τ`,Tcaron:`Ť`,Tcedil:`Ţ`,Tcy:`Т`,Tfr:`𝔗`,Therefore:`∴`,Theta:`Θ`,ThickSpace:`  `,ThinSpace:` `,Tilde:`∼`,TildeEqual:`≃`,TildeFullEqual:`≅`,TildeTilde:`≈`,Topf:`𝕋`,TripleDot:`⃛`,Tscr:`𝒯`,Tstrok:`Ŧ`,Uacute:`Ú`,Uarr:`↟`,Uarrocir:`⥉`,Ubrcy:`Ў`,Ubreve:`Ŭ`,Ucirc:`Û`,Ucy:`У`,Udblac:`Ű`,Ufr:`𝔘`,Ugrave:`Ù`,Umacr:`Ū`,UnderBar:`_`,UnderBrace:`⏟`,UnderBracket:`⎵`,UnderParenthesis:`⏝`,Union:`⋃`,UnionPlus:`⊎`,Uogon:`Ų`,Uopf:`𝕌`,UpArrow:`↑`,UpArrowBar:`⤒`,UpArrowDownArrow:`⇅`,UpDownArrow:`↕`,UpEquilibrium:`⥮`,UpTee:`⊥`,UpTeeArrow:`↥`,Uparrow:`⇑`,Updownarrow:`⇕`,UpperLeftArrow:`↖`,UpperRightArrow:`↗`,Upsi:`ϒ`,Upsilon:`Υ`,Uring:`Ů`,Uscr:`𝒰`,Utilde:`Ũ`,Uuml:`Ü`,VDash:`⊫`,Vbar:`⫫`,Vcy:`В`,Vdash:`⊩`,Vdashl:`⫦`,Vee:`⋁`,Verbar:`‖`,Vert:`‖`,VerticalBar:`∣`,VerticalLine:`|`,VerticalSeparator:`❘`,VerticalTilde:`≀`,VeryThinSpace:` `,Vfr:`𝔙`,Vopf:`𝕍`,Vscr:`𝒱`,Vvdash:`⊪`,Wcirc:`Ŵ`,Wedge:`⋀`,Wfr:`𝔚`,Wopf:`𝕎`,Wscr:`𝒲`,Xfr:`𝔛`,Xi:`Ξ`,Xopf:`𝕏`,Xscr:`𝒳`,YAcy:`Я`,YIcy:`Ї`,YUcy:`Ю`,Yacute:`Ý`,Ycirc:`Ŷ`,Ycy:`Ы`,Yfr:`𝔜`,Yopf:`𝕐`,Yscr:`𝒴`,Yuml:`Ÿ`,ZHcy:`Ж`,Zacute:`Ź`,Zcaron:`Ž`,Zcy:`З`,Zdot:`Ż`,ZeroWidthSpace:`​`,Zeta:`Ζ`,Zfr:`ℨ`,Zopf:`ℤ`,Zscr:`𝒵`,aacute:`á`,abreve:`ă`,ac:`∾`,acE:`∾̳`,acd:`∿`,acirc:`â`,acute:`´`,acy:`а`,aelig:`æ`,af:`⁡`,afr:`𝔞`,agrave:`à`,alefsym:`ℵ`,aleph:`ℵ`,alpha:`α`,amacr:`ā`,amalg:`⨿`,amp:`&`,and:`∧`,andand:`⩕`,andd:`⩜`,andslope:`⩘`,andv:`⩚`,ang:`∠`,ange:`⦤`,angle:`∠`,angmsd:`∡`,angmsdaa:`⦨`,angmsdab:`⦩`,angmsdac:`⦪`,angmsdad:`⦫`,angmsdae:`⦬`,angmsdaf:`⦭`,angmsdag:`⦮`,angmsdah:`⦯`,angrt:`∟`,angrtvb:`⊾`,angrtvbd:`⦝`,angsph:`∢`,angst:`Å`,angzarr:`⍼`,aogon:`ą`,aopf:`𝕒`,ap:`≈`,apE:`⩰`,apacir:`⩯`,ape:`≊`,apid:`≋`,apos:`'`,approx:`≈`,approxeq:`≊`,aring:`å`,ascr:`𝒶`,ast:`*`,asymp:`≈`,asympeq:`≍`,atilde:`ã`,auml:`ä`,awconint:`∳`,awint:`⨑`,bNot:`⫭`,backcong:`≌`,backepsilon:`϶`,backprime:`‵`,backsim:`∽`,backsimeq:`⋍`,barvee:`⊽`,barwed:`⌅`,barwedge:`⌅`,bbrk:`⎵`,bbrktbrk:`⎶`,bcong:`≌`,bcy:`б`,bdquo:`„`,becaus:`∵`,because:`∵`,bemptyv:`⦰`,bepsi:`϶`,bernou:`ℬ`,beta:`β`,beth:`ℶ`,between:`≬`,bfr:`𝔟`,bigcap:`⋂`,bigcirc:`◯`,bigcup:`⋃`,bigodot:`⨀`,bigoplus:`⨁`,bigotimes:`⨂`,bigsqcup:`⨆`,bigstar:`★`,bigtriangledown:`▽`,bigtriangleup:`△`,biguplus:`⨄`,bigvee:`⋁`,bigwedge:`⋀`,bkarow:`⤍`,blacklozenge:`⧫`,blacksquare:`▪`,blacktriangle:`▴`,blacktriangledown:`▾`,blacktriangleleft:`◂`,blacktriangleright:`▸`,blank:`␣`,blk12:`▒`,blk14:`░`,blk34:`▓`,block:`█`,bne:`=⃥`,bnequiv:`≡⃥`,bnot:`⌐`,bopf:`𝕓`,bot:`⊥`,bottom:`⊥`,bowtie:`⋈`,boxDL:`╗`,boxDR:`╔`,boxDl:`╖`,boxDr:`╓`,boxH:`═`,boxHD:`╦`,boxHU:`╩`,boxHd:`╤`,boxHu:`╧`,boxUL:`╝`,boxUR:`╚`,boxUl:`╜`,boxUr:`╙`,boxV:`║`,boxVH:`╬`,boxVL:`╣`,boxVR:`╠`,boxVh:`╫`,boxVl:`╢`,boxVr:`╟`,boxbox:`⧉`,boxdL:`╕`,boxdR:`╒`,boxdl:`┐`,boxdr:`┌`,boxh:`─`,boxhD:`╥`,boxhU:`╨`,boxhd:`┬`,boxhu:`┴`,boxminus:`⊟`,boxplus:`⊞`,boxtimes:`⊠`,boxuL:`╛`,boxuR:`╘`,boxul:`┘`,boxur:`└`,boxv:`│`,boxvH:`╪`,boxvL:`╡`,boxvR:`╞`,boxvh:`┼`,boxvl:`┤`,boxvr:`├`,bprime:`‵`,breve:`˘`,brvbar:`¦`,bscr:`𝒷`,bsemi:`⁏`,bsim:`∽`,bsime:`⋍`,bsol:`\\`,bsolb:`⧅`,bsolhsub:`⟈`,bull:`•`,bullet:`•`,bump:`≎`,bumpE:`⪮`,bumpe:`≏`,bumpeq:`≏`,cacute:`ć`,cap:`∩`,capand:`⩄`,capbrcup:`⩉`,capcap:`⩋`,capcup:`⩇`,capdot:`⩀`,caps:`∩︀`,caret:`⁁`,caron:`ˇ`,ccaps:`⩍`,ccaron:`č`,ccedil:`ç`,ccirc:`ĉ`,ccups:`⩌`,ccupssm:`⩐`,cdot:`ċ`,cedil:`¸`,cemptyv:`⦲`,cent:`¢`,centerdot:`·`,cfr:`𝔠`,chcy:`ч`,check:`✓`,checkmark:`✓`,chi:`χ`,cir:`○`,cirE:`⧃`,circ:`ˆ`,circeq:`≗`,circlearrowleft:`↺`,circlearrowright:`↻`,circledR:`®`,circledS:`Ⓢ`,circledast:`⊛`,circledcirc:`⊚`,circleddash:`⊝`,cire:`≗`,cirfnint:`⨐`,cirmid:`⫯`,cirscir:`⧂`,clubs:`♣`,clubsuit:`♣`,colon:`:`,colone:`≔`,coloneq:`≔`,comma:`,`,commat:`@`,comp:`∁`,compfn:`∘`,complement:`∁`,complexes:`ℂ`,cong:`≅`,congdot:`⩭`,conint:`∮`,copf:`𝕔`,coprod:`∐`,copy:`©`,copysr:`℗`,crarr:`↵`,cross:`✗`,cscr:`𝒸`,csub:`⫏`,csube:`⫑`,csup:`⫐`,csupe:`⫒`,ctdot:`⋯`,cudarrl:`⤸`,cudarrr:`⤵`,cuepr:`⋞`,cuesc:`⋟`,cularr:`↶`,cularrp:`⤽`,cup:`∪`,cupbrcap:`⩈`,cupcap:`⩆`,cupcup:`⩊`,cupdot:`⊍`,cupor:`⩅`,cups:`∪︀`,curarr:`↷`,curarrm:`⤼`,curlyeqprec:`⋞`,curlyeqsucc:`⋟`,curlyvee:`⋎`,curlywedge:`⋏`,curren:`¤`,curvearrowleft:`↶`,curvearrowright:`↷`,cuvee:`⋎`,cuwed:`⋏`,cwconint:`∲`,cwint:`∱`,cylcty:`⌭`,dArr:`⇓`,dHar:`⥥`,dagger:`†`,daleth:`ℸ`,darr:`↓`,dash:`‐`,dashv:`⊣`,dbkarow:`⤏`,dblac:`˝`,dcaron:`ď`,dcy:`д`,dd:`ⅆ`,ddagger:`‡`,ddarr:`⇊`,ddotseq:`⩷`,deg:`°`,delta:`δ`,demptyv:`⦱`,dfisht:`⥿`,dfr:`𝔡`,dharl:`⇃`,dharr:`⇂`,diam:`⋄`,diamond:`⋄`,diamondsuit:`♦`,diams:`♦`,die:`¨`,digamma:`ϝ`,disin:`⋲`,div:`÷`,divide:`÷`,divideontimes:`⋇`,divonx:`⋇`,djcy:`ђ`,dlcorn:`⌞`,dlcrop:`⌍`,dollar:`$`,dopf:`𝕕`,dot:`˙`,doteq:`≐`,doteqdot:`≑`,dotminus:`∸`,dotplus:`∔`,dotsquare:`⊡`,doublebarwedge:`⌆`,downarrow:`↓`,downdownarrows:`⇊`,downharpoonleft:`⇃`,downharpoonright:`⇂`,drbkarow:`⤐`,drcorn:`⌟`,drcrop:`⌌`,dscr:`𝒹`,dscy:`ѕ`,dsol:`⧶`,dstrok:`đ`,dtdot:`⋱`,dtri:`▿`,dtrif:`▾`,duarr:`⇵`,duhar:`⥯`,dwangle:`⦦`,dzcy:`џ`,dzigrarr:`⟿`,eDDot:`⩷`,eDot:`≑`,eacute:`é`,easter:`⩮`,ecaron:`ě`,ecir:`≖`,ecirc:`ê`,ecolon:`≕`,ecy:`э`,edot:`ė`,ee:`ⅇ`,efDot:`≒`,efr:`𝔢`,eg:`⪚`,egrave:`è`,egs:`⪖`,egsdot:`⪘`,el:`⪙`,elinters:`⏧`,ell:`ℓ`,els:`⪕`,elsdot:`⪗`,emacr:`ē`,empty:`∅`,emptyset:`∅`,emptyv:`∅`,emsp13:` `,emsp14:` `,emsp:` `,eng:`ŋ`,ensp:` `,eogon:`ę`,eopf:`𝕖`,epar:`⋕`,eparsl:`⧣`,eplus:`⩱`,epsi:`ε`,epsilon:`ε`,epsiv:`ϵ`,eqcirc:`≖`,eqcolon:`≕`,eqsim:`≂`,eqslantgtr:`⪖`,eqslantless:`⪕`,equals:`=`,equest:`≟`,equiv:`≡`,equivDD:`⩸`,eqvparsl:`⧥`,erDot:`≓`,erarr:`⥱`,escr:`ℯ`,esdot:`≐`,esim:`≂`,eta:`η`,eth:`ð`,euml:`ë`,euro:`€`,excl:`!`,exist:`∃`,expectation:`ℰ`,exponentiale:`ⅇ`,fallingdotseq:`≒`,fcy:`ф`,female:`♀`,ffilig:`ffi`,fflig:`ff`,ffllig:`ffl`,ffr:`𝔣`,filig:`fi`,fjlig:`fj`,flat:`♭`,fllig:`fl`,fltns:`▱`,fnof:`ƒ`,fopf:`𝕗`,forall:`∀`,fork:`⋔`,forkv:`⫙`,fpartint:`⨍`,frac12:`½`,frac13:`⅓`,frac14:`¼`,frac15:`⅕`,frac16:`⅙`,frac18:`⅛`,frac23:`⅔`,frac25:`⅖`,frac34:`¾`,frac35:`⅗`,frac38:`⅜`,frac45:`⅘`,frac56:`⅚`,frac58:`⅝`,frac78:`⅞`,frasl:`⁄`,frown:`⌢`,fscr:`𝒻`,gE:`≧`,gEl:`⪌`,gacute:`ǵ`,gamma:`γ`,gammad:`ϝ`,gap:`⪆`,gbreve:`ğ`,gcirc:`ĝ`,gcy:`г`,gdot:`ġ`,ge:`≥`,gel:`⋛`,geq:`≥`,geqq:`≧`,geqslant:`⩾`,ges:`⩾`,gescc:`⪩`,gesdot:`⪀`,gesdoto:`⪂`,gesdotol:`⪄`,gesl:`⋛︀`,gesles:`⪔`,gfr:`𝔤`,gg:`≫`,ggg:`⋙`,gimel:`ℷ`,gjcy:`ѓ`,gl:`≷`,glE:`⪒`,gla:`⪥`,glj:`⪤`,gnE:`≩`,gnap:`⪊`,gnapprox:`⪊`,gne:`⪈`,gneq:`⪈`,gneqq:`≩`,gnsim:`⋧`,gopf:`𝕘`,grave:"`",gscr:`ℊ`,gsim:`≳`,gsime:`⪎`,gsiml:`⪐`,gt:`>`,gtcc:`⪧`,gtcir:`⩺`,gtdot:`⋗`,gtlPar:`⦕`,gtquest:`⩼`,gtrapprox:`⪆`,gtrarr:`⥸`,gtrdot:`⋗`,gtreqless:`⋛`,gtreqqless:`⪌`,gtrless:`≷`,gtrsim:`≳`,gvertneqq:`≩︀`,gvnE:`≩︀`,hArr:`⇔`,hairsp:` `,half:`½`,hamilt:`ℋ`,hardcy:`ъ`,harr:`↔`,harrcir:`⥈`,harrw:`↭`,hbar:`ℏ`,hcirc:`ĥ`,hearts:`♥`,heartsuit:`♥`,hellip:`…`,hercon:`⊹`,hfr:`𝔥`,hksearow:`⤥`,hkswarow:`⤦`,hoarr:`⇿`,homtht:`∻`,hookleftarrow:`↩`,hookrightarrow:`↪`,hopf:`𝕙`,horbar:`―`,hscr:`𝒽`,hslash:`ℏ`,hstrok:`ħ`,hybull:`⁃`,hyphen:`‐`,iacute:`í`,ic:`⁣`,icirc:`î`,icy:`и`,iecy:`е`,iexcl:`¡`,iff:`⇔`,ifr:`𝔦`,igrave:`ì`,ii:`ⅈ`,iiiint:`⨌`,iiint:`∭`,iinfin:`⧜`,iiota:`℩`,ijlig:`ij`,imacr:`ī`,image:`ℑ`,imagline:`ℐ`,imagpart:`ℑ`,imath:`ı`,imof:`⊷`,imped:`Ƶ`,in:`∈`,incare:`℅`,infin:`∞`,infintie:`⧝`,inodot:`ı`,int:`∫`,intcal:`⊺`,integers:`ℤ`,intercal:`⊺`,intlarhk:`⨗`,intprod:`⨼`,iocy:`ё`,iogon:`į`,iopf:`𝕚`,iota:`ι`,iprod:`⨼`,iquest:`¿`,iscr:`𝒾`,isin:`∈`,isinE:`⋹`,isindot:`⋵`,isins:`⋴`,isinsv:`⋳`,isinv:`∈`,it:`⁢`,itilde:`ĩ`,iukcy:`і`,iuml:`ï`,jcirc:`ĵ`,jcy:`й`,jfr:`𝔧`,jmath:`ȷ`,jopf:`𝕛`,jscr:`𝒿`,jsercy:`ј`,jukcy:`є`,kappa:`κ`,kappav:`ϰ`,kcedil:`ķ`,kcy:`к`,kfr:`𝔨`,kgreen:`ĸ`,khcy:`х`,kjcy:`ќ`,kopf:`𝕜`,kscr:`𝓀`,lAarr:`⇚`,lArr:`⇐`,lAtail:`⤛`,lBarr:`⤎`,lE:`≦`,lEg:`⪋`,lHar:`⥢`,lacute:`ĺ`,laemptyv:`⦴`,lagran:`ℒ`,lambda:`λ`,lang:`⟨`,langd:`⦑`,langle:`⟨`,lap:`⪅`,laquo:`«`,larr:`←`,larrb:`⇤`,larrbfs:`⤟`,larrfs:`⤝`,larrhk:`↩`,larrlp:`↫`,larrpl:`⤹`,larrsim:`⥳`,larrtl:`↢`,lat:`⪫`,latail:`⤙`,late:`⪭`,lates:`⪭︀`,lbarr:`⤌`,lbbrk:`❲`,lbrace:`{`,lbrack:`[`,lbrke:`⦋`,lbrksld:`⦏`,lbrkslu:`⦍`,lcaron:`ľ`,lcedil:`ļ`,lceil:`⌈`,lcub:`{`,lcy:`л`,ldca:`⤶`,ldquo:`“`,ldquor:`„`,ldrdhar:`⥧`,ldrushar:`⥋`,ldsh:`↲`,le:`≤`,leftarrow:`←`,leftarrowtail:`↢`,leftharpoondown:`↽`,leftharpoonup:`↼`,leftleftarrows:`⇇`,leftrightarrow:`↔`,leftrightarrows:`⇆`,leftrightharpoons:`⇋`,leftrightsquigarrow:`↭`,leftthreetimes:`⋋`,leg:`⋚`,leq:`≤`,leqq:`≦`,leqslant:`⩽`,les:`⩽`,lescc:`⪨`,lesdot:`⩿`,lesdoto:`⪁`,lesdotor:`⪃`,lesg:`⋚︀`,lesges:`⪓`,lessapprox:`⪅`,lessdot:`⋖`,lesseqgtr:`⋚`,lesseqqgtr:`⪋`,lessgtr:`≶`,lesssim:`≲`,lfisht:`⥼`,lfloor:`⌊`,lfr:`𝔩`,lg:`≶`,lgE:`⪑`,lhard:`↽`,lharu:`↼`,lharul:`⥪`,lhblk:`▄`,ljcy:`љ`,ll:`≪`,llarr:`⇇`,llcorner:`⌞`,llhard:`⥫`,lltri:`◺`,lmidot:`ŀ`,lmoust:`⎰`,lmoustache:`⎰`,lnE:`≨`,lnap:`⪉`,lnapprox:`⪉`,lne:`⪇`,lneq:`⪇`,lneqq:`≨`,lnsim:`⋦`,loang:`⟬`,loarr:`⇽`,lobrk:`⟦`,longleftarrow:`⟵`,longleftrightarrow:`⟷`,longmapsto:`⟼`,longrightarrow:`⟶`,looparrowleft:`↫`,looparrowright:`↬`,lopar:`⦅`,lopf:`𝕝`,loplus:`⨭`,lotimes:`⨴`,lowast:`∗`,lowbar:`_`,loz:`◊`,lozenge:`◊`,lozf:`⧫`,lpar:`(`,lparlt:`⦓`,lrarr:`⇆`,lrcorner:`⌟`,lrhar:`⇋`,lrhard:`⥭`,lrm:`‎`,lrtri:`⊿`,lsaquo:`‹`,lscr:`𝓁`,lsh:`↰`,lsim:`≲`,lsime:`⪍`,lsimg:`⪏`,lsqb:`[`,lsquo:`‘`,lsquor:`‚`,lstrok:`ł`,lt:`<`,ltcc:`⪦`,ltcir:`⩹`,ltdot:`⋖`,lthree:`⋋`,ltimes:`⋉`,ltlarr:`⥶`,ltquest:`⩻`,ltrPar:`⦖`,ltri:`◃`,ltrie:`⊴`,ltrif:`◂`,lurdshar:`⥊`,luruhar:`⥦`,lvertneqq:`≨︀`,lvnE:`≨︀`,mDDot:`∺`,macr:`¯`,male:`♂`,malt:`✠`,maltese:`✠`,map:`↦`,mapsto:`↦`,mapstodown:`↧`,mapstoleft:`↤`,mapstoup:`↥`,marker:`▮`,mcomma:`⨩`,mcy:`м`,mdash:`—`,measuredangle:`∡`,mfr:`𝔪`,mho:`℧`,micro:`µ`,mid:`∣`,midast:`*`,midcir:`⫰`,middot:`·`,minus:`−`,minusb:`⊟`,minusd:`∸`,minusdu:`⨪`,mlcp:`⫛`,mldr:`…`,mnplus:`∓`,models:`⊧`,mopf:`𝕞`,mp:`∓`,mscr:`𝓂`,mstpos:`∾`,mu:`μ`,multimap:`⊸`,mumap:`⊸`,nGg:`⋙̸`,nGt:`≫⃒`,nGtv:`≫̸`,nLeftarrow:`⇍`,nLeftrightarrow:`⇎`,nLl:`⋘̸`,nLt:`≪⃒`,nLtv:`≪̸`,nRightarrow:`⇏`,nVDash:`⊯`,nVdash:`⊮`,nabla:`∇`,nacute:`ń`,nang:`∠⃒`,nap:`≉`,napE:`⩰̸`,napid:`≋̸`,napos:`ʼn`,napprox:`≉`,natur:`♮`,natural:`♮`,naturals:`ℕ`,nbsp:`\xA0`,nbump:`≎̸`,nbumpe:`≏̸`,ncap:`⩃`,ncaron:`ň`,ncedil:`ņ`,ncong:`≇`,ncongdot:`⩭̸`,ncup:`⩂`,ncy:`н`,ndash:`–`,ne:`≠`,neArr:`⇗`,nearhk:`⤤`,nearr:`↗`,nearrow:`↗`,nedot:`≐̸`,nequiv:`≢`,nesear:`⤨`,nesim:`≂̸`,nexist:`∄`,nexists:`∄`,nfr:`𝔫`,ngE:`≧̸`,nge:`≱`,ngeq:`≱`,ngeqq:`≧̸`,ngeqslant:`⩾̸`,nges:`⩾̸`,ngsim:`≵`,ngt:`≯`,ngtr:`≯`,nhArr:`⇎`,nharr:`↮`,nhpar:`⫲`,ni:`∋`,nis:`⋼`,nisd:`⋺`,niv:`∋`,njcy:`њ`,nlArr:`⇍`,nlE:`≦̸`,nlarr:`↚`,nldr:`‥`,nle:`≰`,nleftarrow:`↚`,nleftrightarrow:`↮`,nleq:`≰`,nleqq:`≦̸`,nleqslant:`⩽̸`,nles:`⩽̸`,nless:`≮`,nlsim:`≴`,nlt:`≮`,nltri:`⋪`,nltrie:`⋬`,nmid:`∤`,nopf:`𝕟`,not:`¬`,notin:`∉`,notinE:`⋹̸`,notindot:`⋵̸`,notinva:`∉`,notinvb:`⋷`,notinvc:`⋶`,notni:`∌`,notniva:`∌`,notnivb:`⋾`,notnivc:`⋽`,npar:`∦`,nparallel:`∦`,nparsl:`⫽⃥`,npart:`∂̸`,npolint:`⨔`,npr:`⊀`,nprcue:`⋠`,npre:`⪯̸`,nprec:`⊀`,npreceq:`⪯̸`,nrArr:`⇏`,nrarr:`↛`,nrarrc:`⤳̸`,nrarrw:`↝̸`,nrightarrow:`↛`,nrtri:`⋫`,nrtrie:`⋭`,nsc:`⊁`,nsccue:`⋡`,nsce:`⪰̸`,nscr:`𝓃`,nshortmid:`∤`,nshortparallel:`∦`,nsim:`≁`,nsime:`≄`,nsimeq:`≄`,nsmid:`∤`,nspar:`∦`,nsqsube:`⋢`,nsqsupe:`⋣`,nsub:`⊄`,nsubE:`⫅̸`,nsube:`⊈`,nsubset:`⊂⃒`,nsubseteq:`⊈`,nsubseteqq:`⫅̸`,nsucc:`⊁`,nsucceq:`⪰̸`,nsup:`⊅`,nsupE:`⫆̸`,nsupe:`⊉`,nsupset:`⊃⃒`,nsupseteq:`⊉`,nsupseteqq:`⫆̸`,ntgl:`≹`,ntilde:`ñ`,ntlg:`≸`,ntriangleleft:`⋪`,ntrianglelefteq:`⋬`,ntriangleright:`⋫`,ntrianglerighteq:`⋭`,nu:`ν`,num:`#`,numero:`№`,numsp:` `,nvDash:`⊭`,nvHarr:`⤄`,nvap:`≍⃒`,nvdash:`⊬`,nvge:`≥⃒`,nvgt:`>⃒`,nvinfin:`⧞`,nvlArr:`⤂`,nvle:`≤⃒`,nvlt:`<⃒`,nvltrie:`⊴⃒`,nvrArr:`⤃`,nvrtrie:`⊵⃒`,nvsim:`∼⃒`,nwArr:`⇖`,nwarhk:`⤣`,nwarr:`↖`,nwarrow:`↖`,nwnear:`⤧`,oS:`Ⓢ`,oacute:`ó`,oast:`⊛`,ocir:`⊚`,ocirc:`ô`,ocy:`о`,odash:`⊝`,odblac:`ő`,odiv:`⨸`,odot:`⊙`,odsold:`⦼`,oelig:`œ`,ofcir:`⦿`,ofr:`𝔬`,ogon:`˛`,ograve:`ò`,ogt:`⧁`,ohbar:`⦵`,ohm:`Ω`,oint:`∮`,olarr:`↺`,olcir:`⦾`,olcross:`⦻`,oline:`‾`,olt:`⧀`,omacr:`ō`,omega:`ω`,omicron:`ο`,omid:`⦶`,ominus:`⊖`,oopf:`𝕠`,opar:`⦷`,operp:`⦹`,oplus:`⊕`,or:`∨`,orarr:`↻`,ord:`⩝`,order:`ℴ`,orderof:`ℴ`,ordf:`ª`,ordm:`º`,origof:`⊶`,oror:`⩖`,orslope:`⩗`,orv:`⩛`,oscr:`ℴ`,oslash:`ø`,osol:`⊘`,otilde:`õ`,otimes:`⊗`,otimesas:`⨶`,ouml:`ö`,ovbar:`⌽`,par:`∥`,para:`¶`,parallel:`∥`,parsim:`⫳`,parsl:`⫽`,part:`∂`,pcy:`п`,percnt:`%`,period:`.`,permil:`‰`,perp:`⊥`,pertenk:`‱`,pfr:`𝔭`,phi:`φ`,phiv:`ϕ`,phmmat:`ℳ`,phone:`☎`,pi:`π`,pitchfork:`⋔`,piv:`ϖ`,planck:`ℏ`,planckh:`ℎ`,plankv:`ℏ`,plus:`+`,plusacir:`⨣`,plusb:`⊞`,pluscir:`⨢`,plusdo:`∔`,plusdu:`⨥`,pluse:`⩲`,plusmn:`±`,plussim:`⨦`,plustwo:`⨧`,pm:`±`,pointint:`⨕`,popf:`𝕡`,pound:`£`,pr:`≺`,prE:`⪳`,prap:`⪷`,prcue:`≼`,pre:`⪯`,prec:`≺`,precapprox:`⪷`,preccurlyeq:`≼`,preceq:`⪯`,precnapprox:`⪹`,precneqq:`⪵`,precnsim:`⋨`,precsim:`≾`,prime:`′`,primes:`ℙ`,prnE:`⪵`,prnap:`⪹`,prnsim:`⋨`,prod:`∏`,profalar:`⌮`,profline:`⌒`,profsurf:`⌓`,prop:`∝`,propto:`∝`,prsim:`≾`,prurel:`⊰`,pscr:`𝓅`,psi:`ψ`,puncsp:` `,qfr:`𝔮`,qint:`⨌`,qopf:`𝕢`,qprime:`⁗`,qscr:`𝓆`,quaternions:`ℍ`,quatint:`⨖`,quest:`?`,questeq:`≟`,quot:`"`,rAarr:`⇛`,rArr:`⇒`,rAtail:`⤜`,rBarr:`⤏`,rHar:`⥤`,race:`∽̱`,racute:`ŕ`,radic:`√`,raemptyv:`⦳`,rang:`⟩`,rangd:`⦒`,range:`⦥`,rangle:`⟩`,raquo:`»`,rarr:`→`,rarrap:`⥵`,rarrb:`⇥`,rarrbfs:`⤠`,rarrc:`⤳`,rarrfs:`⤞`,rarrhk:`↪`,rarrlp:`↬`,rarrpl:`⥅`,rarrsim:`⥴`,rarrtl:`↣`,rarrw:`↝`,ratail:`⤚`,ratio:`∶`,rationals:`ℚ`,rbarr:`⤍`,rbbrk:`❳`,rbrace:`}`,rbrack:`]`,rbrke:`⦌`,rbrksld:`⦎`,rbrkslu:`⦐`,rcaron:`ř`,rcedil:`ŗ`,rceil:`⌉`,rcub:`}`,rcy:`р`,rdca:`⤷`,rdldhar:`⥩`,rdquo:`”`,rdquor:`”`,rdsh:`↳`,real:`ℜ`,realine:`ℛ`,realpart:`ℜ`,reals:`ℝ`,rect:`▭`,reg:`®`,rfisht:`⥽`,rfloor:`⌋`,rfr:`𝔯`,rhard:`⇁`,rharu:`⇀`,rharul:`⥬`,rho:`ρ`,rhov:`ϱ`,rightarrow:`→`,rightarrowtail:`↣`,rightharpoondown:`⇁`,rightharpoonup:`⇀`,rightleftarrows:`⇄`,rightleftharpoons:`⇌`,rightrightarrows:`⇉`,rightsquigarrow:`↝`,rightthreetimes:`⋌`,ring:`˚`,risingdotseq:`≓`,rlarr:`⇄`,rlhar:`⇌`,rlm:`‏`,rmoust:`⎱`,rmoustache:`⎱`,rnmid:`⫮`,roang:`⟭`,roarr:`⇾`,robrk:`⟧`,ropar:`⦆`,ropf:`𝕣`,roplus:`⨮`,rotimes:`⨵`,rpar:`)`,rpargt:`⦔`,rppolint:`⨒`,rrarr:`⇉`,rsaquo:`›`,rscr:`𝓇`,rsh:`↱`,rsqb:`]`,rsquo:`’`,rsquor:`’`,rthree:`⋌`,rtimes:`⋊`,rtri:`▹`,rtrie:`⊵`,rtrif:`▸`,rtriltri:`⧎`,ruluhar:`⥨`,rx:`℞`,sacute:`ś`,sbquo:`‚`,sc:`≻`,scE:`⪴`,scap:`⪸`,scaron:`š`,sccue:`≽`,sce:`⪰`,scedil:`ş`,scirc:`ŝ`,scnE:`⪶`,scnap:`⪺`,scnsim:`⋩`,scpolint:`⨓`,scsim:`≿`,scy:`с`,sdot:`⋅`,sdotb:`⊡`,sdote:`⩦`,seArr:`⇘`,searhk:`⤥`,searr:`↘`,searrow:`↘`,sect:`§`,semi:`;`,seswar:`⤩`,setminus:`∖`,setmn:`∖`,sext:`✶`,sfr:`𝔰`,sfrown:`⌢`,sharp:`♯`,shchcy:`щ`,shcy:`ш`,shortmid:`∣`,shortparallel:`∥`,shy:`­`,sigma:`σ`,sigmaf:`ς`,sigmav:`ς`,sim:`∼`,simdot:`⩪`,sime:`≃`,simeq:`≃`,simg:`⪞`,simgE:`⪠`,siml:`⪝`,simlE:`⪟`,simne:`≆`,simplus:`⨤`,simrarr:`⥲`,slarr:`←`,smallsetminus:`∖`,smashp:`⨳`,smeparsl:`⧤`,smid:`∣`,smile:`⌣`,smt:`⪪`,smte:`⪬`,smtes:`⪬︀`,softcy:`ь`,sol:`/`,solb:`⧄`,solbar:`⌿`,sopf:`𝕤`,spades:`♠`,spadesuit:`♠`,spar:`∥`,sqcap:`⊓`,sqcaps:`⊓︀`,sqcup:`⊔`,sqcups:`⊔︀`,sqsub:`⊏`,sqsube:`⊑`,sqsubset:`⊏`,sqsubseteq:`⊑`,sqsup:`⊐`,sqsupe:`⊒`,sqsupset:`⊐`,sqsupseteq:`⊒`,squ:`□`,square:`□`,squarf:`▪`,squf:`▪`,srarr:`→`,sscr:`𝓈`,ssetmn:`∖`,ssmile:`⌣`,sstarf:`⋆`,star:`☆`,starf:`★`,straightepsilon:`ϵ`,straightphi:`ϕ`,strns:`¯`,sub:`⊂`,subE:`⫅`,subdot:`⪽`,sube:`⊆`,subedot:`⫃`,submult:`⫁`,subnE:`⫋`,subne:`⊊`,subplus:`⪿`,subrarr:`⥹`,subset:`⊂`,subseteq:`⊆`,subseteqq:`⫅`,subsetneq:`⊊`,subsetneqq:`⫋`,subsim:`⫇`,subsub:`⫕`,subsup:`⫓`,succ:`≻`,succapprox:`⪸`,succcurlyeq:`≽`,succeq:`⪰`,succnapprox:`⪺`,succneqq:`⪶`,succnsim:`⋩`,succsim:`≿`,sum:`∑`,sung:`♪`,sup1:`¹`,sup2:`²`,sup3:`³`,sup:`⊃`,supE:`⫆`,supdot:`⪾`,supdsub:`⫘`,supe:`⊇`,supedot:`⫄`,suphsol:`⟉`,suphsub:`⫗`,suplarr:`⥻`,supmult:`⫂`,supnE:`⫌`,supne:`⊋`,supplus:`⫀`,supset:`⊃`,supseteq:`⊇`,supseteqq:`⫆`,supsetneq:`⊋`,supsetneqq:`⫌`,supsim:`⫈`,supsub:`⫔`,supsup:`⫖`,swArr:`⇙`,swarhk:`⤦`,swarr:`↙`,swarrow:`↙`,swnwar:`⤪`,szlig:`ß`,target:`⌖`,tau:`τ`,tbrk:`⎴`,tcaron:`ť`,tcedil:`ţ`,tcy:`т`,tdot:`⃛`,telrec:`⌕`,tfr:`𝔱`,there4:`∴`,therefore:`∴`,theta:`θ`,thetasym:`ϑ`,thetav:`ϑ`,thickapprox:`≈`,thicksim:`∼`,thinsp:` `,thkap:`≈`,thksim:`∼`,thorn:`þ`,tilde:`˜`,times:`×`,timesb:`⊠`,timesbar:`⨱`,timesd:`⨰`,tint:`∭`,toea:`⤨`,top:`⊤`,topbot:`⌶`,topcir:`⫱`,topf:`𝕥`,topfork:`⫚`,tosa:`⤩`,tprime:`‴`,trade:`™`,triangle:`▵`,triangledown:`▿`,triangleleft:`◃`,trianglelefteq:`⊴`,triangleq:`≜`,triangleright:`▹`,trianglerighteq:`⊵`,tridot:`◬`,trie:`≜`,triminus:`⨺`,triplus:`⨹`,trisb:`⧍`,tritime:`⨻`,trpezium:`⏢`,tscr:`𝓉`,tscy:`ц`,tshcy:`ћ`,tstrok:`ŧ`,twixt:`≬`,twoheadleftarrow:`↞`,twoheadrightarrow:`↠`,uArr:`⇑`,uHar:`⥣`,uacute:`ú`,uarr:`↑`,ubrcy:`ў`,ubreve:`ŭ`,ucirc:`û`,ucy:`у`,udarr:`⇅`,udblac:`ű`,udhar:`⥮`,ufisht:`⥾`,ufr:`𝔲`,ugrave:`ù`,uharl:`↿`,uharr:`↾`,uhblk:`▀`,ulcorn:`⌜`,ulcorner:`⌜`,ulcrop:`⌏`,ultri:`◸`,umacr:`ū`,uml:`¨`,uogon:`ų`,uopf:`𝕦`,uparrow:`↑`,updownarrow:`↕`,upharpoonleft:`↿`,upharpoonright:`↾`,uplus:`⊎`,upsi:`υ`,upsih:`ϒ`,upsilon:`υ`,upuparrows:`⇈`,urcorn:`⌝`,urcorner:`⌝`,urcrop:`⌎`,uring:`ů`,urtri:`◹`,uscr:`𝓊`,utdot:`⋰`,utilde:`ũ`,utri:`▵`,utrif:`▴`,uuarr:`⇈`,uuml:`ü`,uwangle:`⦧`,vArr:`⇕`,vBar:`⫨`,vBarv:`⫩`,vDash:`⊨`,vangrt:`⦜`,varepsilon:`ϵ`,varkappa:`ϰ`,varnothing:`∅`,varphi:`ϕ`,varpi:`ϖ`,varpropto:`∝`,varr:`↕`,varrho:`ϱ`,varsigma:`ς`,varsubsetneq:`⊊︀`,varsubsetneqq:`⫋︀`,varsupsetneq:`⊋︀`,varsupsetneqq:`⫌︀`,vartheta:`ϑ`,vartriangleleft:`⊲`,vartriangleright:`⊳`,vcy:`в`,vdash:`⊢`,vee:`∨`,veebar:`⊻`,veeeq:`≚`,vellip:`⋮`,verbar:`|`,vert:`|`,vfr:`𝔳`,vltri:`⊲`,vnsub:`⊂⃒`,vnsup:`⊃⃒`,vopf:`𝕧`,vprop:`∝`,vrtri:`⊳`,vscr:`𝓋`,vsubnE:`⫋︀`,vsubne:`⊊︀`,vsupnE:`⫌︀`,vsupne:`⊋︀`,vzigzag:`⦚`,wcirc:`ŵ`,wedbar:`⩟`,wedge:`∧`,wedgeq:`≙`,weierp:`℘`,wfr:`𝔴`,wopf:`𝕨`,wp:`℘`,wr:`≀`,wreath:`≀`,wscr:`𝓌`,xcap:`⋂`,xcirc:`◯`,xcup:`⋃`,xdtri:`▽`,xfr:`𝔵`,xhArr:`⟺`,xharr:`⟷`,xi:`ξ`,xlArr:`⟸`,xlarr:`⟵`,xmap:`⟼`,xnis:`⋻`,xodot:`⨀`,xopf:`𝕩`,xoplus:`⨁`,xotime:`⨂`,xrArr:`⟹`,xrarr:`⟶`,xscr:`𝓍`,xsqcup:`⨆`,xuplus:`⨄`,xutri:`△`,xvee:`⋁`,xwedge:`⋀`,yacute:`ý`,yacy:`я`,ycirc:`ŷ`,ycy:`ы`,yen:`¥`,yfr:`𝔶`,yicy:`ї`,yopf:`𝕪`,yscr:`𝓎`,yucy:`ю`,yuml:`ÿ`,zacute:`ź`,zcaron:`ž`,zcy:`з`,zdot:`ż`,zeetrf:`ℨ`,zeta:`ζ`,zfr:`𝔷`,zhcy:`ж`,zigrarr:`⇝`,zopf:`𝕫`,zscr:`𝓏`,zwj:`‍`,zwnj:`‌`},co={}.hasOwnProperty;function lo(e){return co.call(so,e)?so[e]:!1}function uo(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}const fo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function po(e){return e.replace(fo,mo)}function mo(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return uo(n.slice(t?2:1),t?16:10)}return lo(n)||e}function ho(){return{enter:{table:go,tableData:bo,tableHeader:bo,tableRow:vo},exit:{codeText:xo,table:_o,tableData:yo,tableHeader:yo,tableRow:yo}}}function go(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function _o(e){this.exit(e),this.data.inTable=void 0}function vo(e){this.enter({type:`tableRow`,children:[]},e)}function yo(e){this.exit(e)}function bo(e){this.enter({type:`tableCell`,children:[]},e)}function xo(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,So));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function So(e,t){return t===`|`?t:e}function Co(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
154
160
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
155
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return Pi(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=Ra.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function to(){return{exit:{taskListCheckValueChecked:ro,taskListCheckValueUnchecked:ro,paragraph:io}}}function no(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:ao}}}function ro(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function io(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function ao(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=Ra.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function oo(){return[Zr(),Si(),Di(),Ka(),to()]}function so(e){return{extensions:[Qr(),Ci(e),Oi(),eo(e),no()]}}function U(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function W(e,t){return e.length>0?(U(e,e.length,0,t),e):t}const co={}.hasOwnProperty;function lo(e){let t={},n=-1;for(;++n<e.length;)uo(t,e[n]);return t}function uo(e,t){let n;for(n in t){let r=(co.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){co.call(r,a)||(r[a]=[]);let e=i[a];fo(r[a],Array.isArray(e)?e:e?[e]:[])}}}function fo(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);U(e,0,0,r)}const po={tokenize:Do,partial:!0},mo={tokenize:Oo,partial:!0},ho={tokenize:ko,partial:!0},go={tokenize:Ao,partial:!0},_o={tokenize:jo,partial:!0},vo={name:`wwwAutolink`,tokenize:To,previous:Mo},yo={name:`protocolAutolink`,tokenize:Eo,previous:No},bo={name:`emailAutolink`,tokenize:wo,previous:Po},xo={};function So(){return{text:xo}}let Co=48;for(;Co<123;)xo[Co]=bo,Co++,Co===58?Co=65:Co===91&&(Co=97);xo[43]=bo,xo[45]=bo,xo[46]=bo,xo[95]=bo,xo[72]=[bo,yo],xo[104]=[bo,yo],xo[87]=[bo,vo],xo[119]=[bo,vo];function wo(e,t,n){let r=this,i,a;return o;function o(t){return!Fo(t)||!Po.call(r,r.previous)||Io(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Fo(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(_o,u,l)(t):t===45||t===95||z(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&R(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function To(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Mo.call(r,r.previous)||Io(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(po,e.attempt(mo,e.attempt(ho,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Eo(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&No.call(r,r.previous)&&!Io(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(R(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||ar(t)||V(t)||ur(t)||lr(t)?n(t):e.attempt(mo,e.attempt(ho,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Do(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Oo(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(go,c,s)(t):t===null||V(t)||ur(t)||t!==45&&lr(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function ko(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(go,t,a)(o):o===null||V(o)||ur(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ao(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||V(o)||ur(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||V(e)||ur(e)?t(e):r(e)}function a(e){return R(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):R(t)?(e.consume(t),o):n(t)}}function jo(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return z(e)?n(e):t(e)}}function Mo(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||V(e)}function No(e){return!R(e)}function Po(e){return!(e===47||Fo(e))}function Fo(e){return e===43||e===45||e===46||e===95||z(e)}function Io(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Lo(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Ro={name:`attention`,resolveAll:zo,tokenize:Bo};function zo(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Vo(d,-c),Vo(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=W(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=W(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=W(l,Lo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=W(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=W(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,U(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Bo(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Zi(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Zi(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Vo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ho={name:`autolink`,tokenize:Uo};function Uo(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return R(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||z(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||z(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||ar(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):ir(t)?(e.consume(t),l):n(t)}function u(e){return z(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||z(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function G(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return H(r)?(e.enter(n),s(r)):t(r)}function s(r){return H(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const Wo={partial:!0,tokenize:Go};function Go(e,t,n){return r;function r(t){return H(t)?G(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||B(e)?t(e):n(e)}}const Ko={continuation:{tokenize:Jo},exit:Yo,name:`blockQuote`,tokenize:qo};function qo(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return H(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Jo(e,t,n){let r=this;return i;function i(t){return H(t)?G(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ko,t,n)(r)}}function Yo(e){e.exit(`blockQuote`)}const Xo={name:`characterEscape`,tokenize:Zo};function Zo(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return cr(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Qo={name:`characterReference`,tokenize:$o};function $o(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=z,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=sr,u):(e.enter(`characterReferenceValue`),a=7,o=or,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===z&&!Va(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const es={partial:!0,tokenize:rs},ts={concrete:!0,name:`codeFenced`,tokenize:ns};function ns(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),H(t)?G(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||B(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(es,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):H(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),G(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||B(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||B(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&H(t)?G(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||B(t)?e.check(es,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||B(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),H(t)?G(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),H(t)?G(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||B(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function rs(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const is={name:`codeIndented`,tokenize:os},as={partial:!0,tokenize:ss};function os(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),G(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):B(t)?e.attempt(as,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||B(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function ss(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):G(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):B(e)?i(e):n(e)}}const cs={name:`codeText`,previous:us,resolve:ls,tokenize:ds};function ls(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function us(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function ds(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||B(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var fs=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&ps(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ps(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ps(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);ps(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);ps(this.left,t.reverse())}}};function ps(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function ms(e){let t={},n=-1,r,i,a,o,s,c,l,u=new fs(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,hs(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return U(e,0,1/0,u.slice(0)),!l}function hs(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const gs={resolve:vs,tokenize:ys},_s={partial:!0,tokenize:bs};function vs(e){return ms(e),e}function ys(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):B(t)?e.check(_s,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function bs(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),G(e,a,`linePrefix`)}function a(i){if(i===null||B(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function xs(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||ar(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||B(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||V(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||ar(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ss(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):B(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||B(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!H(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Cs(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),G(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||B(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function ws(e,t){let n;return r;function r(i){return B(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):H(i)?G(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Ts={name:`definition`,tokenize:Ds},Es={partial:!0,tokenize:Os};function Ds(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ss.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=di(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return V(t)?ws(e,l)(t):l(t)}function l(t){return xs(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Es,d,d)(t)}function d(t){return H(t)?G(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||B(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Os(e,t,n){return r;function r(t){return V(t)?ws(e,i)(t):n(t)}function i(t){return Cs(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return H(t)?G(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||B(e)?t(e):n(e)}}const ks={name:`hardBreakEscape`,tokenize:As};function As(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return B(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const js={name:`headingAtx`,resolve:Ms,tokenize:Ns};function Ms(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},U(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Ns(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||V(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||B(n)?(e.exit(`atxHeading`),t(n)):H(n)?G(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||V(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const Ps=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Fs=[`pre`,`script`,`style`,`textarea`],Is={concrete:!0,name:`htmlFlow`,resolveTo:zs,tokenize:Bs},Ls={partial:!0,tokenize:Hs},Rs={partial:!0,tokenize:Vs};function zs(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Bs(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ie):R(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):R(a)?(e.consume(a),i=4,r.interrupt?t:ie):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ie):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return R(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||V(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Fs.includes(l)?(i=1,r.interrupt?t(s):O(s)):Ps.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||z(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return H(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||R(t)?(e.consume(t),b):H(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||z(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):H(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):H(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||B(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||V(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||H(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||B(t)?O(t):H(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),te):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),ie):t===93&&i===5?(e.consume(t),re):B(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Ls,oe,k)(t)):t===null||B(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Rs,A,oe)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||B(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function te(t){return t===45?(e.consume(t),ie):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return Fs.includes(n)?(e.consume(t),ae):O(t)}return R(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function re(t){return t===93?(e.consume(t),ie):O(t)}function ie(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),ie):O(t)}function ae(t){return t===null||B(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function Vs(e,t,n){let r=this;return i;function i(t){return B(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Hs(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Wo,t,n)}}const Us={name:`htmlText`,tokenize:Ws};function Ws(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):R(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):R(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):B(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?te(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):B(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?te(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?te(t):B(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):B(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?te(e):y(e)}function x(t){return R(t)?(e.consume(t),S):n(t)}function S(t){return t===45||z(t)?(e.consume(t),S):C(t)}function C(t){return B(t)?(o=C,j(t)):H(t)?(e.consume(t),C):te(t)}function w(t){return t===45||z(t)?(e.consume(t),w):t===47||t===62||V(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),te):t===58||t===95||R(t)?(e.consume(t),E):B(t)?(o=T,j(t)):H(t)?(e.consume(t),T):te(t)}function E(t){return t===45||t===46||t===58||t===95||z(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):B(t)?(o=D,j(t)):H(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):B(t)?(o=O,j(t)):H(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):B(t)?(o=k,j(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||V(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||V(e)?T(e):n(e)}function te(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return H(t)?G(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}const Gs={name:`labelEnd`,resolveAll:Ys,resolveTo:Xs,tokenize:Zs},Ks={tokenize:Qs},qs={tokenize:$s},Js={tokenize:ec};function Ys(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&U(e,0,e.length,n),e}function Xs(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=W(s,e.slice(a+1,a+r+3)),s=W(s,[[`enter`,u,t]]),s=W(s,Lo(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=W(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=W(s,e.slice(o+1)),s=W(s,[[`exit`,c,t]]),U(e,a,e.length,s),e}function Zs(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(di(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ks,u,o?u:d)(t):t===91?e.attempt(qs,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Js,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Qs(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return V(t)?ws(e,a)(t):a(t)}function a(t){return t===41?u(t):xs(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return V(t)?ws(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Cs(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return V(t)?ws(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function $s(e,t,n){let r=this;return i;function i(t){return Ss.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(di(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ec(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const tc={name:`labelStartImage`,resolveAll:Gs.resolveAll,tokenize:nc};function nc(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const rc={name:`labelStartLink`,resolveAll:Gs.resolveAll,tokenize:ic};function ic(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const ac={name:`lineEnding`,tokenize:oc};function oc(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),G(e,t,`linePrefix`)}}const sc={name:`thematicBreak`,tokenize:cc};function cc(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||B(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),H(t)?G(e,s,`whitespace`)(t):s(t))}}const K={continuation:{tokenize:fc},exit:mc,name:`list`,tokenize:dc},lc={partial:!0,tokenize:hc},uc={partial:!0,tokenize:pc};function dc(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:or(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(sc,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return or(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Wo,r.interrupt?n:u,e.attempt(lc,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return H(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function fc(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Wo,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,G(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!H(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(uc,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,G(e,e.attempt(K,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function pc(e,t,n){let r=this;return G(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function mc(e){e.exit(this.containerState.type)}function hc(e,t,n){let r=this;return G(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!H(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const gc={name:`setextUnderline`,resolveTo:_c,tokenize:vc};function _c(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function vc(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),H(t)?G(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||B(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const yc={tokenize:Dc,partial:!0};function bc(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:wc,continuation:{tokenize:Tc},exit:Ec}},text:{91:{name:`gfmFootnoteCall`,tokenize:Cc},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:xc,resolveTo:Sc}}}}function xc(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=di(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Sc(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Cc(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||V(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(di(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return V(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function wc(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||V(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=di(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return V(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),G(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Tc(e,t,n){return e.check(Wo,t,e.attempt(yc,t,n))}function Ec(e){e.exit(`gfmFootnoteDefinition`)}function Dc(e,t,n){let r=this;return G(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Oc(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&U(o,o.length,0,Lo(s,e.slice(r+1,n),t)),U(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),U(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Zi(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Zi(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var kc=class{constructor(){this.map=[]}add(e,t,n){Ac(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Ac(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function jc(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Mc(){return{flow:{null:{name:`table`,tokenize:Nc,resolveAll:Pc}}}}function Nc(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):B(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):H(t)?G(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||V(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,H(t)?G(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return H(t)?G(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||B(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return H(t)?G(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||B(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||B(n)?(e.exit(`tableRow`),t(n)):H(n)?G(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||V(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Pc(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new kc;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Ic(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Fc(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Fc(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Fc(f,t,o,i,n,d)):(o[0]=o[1],d=Fc(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Ic(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=jc(t.events,n))}return e}function Fc(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Lc(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Lc(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Lc(t.events,n[2]),a=Lc(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Lc(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Ic(e,t,n,r,i){let a=[],o=Lc(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Lc(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const Rc={name:`tasklistCheck`,tokenize:Bc};function zc(){return{text:{91:Rc}}}function Bc(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return V(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return B(r)?t(r):H(r)?e.check({tokenize:Vc},t,n)(r):n(r)}}function Vc(e,t,n){return G(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Hc(e){return lo([So(),bc(),Oc(e),Mc(),zc()])}const Uc={};function Wc(e){let t=this,n=e||Uc,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Hc(n)),a.push(oo()),o.push(so(n))}const Gc={tokenize:Kc};function Kc(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),G(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return B(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const qc={tokenize:Yc},Jc={tokenize:Xc};function Yc(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return U(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Jc,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Jc,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return B(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;U(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Xc(e,t,n){return G(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const Zc={tokenize:Qc};function Qc(e){let t=this,n=e.attempt(Wo,r,e.attempt(this.parser.constructs.flowInitial,i,G(e,e.attempt(this.parser.constructs.flow,i,e.attempt(gs,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const $c={resolveAll:rl()},el=nl(`string`),tl=nl(`text`);function nl(e){return{resolveAll:rl(e===`text`?il:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function rl(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function il(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var al=y({attentionMarkers:()=>pl,contentInitial:()=>sl,disable:()=>ml,document:()=>ol,flow:()=>ll,flowInitial:()=>cl,insideSpan:()=>fl,string:()=>ul,text:()=>dl});const ol={42:K,43:K,45:K,48:K,49:K,50:K,51:K,52:K,53:K,54:K,55:K,56:K,57:K,62:Ko},sl={91:Ts},cl={[-2]:is,[-1]:is,32:is},ll={35:js,42:sc,45:[gc,sc],60:Is,61:gc,95:sc,96:ts,126:ts},ul={38:Qo,92:Xo},dl={[-5]:ac,[-4]:ac,[-3]:ac,33:tc,38:Qo,42:Ro,60:[Ho,Us],91:rc,92:[ks,Xo],93:Gs,95:Ro,96:cs},fl={null:[Ro,$c]},pl={null:[42,95]},ml={null:[]};function hl(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=W(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Lo(a,l.events,l),l.events):[]}function f(e,t){return _l(p(e),t)}function p(e){return gl(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){B(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&U(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function gl(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function _l(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
161
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return na(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=oo.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function wo(){return{exit:{taskListCheckValueChecked:Eo,taskListCheckValueUnchecked:Eo,paragraph:Do}}}function To(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Oo}}}function Eo(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Do(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function Oo(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=oo.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ko(){return[yi(),Wi(),Yi(),ho(),wo()]}function Ao(e){return{extensions:[bi(),Gi(e),Xi(),Co(e),To()]}}function W(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function jo(e,t){return e.length>0?(W(e,e.length,0,t),e):t}const Mo={}.hasOwnProperty;function No(e){let t={},n=-1;for(;++n<e.length;)Po(t,e[n]);return t}function Po(e,t){let n;for(n in t){let r=(Mo.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Mo.call(r,a)||(r[a]=[]);let e=i[a];Fo(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Fo(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);W(e,0,0,r)}const Io={tokenize:Xo,partial:!0},Lo={tokenize:Zo,partial:!0},Ro={tokenize:Qo,partial:!0},zo={tokenize:$o,partial:!0},Bo={tokenize:es,partial:!0},Vo={name:`wwwAutolink`,tokenize:Jo,previous:ts},Ho={name:`protocolAutolink`,tokenize:Yo,previous:ns},Uo={name:`emailAutolink`,tokenize:qo,previous:rs},Wo={};function Go(){return{text:Wo}}let Ko=48;for(;Ko<123;)Wo[Ko]=Uo,Ko++,Ko===58?Ko=65:Ko===91&&(Ko=97);Wo[43]=Uo,Wo[45]=Uo,Wo[46]=Uo,Wo[95]=Uo,Wo[72]=[Uo,Ho],Wo[104]=[Uo,Ho],Wo[87]=[Uo,Vo],Wo[119]=[Uo,Vo];function qo(e,t,n){let r=this,i,a;return o;function o(t){return!is(t)||!rs.call(r,r.previous)||as(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return is(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Bo,u,l)(t):t===45||t===95||B(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&z(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Jo(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!ts.call(r,r.previous)||as(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Io,e.attempt(Lo,e.attempt(Ro,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Yo(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&ns.call(r,r.previous)&&!as(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(z(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Dr(t)||H(t)||Mr(t)||jr(t)?n(t):e.attempt(Lo,e.attempt(Ro,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Xo(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Zo(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(zo,c,s)(t):t===null||H(t)||Mr(t)||t!==45&&jr(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Qo(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(zo,t,a)(o):o===null||H(o)||Mr(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function $o(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||H(o)||Mr(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||H(e)||Mr(e)?t(e):r(e)}function a(e){return z(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):z(t)?(e.consume(t),o):n(t)}}function es(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return B(e)?n(e):t(e)}}function ts(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||H(e)}function ns(e){return!z(e)}function rs(e){return!(e===47||is(e))}function is(e){return e===43||e===45||e===46||e===95||B(e)}function as(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function os(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const ss={name:`attention`,resolveAll:cs,tokenize:ls};function cs(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};us(d,-c),us(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=jo(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=jo(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=jo(l,os(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=jo(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=jo(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,W(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function ls(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=ya(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=ya(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function us(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ds={name:`autolink`,tokenize:fs};function fs(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return z(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||B(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||B(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Dr(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Er(t)?(e.consume(t),l):n(t)}function u(e){return B(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||B(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function G(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return U(r)?(e.enter(n),s(r)):t(r)}function s(r){return U(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const ps={partial:!0,tokenize:ms};function ms(e,t,n){return r;function r(t){return U(t)?G(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||V(e)?t(e):n(e)}}const hs={continuation:{tokenize:_s},exit:vs,name:`blockQuote`,tokenize:gs};function gs(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return U(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function _s(e,t,n){let r=this;return i;function i(t){return U(t)?G(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(hs,t,n)(r)}}function vs(e){e.exit(`blockQuote`)}const ys={name:`characterEscape`,tokenize:bs};function bs(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Ar(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const xs={name:`characterReference`,tokenize:Ss};function Ss(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=B,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=kr,u):(e.enter(`characterReferenceValue`),a=7,o=Or,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===B&&!lo(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const Cs={partial:!0,tokenize:Es},ws={concrete:!0,name:`codeFenced`,tokenize:Ts};function Ts(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),U(t)?G(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||V(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Cs,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||V(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),G(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||V(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||V(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&U(t)?G(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||V(t)?e.check(Cs,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||V(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),U(t)?G(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),U(t)?G(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||V(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Es(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const Ds={name:`codeIndented`,tokenize:ks},Os={partial:!0,tokenize:As};function ks(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),G(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):V(t)?e.attempt(Os,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||V(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function As(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):G(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):V(e)?i(e):n(e)}}const js={name:`codeText`,previous:Ns,resolve:Ms,tokenize:Ps};function Ms(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Ns(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ps(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||V(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Fs=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Is(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Is(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Is(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);Is(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Is(this.left,t.reverse())}}};function Is(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ls(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Fs(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Rs(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return W(e,0,1/0,u.slice(0)),!l}function Rs(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const zs={resolve:Vs,tokenize:Hs},Bs={partial:!0,tokenize:Us};function Vs(e){return Ls(e),e}function Hs(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):V(t)?e.check(Bs,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Us(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),G(e,a,`linePrefix`)}function a(i){if(i===null||V(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Ws(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Dr(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||V(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||H(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Dr(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Gs(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):V(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||V(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!U(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ks(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),G(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||V(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function qs(e,t){let n;return r;function r(i){return V(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):U(i)?G(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const Js={name:`definition`,tokenize:Xs},Ys={partial:!0,tokenize:Zs};function Xs(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Gs.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ni(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return H(t)?qs(e,l)(t):l(t)}function l(t){return Ws(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ys,d,d)(t)}function d(t){return U(t)?G(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||V(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Zs(e,t,n){return r;function r(t){return H(t)?qs(e,i)(t):n(t)}function i(t){return Ks(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return U(t)?G(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||V(e)?t(e):n(e)}}const Qs={name:`hardBreakEscape`,tokenize:$s};function $s(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return V(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const ec={name:`headingAtx`,resolve:tc,tokenize:nc};function tc(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},W(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function nc(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||H(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||V(n)?(e.exit(`atxHeading`),t(n)):U(n)?G(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||H(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const rc=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),ic=[`pre`,`script`,`style`,`textarea`],ac={concrete:!0,name:`htmlFlow`,resolveTo:cc,tokenize:lc},oc={partial:!0,tokenize:dc},sc={partial:!0,tokenize:uc};function cc(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function lc(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:M):z(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):z(a)?(e.consume(a),i=4,r.interrupt?t:M):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:M):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return z(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||H(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ic.includes(l)?(i=1,r.interrupt?t(s):O(s)):rc.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||B(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return U(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||z(t)?(e.consume(t),b):U(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||B(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):U(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):U(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||V(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||H(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||U(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||V(t)?O(t):U(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),te):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),M):t===93&&i===5?(e.consume(t),re):V(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(oc,ae,k)(t)):t===null||V(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(sc,A,ae)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||V(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),M):O(t)}function te(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return ic.includes(n)?(e.consume(t),ie):O(t)}return z(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function re(t){return t===93?(e.consume(t),M):O(t)}function M(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),M):O(t)}function ie(t){return t===null||V(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function uc(e,t,n){let r=this;return i;function i(t){return V(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function dc(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ps,t,n)}}const fc={name:`htmlText`,tokenize:pc};function pc(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):z(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):z(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):V(t)?(o=d,te(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):V(t)?(o=h,te(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):V(t)?(o=v,te(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):V(t)?(o=y,te(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return z(t)?(e.consume(t),S):n(t)}function S(t){return t===45||B(t)?(e.consume(t),S):C(t)}function C(t){return V(t)?(o=C,te(t)):U(t)?(e.consume(t),C):j(t)}function w(t){return t===45||B(t)?(e.consume(t),w):t===47||t===62||H(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||z(t)?(e.consume(t),E):V(t)?(o=T,te(t)):U(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||B(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):V(t)?(o=D,te(t)):U(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):V(t)?(o=O,te(t)):U(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):V(t)?(o=k,te(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||H(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||H(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function te(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return U(t)?G(e,re,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):re(t)}function re(t){return e.enter(`htmlTextData`),o(t)}}const mc={name:`labelEnd`,resolveAll:vc,resolveTo:yc,tokenize:bc},hc={tokenize:xc},gc={tokenize:Sc},_c={tokenize:Cc};function vc(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&W(e,0,e.length,n),e}function yc(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=jo(s,e.slice(a+1,a+r+3)),s=jo(s,[[`enter`,u,t]]),s=jo(s,os(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=jo(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=jo(s,e.slice(o+1)),s=jo(s,[[`exit`,c,t]]),W(e,a,e.length,s),e}function bc(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Ni(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(hc,u,o?u:d)(t):t===91?e.attempt(gc,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(_c,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function xc(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return H(t)?qs(e,a)(t):a(t)}function a(t){return t===41?u(t):Ws(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return H(t)?qs(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ks(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return H(t)?qs(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Sc(e,t,n){let r=this;return i;function i(t){return Gs.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ni(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Cc(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const wc={name:`labelStartImage`,resolveAll:mc.resolveAll,tokenize:Tc};function Tc(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const Ec={name:`labelStartLink`,resolveAll:mc.resolveAll,tokenize:Dc};function Dc(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const Oc={name:`lineEnding`,tokenize:kc};function kc(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),G(e,t,`linePrefix`)}}const Ac={name:`thematicBreak`,tokenize:jc};function jc(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||V(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),U(t)?G(e,s,`whitespace`)(t):s(t))}}const K={continuation:{tokenize:Fc},exit:Lc,name:`list`,tokenize:Pc},Mc={partial:!0,tokenize:Rc},Nc={partial:!0,tokenize:Ic};function Pc(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Or(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ac,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Or(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ps,r.interrupt?n:u,e.attempt(Mc,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return U(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Fc(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ps,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,G(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!U(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Nc,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,G(e,e.attempt(K,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Ic(e,t,n){let r=this;return G(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Lc(e){e.exit(this.containerState.type)}function Rc(e,t,n){let r=this;return G(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!U(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const zc={name:`setextUnderline`,resolveTo:Bc,tokenize:Vc};function Bc(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Vc(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),U(t)?G(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||V(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const Hc={tokenize:Xc,partial:!0};function Uc(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:qc,continuation:{tokenize:Jc},exit:Yc}},text:{91:{name:`gfmFootnoteCall`,tokenize:Kc},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Wc,resolveTo:Gc}}}}function Wc(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Ni(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Gc(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function Kc(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||H(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Ni(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return H(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function qc(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||H(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Ni(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return H(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),G(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Jc(e,t,n){return e.check(ps,t,e.attempt(Hc,t,n))}function Yc(e){e.exit(`gfmFootnoteDefinition`)}function Xc(e,t,n){let r=this;return G(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Zc(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&W(o,o.length,0,os(s,e.slice(r+1,n),t)),W(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),W(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=ya(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=ya(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Qc=class{constructor(){this.map=[]}add(e,t,n){$c(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function $c(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function el(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function tl(){return{flow:{null:{name:`table`,tokenize:nl,resolveAll:rl}}}}function nl(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):V(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):U(t)?G(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||H(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,U(t)?G(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return U(t)?G(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||V(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return U(t)?G(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||V(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||V(n)?(e.exit(`tableRow`),t(n)):U(n)?G(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||H(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function rl(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Qc;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(al(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=il(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=il(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=il(f,t,o,i,n,d)):(o[0]=o[1],d=il(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&al(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=el(t.events,n))}return e}function il(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},ol(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=ol(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=ol(t.events,n[2]),a=ol(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},ol(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function al(e,t,n,r,i){let a=[],o=ol(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function ol(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const sl={name:`tasklistCheck`,tokenize:ll};function cl(){return{text:{91:sl}}}function ll(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return H(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return V(r)?t(r):U(r)?e.check({tokenize:ul},t,n)(r):n(r)}}function ul(e,t,n){return G(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function dl(e){return No([Go(),Uc(),Zc(e),tl(),cl()])}const fl={};function pl(e){let t=this,n=e||fl,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(dl(n)),a.push(ko()),o.push(Ao(n))}const ml={tokenize:hl};function hl(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),G(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return V(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const gl={tokenize:vl},_l={tokenize:yl};function vl(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return W(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(_l,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(_l,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return V(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;W(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function yl(e,t,n){return G(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const bl={tokenize:xl};function xl(e){let t=this,n=e.attempt(ps,r,e.attempt(this.parser.constructs.flowInitial,i,G(e,e.attempt(this.parser.constructs.flow,i,e.attempt(zs,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}const Sl={resolveAll:El()},Cl=Tl(`string`),wl=Tl(`text`);function Tl(e){return{resolveAll:El(e===`text`?Dl:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function El(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Dl(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Ol=te({attentionMarkers:()=>Il,contentInitial:()=>Al,disable:()=>Ll,document:()=>kl,flow:()=>Ml,flowInitial:()=>jl,insideSpan:()=>Fl,string:()=>Nl,text:()=>Pl});const kl={42:K,43:K,45:K,48:K,49:K,50:K,51:K,52:K,53:K,54:K,55:K,56:K,57:K,62:hs},Al={91:Js},jl={[-2]:Ds,[-1]:Ds,32:Ds},Ml={35:ec,42:Ac,45:[zc,Ac],60:ac,61:zc,95:Ac,96:ws,126:ws},Nl={38:xs,92:ys},Pl={[-5]:Oc,[-4]:Oc,[-3]:Oc,33:wc,38:xs,42:ss,60:[ds,fc],91:Ec,92:[Qs,ys],93:mc,95:ss,96:js},Fl={null:[ss,Sl]},Il={null:[42,95]},Ll={null:[]};function Rl(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=jo(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=os(a,l.events,l),l.events):[]}function f(e,t){return Bl(p(e),t)}function p(e){return zl(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){V(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&W(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zl(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Bl(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
156
162
  `;break;case-3:o=`\r
157
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function vl(e){let t={constructs:lo([al,...(e||{}).extensions||[]]),content:n(Gc),defined:[],document:n(qc),flow:n(Zc),lazy:{},string:n(el),text:n(tl)};return t;function n(e){return n;function n(n){return hl(t,e,n)}}}function yl(e){for(;!ms(e););return e}const bl=/[\0\t\n\r]/g;function xl(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(bl.lastIndex=u,c=bl.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function Sl(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?wl(e.position):`start`in e||`end`in e?wl(e):`line`in e||`column`in e?Cl(e):``}function Cl(e){return Tl(e&&e.line)+`:`+Tl(e&&e.column)}function wl(e){return Cl(e&&e.start)+`-`+Cl(e&&e.end)}function Tl(e){return e&&typeof e==`number`?e:1}const El={}.hasOwnProperty;function Dl(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),Ol(n)(yl(vl(n).document().write(xl()(e,t,!0))))}function Ol(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(me),characterEscape:T,characterReference:T,codeFenced:a(he),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(he,o),codeText:a(ge,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(_e),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ve),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:se,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:pe,autolinkProtocol:fe,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ue,characterReference:de,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(j),label:re,labelText:ne,lineEnding:D,link:c(te),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:ie,resourceTitleString:ae,resource:oe,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};Al(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];El.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ml).call(a,void 0,e[0])}for(r.position={start:kl(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:kl(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:kl(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||Ml).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Sl({start:e.start,end:e.end})+`): it’s not open`);n.position.end=kl(e.end)}function u(){return ra(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=di(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Oe(),n.position={start:kl(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=kl(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=kl(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Wa(t),n.identifier=di(t).toLowerCase()}function re(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=di(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function ue(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ha(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Va(t);let i=this.stack[this.stack.length-1];i.value+=r}function de(e){let t=this.stack.pop();t.position.end=kl(e.end)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function pe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function me(){return{type:`blockquote`,children:[]}}function he(){return{type:`code`,lang:null,meta:null,value:``}}function ge(){return{type:`inlineCode`,value:``}}function _e(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function ve(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function kl(e){return{line:e.line,column:e.column,offset:e.offset}}function Al(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Al(e,r):jl(e,r)}}function jl(e,t){let n;for(n in t)if(El.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function Ml(e,t){throw e?Error("Cannot close `"+e.type+"` ("+Sl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Sl({start:t.start,end:t.end})+`) is open`):Error("Cannot close document, a token (`"+t.type+"`, "+Sl({start:t.start,end:t.end})+`) is still open`)}function Nl(e){let t=this;t.parser=n;function n(n){return Dl(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Pl(e){if(e)throw e}var Fl=v(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`)if(n.call(e,t)){if(a)return a(e,t).value}else return;return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Il(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ll(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Rl(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Rl(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var q=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Sl(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};q.prototype.file=``,q.prototype.name=``,q.prototype.reason=``,q.prototype.message=``,q.prototype.stack=``,q.prototype.column=void 0,q.prototype.line=void 0,q.prototype.ancestors=void 0,q.prototype.cause=void 0,q.prototype.fatal=void 0,q.prototype.place=void 0,q.prototype.ruleId=void 0,q.prototype.source=void 0;function zl(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const Bl=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var Vl=class{constructor(e){let n;n=e?zl(e)?{path:e}:typeof e==`string`||Gl(e)?{value:e}:e:{},this.cwd=`cwd`in n?``:t.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Bl.length;){let e=Bl[r];e in n&&n[e]!==void 0&&n[e]!==null&&(this[e]=e===`history`?[...n[e]]:n[e])}let i;for(i in n)Bl.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path==`string`?a.basename(this.path):void 0}set basename(e){Ul(e,`basename`),Hl(e,`basename`),this.path=a.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?a.dirname(this.path):void 0}set dirname(e){Wl(this.basename,`dirname`),this.path=a.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?a.extname(this.path):void 0}set extname(e){if(Hl(e,`extname`),Wl(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=a.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){zl(e)&&(e=c(e)),Ul(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?a.basename(this.path,this.extname):void 0}set stem(e){Ul(e,`stem`),Hl(e,`stem`),this.path=a.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new q(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function Hl(e,t){if(e&&e.includes(a.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+a.sep+"`")}function Ul(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function Wl(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function Gl(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const Kl=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var ql=x(Fl(),1);const Jl={}.hasOwnProperty,Yl=new class e extends Kl{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Ll()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ql.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(Ql(`data`,this.frozen),this.namespace[e]=t,this):Jl.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Ql(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=tu(e),n=this.parser||this.Parser;return Xl(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Xl(`process`,this.parser||this.Parser),Zl(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=tu(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);ru(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Xl(`processSync`,this.parser||this.Parser),Zl(`processSync`,this.compiler||this.Compiler),this.process(e,r),eu(`processSync`,`process`,t),n;function r(e,r){t=!0,Pl(e),n=r}}run(e,t,n){$l(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=tu(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),eu(`runSync`,`run`,n),r;function i(e,t){Pl(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=tu(t),r=this.compiler||this.Compiler;return Zl(`stringify`,r),$l(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(Ql(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,ql.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Il(o)&&Il(r)&&(r=(0,ql.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Xl(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Zl(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function Ql(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function $l(e){if(!Il(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function eu(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function tu(e){return nu(e)?e:new Vl(e)}function nu(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function ru(e){return typeof e==`string`||iu(e)}function iu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var J=v((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),au=v((e=>{var t=J();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),ou=v((e=>{var t=J(),n=au();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(`
158
- `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),su=v((e=>{var t=J(),n=au();function r(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 i(e){let t=new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=new Map,s=null;return{onAnchor:t=>{r.push(t),s??=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}}e.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),cu=v((e=>{function t(e,n,r,i){if(i&&typeof i==`object`)if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}return e.call(n,r,i)}e.applyReviver=t})),lu=v((e=>{var t=J();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),uu=v((e=>{var t=cu(),n=J(),r=lu();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{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:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),du=v((e=>{var t=su(),n=au(),r=J(),i=uu(),a=lu(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let a;for(let e of i){if(e===this)break;e.anchor===this.source&&(a=e)}return a}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let c=n.get(o);if(c||=(a.toJS(o,null,t),n.get(o)),c?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=s(r,o,n)),c.count*c.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return c.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(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`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}else if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),Y=v((e=>{var t=J(),n=uu(),r=lu();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),fu=v((e=>{var t=du(),n=J(),r=Y();function i(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 a(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);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:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??=c(e),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}e.createNode=a})),pu=v((e=>{var t=fu(),n=J(),r=uu();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}},e.collectionFromPath=i,e.isEmptyPath=a})),mu=v((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
163
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Vl(e){let t={constructs:No([Ol,...(e||{}).extensions||[]]),content:n(ml),defined:[],document:n(gl),flow:n(bl),lazy:{},string:n(Cl),text:n(wl)};return t;function n(e){return n;function n(n){return Rl(t,e,n)}}}function Hl(e){for(;!Ls(e););return e}const Ul=/[\0\t\n\r]/g;function Wl(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Ul.lastIndex=u,c=Ul.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}function Gl(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?ql(e.position):`start`in e||`end`in e?ql(e):`line`in e||`column`in e?Kl(e):``}function Kl(e){return Jl(e&&e.line)+`:`+Jl(e&&e.column)}function ql(e){return Kl(e&&e.start)+`-`+Kl(e&&e.end)}function Jl(e){return e&&typeof e==`number`?e:1}const Yl={}.hasOwnProperty;function Xl(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),Zl(n)(Hl(Vl(n).document().write(Wl()(e,t,!0))))}function Zl(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Se),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ve),blockQuote:a(pe),characterEscape:T,characterReference:T,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(he,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_e),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(be,o),htmlFlowData:T,htmlText:a(be,o),htmlTextData:T,image:a(xe),label:o,link:a(Se),listItem:a(we),listItemValue:f,listOrdered:a(Ce,d),listUnordered:a(Ce),paragraph:a(Te),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ve),strong:a(Ee),thematicBreak:a(Oe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(te),label:re,labelText:ne,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:M,resourceTitleString:ie,resource:ae,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};$l(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Yl.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||tu).call(a,void 0,e[0])}for(r.position={start:Ql(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Ql(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Ql(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||tu).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Gl({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Ql(e.end)}function u(){return Ta(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ni(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=De(),n.position={start:Ql(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Ql(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Ql(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=po(t),n.identifier=Ni(t).toLowerCase()}function re(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function M(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ae(){this.data.inReference=void 0}function oe(){this.data.referenceType=`collapsed`}function se(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ni(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ce(e){this.data.characterReferenceType=e.type}function le(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=uo(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=lo(t);let i=this.stack[this.stack.length-1];i.value+=r}function ue(e){let t=this.stack.pop();t.position.end=Ql(e.end)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function fe(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function pe(){return{type:`blockquote`,children:[]}}function me(){return{type:`code`,lang:null,meta:null,value:``}}function he(){return{type:`inlineCode`,value:``}}function ge(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function _e(){return{type:`emphasis`,children:[]}}function ve(){return{type:`heading`,depth:0,children:[]}}function ye(){return{type:`break`}}function be(){return{type:`html`,value:``}}function xe(){return{type:`image`,title:null,url:``,alt:null}}function Se(){return{type:`link`,title:null,url:``,children:[]}}function Ce(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function we(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Te(){return{type:`paragraph`,children:[]}}function Ee(){return{type:`strong`,children:[]}}function De(){return{type:`text`,value:``}}function Oe(){return{type:`thematicBreak`}}}function Ql(e){return{line:e.line,column:e.column,offset:e.offset}}function $l(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?$l(e,r):eu(e,r)}}function eu(e,t){let n;for(n in t)if(Yl.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function tu(e,t){throw e?Error("Cannot close `"+e.type+"` ("+Gl({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Gl({start:t.start,end:t.end})+`) is open`):Error("Cannot close document, a token (`"+t.type+"`, "+Gl({start:t.start,end:t.end})+`) is still open`)}function nu(e){let t=this;t.parser=n;function n(n){return Xl(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function ru(e){if(e)throw e}var iu=j(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`)if(n.call(e,t)){if(a)return a(e,t).value}else return;return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function au(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function ou(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?su(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function su(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var q=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Gl(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};q.prototype.file=``,q.prototype.name=``,q.prototype.reason=``,q.prototype.message=``,q.prototype.stack=``,q.prototype.column=void 0,q.prototype.line=void 0,q.prototype.ancestors=void 0,q.prototype.cause=void 0,q.prototype.fatal=void 0,q.prototype.place=void 0,q.prototype.ruleId=void 0,q.prototype.source=void 0;function cu(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const lu=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var uu=class{constructor(e){let t;t=e?cu(e)?{path:e}:typeof e==`string`||mu(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:p.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<lu.length;){let e=lu[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)lu.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?_.basename(this.path):void 0}set basename(e){fu(e,`basename`),du(e,`basename`),this.path=_.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?_.dirname(this.path):void 0}set dirname(e){pu(this.basename,`dirname`),this.path=_.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?_.extname(this.path):void 0}set extname(e){if(du(e,`extname`),pu(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=_.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){cu(e)&&(e=b(e)),fu(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?_.basename(this.path,this.extname):void 0}set stem(e){fu(e,`stem`),du(e,`stem`),this.path=_.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new q(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function du(e,t){if(e&&e.includes(_.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+_.sep+"`")}function fu(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function pu(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function mu(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const hu=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var gu=re(iu(),1);const _u={}.hasOwnProperty,vu=new class e extends hu{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=ou()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,gu.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(xu(`data`,this.frozen),this.namespace[e]=t,this):_u.call(this.namespace,e)&&this.namespace[e]||void 0:e?(xu(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=wu(e),n=this.parser||this.Parser;return yu(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),yu(`process`,this.parser||this.Parser),bu(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=wu(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);Eu(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),yu(`processSync`,this.parser||this.Parser),bu(`processSync`,this.compiler||this.Compiler),this.process(e,r),Cu(`processSync`,`process`,t),n;function r(e,r){t=!0,ru(e),n=r}}run(e,t,n){Su(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=wu(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Cu(`runSync`,`run`,n),r;function i(e,t){ru(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=wu(t),r=this.compiler||this.Compiler;return bu(`stringify`,r),Su(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(xu(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,gu.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];au(o)&&au(r)&&(r=(0,gu.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function yu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function bu(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function xu(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Su(e){if(!au(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Cu(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function wu(e){return Tu(e)?e:new uu(e)}function Tu(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function Eu(e){return typeof e==`string`||Du(e)}function Du(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var J=j((e=>{let t=Symbol.for(`yaml.alias`),n=Symbol.for(`yaml.document`),r=Symbol.for(`yaml.map`),i=Symbol.for(`yaml.pair`),a=Symbol.for(`yaml.scalar`),o=Symbol.for(`yaml.seq`),s=Symbol.for(`yaml.node.type`),c=e=>!!e&&typeof e==`object`&&e[s]===t,l=e=>!!e&&typeof e==`object`&&e[s]===n,u=e=>!!e&&typeof e==`object`&&e[s]===r,d=e=>!!e&&typeof e==`object`&&e[s]===i,f=e=>!!e&&typeof e==`object`&&e[s]===a,p=e=>!!e&&typeof e==`object`&&e[s]===o;function m(e){if(e&&typeof e==`object`)switch(e[s]){case r:case o:return!0}return!1}function h(e){if(e&&typeof e==`object`)switch(e[s]){case t:case r:case a:case o:return!0}return!1}e.ALIAS=t,e.DOC=n,e.MAP=r,e.NODE_TYPE=s,e.PAIR=i,e.SCALAR=a,e.SEQ=o,e.hasAnchor=e=>(f(e)||m(e))&&!!e.anchor,e.isAlias=c,e.isCollection=m,e.isDocument=l,e.isMap=u,e.isNode=h,e.isPair=d,e.isScalar=f,e.isSeq=p})),Ou=j((e=>{var t=J();let n=Symbol(`break visit`),r=Symbol(`skip children`),i=Symbol(`remove node`);function a(e,n){let r=l(n);t.isDocument(e)?o(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):o(null,e,r,Object.freeze([]))}a.BREAK=n,a.SKIP=r,a.REMOVE=i;function o(e,r,a,s){let c=u(e,r,a,s);if(t.isNode(c)||t.isPair(c))return d(e,s,c),o(e,c,a,s);if(typeof c!=`symbol`){if(t.isCollection(r)){s=Object.freeze(s.concat(r));for(let e=0;e<r.items.length;++e){let t=o(e,r.items[e],a,s);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){s=Object.freeze(s.concat(r));let e=o(`key`,r.key,a,s);if(e===n)return n;e===i&&(r.key=null);let t=o(`value`,r.value,a,s);if(t===n)return n;t===i&&(r.value=null)}}return c}async function s(e,n){let r=l(n);t.isDocument(e)?await c(null,e.contents,r,Object.freeze([e]))===i&&(e.contents=null):await c(null,e,r,Object.freeze([]))}s.BREAK=n,s.SKIP=r,s.REMOVE=i;async function c(e,r,a,o){let s=await u(e,r,a,o);if(t.isNode(s)||t.isPair(s))return d(e,o,s),c(e,s,a,o);if(typeof s!=`symbol`){if(t.isCollection(r)){o=Object.freeze(o.concat(r));for(let e=0;e<r.items.length;++e){let t=await c(e,r.items[e],a,o);if(typeof t==`number`)e=t-1;else if(t===n)return n;else t===i&&(r.items.splice(e,1),--e)}}else if(t.isPair(r)){o=Object.freeze(o.concat(r));let e=await c(`key`,r.key,a,o);if(e===n)return n;e===i&&(r.key=null);let t=await c(`value`,r.value,a,o);if(t===n)return n;t===i&&(r.value=null)}}return s}function l(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function u(e,n,r,i){if(typeof r==`function`)return r(e,n,i);if(t.isMap(n))return r.Map?.(e,n,i);if(t.isSeq(n))return r.Seq?.(e,n,i);if(t.isPair(n))return r.Pair?.(e,n,i);if(t.isScalar(n))return r.Scalar?.(e,n,i);if(t.isAlias(n))return r.Alias?.(e,n,i)}function d(e,n,r){let i=n[n.length-1];if(t.isCollection(i))i.items[e]=r;else if(t.isPair(i))e===`key`?i.key=r:i.value=r;else if(t.isDocument(i))i.contents=r;else{let e=t.isAlias(i)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}e.visit=a,e.visitAsync=s})),ku=j((e=>{var t=J(),n=Ou();let r={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},i=e=>e.replace(/[!,[\]{}]/g,e=>r[e]);var a=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags);break}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+i(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let r=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],i=Object.entries(this.tags),a;if(e&&i.length>0&&t.isNode(e.contents)){let r={};n.visit(e.contents,(e,n)=>{t.isNode(n)&&n.tag&&(r[n.tag]=!0)}),a=Object.keys(r)}else a=[];for(let[t,n]of i)t===`!!`&&n===`tag:yaml.org,2002:`||(!e||a.some(e=>e.startsWith(n)))&&r.push(`%TAG ${t} ${n}`);return r.join(`
164
+ `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),Au=j((e=>{var t=J(),n=Ou();function r(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 i(e){let t=new Set;return n.visit(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function a(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function o(e,n){let r=[],o=new Map,s=null;return{onAnchor:t=>{r.push(t),s??=i(e);let o=a(n,s);return s.add(o),o},setAnchors:()=>{for(let e of r){let n=o.get(e);if(typeof n==`object`&&n.anchor&&(t.isScalar(n.node)||t.isCollection(n.node)))n.node.anchor=n.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:o}}e.anchorIsValid=r,e.anchorNames=i,e.createNodeAnchors=o,e.findNewAnchor=a})),ju=j((e=>{function t(e,n,r,i){if(i&&typeof i==`object`)if(Array.isArray(i))for(let n=0,r=i.length;n<r;++n){let r=i[n],a=t(e,i,String(n),r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}else if(i instanceof Map)for(let n of Array.from(i.keys())){let r=i.get(n),a=t(e,i,n,r);a===void 0?i.delete(n):a!==r&&i.set(n,a)}else if(i instanceof Set)for(let n of Array.from(i)){let r=t(e,i,n,n);r===void 0?i.delete(n):r!==n&&(i.delete(n),i.add(r))}else for(let[n,r]of Object.entries(i)){let a=t(e,i,n,r);a===void 0?delete i[n]:a!==r&&(i[n]=a)}return e.call(n,r,i)}e.applyReviver=t})),Mu=j((e=>{var t=J();function n(e,r,i){if(Array.isArray(e))return e.map((e,t)=>n(e,String(t),i));if(e&&typeof e.toJSON==`function`){if(!i||!t.hasAnchor(e))return e.toJSON(r,i);let n={aliasCount:0,count:1,res:void 0};i.anchors.set(e,n),i.onCreate=e=>{n.res=e,delete i.onCreate};let a=e.toJSON(r,i);return i.onCreate&&i.onCreate(a),a}return typeof e==`bigint`&&!i?.keep?Number(e):e}e.toJS=n})),Nu=j((e=>{var t=ju(),n=J(),r=Mu();e.NodeBase=class{constructor(e){Object.defineProperty(this,n.NODE_TYPE,{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:i,maxAliasCount:a,onAnchor:o,reviver:s}={}){if(!n.isDocument(e))throw TypeError(`A document argument is required`);let c={anchors:new Map,doc:e,keep:!0,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof a==`number`?a:100},l=r.toJS(this,``,c);if(typeof o==`function`)for(let{count:e,res:t}of c.anchors.values())o(t,e);return typeof s==`function`?t.applyReviver(s,{"":l},``,l):l}}})),Pu=j((e=>{var t=Au(),n=Ou(),r=J(),i=Nu(),a=Mu(),o=class extends i.NodeBase{constructor(e){super(r.ALIAS),this.source=e,Object.defineProperty(this,`tag`,{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],n.visit(e,{Node:(e,t)=>{(r.isAlias(t)||r.hasAnchor(t))&&i.push(t)}}),t&&(t.aliasResolveCache=i));let a;for(let e of i){if(e===this)break;e.anchor===this.source&&(a=e)}return a}toJSON(e,t){if(!t)return{source:this.source};let{anchors:n,doc:r,maxAliasCount:i}=t,o=this.resolve(r,t);if(!o){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}let c=n.get(o);if(c||=(a.toJS(o,null,t),n.get(o)),c?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(c.count+=1,c.aliasCount===0&&(c.aliasCount=s(r,o,n)),c.count*c.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`);return c.res}toString(e,n,r){let i=`*${this.source}`;if(e){if(t.anchorIsValid(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`${i} `}return i}};function s(e,t,n){if(r.isAlias(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(r.isCollection(t)){let r=0;for(let i of t.items){let t=s(e,i,n);t>r&&(r=t)}return r}else if(r.isPair(t)){let r=s(e,t.key,n),i=s(e,t.value,n);return Math.max(r,i)}return 1}e.Alias=o})),Y=j((e=>{var t=J(),n=Nu(),r=Mu();let i=e=>!e||typeof e!=`function`&&typeof e!=`object`;var a=class extends n.NodeBase{constructor(e){super(t.SCALAR),this.value=e}toJSON(e,t){return t?.keep?this.value:r.toJS(this.value,e,t)}toString(){return String(this.value)}};a.BLOCK_FOLDED=`BLOCK_FOLDED`,a.BLOCK_LITERAL=`BLOCK_LITERAL`,a.PLAIN=`PLAIN`,a.QUOTE_DOUBLE=`QUOTE_DOUBLE`,a.QUOTE_SINGLE=`QUOTE_SINGLE`,e.Scalar=a,e.isScalarValue=i})),Fu=j((e=>{var t=Pu(),n=J(),r=Y();function i(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 a(e,a,o){if(n.isDocument(e)&&(e=e.contents),n.isNode(e))return e;if(n.isPair(e)){let t=o.schema[n.MAP].createNode?.(o.schema,null,o);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:s,onAnchor:c,onTagObj:l,schema:u,sourceObjects:d}=o,f;if(s&&e&&typeof e==`object`){if(f=d.get(e),f)return f.anchor??=c(e),new t.Alias(f.anchor);f={anchor:null,node:null},d.set(e,f)}a?.startsWith(`!!`)&&(a=`tag:yaml.org,2002:`+a.slice(2));let p=i(e,a,u.tags);if(!p){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new r.Scalar(e);return f&&(f.node=t),t}p=e instanceof Map?u[n.MAP]:Symbol.iterator in Object(e)?u[n.SEQ]:u[n.MAP]}l&&(l(p),delete o.onTagObj);let m=p?.createNode?p.createNode(o.schema,e,o):typeof p?.nodeClass?.from==`function`?p.nodeClass.from(o.schema,e,o):new r.Scalar(e);return a?m.tag=a:p.default||(m.tag=p.tag),f&&(f.node=m),m}e.createNode=a})),Iu=j((e=>{var t=Fu(),n=J(),r=Nu();function i(e,n,r){let i=r;for(let e=n.length-1;e>=0;--e){let t=n[e];if(typeof t==`number`&&Number.isInteger(t)&&t>=0){let e=[];e[t]=i,i=e}else i=new Map([[t,i]])}return t.createNode(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}let a=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done;e.Collection=class extends r.NodeBase{constructor(e,t){super(e),Object.defineProperty(this,`schema`,{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>n.isNode(t)||n.isPair(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(a(e))this.add(t);else{let[r,...a]=e,o=this.get(r,!0);if(n.isCollection(o))o.addIn(a,t);else if(o===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let i=this.get(t,!0);if(n.isCollection(i))return i.deleteIn(r);throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...i]=e,a=this.get(r,!0);return i.length===0?!t&&n.isScalar(a)?a.value:a:n.isCollection(a)?a.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!n.isPair(t))return!1;let r=t.value;return r==null||e&&n.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let i=this.get(t,!0);return n.isCollection(i)?i.hasIn(r):!1}setIn(e,t){let[r,...a]=e;if(a.length===0)this.set(r,t);else{let e=this.get(r,!0);if(n.isCollection(e))e.setIn(a,t);else if(e===void 0&&this.schema)this.set(r,i(this.schema,a,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}},e.collectionFromPath=i,e.isEmptyPath=a})),Lu=j((e=>{let t=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function n(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}e.indentComment=n,e.lineComment=(e,t,r)=>e.endsWith(`
159
165
  `)?n(r,t):r.includes(`
160
166
  `)?`
161
- `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),hu=v((e=>{let t=`block`,n=`quoted`;function r(e,r,a=`flow`,{indentAtStart:o,lineWidth:s=80,minContentWidth:c=20,onFold:l,onOverflow:u}={}){if(!s||s<0)return e;s<c&&(c=0);let d=Math.max(1+c,1+s-r.length);if(e.length<=d)return e;let f=[],p={},m=s-r.length;typeof o==`number`&&(o>s-Math.max(2,c)?f.push(0):m=s-o);let h,g,_=!1,v=-1,y=-1,b=-1;a===t&&(v=i(e,v,r.length),v!==-1&&(m=v+d));for(let o;o=e[v+=1];){if(a===n&&o===`\\`){switch(y=v,e[v+1]){case`x`:v+=3;break;case`u`:v+=5;break;case`U`:v+=9;break;default:v+=1}b=v}if(o===`
167
+ `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),Ru=j((e=>{let t=`block`,n=`quoted`;function r(e,r,a=`flow`,{indentAtStart:o,lineWidth:s=80,minContentWidth:c=20,onFold:l,onOverflow:u}={}){if(!s||s<0)return e;s<c&&(c=0);let d=Math.max(1+c,1+s-r.length);if(e.length<=d)return e;let f=[],p={},m=s-r.length;typeof o==`number`&&(o>s-Math.max(2,c)?f.push(0):m=s-o);let h,g,_=!1,v=-1,y=-1,b=-1;a===t&&(v=i(e,v,r.length),v!==-1&&(m=v+d));for(let o;o=e[v+=1];){if(a===n&&o===`\\`){switch(y=v,e[v+1]){case`x`:v+=3;break;case`u`:v+=5;break;case`U`:v+=9;break;default:v+=1}b=v}if(o===`
162
168
  `)a===t&&(v=i(e,v,r.length)),m=v+r.length+d,h=void 0;else{if(o===` `&&g&&g!==` `&&g!==`
163
169
  `&&g!==` `){let t=e[v+1];t&&t!==` `&&t!==`
164
170
  `&&t!==` `&&(h=v)}if(v>=m)if(h)f.push(h),m=h+d,h=void 0;else if(a===n){for(;g===` `||g===` `;)g=o,o=e[v+=1],_=!0;let t=v>b+1?v-2:y-1;if(p[t])return e;f.push(t),p[t]=!0,m=t+d,h=void 0}else _=!0}g=o}if(_&&u&&u(),f.length===0)return e;l&&l();let x=e.slice(0,f[0]);for(let t=0;t<f.length;++t){let i=f[t],o=f[t+1]||e.length;i===0?x=`\n${r}${e.slice(0,o)}`:(a===n&&p[i]&&(x+=`${e[i]}\\`),x+=`\n${r}${e.slice(i+1,o)}`)}return x}function i(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!==`
165
- `);r=t,i=t+1,a=e[i]}return r}e.FOLD_BLOCK=t,e.FOLD_FLOW=`flow`,e.FOLD_QUOTED=n,e.foldFlowLines=r})),gu=v((e=>{var t=Y(),n=hu();let r=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),i=e=>/^(%|---|\.\.\.)/m.test(e);function a(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]===`
171
+ `);r=t,i=t+1,a=e[i]}return r}e.FOLD_BLOCK=t,e.FOLD_FLOW=`flow`,e.FOLD_QUOTED=n,e.foldFlowLines=r})),zu=j((e=>{var t=Y(),n=Ru();let r=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),i=e=>/^(%|---|\.\.\.)/m.test(e);function a(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]===`
166
172
  `){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function o(e,t){let a=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return a;let{implicitKey:o}=t,s=t.options.doubleQuotedMinMultiLineLength,c=t.indent||(i(e)?` `:``),l=``,u=0;for(let e=0,t=a[e];t;t=a[++e])if(t===` `&&a[e+1]===`\\`&&a[e+2]===`n`&&(l+=a.slice(u,e)+`\\ `,e+=1,u=e,t=`\\`),t===`\\`)switch(a[e+1]){case`u`:{l+=a.slice(u,e);let t=a.substr(e+2,4);switch(t){case`0000`:l+=`\\0`;break;case`0007`:l+=`\\a`;break;case`000b`:l+=`\\v`;break;case`001b`:l+=`\\e`;break;case`0085`:l+=`\\N`;break;case`00a0`:l+=`\\_`;break;case`2028`:l+=`\\L`;break;case`2029`:l+=`\\P`;break;default:t.substr(0,2)===`00`?l+=`\\x`+t.substr(2):l+=a.substr(e,6)}e+=5,u=e+1}break;case`n`:if(o||a[e+2]===`"`||a.length<s)e+=1;else{for(l+=a.slice(u,e)+`
167
173
 
168
174
  `;a[e+2]===`\\`&&a[e+3]===`n`&&a[e+4]!==`"`;)l+=`
@@ -180,29 +186,29 @@ Thumbs.db
180
186
  $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${g}`),i=!1,a=r(u,!0);p!==`folded`&&o!==t.Scalar.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let c=n.foldFlowLines(`${T}${e}${b}`,g,n.FOLD_BLOCK,a);if(!i)return`>${E}\n${g}${c}`}return s=s.replace(/\n+/g,`$&${g}`),`|${E}\n${g}${T}${s}${b}`}function d(e,a,o,s){let{type:l,value:d}=e,{actualString:f,implicitKey:p,indent:m,indentStep:h,inFlow:g}=a;if(p&&d.includes(`
181
187
  `)||g&&/[[\]{},]/.test(d))return c(d,a);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(d))return p||g||!d.includes(`
182
188
  `)?c(d,a):u(e,a,o,s);if(!p&&!g&&l!==t.Scalar.PLAIN&&d.includes(`
183
- `))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}function f(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}e.stringifyString=f})),_u=v((e=>{var t=su(),n=J(),r=mu(),i=gu();function a(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,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,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}}function o(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 r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function s(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}function c(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);if(n.isAlias(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 c,l=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>c=e});c??=o(t.doc.schema.tags,l);let u=s(l,c,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);let d=typeof c.stringify==`function`?c.stringify(l,t,r,a):n.isScalar(l)?i.stringifyString(l,t,r,a):l.toString(t,r,a);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}e.createStringifyContext=a,e.stringify=c})),vu=v((e=>{var t=J(),n=Y(),r=_u(),i=mu();function a({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:m,simpleKeys:h}}=o,g=t.isNode(e)&&e.comment||null;if(h){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!h&&(!e||g&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!_&&(h||!l),indent:d+f});let v=!1,y=!1,b=r.stringify(e,o,()=>v=!0,()=>y=!0);if(!_&&!o.inFlow&&b.length>1024){if(h)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(o.inFlow){if(l||a==null)return v&&s&&s(),b===``?`?`:_?`? ${b}`:b}else if(l&&!h||a==null&&_)return b=`? ${b}`,g&&!v?b+=i.lineComment(b,o.indent,p(g)):y&&c&&c(),b;v&&(g=null),_?(g&&(b+=i.lineComment(b,o.indent,p(g))),b=`? ${b}\n${d}:`):(b=`${b}:`,g&&(b+=i.lineComment(b,o.indent,p(g))));let x,S,C;t.isNode(a)?(x=!!a.spaceBefore,S=a.commentBefore,C=a.comment):(x=!1,S=null,C=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!_&&!g&&t.isScalar(a)&&(o.indentAtStart=b.length+1),y=!1,!m&&f.length>=2&&!o.inFlow&&!_&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let w=!1,T=r.stringify(a,o,()=>w=!0,()=>y=!0),E=` `;if(g||x||S){if(E=x?`
189
+ `))return u(e,a,o,s);if(i(d)){if(m===``)return a.forceBlockIndent=!0,u(e,a,o,s);if(p&&m===h)return c(d,a)}let _=d.replace(/\n+/g,`$&\n${m}`);if(f){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(_),{compat:t,tags:n}=a.doc.schema;if(n.some(e)||t?.some(e))return c(d,a)}return p?_:n.foldFlowLines(_,m,n.FOLD_FLOW,r(a,!1))}function f(e,n,r,i){let{implicitKey:a,inFlow:l}=n,f=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:p}=e;p!==t.Scalar.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(f.value)&&(p=t.Scalar.QUOTE_DOUBLE);let m=e=>{switch(e){case t.Scalar.BLOCK_FOLDED:case t.Scalar.BLOCK_LITERAL:return a||l?c(f.value,n):u(f,n,r,i);case t.Scalar.QUOTE_DOUBLE:return o(f.value,n);case t.Scalar.QUOTE_SINGLE:return s(f.value,n);case t.Scalar.PLAIN:return d(f,n,r,i);default:return null}},h=m(p);if(h===null){let{defaultKeyType:e,defaultStringType:t}=n.options,r=a&&e||t;if(h=m(r),h===null)throw Error(`Unsupported default string type ${r}`)}return h}e.stringifyString=f})),Bu=j((e=>{var t=Au(),n=J(),r=Lu(),i=zu();function a(e,t){let n=Object.assign({blockQuote:!0,commentString:r.stringifyComment,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,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),i;switch(n.collectionStyle){case`block`:i=!1;break;case`flow`:i=!0;break;default:i=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:i,options:n}}function o(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 r,i;if(n.isScalar(t)){i=t.value;let n=e.filter(e=>e.identify?.(i));if(n.length>1){let e=n.filter(e=>e.test);e.length>0&&(n=e)}r=n.find(e=>e.format===t.format)??n.find(e=>!e.format)}else i=t,r=e.find(e=>e.nodeClass&&i instanceof e.nodeClass);if(!r){let e=i?.constructor?.name??(i===null?`null`:typeof i);throw Error(`Tag not resolved for ${e} value`)}return r}function s(e,r,{anchors:i,doc:a}){if(!a.directives)return``;let o=[],s=(n.isScalar(e)||n.isCollection(e))&&e.anchor;s&&t.anchorIsValid(s)&&(i.add(s),o.push(`&${s}`));let c=e.tag??(r.default?null:r.tag);return c&&o.push(a.directives.tagString(c)),o.join(` `)}function c(e,t,r,a){if(n.isPair(e))return e.toString(t,r,a);if(n.isAlias(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 c,l=n.isNode(e)?e:t.doc.createNode(e,{onTagObj:e=>c=e});c??=o(t.doc.schema.tags,l);let u=s(l,c,t);u.length>0&&(t.indentAtStart=(t.indentAtStart??0)+u.length+1);let d=typeof c.stringify==`function`?c.stringify(l,t,r,a):n.isScalar(l)?i.stringifyString(l,t,r,a):l.toString(t,r,a);return u?n.isScalar(l)||d[0]===`{`||d[0]===`[`?`${u} ${d}`:`${u}\n${t.indent}${d}`:d}e.createStringifyContext=a,e.stringify=c})),Vu=j((e=>{var t=J(),n=Y(),r=Bu(),i=Lu();function a({key:e,value:a},o,s,c){let{allNullValues:l,doc:u,indent:d,indentStep:f,options:{commentString:p,indentSeq:m,simpleKeys:h}}=o,g=t.isNode(e)&&e.comment||null;if(h){if(g)throw Error(`With simple keys, key nodes cannot have comments`);if(t.isCollection(e)||!t.isNode(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let _=!h&&(!e||g&&a==null&&!o.inFlow||t.isCollection(e)||(t.isScalar(e)?e.type===n.Scalar.BLOCK_FOLDED||e.type===n.Scalar.BLOCK_LITERAL:typeof e==`object`));o=Object.assign({},o,{allNullValues:!1,implicitKey:!_&&(h||!l),indent:d+f});let v=!1,y=!1,b=r.stringify(e,o,()=>v=!0,()=>y=!0);if(!_&&!o.inFlow&&b.length>1024){if(h)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);_=!0}if(o.inFlow){if(l||a==null)return v&&s&&s(),b===``?`?`:_?`? ${b}`:b}else if(l&&!h||a==null&&_)return b=`? ${b}`,g&&!v?b+=i.lineComment(b,o.indent,p(g)):y&&c&&c(),b;v&&(g=null),_?(g&&(b+=i.lineComment(b,o.indent,p(g))),b=`? ${b}\n${d}:`):(b=`${b}:`,g&&(b+=i.lineComment(b,o.indent,p(g))));let x,S,C;t.isNode(a)?(x=!!a.spaceBefore,S=a.commentBefore,C=a.comment):(x=!1,S=null,C=null,a&&typeof a==`object`&&(a=u.createNode(a))),o.implicitKey=!1,!_&&!g&&t.isScalar(a)&&(o.indentAtStart=b.length+1),y=!1,!m&&f.length>=2&&!o.inFlow&&!_&&t.isSeq(a)&&!a.flow&&!a.tag&&!a.anchor&&(o.indent=o.indent.substring(2));let w=!1,T=r.stringify(a,o,()=>w=!0,()=>y=!0),E=` `;if(g||x||S){if(E=x?`
184
190
  `:``,S){let e=p(S);E+=`\n${i.indentComment(e,o.indent)}`}T===``&&!o.inFlow?E===`
185
191
  `&&C&&(E=`
186
192
 
187
193
  `):E+=`\n${o.indent}`}else if(!_&&t.isCollection(a)){let e=T[0],t=T.indexOf(`
188
194
  `),n=t!==-1,r=o.inFlow??a.flow??a.items.length===0;if(n||!r){let r=!1;if(n&&(e===`&`||e===`!`)){let n=T.indexOf(` `);e===`&`&&n!==-1&&n<t&&T[n+1]===`!`&&(n=T.indexOf(` `,n+1)),(n===-1||t<n)&&(r=!0)}r||(E=`\n${o.indent}`)}}else (T===``||T[0]===`
189
- `)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}e.stringifyPair=a})),yu=v((e=>{var t=S(`process`);function n(e,...t){e===`debug`&&console.log(...t)}function r(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}e.debug=n,e.warn=r})),bu=v((e=>{var t=J(),n=Y();let r={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(`<<`)),{addToJSMap:a}),stringify:()=>`<<`},i=(e,i)=>(r.identify(i)||t.isScalar(i)&&(!i.type||i.type===n.Scalar.PLAIN)&&r.identify(i.value))&&e?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default);function a(e,n,r){if(r=e&&t.isAlias(r)?r.resolve(e.doc):r,t.isSeq(r))for(let t of r.items)o(e,n,t);else if(Array.isArray(r))for(let t of r)o(e,n,t);else o(e,n,r)}function o(e,n,r){let i=e&&t.isAlias(r)?r.resolve(e.doc):r;if(!t.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,t]of a)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}e.addMergeToJSMap=a,e.isMergeKey=i,e.merge=r})),xu=v((e=>{var t=yu(),n=bu(),r=_u(),i=J(),a=lu();function o(e,t,{key:r,value:o}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,o);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=s(r,n,e),c=a.toJS(o,i,e);i in t?Object.defineProperty(t,i,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[i]=c}}return t}function s(e,n,a){if(n===null)return``;if(typeof n!=`object`)return String(n);if(i.isNode(e)&&a?.doc){let n=r.createStringifyContext(a.doc,{});n.anchors=new Set;for(let e of a.anchors.keys())n.anchors.add(e.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(n)}e.addPairToJSMap=o})),Su=v((e=>{var t=fu(),n=vu(),r=xu(),i=J();function a(e,n,r){return new o(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var o=class e{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return i.isNode(n)&&(n=n.clone(t)),i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=o,e.createPair=a})),Cu=v((e=>{var t=J(),n=_u(),r=mu();function i(e,t,n){return(t.inFlow??e.flow?o:a)(e,t,n)}function a({comment:e,items:i},a,{blockItemPrefix:o,flowChars:c,itemIndent:l,onChompKeep:u,onComment:d}){let{indent:f,options:{commentString:p}}=a,m=Object.assign({},a,{indent:l,type:null}),h=!1,g=[];for(let e=0;e<i.length;++e){let c=i[e],u=null;if(t.isNode(c))!h&&c.spaceBefore&&g.push(``),s(a,g,c.commentBefore,h),c.comment&&(u=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(!h&&e.spaceBefore&&g.push(``),s(a,g,e.commentBefore,h))}h=!1;let d=n.stringify(c,m,()=>u=null,()=>h=!0);u&&(d+=r.lineComment(d,l,p(u))),h&&u&&(h=!1),g.push(o+d)}let _;if(g.length===0)_=c.start+c.end;else{_=g[0];for(let e=1;e<g.length;++e){let t=g[e];_+=t?`\n${f}${t}`:`
195
+ `)&&(E=``);return b+=E+T,o.inFlow?w&&s&&s():C&&!w?b+=i.lineComment(b,o.indent,p(C)):y&&c&&c(),b}e.stringifyPair=a})),Hu=j((e=>{var t=M(`process`);function n(e,...t){e===`debug`&&console.log(...t)}function r(e,n){(e===`debug`||e===`warn`)&&(typeof t.emitWarning==`function`?t.emitWarning(n):console.warn(n))}e.debug=n,e.warn=r})),Uu=j((e=>{var t=J(),n=Y();let r={identify:e=>e===`<<`||typeof e==`symbol`&&e.description===`<<`,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new n.Scalar(Symbol(`<<`)),{addToJSMap:a}),stringify:()=>`<<`},i=(e,i)=>(r.identify(i)||t.isScalar(i)&&(!i.type||i.type===n.Scalar.PLAIN)&&r.identify(i.value))&&e?.doc.schema.tags.some(e=>e.tag===r.tag&&e.default);function a(e,n,r){if(r=e&&t.isAlias(r)?r.resolve(e.doc):r,t.isSeq(r))for(let t of r.items)o(e,n,t);else if(Array.isArray(r))for(let t of r)o(e,n,t);else o(e,n,r)}function o(e,n,r){let i=e&&t.isAlias(r)?r.resolve(e.doc):r;if(!t.isMap(i))throw Error(`Merge sources must be maps or map aliases`);let a=i.toJSON(null,e,Map);for(let[e,t]of a)n instanceof Map?n.has(e)||n.set(e,t):n instanceof Set?n.add(e):Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(n,e,{value:t,writable:!0,enumerable:!0,configurable:!0});return n}e.addMergeToJSMap=a,e.isMergeKey=i,e.merge=r})),Wu=j((e=>{var t=Hu(),n=Uu(),r=Bu(),i=J(),a=Mu();function o(e,t,{key:r,value:o}){if(i.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(n.isMergeKey(e,r))n.addMergeToJSMap(e,t,o);else{let n=a.toJS(r,``,e);if(t instanceof Map)t.set(n,a.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=s(r,n,e),c=a.toJS(o,i,e);i in t?Object.defineProperty(t,i,{value:c,writable:!0,enumerable:!0,configurable:!0}):t[i]=c}}return t}function s(e,n,a){if(n===null)return``;if(typeof n!=`object`)return String(n);if(i.isNode(e)&&a?.doc){let n=r.createStringifyContext(a.doc,{});n.anchors=new Set;for(let e of a.anchors.keys())n.anchors.add(e.anchor);n.inFlow=!0,n.inStringifyKey=!0;let i=e.toString(n);if(!a.mapKeyWarned){let e=JSON.stringify(i);e.length>40&&(e=e.substring(0,36)+`..."`),t.warn(a.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),a.mapKeyWarned=!0}return i}return JSON.stringify(n)}e.addPairToJSMap=o})),Gu=j((e=>{var t=Fu(),n=Vu(),r=Wu(),i=J();function a(e,n,r){return new o(t.createNode(e,void 0,r),t.createNode(n,void 0,r))}var o=class e{constructor(e,t=null){Object.defineProperty(this,i.NODE_TYPE,{value:i.PAIR}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return i.isNode(n)&&(n=n.clone(t)),i.isNode(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return r.addPairToJSMap(t,n,this)}toString(e,t,r){return e?.doc?n.stringifyPair(this,e,t,r):JSON.stringify(this)}};e.Pair=o,e.createPair=a})),Ku=j((e=>{var t=J(),n=Bu(),r=Lu();function i(e,t,n){return(t.inFlow??e.flow?o:a)(e,t,n)}function a({comment:e,items:i},a,{blockItemPrefix:o,flowChars:c,itemIndent:l,onChompKeep:u,onComment:d}){let{indent:f,options:{commentString:p}}=a,m=Object.assign({},a,{indent:l,type:null}),h=!1,g=[];for(let e=0;e<i.length;++e){let c=i[e],u=null;if(t.isNode(c))!h&&c.spaceBefore&&g.push(``),s(a,g,c.commentBefore,h),c.comment&&(u=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(!h&&e.spaceBefore&&g.push(``),s(a,g,e.commentBefore,h))}h=!1;let d=n.stringify(c,m,()=>u=null,()=>h=!0);u&&(d+=r.lineComment(d,l,p(u))),h&&u&&(h=!1),g.push(o+d)}let _;if(g.length===0)_=c.start+c.end;else{_=g[0];for(let e=1;e<g.length;++e){let t=g[e];_+=t?`\n${f}${t}`:`
190
196
  `}}return e?(_+=`
191
197
  `+r.indentComment(p(e),f),d&&d()):h&&u&&u(),_}function o({items:e},i,{flowChars:a,itemIndent:o}){let{indent:c,indentStep:l,flowCollectionPadding:u,options:{commentString:d}}=i;o+=l;let f=Object.assign({},i,{indent:o,inFlow:!0,type:null}),p=!1,m=0,h=[];for(let a=0;a<e.length;++a){let c=e[a],l=null;if(t.isNode(c))c.spaceBefore&&h.push(``),s(i,h,c.commentBefore,!1),c.comment&&(l=c.comment);else if(t.isPair(c)){let e=t.isNode(c.key)?c.key:null;e&&(e.spaceBefore&&h.push(``),s(i,h,e.commentBefore,!1),e.comment&&(p=!0));let n=t.isNode(c.value)?c.value:null;n?(n.comment&&(l=n.comment),n.commentBefore&&(p=!0)):c.value==null&&e?.comment&&(l=e.comment)}l&&(p=!0);let u=n.stringify(c,f,()=>l=null);a<e.length-1&&(u+=`,`),l&&(u+=r.lineComment(u,o,d(l))),!p&&(h.length>m||u.includes(`
192
198
  `))&&(p=!0),h.push(u),m=h.length}let{start:g,end:_}=a;if(h.length===0)return g+_;if(!p){let e=h.reduce((e,t)=>e+t.length+2,2);p=i.options.lineWidth>0&&e>i.options.lineWidth}if(p){let e=g;for(let t of h)e+=t?`\n${l}${c}${t}`:`
193
- `;return`${e}\n${c}${_}`}else return`${g}${u}${h.join(` `)}${u}${_}`}function s({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=i})),wu=v((e=>{var t=Cu(),n=xu(),r=pu(),i=J(),a=Su(),o=Y();function s(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),s=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)s(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))s(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=s(this.items,n.key),c=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(c){let e=this.items.findIndex(e=>c(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=s(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=s(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!s(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(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})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=s})),Tu=v((e=>{var t=J(),n=wu();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),Eu=v((e=>{var t=fu(),n=Cu(),r=pu(),i=J(),a=Y(),o=lu(),s=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=c(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=c(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=c(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=c(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];i.isScalar(r)&&a.isScalarValue(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(o.toJS(e,String(r++),t));return n}toString(e,t,r){return e?n.stringifyCollection(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,a=new this(e);if(n&&Symbol.iterator in Object(n)){let e=0;for(let o of n){if(typeof i==`function`){let t=n instanceof Set?o:String(e++);o=i.call(n,t,o)}a.items.push(t.createNode(o,void 0,r))}}return a}};function c(e){let t=i.isScalar(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}e.YAMLSeq=s})),Du=v((e=>{var t=J(),n=Eu();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),Ou=v((e=>{var t=gu();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),ku=v((e=>{var t=Y();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),Au=v((e=>{var t=Y();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),ju=v((e=>{function t({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)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}e.stringifyNumber=t})),Mu=v((e=>{var t=Y(),n=ju();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={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),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),Nu=v((e=>{var t=ju();let n=e=>typeof e==`bigint`||Number.isInteger(e),r=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function i(e,r,i){let{value:a}=e;return n(a)&&a>=0?i+a.toString(r):t.stringifyNumber(e)}e.int={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)},e.intOct={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>r(e,2,8,n),stringify:e=>i(e,8,`0o`)}})),Pu=v((e=>{var t=Tu(),n=ku(),r=Du(),i=Ou(),a=Au(),o=Mu(),s=Nu();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),Fu=v((e=>{var t=Y(),n=Tu(),r=Du();function i(e){return typeof e==`bigint`||Number.isInteger(e)}let a=({value:e})=>JSON.stringify(e),o=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:a},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:a},{identify:i,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>i(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}];e.schema=[n.map,r.seq].concat(o,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),Iu=v((e=>{var t=S(`buffer`),n=Y(),r=gu();e.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,n){if(typeof t.Buffer==`function`)return t.Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return n(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:i,value:a},o,s,c){if(!a)return``;let l=a,u;if(typeof t.Buffer==`function`)u=l instanceof t.Buffer?l.toString(`base64`):t.Buffer.from(l.buffer).toString(`base64`);else if(typeof btoa==`function`){let e=``;for(let t=0;t<l.length;++t)e+=String.fromCharCode(l[t]);u=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(i??=n.Scalar.BLOCK_LITERAL,i!==n.Scalar.QUOTE_DOUBLE){let e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),t=Math.ceil(u.length/e),r=Array(t);for(let n=0,i=0;n<t;++n,i+=e)r[n]=u.substr(i,e);u=r.join(i===n.Scalar.BLOCK_LITERAL?`
194
- `:` `)}return r.stringifyString({comment:e,type:i,value:u},o,s,c)}}})),Lu=v((e=>{var t=J(),n=Su(),r=Y(),i=Eu();function a(e,i){if(t.isSeq(e))for(let a=0;a<e.items.length;++a){let o=e.items[a];if(!t.isPair(o)){if(t.isMap(o)){o.items.length>1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function o(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e))if(e.length===2)i=e[0],c=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)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let s={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:a,createNode:o};e.createPairs=o,e.pairs=s,e.resolvePairs=a})),Ru=v((e=>{var t=J(),n=lu(),r=wu(),i=Eu(),a=Lu(),o=class e extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),zu=v((e=>{var t=Y();function n({value:e,source:t},n){return t&&(e?r:i).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let r={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 t.Scalar(!0),stringify:n},i={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 t.Scalar(!1),stringify:n};e.falseTag=i,e.trueTag=r})),Bu=v((e=>{var t=Y(),n=ju();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),Vu=v((e=>{var t=ju();let n=e=>typeof e==`bigint`||Number.isInteger(e);function r(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}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function i(e,r,i){let{value:a}=e;if(n(a)){let e=a.toString(r);return a<0?`-`+i+e.substr(1):i+e}return t.stringifyNumber(e)}let a={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>i(e,2,`0b`)},o={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>i(e,8,`0`)},s={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)};e.int=s,e.intBin=a,e.intHex=c,e.intOct=o})),Hu=v((e=>{var t=J(),n=Su(),r=wu(),i=class e extends r.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(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 super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),Uu=v((e=>{var t=ju();function n(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function r(e){let{value:n}=e,r=e=>e;if(typeof n==`bigint`)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let i=``;n<0&&(i=`-`,n*=r(-1));let a=r(60),o=[n%a];return n<60?o.unshift(0):(n=(n-o[0])/a,o.unshift(n%a),n>=60&&(n=(n-o[0])/a,o.unshift(n))),i+o.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let i={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:r},a={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:r},o={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(o.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,r,i,a,s,c,l]=t.map(Number),u=t[7]?Number((t[7]+`00`).substr(1,3)):0,d=Date.UTC(r,i-1,a,s||0,c||0,l||0,u),f=t[8];if(f&&f!==`Z`){let e=n(f,!1);Math.abs(e)<30&&(e*=60),d-=6e4*e}return new Date(d)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=a,e.intTime=i,e.timestamp=o})),Wu=v((e=>{var t=Tu(),n=ku(),r=Du(),i=Ou(),a=Iu(),o=zu(),s=Bu(),c=Vu(),l=bu(),u=Ru(),d=Lu(),f=Hu(),p=Uu();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),Gu=v((e=>{var t=Tu(),n=ku(),r=Du(),i=Ou(),a=Au(),o=Mu(),s=Nu(),c=Pu(),l=Fu(),u=Iu(),d=bu(),f=Ru(),p=Lu(),m=Wu(),h=Hu(),g=Uu();let _=new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,m.schema],[`yaml-1.1`,m.schema]]),v={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:g.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:g.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:h.set,timestamp:g.timestamp},y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":g.timestamp};function b(e,t,n){let r=_.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?v[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(v).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}e.coreKnownTags=y,e.getTags=b})),Ku=v((e=>{var t=J(),n=Tu(),r=Du(),i=Ou(),a=Gu();let o=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;e.Schema=class e{constructor({compat:e,customTags:s,merge:c,resolveKnownTags:l,schema:u,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof u==`string`&&u||`core`,this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(s,this.name,c),this.toStringOptions=f??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof d==`function`?d:d===!0?o:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}})),qu=v((e=>{var t=J(),n=_u(),r=mu();function i(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd)if(e.comment){let t=c(e.comment);t.includes(`
199
+ `;return`${e}\n${c}${_}`}else return`${g}${u}${h.join(` `)}${u}${_}`}function s({indent:e,options:{commentString:t}},n,i,a){if(i&&a&&(i=i.replace(/^\n+/,``)),i){let a=r.indentComment(t(i),e);n.push(a.trimStart())}}e.stringifyCollection=i})),qu=j((e=>{var t=Ku(),n=Wu(),r=Iu(),i=J(),a=Gu(),o=Y();function s(e,t){let n=i.isScalar(t)?t.value:t;for(let r of e)if(i.isPair(r)&&(r.key===t||r.key===n||i.isScalar(r.key)&&r.key.value===n))return r}e.YAMLMap=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(i.MAP,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,o=new this(e),s=(e,s)=>{if(typeof i==`function`)s=i.call(t,e,s);else if(Array.isArray(i)&&!i.includes(e))return;(s!==void 0||r)&&o.items.push(a.createPair(e,s,n))};if(t instanceof Map)for(let[e,n]of t)s(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))s(e,t[e]);return typeof e.sortMapEntries==`function`&&o.items.sort(e.sortMapEntries),o}add(e,t){let n;n=i.isPair(e)?e:!e||typeof e!=`object`||!(`key`in e)?new a.Pair(e,e?.value):new a.Pair(e.key,e.value);let r=s(this.items,n.key),c=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);i.isScalar(r.value)&&o.isScalarValue(n.value)?r.value.value=n.value:r.value=n.value}else if(c){let e=this.items.findIndex(e=>c(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=s(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=s(this.items,e)?.value;return(!t&&i.isScalar(n)?n.value:n)??void 0}has(e){return!!s(this.items,e)}set(e,t){this.add(new a.Pair(e,t),!0)}toJSON(e,t,r){let i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(let e of this.items)n.addPairToJSMap(t,i,e);return i}toString(e,n,r){if(!e)return JSON.stringify(this);for(let e of this.items)if(!i.isPair(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})),t.stringifyCollection(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:r,onComment:n})}},e.findPair=s})),Ju=j((e=>{var t=J(),n=qu();e.map={collection:`map`,default:!0,nodeClass:n.YAMLMap,tag:`tag:yaml.org,2002:map`,resolve(e,n){return t.isMap(e)||n(`Expected a mapping for this tag`),e},createNode:(e,t,r)=>n.YAMLMap.from(e,t,r)}})),Yu=j((e=>{var t=Fu(),n=Ku(),r=Iu(),i=J(),a=Y(),o=Mu(),s=class extends r.Collection{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(i.SEQ,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=c(e);return typeof t==`number`?this.items.splice(t,1).length>0:!1}get(e,t){let n=c(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&i.isScalar(r)?r.value:r}has(e){let t=c(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=c(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];i.isScalar(r)&&a.isScalarValue(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(o.toJS(e,String(r++),t));return n}toString(e,t,r){return e?n.stringifyCollection(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,n,r){let{replacer:i}=r,a=new this(e);if(n&&Symbol.iterator in Object(n)){let e=0;for(let o of n){if(typeof i==`function`){let t=n instanceof Set?o:String(e++);o=i.call(n,t,o)}a.items.push(t.createNode(o,void 0,r))}}return a}};function c(e){let t=i.isScalar(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}e.YAMLSeq=s})),Xu=j((e=>{var t=J(),n=Yu();e.seq={collection:`seq`,default:!0,nodeClass:n.YAMLSeq,tag:`tag:yaml.org,2002:seq`,resolve(e,n){return t.isSeq(e)||n(`Expected a sequence for this tag`),e},createNode:(e,t,r)=>n.YAMLSeq.from(e,t,r)}})),Zu=j((e=>{var t=zu();e.string={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,n,r,i){return n=Object.assign({actualString:!0},n),t.stringifyString(e,n,r,i)}}})),Qu=j((e=>{var t=Y();let n={identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new t.Scalar(null),stringify:({source:e},t)=>typeof e==`string`&&n.test.test(e)?e:t.options.nullStr};e.nullTag=n})),$u=j((e=>{var t=Y();let n={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new t.Scalar(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},r){return e&&n.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?r.options.trueStr:r.options.falseStr}};e.boolTag=n})),ed=j((e=>{function t({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)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-- >0;)a+=`0`}return a}e.stringifyNumber=t})),td=j((e=>{var t=Y(),n=ed();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let n=new t.Scalar(parseFloat(e)),r=e.indexOf(`.`);return r!==-1&&e[e.length-1]===`0`&&(n.minFractionDigits=e.length-r-1),n},stringify:n.stringifyNumber},e.floatExp={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),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),nd=j((e=>{var t=ed();let n=e=>typeof e==`bigint`||Number.isInteger(e),r=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function i(e,r,i){let{value:a}=e;return n(a)&&a>=0?i+a.toString(r):t.stringifyNumber(e)}e.int={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},e.intHex={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)},e.intOct={identify:e=>n(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>r(e,2,8,n),stringify:e=>i(e,8,`0o`)}})),rd=j((e=>{var t=Ju(),n=Qu(),r=Xu(),i=Zu(),a=$u(),o=td(),s=nd();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),id=j((e=>{var t=Y(),n=Ju(),r=Xu();function i(e){return typeof e==`bigint`||Number.isInteger(e)}let a=({value:e})=>JSON.stringify(e),o=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:a},{identify:e=>e==null,createNode:()=>new t.Scalar(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:a},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:a},{identify:i,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>i(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:a}];e.schema=[n.map,r.seq].concat(o,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}})})),ad=j((e=>{var t=M(`buffer`),n=Y(),r=zu();e.binary={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,n){if(typeof t.Buffer==`function`)return t.Buffer.from(e,`base64`);if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}else return n(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:i,value:a},o,s,c){if(!a)return``;let l=a,u;if(typeof t.Buffer==`function`)u=l instanceof t.Buffer?l.toString(`base64`):t.Buffer.from(l.buffer).toString(`base64`);else if(typeof btoa==`function`){let e=``;for(let t=0;t<l.length;++t)e+=String.fromCharCode(l[t]);u=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(i??=n.Scalar.BLOCK_LITERAL,i!==n.Scalar.QUOTE_DOUBLE){let e=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),t=Math.ceil(u.length/e),r=Array(t);for(let n=0,i=0;n<t;++n,i+=e)r[n]=u.substr(i,e);u=r.join(i===n.Scalar.BLOCK_LITERAL?`
200
+ `:` `)}return r.stringifyString({comment:e,type:i,value:u},o,s,c)}}})),od=j((e=>{var t=J(),n=Gu(),r=Y(),i=Yu();function a(e,i){if(t.isSeq(e))for(let a=0;a<e.items.length;++a){let o=e.items[a];if(!t.isPair(o)){if(t.isMap(o)){o.items.length>1&&i(`Each pair must have its own sequence indicator`);let e=o.items[0]||new n.Pair(new r.Scalar(null));if(o.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${o.commentBefore}\n${e.key.commentBefore}`:o.commentBefore),o.comment){let t=e.value??e.key;t.comment=t.comment?`${o.comment}\n${t.comment}`:o.comment}o=e}e.items[a]=t.isPair(o)?o:new n.Pair(o)}}else i(`Expected a sequence for this tag`);return e}function o(e,t,r){let{replacer:a}=r,o=new i.YAMLSeq(e);o.tag=`tag:yaml.org,2002:pairs`;let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof a==`function`&&(e=a.call(t,String(s++),e));let i,c;if(Array.isArray(e))if(e.length===2)i=e[0],c=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)i=t[0],c=e[i];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else i=e;o.items.push(n.createPair(i,c,r))}return o}let s={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:a,createNode:o};e.createPairs=o,e.pairs=s,e.resolvePairs=a})),sd=j((e=>{var t=J(),n=Mu(),r=qu(),i=Yu(),a=od(),o=class e extends i.YAMLSeq{constructor(){super(),this.add=r.YAMLMap.prototype.add.bind(this),this.delete=r.YAMLMap.prototype.delete.bind(this),this.get=r.YAMLMap.prototype.get.bind(this),this.has=r.YAMLMap.prototype.has.bind(this),this.set=r.YAMLMap.prototype.set.bind(this),this.tag=e.tag}toJSON(e,r){if(!r)return super.toJSON(e);let i=new Map;r?.onCreate&&r.onCreate(i);for(let e of this.items){let a,o;if(t.isPair(e)?(a=n.toJS(e.key,``,r),o=n.toJS(e.value,a,r)):a=n.toJS(e,``,r),i.has(a))throw Error(`Ordered maps must not include duplicate keys`);i.set(a,o)}return i}static from(e,t,n){let r=a.createPairs(e,t,n),i=new this;return i.items=r.items,i}};o.tag=`tag:yaml.org,2002:omap`;let s={collection:`seq`,identify:e=>e instanceof Map,nodeClass:o,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,n){let r=a.resolvePairs(e,n),i=[];for(let{key:e}of r.items)t.isScalar(e)&&(i.includes(e.value)?n(`Ordered maps must not include duplicate keys: ${e.value}`):i.push(e.value));return Object.assign(new o,r)},createNode:(e,t,n)=>o.from(e,t,n)};e.YAMLOMap=o,e.omap=s})),cd=j((e=>{var t=Y();function n({value:e,source:t},n){return t&&(e?r:i).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let r={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 t.Scalar(!0),stringify:n},i={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 t.Scalar(!1),stringify:n};e.falseTag=i,e.trueTag=r})),ld=j((e=>{var t=Y(),n=ed();let r={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:n.stringifyNumber};e.float={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let n=new t.Scalar(parseFloat(e.replace(/_/g,``))),r=e.indexOf(`.`);if(r!==-1){let t=e.substring(r+1).replace(/_/g,``);t[t.length-1]===`0`&&(n.minFractionDigits=t.length)}return n},stringify:n.stringifyNumber},e.floatExp={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():n.stringifyNumber(e)}},e.floatNaN=r})),ud=j((e=>{var t=ed();let n=e=>typeof e==`bigint`||Number.isInteger(e);function r(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}`;break}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function i(e,r,i){let{value:a}=e;if(n(a)){let e=a.toString(r);return a<0?`-`+i+e.substr(1):i+e}return t.stringifyNumber(e)}let a={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>r(e,2,2,n),stringify:e=>i(e,2,`0b`)},o={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>r(e,1,8,n),stringify:e=>i(e,8,`0`)},s={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>r(e,0,10,n),stringify:t.stringifyNumber},c={identify:n,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>r(e,2,16,n),stringify:e=>i(e,16,`0x`)};e.int=s,e.intBin=a,e.intHex=c,e.intOct=o})),dd=j((e=>{var t=J(),n=Gu(),r=qu(),i=class e extends r.YAMLMap{constructor(t){super(t),this.tag=e.tag}add(e){let i;i=t.isPair(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new n.Pair(e.key,null):new n.Pair(e,null),r.findPair(this.items,i.key)||this.items.push(i)}get(e,n){let i=r.findPair(this.items,e);return!n&&t.isPair(i)?t.isScalar(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let i=r.findPair(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new n.Pair(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 super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,r){let{replacer:i}=r,a=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof i==`function`&&(e=i.call(t,e,e)),a.items.push(n.createPair(e,null,r));return a}};i.tag=`tag:yaml.org,2002:set`;let a={collection:`map`,identify:e=>e instanceof Set,nodeClass:i,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>i.from(e,t,n),resolve(e,n){if(t.isMap(e)){if(e.hasAllNullValues(!0))return Object.assign(new i,e);n(`Set items must all have null values`)}else n(`Expected a mapping for this tag`);return e}};e.YAMLSet=i,e.set=a})),fd=j((e=>{var t=ed();function n(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function r(e){let{value:n}=e,r=e=>e;if(typeof n==`bigint`)r=e=>BigInt(e);else if(isNaN(n)||!isFinite(n))return t.stringifyNumber(e);let i=``;n<0&&(i=`-`,n*=r(-1));let a=r(60),o=[n%a];return n<60?o.unshift(0):(n=(n-o[0])/a,o.unshift(n%a),n>=60&&(n=(n-o[0])/a,o.unshift(n))),i+o.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}let i={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>n(e,r),stringify:r},a={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>n(e,!1),stringify:r},o={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(o.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,r,i,a,s,c,l]=t.map(Number),u=t[7]?Number((t[7]+`00`).substr(1,3)):0,d=Date.UTC(r,i-1,a,s||0,c||0,l||0,u),f=t[8];if(f&&f!==`Z`){let e=n(f,!1);Math.abs(e)<30&&(e*=60),d-=6e4*e}return new Date(d)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,``)??``};e.floatTime=a,e.intTime=i,e.timestamp=o})),pd=j((e=>{var t=Ju(),n=Qu(),r=Xu(),i=Zu(),a=ad(),o=cd(),s=ld(),c=ud(),l=Uu(),u=sd(),d=od(),f=dd(),p=fd();e.schema=[t.map,r.seq,i.string,n.nullTag,o.trueTag,o.falseTag,c.intBin,c.intOct,c.int,c.intHex,s.floatNaN,s.floatExp,s.float,a.binary,l.merge,u.omap,d.pairs,f.set,p.intTime,p.floatTime,p.timestamp]})),md=j((e=>{var t=Ju(),n=Qu(),r=Xu(),i=Zu(),a=$u(),o=td(),s=nd(),c=rd(),l=id(),u=ad(),d=Uu(),f=sd(),p=od(),m=pd(),h=dd(),g=fd();let _=new Map([[`core`,c.schema],[`failsafe`,[t.map,r.seq,i.string]],[`json`,l.schema],[`yaml11`,m.schema],[`yaml-1.1`,m.schema]]),v={binary:u.binary,bool:a.boolTag,float:o.float,floatExp:o.floatExp,floatNaN:o.floatNaN,floatTime:g.floatTime,int:s.int,intHex:s.intHex,intOct:s.intOct,intTime:g.intTime,map:t.map,merge:d.merge,null:n.nullTag,omap:f.omap,pairs:p.pairs,seq:r.seq,set:h.set,timestamp:g.timestamp},y={"tag:yaml.org,2002:binary":u.binary,"tag:yaml.org,2002:merge":d.merge,"tag:yaml.org,2002:omap":f.omap,"tag:yaml.org,2002:pairs":p.pairs,"tag:yaml.org,2002:set":h.set,"tag:yaml.org,2002:timestamp":g.timestamp};function b(e,t,n){let r=_.get(t);if(r&&!e)return n&&!r.includes(d.merge)?r.concat(d.merge):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(_.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(d.merge)),i.reduce((e,t)=>{let n=typeof t==`string`?v[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(v).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}e.coreKnownTags=y,e.getTags=b})),hd=j((e=>{var t=J(),n=Ju(),r=Xu(),i=Zu(),a=md();let o=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;e.Schema=class e{constructor({compat:e,customTags:s,merge:c,resolveKnownTags:l,schema:u,sortMapEntries:d,toStringDefaults:f}){this.compat=Array.isArray(e)?a.getTags(e,`compat`):e?a.getTags(null,e):null,this.name=typeof u==`string`&&u||`core`,this.knownTags=l?a.coreKnownTags:{},this.tags=a.getTags(s,this.name,c),this.toStringOptions=f??null,Object.defineProperty(this,t.MAP,{value:n.map}),Object.defineProperty(this,t.SCALAR,{value:i.string}),Object.defineProperty(this,t.SEQ,{value:r.seq}),this.sortMapEntries=typeof d==`function`?d:d===!0?o:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}}})),gd=j((e=>{var t=J(),n=Bu(),r=Lu();function i(e,i){let a=[],o=i.directives===!0;if(i.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(a.push(t),o=!0):e.directives.docStart&&(o=!0)}o&&a.push(`---`);let s=n.createStringifyContext(e,i),{commentString:c}=s.options;if(e.commentBefore){a.length!==1&&a.unshift(``);let t=c(e.commentBefore);a.unshift(r.indentComment(t,``))}let l=!1,u=null;if(e.contents){if(t.isNode(e.contents)){if(e.contents.spaceBefore&&o&&a.push(``),e.contents.commentBefore){let t=c(e.contents.commentBefore);a.push(r.indentComment(t,``))}s.forceBlockIndent=!!e.comment,u=e.contents.comment}let i=u?void 0:()=>l=!0,d=n.stringify(e.contents,s,()=>u=null,i);u&&(d+=r.lineComment(d,``,c(u))),(d[0]===`|`||d[0]===`>`)&&a[a.length-1]===`---`?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(n.stringify(e.contents,s));if(e.directives?.docEnd)if(e.comment){let t=c(e.comment);t.includes(`
195
201
  `)?(a.push(`...`),a.push(r.indentComment(t,``))):a.push(`... ${t}`)}else a.push(`...`);else{let t=e.comment;t&&l&&(t=t.replace(/^\n+/,``)),t&&((!l||u)&&a[a.length-1]!==``&&a.push(``),a.push(r.indentComment(c(t),``)))}return a.join(`
196
202
  `)+`
197
- `}e.stringifyDocument=i})),Ju=v((e=>{var t=du(),n=pu(),r=J(),i=Su(),a=lu(),o=Ku(),s=qu(),c=su(),l=cu(),u=fu(),d=ou(),f=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[r.NODE_TYPE]:{value:r.DOC}});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=r.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){p(this.contents)&&this.contents.add(e)}addIn(e,t){p(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=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)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:m,sourceObjects:h}=c.createNodeAnchors(this,o||`a`),g={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:h},_=u.createNode(e,f,g);return s&&r.isCollection(_)&&(_.flow=!0),m(),_}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return p(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):p(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):p(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):p(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 d.Directives({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 d.Directives({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 o.Schema(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:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}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 s.stringifyDocument(this,e)}};function p(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),Yu=v((e=>{var t=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},n=class extends t{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},r=class extends t{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=t,e.YAMLParseError=n,e.YAMLWarning=r,e.prettifyError=(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)+`…
198
- `),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`}}})),Xu=v((e=>{function t(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}}e.resolveProps=t})),Zu=v((e=>{function t(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
199
- `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let n of e.items){for(let e of n.start)if(e.type===`newline`)return!0;if(n.sep){for(let e of n.sep)if(e.type===`newline`)return!0}if(t(n.key)||t(n.value))return!0}return!1;default:return!0}}e.containsNewline=t})),Qu=v((e=>{var t=Zu();function n(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}e.flowIndentCheck=n})),$u=v((e=>{var t=J();function n(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(e,n)=>e===n||t.isScalar(e)&&t.isScalar(n)&&e.value===n.value;return n.some(e=>a(e.key,r))}e.mapIncludes=n})),ed=v((e=>{var t=Su(),n=wu(),r=Xu(),i=Zu(),a=Qu(),o=$u();let s=`All mapping items must start at the same column`;function c({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new(f?.nodeClass??n.YAMLMap)(l.schema);l.atRoot&&=!1;let m=u.offset,h=null;for(let n of u.items){let{start:f,key:g,sep:_,value:v}=n,y=r.resolveProps(f,{indicator:`explicit-key-ind`,next:g??_?.[0],offset:m,onError:d,parentIndent:u.indent,startOnNewline:!0}),b=!y.found;if(b){if(g&&(g.type===`block-seq`?d(m,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in g&&g.indent!==u.indent&&d(m,`BAD_INDENT`,s)),!y.anchor&&!y.tag&&!_){h=y.end,y.comment&&(p.comment?p.comment+=`
203
+ `}e.stringifyDocument=i})),_d=j((e=>{var t=Pu(),n=Iu(),r=J(),i=Gu(),a=Mu(),o=hd(),s=gd(),c=Au(),l=ju(),u=Fu(),d=ku(),f=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,r.NODE_TYPE,{value:r.DOC});let i=null;typeof t==`function`||Array.isArray(t)?i=t:n===void 0&&t&&(n=t,t=void 0);let a=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=a;let{version:o}=a;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new d.Directives({version:o}),this.setSchema(o,n),this.contents=e===void 0?null:this.createNode(e,i,n)}clone(){let t=Object.create(e.prototype,{[r.NODE_TYPE]:{value:r.DOC}});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=r.isNode(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){p(this.contents)&&this.contents.add(e)}addIn(e,t){p(this.contents)&&this.contents.addIn(e,t)}createAlias(e,n){if(!e.anchor){let t=c.anchorNames(this);e.anchor=!n||t.has(n)?c.findNewAnchor(n||`a`,t):n}return new t.Alias(e.anchor)}createNode(e,t,n){let i;if(typeof t==`function`)e=t.call({"":e},``,e),i=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)),i=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:a,anchorPrefix:o,flow:s,keepUndefined:l,onTagObj:d,tag:f}=n??{},{onAnchor:p,setAnchors:m,sourceObjects:h}=c.createNodeAnchors(this,o||`a`),g={aliasDuplicateObjects:a??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:d,replacer:i,schema:this.schema,sourceObjects:h},_=u.createNode(e,f,g);return s&&r.isCollection(_)&&(_.flow=!0),m(),_}createPair(e,t,n={}){let r=this.createNode(e,null,n),a=this.createNode(t,null,n);return new i.Pair(r,a)}delete(e){return p(this.contents)?this.contents.delete(e):!1}deleteIn(e){return n.isEmptyPath(e)?this.contents==null?!1:(this.contents=null,!0):p(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return r.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return n.isEmptyPath(e)?!t&&r.isScalar(this.contents)?this.contents.value:this.contents:r.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return r.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){return n.isEmptyPath(e)?this.contents!==void 0:r.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=n.collectionFromPath(this.schema,[e],t):p(this.contents)&&this.contents.set(e,t)}setIn(e,t){n.isEmptyPath(e)?this.contents=t:this.contents==null?this.contents=n.collectionFromPath(this.schema,Array.from(e),t):p(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 d.Directives({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 d.Directives({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 o.Schema(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:o}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},c=a.toJS(this.contents,t??``,s);if(typeof i==`function`)for(let{count:e,res:t}of s.anchors.values())i(t,e);return typeof o==`function`?l.applyReviver(o,{"":c},``,c):c}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 s.stringifyDocument(this,e)}};function p(e){if(r.isCollection(e))return!0;throw Error(`Expected a YAML collection as document contents`)}e.Document=f})),vd=j((e=>{var t=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},n=class extends t{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},r=class extends t{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}};e.YAMLError=t,e.YAMLParseError=n,e.YAMLWarning=r,e.prettifyError=(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)+`…
204
+ `),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`}}})),yd=j((e=>{function t(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}}e.resolveProps=t})),bd=j((e=>{function t(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
205
+ `))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let n of e.items){for(let e of n.start)if(e.type===`newline`)return!0;if(n.sep){for(let e of n.sep)if(e.type===`newline`)return!0}if(t(n.key)||t(n.value))return!0}return!1;default:return!0}}e.containsNewline=t})),xd=j((e=>{var t=bd();function n(e,n,r){if(n?.type===`flow-collection`){let i=n.end[0];i.indent===e&&(i.source===`]`||i.source===`}`)&&t.containsNewline(n)&&r(i,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}e.flowIndentCheck=n})),Sd=j((e=>{var t=J();function n(e,n,r){let{uniqueKeys:i}=e.options;if(i===!1)return!1;let a=typeof i==`function`?i:(e,n)=>e===n||t.isScalar(e)&&t.isScalar(n)&&e.value===n.value;return n.some(e=>a(e.key,r))}e.mapIncludes=n})),Cd=j((e=>{var t=Gu(),n=qu(),r=yd(),i=bd(),a=xd(),o=Sd();let s=`All mapping items must start at the same column`;function c({composeNode:e,composeEmptyNode:c},l,u,d,f){let p=new(f?.nodeClass??n.YAMLMap)(l.schema);l.atRoot&&=!1;let m=u.offset,h=null;for(let n of u.items){let{start:f,key:g,sep:_,value:v}=n,y=r.resolveProps(f,{indicator:`explicit-key-ind`,next:g??_?.[0],offset:m,onError:d,parentIndent:u.indent,startOnNewline:!0}),b=!y.found;if(b){if(g&&(g.type===`block-seq`?d(m,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in g&&g.indent!==u.indent&&d(m,`BAD_INDENT`,s)),!y.anchor&&!y.tag&&!_){h=y.end,y.comment&&(p.comment?p.comment+=`
200
206
  `+y.comment:p.comment=y.comment);continue}(y.newlineAfterProp||i.containsNewline(g))&&d(g??f[f.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else y.found?.indent!==u.indent&&d(m,`BAD_INDENT`,s);l.atKey=!0;let x=y.end,S=g?e(l,g,y,d):c(l,x,f,null,y,d);l.schema.compat&&a.flowIndentCheck(u.indent,g,d),l.atKey=!1,o.mapIncludes(l,p.items,S)&&d(x,`DUPLICATE_KEY`,`Map keys must be unique`);let C=r.resolveProps(_??[],{indicator:`map-value-ind`,next:v,offset:S.range[2],onError:d,parentIndent:u.indent,startOnNewline:!g||g.type===`block-scalar`});if(m=C.end,C.found){b&&(v?.type===`block-map`&&!C.hasNewline&&d(m,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),l.options.strict&&y.start<C.found.offset-1024&&d(S.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let r=v?e(l,v,C,d):c(l,m,_,null,C,d);l.schema.compat&&a.flowIndentCheck(u.indent,v,d),m=r.range[2];let i=new t.Pair(S,r);l.options.keepSourceTokens&&(i.srcToken=n),p.items.push(i)}else{b&&d(S.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),C.comment&&(S.comment?S.comment+=`
201
- `+C.comment:S.comment=C.comment);let e=new t.Pair(S);l.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return h&&h<m&&d(h,`IMPOSSIBLE`,`Map comment with trailing content`),p.range=[u.offset,m,h??m],p}e.resolveBlockMap=c})),td=v((e=>{var t=Eu(),n=Xu(),r=Qu();function i({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new(c?.nodeClass??t.YAMLSeq)(a.schema);a.atRoot&&=!1,a.atKey&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,parentIndent:o.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||c)c?.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}e.resolveBlockSeq=i})),nd=v((e=>{function t(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}}e.resolveEnd=t})),rd=v((e=>{var t=J(),n=Su(),r=wu(),i=Eu(),a=nd(),o=Xu(),s=Zu(),c=$u();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function d({composeNode:e,composeEmptyNode:d},f,p,m,h){let g=p.start.source===`{`,_=g?`flow map`:`flow sequence`,v=new(h?.nodeClass??(g?r.YAMLMap:i.YAMLSeq))(f.schema);v.flow=!0;let y=f.atRoot;y&&(f.atRoot=!1),f.atKey&&=!1;let b=p.offset+p.start.source.length;for(let i=0;i<p.items.length;++i){let a=p.items[i],{start:h,key:y,sep:x,value:S}=a,C=o.resolveProps(h,{flow:_,indicator:`explicit-key-ind`,next:y??x?.[0],offset:b,onError:m,parentIndent:p.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!S){i===0&&C.comma?m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`):i<p.items.length-1&&m(C.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${_}`),C.comment&&(v.comment?v.comment+=`
207
+ `+C.comment:S.comment=C.comment);let e=new t.Pair(S);l.options.keepSourceTokens&&(e.srcToken=n),p.items.push(e)}}return h&&h<m&&d(h,`IMPOSSIBLE`,`Map comment with trailing content`),p.range=[u.offset,m,h??m],p}e.resolveBlockMap=c})),wd=j((e=>{var t=Yu(),n=yd(),r=xd();function i({composeNode:e,composeEmptyNode:i},a,o,s,c){let l=new(c?.nodeClass??t.YAMLSeq)(a.schema);a.atRoot&&=!1,a.atKey&&=!1;let u=o.offset,d=null;for(let{start:t,value:c}of o.items){let f=n.resolveProps(t,{indicator:`seq-item-ind`,next:c,offset:u,onError:s,parentIndent:o.indent,startOnNewline:!0});if(!f.found)if(f.anchor||f.tag||c)c?.type===`block-seq`?s(f.end,`BAD_INDENT`,`All sequence items must start at the same column`):s(u,`MISSING_CHAR`,`Sequence item without - indicator`);else{d=f.end,f.comment&&(l.comment=f.comment);continue}let p=c?e(a,c,f,s):i(a,f.end,t,null,f,s);a.schema.compat&&r.flowIndentCheck(o.indent,c,s),u=p.range[2],l.items.push(p)}return l.range=[o.offset,u,d??u],l}e.resolveBlockSeq=i})),Td=j((e=>{function t(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}}e.resolveEnd=t})),Ed=j((e=>{var t=J(),n=Gu(),r=qu(),i=Yu(),a=Td(),o=yd(),s=bd(),c=Sd();let l=`Block collections are not allowed within flow collections`,u=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function d({composeNode:e,composeEmptyNode:d},f,p,m,h){let g=p.start.source===`{`,_=g?`flow map`:`flow sequence`,v=new(h?.nodeClass??(g?r.YAMLMap:i.YAMLSeq))(f.schema);v.flow=!0;let y=f.atRoot;y&&(f.atRoot=!1),f.atKey&&=!1;let b=p.offset+p.start.source.length;for(let i=0;i<p.items.length;++i){let a=p.items[i],{start:h,key:y,sep:x,value:S}=a,C=o.resolveProps(h,{flow:_,indicator:`explicit-key-ind`,next:y??x?.[0],offset:b,onError:m,parentIndent:p.indent,startOnNewline:!1});if(!C.found){if(!C.anchor&&!C.tag&&!x&&!S){i===0&&C.comma?m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`):i<p.items.length-1&&m(C.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${_}`),C.comment&&(v.comment?v.comment+=`
202
208
  `+C.comment:v.comment=C.comment),b=C.end;continue}!g&&f.options.strict&&s.containsNewline(y)&&m(y,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(i===0)C.comma&&m(C.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${_}`);else if(C.comma||m(C.start,`MISSING_CHAR`,`Missing , between ${_} items`),C.comment){let e=``;loop:for(let t of h)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let n=v.items[v.items.length-1];t.isPair(n)&&(n=n.value??n.key),n.comment?n.comment+=`
203
209
  `+e:n.comment=e,C.comment=C.comment.substring(e.length+1)}}if(!g&&!x&&!C.found){let t=S?e(f,S,C,m):d(f,C.end,x,null,C,m);v.items.push(t),b=t.range[2],u(S)&&m(t.range,`BLOCK_IN_FLOW`,l)}else{f.atKey=!0;let t=C.end,i=y?e(f,y,C,m):d(f,t,h,null,C,m);u(y)&&m(i.range,`BLOCK_IN_FLOW`,l),f.atKey=!1;let s=o.resolveProps(x??[],{flow:_,indicator:`map-value-ind`,next:S,offset:i.range[2],onError:m,parentIndent:p.indent,startOnNewline:!1});if(s.found){if(!g&&!C.found&&f.options.strict){if(x)for(let e of x){if(e===s.found)break;if(e.type===`newline`){m(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}C.start<s.found.offset-1024&&m(s.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else S&&(`source`in S&&S.source?.[0]===`:`?m(S,`MISSING_CHAR`,`Missing space after : in ${_}`):m(s.start,`MISSING_CHAR`,`Missing , or : between ${_} items`));let w=S?e(f,S,s,m):s.found?d(f,s.end,x,null,s,m):null;w?u(S)&&m(w.range,`BLOCK_IN_FLOW`,l):s.comment&&(i.comment?i.comment+=`
204
210
  `+s.comment:i.comment=s.comment);let T=new n.Pair(i,w);if(f.options.keepSourceTokens&&(T.srcToken=a),g){let e=v;c.mapIncludes(f,e.items,i)&&m(t,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(T)}else{let e=new r.YAMLMap(f.schema);e.flow=!0,e.items.push(T);let t=(w??i).range;e.range=[i.range[0],t[1],t[2]],v.items.push(e)}b=w?w.range[2]:s.end}}let x=g?`}`:`]`,[S,...C]=p.end,w=b;if(S?.source===x)w=S.offset+S.source.length;else{let e=_[0].toUpperCase()+_.substring(1),t=y?`${e} must end with a ${x}`:`${e} in block collection must be sufficiently indented and end with a ${x}`;m(b,y?`MISSING_CHAR`:`BAD_INDENT`,t),S&&S.source.length!==1&&C.unshift(S)}if(C.length>0){let e=a.resolveEnd(C,w,f.options.strict,m);e.comment&&(v.comment?v.comment+=`
205
- `+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}e.resolveFlowCollection=d})),id=v((e=>{var t=J(),n=Y(),r=wu(),i=Eu(),a=ed(),o=td(),s=rd();function c(e,t,n,r,i,c){let l=n.type===`block-map`?a.resolveBlockMap(e,t,n,r,c):n.type===`block-seq`?o.resolveBlockSeq(e,t,n,r,c):s.resolveFlowCollection(e,t,n,r,c),u=l.constructor;return i===`!`||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function l(e,a,o,s,l){let u=s.tag,d=u?a.directives.tagName(u.source,e=>l(u,`TAG_RESOLVE_FAILED`,e)):null;if(o.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=s,n=e&&u?e.offset>u.offset?e:u:e??u;n&&(!t||t.offset<n.offset)&&l(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let f=o.type===`block-map`?`map`:o.type===`block-seq`?`seq`:o.start.source===`{`?`map`:`seq`;if(!u||!d||d===`!`||d===r.YAMLMap.tagName&&f===`map`||d===i.YAMLSeq.tagName&&f===`seq`)return c(e,a,o,l,d);let p=a.schema.tags.find(e=>e.tag===d&&e.collection===f);if(!p){let t=a.schema.knownTags[d];if(t?.collection===f)a.schema.tags.push(Object.assign({},t,{default:!1})),p=t;else return t?l(u,`BAD_COLLECTION_TYPE`,`${t.tag} used for ${f} collection, but expects ${t.collection??`scalar`}`,!0):l(u,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${d}`,!0),c(e,a,o,l,d)}let m=c(e,a,o,l,d,p),h=p.resolve?.(m,e=>l(u,`TAG_RESOLVE_FAILED`,e),a.options)??m,g=t.isNode(h)?h:new n.Scalar(h);return g.range=m.range,g.tag=d,p?.format&&(g.format=p.format),g}e.composeCollection=l})),ad=v((e=>{var t=Y();function n(e,n,a){let o=n.offset,s=r(n,e.options.strict,a);if(!s)return{value:``,type:null,comment:``,range:[o,o,o]};let c=s.mode===`>`?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,l=n.source?i(n.source):[],u=l.length;for(let e=l.length-1;e>=0;--e){let t=l[e][1];if(t===``||t===`\r`)u=e;else break}if(u===0){let e=s.chomp===`+`&&l.length>0?`
211
+ `+e.comment:v.comment=e.comment),v.range=[p.offset,w,e.offset]}else v.range=[p.offset,w,w];return v}e.resolveFlowCollection=d})),Dd=j((e=>{var t=J(),n=Y(),r=qu(),i=Yu(),a=Cd(),o=wd(),s=Ed();function c(e,t,n,r,i,c){let l=n.type===`block-map`?a.resolveBlockMap(e,t,n,r,c):n.type===`block-seq`?o.resolveBlockSeq(e,t,n,r,c):s.resolveFlowCollection(e,t,n,r,c),u=l.constructor;return i===`!`||i===u.tagName?(l.tag=u.tagName,l):(i&&(l.tag=i),l)}function l(e,a,o,s,l){let u=s.tag,d=u?a.directives.tagName(u.source,e=>l(u,`TAG_RESOLVE_FAILED`,e)):null;if(o.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=s,n=e&&u?e.offset>u.offset?e:u:e??u;n&&(!t||t.offset<n.offset)&&l(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let f=o.type===`block-map`?`map`:o.type===`block-seq`?`seq`:o.start.source===`{`?`map`:`seq`;if(!u||!d||d===`!`||d===r.YAMLMap.tagName&&f===`map`||d===i.YAMLSeq.tagName&&f===`seq`)return c(e,a,o,l,d);let p=a.schema.tags.find(e=>e.tag===d&&e.collection===f);if(!p){let t=a.schema.knownTags[d];if(t?.collection===f)a.schema.tags.push(Object.assign({},t,{default:!1})),p=t;else return t?l(u,`BAD_COLLECTION_TYPE`,`${t.tag} used for ${f} collection, but expects ${t.collection??`scalar`}`,!0):l(u,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${d}`,!0),c(e,a,o,l,d)}let m=c(e,a,o,l,d,p),h=p.resolve?.(m,e=>l(u,`TAG_RESOLVE_FAILED`,e),a.options)??m,g=t.isNode(h)?h:new n.Scalar(h);return g.range=m.range,g.tag=d,p?.format&&(g.format=p.format),g}e.composeCollection=l})),Od=j((e=>{var t=Y();function n(e,n,a){let o=n.offset,s=r(n,e.options.strict,a);if(!s)return{value:``,type:null,comment:``,range:[o,o,o]};let c=s.mode===`>`?t.Scalar.BLOCK_FOLDED:t.Scalar.BLOCK_LITERAL,l=n.source?i(n.source):[],u=l.length;for(let e=l.length-1;e>=0;--e){let t=l[e][1];if(t===``||t===`\r`)u=e;else break}if(u===0){let e=s.chomp===`+`&&l.length>0?`
206
212
  `.repeat(Math.max(1,l.length-1)):``,t=o+s.length;return n.source&&(t+=n.source.length),{value:e,type:c,comment:s.comment,range:[o,t,t]}}let d=n.indent+s.indent,f=n.offset+s.length,p=0;for(let t=0;t<u;++t){let[n,r]=l[t];if(r===``||r===`\r`)s.indent===0&&n.length>d&&(d=n.length);else{n.length<d&&a(f+n.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),s.indent===0&&(d=n.length),p=t,d===0&&!e.atRoot&&a(f,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}f+=n.length+r.length+1}for(let e=l.length-1;e>=u;--e)l[e][0].length>d&&(u=e+1);let m=``,h=``,g=!1;for(let e=0;e<p;++e)m+=l[e][0].slice(d)+`
207
213
  `;for(let e=p;e<u;++e){let[n,r]=l[e];f+=n.length+r.length+1;let i=r[r.length-1]===`\r`;if(i&&(r=r.slice(0,-1)),r&&n.length<d){let e=`Block scalar lines must not be less indented than their ${s.indent?`explicit indentation indicator`:`first line`}`;a(f-r.length-(i?2:1),`BAD_INDENT`,e),n=``}c===t.Scalar.BLOCK_LITERAL?(m+=h+n.slice(d)+r,h=`
208
214
  `):n.length>d||r[0]===` `?(h===` `?h=`
@@ -217,7 +223,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
217
223
  `+l[e][0].slice(d);m[m.length-1]!==`
218
224
  `&&(m+=`
219
225
  `);break;default:m+=`
220
- `}let _=o+s.length+n.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}function r({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 i(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}e.resolveBlockScalar=n})),od=v((e=>{var t=Y(),n=nd();function r(e,r,o){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>o(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=i(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=a(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=s(u,m);break;default:return o(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${l}`),{value:``,type:null,comment:``,range:[c,c+u.length,c+u.length]}}let h=c+u.length,g=n.resolveEnd(d,h,r,o);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}function i(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]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),o(e)}function a(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),o(e.slice(1,-1)).replace(/''/g,`'`)}function o(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
226
+ `}let _=o+s.length+n.source.length;return{value:m,type:c,comment:s.comment,range:[o,_,_]}}function r({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 i(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}e.resolveBlockScalar=n})),kd=j((e=>{var t=Y(),n=Td();function r(e,r,o){let{offset:c,type:l,source:u,end:d}=e,f,p,m=(e,t,n)=>o(c+e,t,n);switch(l){case`scalar`:f=t.Scalar.PLAIN,p=i(u,m);break;case`single-quoted-scalar`:f=t.Scalar.QUOTE_SINGLE,p=a(u,m);break;case`double-quoted-scalar`:f=t.Scalar.QUOTE_DOUBLE,p=s(u,m);break;default:return o(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${l}`),{value:``,type:null,comment:``,range:[c,c+u.length,c+u.length]}}let h=c+u.length,g=n.resolveEnd(d,h,r,o);return{value:p,type:f,comment:g.comment,range:[c,h,g.offset]}}function i(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]}`;break}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),o(e)}function a(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),o(e.slice(1,-1)).replace(/''/g,`'`)}function o(e){let t,n;try{t=RegExp(`(.*?)(?<![ ])[ ]*\r?
221
227
  `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
222
228
  `,`sy`)}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let i=r[1],a=` `,o=t.lastIndex;for(n.lastIndex=o;r=n.exec(e);)r[1]===``?a===`
223
229
  `?i+=a:a=`
@@ -232,10 +238,10 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
232
238
  `);)r===`
233
239
  `&&(n+=`
234
240
  `),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}let l={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
235
- `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function u(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}e.resolveFlowScalar=r})),sd=v((e=>{var t=J(),n=Y(),r=ad(),i=od();function a(e,a,c,l){let{value:u,type:d,comment:f,range:p}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,l):i.resolveFlowScalar(a,e.options.strict,l),m=c?e.directives.tagName(c.source,e=>l(c,`TAG_RESOLVE_FAILED`,e)):null,h;h=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:m?o(e.schema,u,m,c,l):a.type===`scalar`?s(e,u,a,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??a,`TAG_RESOLVE_FAILED`,e),e.options);g=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);l(c??a,`TAG_RESOLVE_FAILED`,t),g=new n.Scalar(u)}return g.range=p,g.source=u,d&&(g.type=d),m&&(g.tag=m),h.format&&(g.format=h.format),f&&(g.comment=f),g}function o(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(t.default&&t.test)o.push(t);else return t;for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function s({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=a})),cd=v((e=>{function t(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}e.emptyScalarPosition=t})),ld=v((e=>{var t=du(),n=J(),r=id(),i=sd(),a=nd(),o=cd();let s={composeNode:c,composeEmptyNode:l};function c(e,t,a,o){let c=e.atKey,{spaceBefore:d,comment:f,anchor:p,tag:m}=a,h,g=!0;switch(t.type){case`alias`:h=u(e,t,o),(p||m)&&o(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`:h=i.composeScalar(e,t,m,o),p&&(h.anchor=p.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1));break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),h=l(e,t.offset,void 0,null,a,o),g=!1}return p&&h.anchor===``&&o(p,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(h)||typeof h.value!=`string`||h.tag&&h.tag!==`tag:yaml.org,2002:str`)&&o(m??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),d&&(h.spaceBefore=!0),f&&(t.type===`scalar`&&t.source===``?h.comment=f:h.commentBefore=f),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function l(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function u({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=l,e.composeNode=c})),ud=v((e=>{var t=Ju(),n=ld(),r=nd(),i=Xu();function a(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!m.hasNewline&&u(m.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,m,u):n.composeEmptyNode(p,m.end,s,null,m,u);let h=f.contents.range[2],g=r.resolveEnd(l,h,!1,u);return g.comment&&(f.comment=g.comment),f.range=[o,h,g.offset],f}e.composeDoc=a})),dd=v((e=>{var t=S(`process`),n=ou(),r=Ju(),i=Yu(),a=J(),o=ud(),s=nd();function c(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 l(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?`
241
+ `,r:`\r`,t:` `,v:`\v`,N:`…`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function u(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(a)){let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}return String.fromCodePoint(a)}e.resolveFlowScalar=r})),Ad=j((e=>{var t=J(),n=Y(),r=Od(),i=kd();function a(e,a,c,l){let{value:u,type:d,comment:f,range:p}=a.type===`block-scalar`?r.resolveBlockScalar(e,a,l):i.resolveFlowScalar(a,e.options.strict,l),m=c?e.directives.tagName(c.source,e=>l(c,`TAG_RESOLVE_FAILED`,e)):null,h;h=e.options.stringKeys&&e.atKey?e.schema[t.SCALAR]:m?o(e.schema,u,m,c,l):a.type===`scalar`?s(e,u,a,l):e.schema[t.SCALAR];let g;try{let r=h.resolve(u,e=>l(c??a,`TAG_RESOLVE_FAILED`,e),e.options);g=t.isScalar(r)?r:new n.Scalar(r)}catch(e){let t=e instanceof Error?e.message:String(e);l(c??a,`TAG_RESOLVE_FAILED`,t),g=new n.Scalar(u)}return g.range=p,g.source=u,d&&(g.type=d),m&&(g.tag=m),h.format&&(g.format=h.format),f&&(g.comment=f),g}function o(e,n,r,i,a){if(r===`!`)return e[t.SCALAR];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===r)if(t.default&&t.test)o.push(t);else return t;for(let e of o)if(e.test?.test(n))return e;let s=e.knownTags[r];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(a(i,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${r}`,r!==`tag:yaml.org,2002:str`),e[t.SCALAR])}function s({atKey:e,directives:n,schema:r},i,a,o){let s=r.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(i))||r[t.SCALAR];if(r.compat){let e=r.compat.find(e=>e.default&&e.test?.test(i))??r[t.SCALAR];s.tag!==e.tag&&o(a,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${n.tagString(s.tag)} or ${n.tagString(e.tag)}`,!0)}return s}e.composeScalar=a})),jd=j((e=>{function t(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}e.emptyScalarPosition=t})),Md=j((e=>{var t=Pu(),n=J(),r=Dd(),i=Ad(),a=Td(),o=jd();let s={composeNode:c,composeEmptyNode:l};function c(e,t,a,o){let c=e.atKey,{spaceBefore:d,comment:f,anchor:p,tag:m}=a,h,g=!0;switch(t.type){case`alias`:h=u(e,t,o),(p||m)&&o(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`:h=i.composeScalar(e,t,m,o),p&&(h.anchor=p.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1));break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),h=l(e,t.offset,void 0,null,a,o),g=!1}return p&&h.anchor===``&&o(p,`BAD_ALIAS`,`Anchor cannot be an empty string`),c&&e.options.stringKeys&&(!n.isScalar(h)||typeof h.value!=`string`||h.tag&&h.tag!==`tag:yaml.org,2002:str`)&&o(m??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),d&&(h.spaceBefore=!0),f&&(t.type===`scalar`&&t.source===``?h.comment=f:h.commentBefore=f),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function l(e,t,n,r,{spaceBefore:a,comment:s,anchor:c,tag:l,end:u},d){let f={type:`scalar`,offset:o.emptyScalarPosition(t,n,r),indent:-1,source:``},p=i.composeScalar(e,f,l,d);return c&&(p.anchor=c.source.substring(1),p.anchor===``&&d(c,`BAD_ALIAS`,`Anchor cannot be an empty string`)),a&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=u),p}function u({options:e},{offset:n,source:r,end:i},o){let s=new t.Alias(r.substring(1));s.source===``&&o(n,`BAD_ALIAS`,`Alias cannot be an empty string`),s.source.endsWith(`:`)&&o(n+r.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let c=n+r.length,l=a.resolveEnd(i,c,e.strict,o);return s.range=[n,c,l.offset],l.comment&&(s.comment=l.comment),s}e.composeEmptyNode=l,e.composeNode=c})),Nd=j((e=>{var t=_d(),n=Md(),r=Td(),i=yd();function a(e,a,{offset:o,start:s,value:c,end:l},u){let d=Object.assign({_directives:a},e),f=new t.Document(void 0,d),p={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},m=i.resolveProps(s,{indicator:`doc-start`,next:c??l?.[0],offset:o,onError:u,parentIndent:0,startOnNewline:!0});m.found&&(f.directives.docStart=!0,c&&(c.type===`block-map`||c.type===`block-seq`)&&!m.hasNewline&&u(m.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),f.contents=c?n.composeNode(p,c,m,u):n.composeEmptyNode(p,m.end,s,null,m,u);let h=f.contents.range[2],g=r.resolveEnd(l,h,!1,u);return g.comment&&(f.comment=g.comment),f.range=[o,h,g.offset],f}e.composeDoc=a})),Pd=j((e=>{var t=M(`process`),n=ku(),r=_d(),i=vd(),a=J(),o=Nd(),s=Td();function c(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 l(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?`
236
242
 
237
243
  `:`
238
- `)+(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}}e.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let a=c(e);r?this.warnings.push(new i.YAMLWarning(a,t,n)):this.errors.push(new i.YAMLParseError(a,t,n))},this.directives=new n.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=l(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(a.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];a.isPair(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}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:l(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(t.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=c(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=o.composeDoc(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 i.YAMLParseError(c(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 i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=s.resolveEnd(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 i.YAMLParseError(c(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=Object.assign({_directives:this.directives},this.options),n=new r.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),fd=v((e=>{var t=ad(),n=od(),r=Yu(),i=gu();function a(e,i=!0,a){if(e){let o=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,o);case`block-scalar`:return t.resolveBlockScalar({options:{strict:i}},e,o)}}return null}function o(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:`newline`,offset:-1,indent:r,source:`
244
+ `)+(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}}e.Composer=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let a=c(e);r?this.warnings.push(new i.YAMLWarning(a,t,n)):this.errors.push(new i.YAMLParseError(a,t,n))},this.directives=new n.Directives({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=l(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(a.isCollection(i)&&!i.flow&&i.items.length>0){let e=i.items[0];a.isPair(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}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:l(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(t.env.LOG_STREAM&&console.dir(e,{depth:null}),e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=c(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=o.composeDoc(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 i.YAMLParseError(c(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 i.YAMLParseError(c(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=s.resolveEnd(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 i.YAMLParseError(c(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=Object.assign({_directives:this.directives},this.options),n=new r.Document(void 0,e);this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),n.range=[0,t,t],this.decorate(n,!1),yield n}}}})),Fd=j((e=>{var t=Od(),n=kd(),r=vd(),i=zu();function a(e,i=!0,a){if(e){let o=(e,t,n)=>{let i=typeof e==`number`?e:Array.isArray(e)?e[0]:e.offset;if(a)a(i,t,n);else throw new r.YAMLParseError([i,i+1],t,n)};switch(e.type){case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return n.resolveFlowScalar(e,i,o);case`block-scalar`:return t.resolveBlockScalar({options:{strict:i}},e,o)}}return null}function o(e,t){let{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:s=`PLAIN`}=t,c=i.stringifyString({type:s,value:e},{implicitKey:n,indent:r>0?` `.repeat(r):``,inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),u=t.end??[{type:`newline`,offset:-1,indent:r,source:`
239
245
  `}];switch(c[0]){case`|`:case`>`:{let e=c.indexOf(`
240
246
  `),t=c.substring(0,e),n=c.substring(e+1)+`
241
247
  `,i=[{type:`block-scalar-header`,offset:o,indent:r,source:t}];return l(i,u)||i.push({type:`newline`,offset:-1,indent:r,source:`
@@ -243,9 +249,9 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
243
249
  `),r=t.substring(0,n),i=t.substring(n+1)+`
244
250
  `;if(e.type===`block-scalar`){let t=e.props[0];if(t.type!==`block-scalar-header`)throw Error(`Invalid block scalar header`);t.source=r,e.source=i}else{let{offset:t}=e,n=`indent`in e?e.indent:-1,a=[{type:`block-scalar-header`,offset:t,indent:n,source:r}];l(a,`end`in e?e.end:void 0)||a.push({type:`newline`,offset:-1,indent:n,source:`
245
251
  `});for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:`block-scalar`,indent:n,props:a,source:i})}}function l(e,t){if(t)for(let n of t)switch(n.type){case`space`:case`comment`:e.push(n);break;case`newline`:return e.push(n),!0}return!1}function u(e,t,n){switch(e.type){case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:e.type=n,e.source=t;break;case`block-scalar`:{let r=e.props.slice(1),i=t.length;e.props[0].type===`block-scalar-header`&&(i-=e.props[0].source.length);for(let e of r)e.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case`block-map`:case`block-seq`:{let r={type:`newline`,offset:e.offset+t.length,indent:e.indent,source:`
246
- `};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=o,e.resolveAsScalar=a,e.setScalarValue=s})),pd=v((e=>{let t=e=>`type`in e?n(e):r(e);function n(e){switch(e.type){case`block-scalar`:{let t=``;for(let r of e.props)t+=n(r);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=r(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=r(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=r(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function r({start:e,key:t,sep:r,value:i}){let a=``;for(let t of e)a+=t.source;if(t&&(a+=n(t)),r)for(let e of r)a+=e.source;return i&&(a+=n(i)),a}e.stringify=t})),md=v((e=>{let t=Symbol(`break visit`),n=Symbol(`skip children`),r=Symbol(`remove item`);function i(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),a(Object.freeze([]),e,t)}i.BREAK=t,i.SKIP=n,i.REMOVE=r,i.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},i.parentCollection=(e,t)=>{let n=i.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],a=n?.[r];if(a&&`items`in a)return a;throw Error(`Parent collection not found`)};function a(e,n,i){let o=i(n,e);if(typeof o==`symbol`)return o;for(let s of[`key`,`value`]){let c=n[s];if(c&&`items`in c){for(let n=0;n<c.items.length;++n){let o=a(Object.freeze(e.concat([[s,n]])),c.items[n],i);if(typeof o==`number`)n=o-1;else if(o===t)return t;else o===r&&(c.items.splice(n,1),--n)}typeof o==`function`&&s===`key`&&(o=o(n,e))}}return typeof o==`function`?o(n,e):o}e.visit=i})),hd=v((e=>{var t=fd(),n=pd(),r=md();let i=e=>!!e&&`items`in e,a=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function o(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}}function s(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`
252
+ `};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r=`indent`in e?e.indent:-1,i=`end`in e&&Array.isArray(e.end)?e.end.filter(e=>e.type===`space`||e.type===`comment`||e.type===`newline`):[];for(let t of Object.keys(e))t!==`type`&&t!==`offset`&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}e.createScalarToken=o,e.resolveAsScalar=a,e.setScalarValue=s})),Id=j((e=>{let t=e=>`type`in e?n(e):r(e);function n(e){switch(e.type){case`block-scalar`:{let t=``;for(let r of e.props)t+=n(r);return t+e.source}case`block-map`:case`block-seq`:{let t=``;for(let n of e.items)t+=r(n);return t}case`flow-collection`:{let t=e.start.source;for(let n of e.items)t+=r(n);for(let n of e.end)t+=n.source;return t}case`document`:{let t=r(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if(`end`in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function r({start:e,key:t,sep:r,value:i}){let a=``;for(let t of e)a+=t.source;if(t&&(a+=n(t)),r)for(let e of r)a+=e.source;return i&&(a+=n(i)),a}e.stringify=t})),Ld=j((e=>{let t=Symbol(`break visit`),n=Symbol(`skip children`),r=Symbol(`remove item`);function i(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),a(Object.freeze([]),e,t)}i.BREAK=t,i.SKIP=n,i.REMOVE=r,i.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},i.parentCollection=(e,t)=>{let n=i.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],a=n?.[r];if(a&&`items`in a)return a;throw Error(`Parent collection not found`)};function a(e,n,i){let o=i(n,e);if(typeof o==`symbol`)return o;for(let s of[`key`,`value`]){let c=n[s];if(c&&`items`in c){for(let n=0;n<c.items.length;++n){let o=a(Object.freeze(e.concat([[s,n]])),c.items[n],i);if(typeof o==`number`)n=o-1;else if(o===t)return t;else o===r&&(c.items.splice(n,1),--n)}typeof o==`function`&&s===`key`&&(o=o(n,e))}}return typeof o==`function`?o(n,e):o}e.visit=i})),Rd=j((e=>{var t=Fd(),n=Id(),r=Ld();let i=e=>!!e&&`items`in e,a=e=>!!e&&(e.type===`scalar`||e.type===`single-quoted-scalar`||e.type===`double-quoted-scalar`||e.type===`block-scalar`);function o(e){switch(e){case``:return`<BOM>`;case``:return`<DOC>`;case``:return`<FLOW_END>`;case``:return`<SCALAR>`;default:return JSON.stringify(e)}}function s(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`
247
253
  `:case`\r
248
- `: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}e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=i,e.isScalar=a,e.prettyToken=o,e.tokenType=s})),gd=v((e=>{var t=hd();function n(e){switch(e){case void 0:case` `:case`
254
+ `: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}e.createScalarToken=t.createScalarToken,e.resolveAsScalar=t.resolveAsScalar,e.setScalarValue=t.setScalarValue,e.stringify=n.stringify,e.visit=r.visit,e.BOM=``,e.DOCUMENT=``,e.FLOW_END=``,e.SCALAR=``,e.isCollection=i,e.isScalar=a,e.prettyToken=o,e.tokenType=s})),zd=j((e=>{var t=Rd();function n(e){switch(e){case void 0:case` `:case`
249
255
  `:case`\r`:case` `:return!0;default:return!1}}let r=new Set(`0123456789ABCDEFabcdef`),i=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),a=new Set(`,[]{}`),o=new Set(` ,[]{}
250
256
  \r `),s=e=>!e||o.has(e);e.Lexer=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===`
251
257
  `?!0:t===`\r`?this.buffer[e+1]===`
@@ -264,14 +270,16 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
264
270
  `,t=this.buffer[i+1]):r=i),t===`#`||e&&a.has(t))break;if(o===`
265
271
  `){let e=this.continueScalar(i+1);if(e===-1)break;i=Math.max(i,e-2)}}else{if(e&&a.has(o))break;r=i}return!o&&!this.atEnd?this.setNext(`plain-scalar`):(yield t.SCALAR,yield*this.pushToIndex(r+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(){switch(this.charAt(0)){case`!`:return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`&`:return(yield*this.pushUntil(s))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case`-`:case`?`:case`:`:{let e=this.flowLevel>0,t=this.charAt(1);if(n(t)||e&&a.has(t))return e?this.flowKey&&=!1:this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!n(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(i.has(t))t=this.buffer[++e];else if(t===`%`&&r.has(this.buffer[e+1])&&r.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===`
266
272
  `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
267
- `?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)}}})),_d=v((e=>{e.LineCounter=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}}}}})),vd=v((e=>{var t=S(`process`),n=hd(),r=gd();function i(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function a(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 o(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 s(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 c(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 l(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!i(t.start,`explicit-key-ind`)&&!i(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,o(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}e.Parser=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 r.Lexer,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,t.env.LOG_TOKENS&&console.log(`|`,n.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=n.tokenType(e);if(r)if(r===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=r,yield*this.step(),r){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}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),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`&&l(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}else 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&&a(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:a(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=c(s(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
273
+ `?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)}}})),Bd=j((e=>{e.LineCounter=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}}}}})),Vd=j((e=>{var t=M(`process`),n=Rd(),r=zd();function i(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function a(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 o(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 s(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 c(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 l(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!i(t.start,`explicit-key-ind`)&&!i(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,o(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}e.Parser=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 r.Lexer,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,t.env.LOG_TOKENS&&console.log(`|`,n.prettyToken(e)),this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let r=n.tokenType(e);if(r)if(r===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=r,yield*this.step(),r){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}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),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`&&l(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}else 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&&a(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:a(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=c(s(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
268
274
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
269
275
  `,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)){Array.prototype.push.apply(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`,a=[];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&&(a=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(a.push(this.sourceToken),e.items.push({start:a}),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?(a.push(this.sourceToken),e.items.push({start:a,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(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(i(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]});else if(o(t.key)&&!i(t.sep,`newline`)){let e=c(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 a.length>0?t.sep=t.sep.concat(a,this.sourceToken):t.sep.push(this.sourceToken);else if(i(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=c(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:a,key:null,sep:[this.sourceToken]}):i(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:a,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&&!i(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:a});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)){Array.prototype.push.apply(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||i(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.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=c(s(t));l(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
270
276
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
271
- `,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=c(s(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=c(s(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;case`space`:case`comment`:default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),yd=v((e=>{var t=dd(),n=Ju(),r=Yu(),i=yu(),a=J(),o=_d(),s=vd();function c(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(o.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())}function u(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(o.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}function d(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=u(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function f(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}e.parse=d,e.parseAllDocuments=l,e.parseDocument=u,e.stringify=f})),bd=x(v((e=>{var t=dd(),n=Ju(),r=Ku(),i=Yu(),a=du(),o=J(),s=Su(),c=Y(),l=wu(),u=Eu();hd();var d=gd(),f=_d(),p=vd(),m=yd(),h=au();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=m.parse,e.parseAllDocuments=m.parseAllDocuments,e.parseDocument=m.parseDocument,e.stringify=m.stringify,e.visit=h.visit,e.visitAsync=h.visitAsync}))(),1);function xd(e,t){let n=Object.fromEntries(Object.entries(e).filter(([e,t])=>t!=null));return Object.keys(n).length===0?`---
272
- ---`:`---\n${bd.stringify(n,{singleQuote:t?.singleQuote??!1,lineWidth:t?.lineWidth??0}).trimEnd()}\n---`}function Sd(e,t,n){return e==null||Object.keys(e).length===0?t:`${xd(e,n)}\n${t}`}function Cd(e){let t=Yl().use(Nl).use(Wc).use(Mr,[`yaml`]).parse(e),n,r,i=[];for(let e of t.children)if(e.type===`yaml`){let t=e;r=t.value;try{n=bd.parse(t.value)}catch{}}else i.push(e);let a=e;return r!=null&&(a=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``)),{...n!=null&&{yamlFrontMatter:n},...r!=null&&{rawFrontMatter:r},markdownAst:t,markdownContents:i,contentWithoutFrontMatter:a}}var wd=class{type;name;_log;get log(){return this._log??=yn(this.name),this._log}dependsOn;constructor(e,t,n){this.name=e,this.type=t,n!=null&&(this.dependsOn=n)}},Td=class extends wd{globalConfigDir;outputFileName;registryWriterCache=new Map;writeEffects=[];cleanEffects=[];constructor(e,t){super(e,mt.Output,t?.dependsOn),this.globalConfigDir=t?.globalConfigDir??``,this.outputFileName=t?.outputFileName??``}registerWriteEffect(e,t){this.writeEffects.push({name:e,handler:t})}registerCleanEffect(e,t){this.cleanEffects.push({name:e,handler:t})}async executeWriteEffects(e){let t=[];for(let n of this.writeEffects){if(e.dryRun===!0){this.log.trace({action:`dryRun`,type:`effect`,name:n.name}),t.push({success:!0,description:`Would execute write effect: ${n.name}`});continue}try{let r=await n.handler(e);if(r.success)this.log.trace({action:`effect`,name:n.name,status:`success`});else{let e=r.error instanceof Error?r.error.message:String(r.error);this.log.error({action:`effect`,name:n.name,status:`failed`,error:e})}t.push(r)}catch(e){let r=e instanceof Error?e.message:String(e);this.log.error({action:`effect`,name:n.name,status:`failed`,error:r}),t.push({success:!1,error:e,description:`Write effect failed: ${n.name}`})}}return t}async executeCleanEffects(e){let t=[];for(let n of this.cleanEffects){if(e.dryRun===!0){this.log.trace({action:`dryRun`,type:`effect`,name:n.name}),t.push({success:!0,description:`Would execute clean effect: ${n.name}`});continue}try{let r=await n.handler(e);if(r.success)this.log.trace({action:`effect`,name:n.name,status:`success`});else{let e=r.error instanceof Error?r.error.message:String(r.error);this.log.error({action:`effect`,name:n.name,status:`failed`,error:e})}t.push(r)}catch(e){let r=e instanceof Error?e.message:String(e);this.log.error({action:`effect`,name:n.name,status:`failed`,error:r}),t.push({success:!1,error:e,description:`Clean effect failed: ${n.name}`})}}return t}isRelativePath(e){return e.pathKind===M.Relative}toRelativePath(e){return this.isRelativePath(e)?e:{pathKind:M.Relative,path:e.path,basePath:``,getDirectoryName:e.getDirectoryName,getAbsolutePath:()=>e.path}}resolveFullPath(e,t){let r;r=e.pathKind===M.Absolute?e.path:this.isRelativePath(e)?i.resolve(e.basePath,e.path):i.resolve(n.cwd(),e.path);let a=t??this.outputFileName;return a?i.join(r,a):r}createRelativePath(e,t,n){return{pathKind:M.Relative,path:e,basePath:t,getDirectoryName:n,getAbsolutePath:()=>i.join(t,e)}}createFileRelativePath(e,t){let n=i.join(e.path,t);return{pathKind:M.Relative,path:n,basePath:e.basePath,getDirectoryName:()=>e.getDirectoryName(),getAbsolutePath:()=>i.join(e.basePath,n)}}getGlobalConfigDir(){return i.join(this.getHomeDir(),this.globalConfigDir)}getHomeDir(){return o.homedir()}joinPath(...e){return i.join(...e)}resolvePath(...e){return i.resolve(...e)}dirname(e){return i.dirname(e)}basename(e,t){return i.basename(e,t)}writeFileSync(e,t,n=`utf-8`){r.writeFileSync(e,t,n)}writeFileSyncBuffer(e,t){r.writeFileSync(e,t)}ensureDirectory(e){r.existsSync(e)||r.mkdirSync(e,{recursive:!0})}existsSync(e){return r.existsSync(e)}readdirSync(e,t){return t?.withFileTypes===!0?r.readdirSync(e,{withFileTypes:!0}):r.readdirSync(e)}async writeFile(e,t,n,a){let o=i.dirname(t),s=i.basename(t),c={pathKind:M.Relative,path:s,basePath:o,getDirectoryName:()=>i.basename(o),getAbsolutePath:()=>t};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`file`,path:t,label:a}),{path:c,success:!0,skipped:!1};try{return this.ensureDirectory(o),r.writeFileSync(t,n,`utf-8`),this.log.trace({action:`write`,type:`file`,path:t,label:a}),{path:c,success:!0}}catch(e){let n=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`file`,path:t,label:a,error:n}),{path:c,success:!1,error:e}}}async writePromptFile(e,t,n,a){let o=this.resolveFullPath(t),s=this.toRelativePath(t);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`promptFile`,path:o,label:a}),{path:s,success:!0,skipped:!1};try{let e=i.dirname(o);return this.ensureDirectory(e),r.writeFileSync(o,n,`utf-8`),this.log.trace({action:`write`,type:`promptFile`,path:o,label:a}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`promptFile`,path:o,label:a,error:t}),{path:s,success:!1,error:e}}}buildMarkdownContent(e,t){return Sd(t,e)}extractGlobalMemoryContent(e){return e.collectedInputContext.globalMemory?.content}combineGlobalWithContent(e,t,n){let{separator:r=`
277
+ `,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=c(s(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=c(s(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;case`space`:case`comment`:default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),Hd=j((e=>{var t=Pd(),n=_d(),r=vd(),i=Hu(),a=J(),o=Bd(),s=Vd();function c(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new o.LineCounter||null,prettyErrors:t}}function l(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=Array.from(l.compose(o.parse(e)));if(a&&i)for(let t of u)t.errors.forEach(r.prettifyError(e,i)),t.warnings.forEach(r.prettifyError(e,i));return u.length>0?u:Object.assign([],{empty:!0},l.streamInfo())}function u(e,n={}){let{lineCounter:i,prettyErrors:a}=c(n),o=new s.Parser(i?.addNewLine),l=new t.Composer(n),u=null;for(let t of l.compose(o.parse(e),!0,e.length))if(!u)u=t;else if(u.options.logLevel!==`silent`){u.errors.push(new r.YAMLParseError(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return a&&i&&(u.errors.forEach(r.prettifyError(e,i)),u.warnings.forEach(r.prettifyError(e,i))),u}function d(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let a=u(e,n);if(!a)return null;if(a.warnings.forEach(e=>i.warn(a.options.logLevel,e)),a.errors.length>0){if(a.options.logLevel!==`silent`)throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function f(e,t,r){let i=null;if(typeof t==`function`||Array.isArray(t)?i=t:r===void 0&&t&&(r=t),typeof r==`string`&&(r=r.length),typeof r==`number`){let e=Math.round(r);r=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=r??t??{};if(!e)return}return a.isDocument(e)&&!i?e.toString(r):new n.Document(e,i,r).toString(r)}e.parse=d,e.parseAllDocuments=l,e.parseDocument=u,e.stringify=f})),Ud=re(j((e=>{var t=Pd(),n=_d(),r=hd(),i=vd(),a=Pu(),o=J(),s=Gu(),c=Y(),l=qu(),u=Yu();Rd();var d=zd(),f=Bd(),p=Vd(),m=Hd(),h=Ou();e.Composer=t.Composer,e.Document=n.Document,e.Schema=r.Schema,e.YAMLError=i.YAMLError,e.YAMLParseError=i.YAMLParseError,e.YAMLWarning=i.YAMLWarning,e.Alias=a.Alias,e.isAlias=o.isAlias,e.isCollection=o.isCollection,e.isDocument=o.isDocument,e.isMap=o.isMap,e.isNode=o.isNode,e.isPair=o.isPair,e.isScalar=o.isScalar,e.isSeq=o.isSeq,e.Pair=s.Pair,e.Scalar=c.Scalar,e.YAMLMap=l.YAMLMap,e.YAMLSeq=u.YAMLSeq,e.Lexer=d.Lexer,e.LineCounter=f.LineCounter,e.Parser=p.Parser,e.parse=m.parse,e.parseAllDocuments=m.parseAllDocuments,e.parseDocument=m.parseDocument,e.stringify=m.stringify,e.visit=h.visit,e.visitAsync=h.visitAsync}))(),1);function Wd(e,t){let n=Object.fromEntries(Object.entries(e).filter(([e,t])=>t!=null));return Object.keys(n).length===0?`---
278
+ ---`:`---\n${Ud.stringify(n,{singleQuote:t?.singleQuote??!1,lineWidth:t?.lineWidth??0}).trimEnd()}\n---`}function Gd(e,t,n){return e==null||Object.keys(e).length===0?t:`${Wd(e,n)}\n${t}`}function Kd(e){let t=vu().use(nu).use(pl).use(ei,[`yaml`]).parse(e),n,r,i=[];for(let e of t.children)if(e.type===`yaml`){let t=e;r=t.value;try{n=Ud.parse(t.value)}catch{}}else i.push(e);let a=e;return r!=null&&(a=e.replace(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/,``)),{...n!=null&&{yamlFrontMatter:n},...r!=null&&{rawFrontMatter:r},markdownAst:t,markdownContents:i,contentWithoutFrontMatter:a}}var qd=class{type;name;_log;get log(){return this._log??=Fn(this.name),this._log}dependsOn;constructor(e,t,n){this.name=e,this.type=t,n!=null&&(this.dependsOn=n)}},Jd=class extends qd{globalConfigDir;outputFileName;registryWriterCache=new Map;writeEffects=[];cleanEffects=[];constructor(e,t){super(e,Dt.Output,t?.dependsOn),this.globalConfigDir=t?.globalConfigDir??``,this.outputFileName=t?.outputFileName??``}registerWriteEffect(e,t){this.writeEffects.push({name:e,handler:t})}registerCleanEffect(e,t){this.cleanEffects.push({name:e,handler:t})}async executeWriteEffects(e){let t=[];for(let n of this.writeEffects){if(e.dryRun===!0){this.log.trace({action:`dryRun`,type:`effect`,name:n.name}),t.push({success:!0,description:`Would execute write effect: ${n.name}`});continue}try{let r=await n.handler(e);if(r.success)this.log.trace({action:`effect`,name:n.name,status:`success`});else{let e=r.error instanceof Error?r.error.message:String(r.error);this.log.error({action:`effect`,name:n.name,status:`failed`,error:e})}t.push(r)}catch(e){let r=e instanceof Error?e.message:String(e);this.log.error({action:`effect`,name:n.name,status:`failed`,error:r}),t.push({success:!1,error:e,description:`Write effect failed: ${n.name}`})}}return t}async executeCleanEffects(e){let t=[];for(let n of this.cleanEffects){if(e.dryRun===!0){this.log.trace({action:`dryRun`,type:`effect`,name:n.name}),t.push({success:!0,description:`Would execute clean effect: ${n.name}`});continue}try{let r=await n.handler(e);if(r.success)this.log.trace({action:`effect`,name:n.name,status:`success`});else{let e=r.error instanceof Error?r.error.message:String(r.error);this.log.error({action:`effect`,name:n.name,status:`failed`,error:e})}t.push(r)}catch(e){let r=e instanceof Error?e.message:String(e);this.log.error({action:`effect`,name:n.name,status:`failed`,error:r}),t.push({success:!1,error:e,description:`Clean effect failed: ${n.name}`})}}return t}isRelativePath(e){return e.pathKind===N.Relative}toRelativePath(e){return this.isRelativePath(e)?e:{pathKind:N.Relative,path:e.path,basePath:``,getDirectoryName:e.getDirectoryName,getAbsolutePath:()=>e.path}}resolveFullPath(e,t){let n;n=e.pathKind===N.Absolute?e.path:this.isRelativePath(e)?g.resolve(e.basePath,e.path):g.resolve(m.cwd(),e.path);let r=t??this.outputFileName;return r?g.join(n,r):n}createRelativePath(e,t,n){return{pathKind:N.Relative,path:e,basePath:t,getDirectoryName:n,getAbsolutePath:()=>g.join(t,e)}}createFileRelativePath(e,t){let n=g.join(e.path,t);return{pathKind:N.Relative,path:n,basePath:e.basePath,getDirectoryName:()=>e.getDirectoryName(),getAbsolutePath:()=>g.join(e.basePath,n)}}getGlobalConfigDir(){return g.join(this.getHomeDir(),this.globalConfigDir)}getHomeDir(){return v.homedir()}joinPath(...e){return g.join(...e)}resolvePath(...e){return g.resolve(...e)}dirname(e){return g.dirname(e)}basename(e,t){return g.basename(e,t)}writeFileSync(e,t,n=`utf-8`){h.writeFileSync(e,t,n)}writeFileSyncBuffer(e,t){h.writeFileSync(e,t)}ensureDirectory(e){h.existsSync(e)||h.mkdirSync(e,{recursive:!0})}existsSync(e){return h.existsSync(e)}readdirSync(e,t){return t?.withFileTypes===!0?h.readdirSync(e,{withFileTypes:!0}):h.readdirSync(e)}async writeFile(e,t,n,r){let i=g.dirname(t),a=g.basename(t),o={pathKind:N.Relative,path:a,basePath:i,getDirectoryName:()=>g.basename(i),getAbsolutePath:()=>t};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`file`,path:t,label:r}),{path:o,success:!0,skipped:!1};try{return this.ensureDirectory(i),h.writeFileSync(t,n,`utf-8`),this.log.trace({action:`write`,type:`file`,path:t,label:r}),{path:o,success:!0}}catch(e){let n=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`file`,path:t,label:r,error:n}),{path:o,success:!1,error:e}}}async writePromptFile(e,t,n,r){let i=this.resolveFullPath(t),a=this.toRelativePath(t);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`promptFile`,path:i,label:r}),{path:a,success:!0,skipped:!1};try{let e=g.dirname(i);return this.ensureDirectory(e),h.writeFileSync(i,n,`utf-8`),this.log.trace({action:`write`,type:`promptFile`,path:i,label:r}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`promptFile`,path:i,label:r,error:t}),{path:a,success:!1,error:e}}}buildMarkdownContent(e,t){return Gd(t,e)}buildMarkdownContentWithRaw(e,t,n){return t!=null&&Object.keys(t).length>0?Gd(t,e):n!=null&&n.length>0?`---\n${n}\n---\n${e}`:e}extractGlobalMemoryContent(e){return e.collectedInputContext.globalMemory?.content}combineGlobalWithContent(e,t,n){let{separator:r=`
273
279
 
274
- `,skipIfEmpty:i=!0,position:a=`before`}=n??{};if(i&&(e==null||e.trim().length===0))return t;let o=e??``;return a===`after`?`${t}${r}${o}`:`${o}${r}${t}`}transformFastCommandName(e,t){let{includeSeriesPrefix:n=!0,seriesSeparator:r=`_`}=t??{};return!n||e.series==null?`${e.commandName}.md`:`${e.series}${r}${e.commandName}.md`}getFastCommandSeriesOptions(e){let t=e.pluginOptions?.fastCommandSeriesOptions,n=t?.pluginOverrides?.[this.name],r=n?.includeSeriesPrefix??t?.includeSeriesPrefix,i=n?.seriesSeparator;return r!=null&&i!=null?{includeSeriesPrefix:r,seriesSeparator:i}:r==null?i==null?{}:{seriesSeparator:i}:{includeSeriesPrefix:r}}getTransformOptionsFromContext(e,t){let n=this.getFastCommandSeriesOptions(e),r=n.includeSeriesPrefix??t?.includeSeriesPrefix,i=n.seriesSeparator??t?.seriesSeparator;return r!=null&&i!=null?{includeSeriesPrefix:r,seriesSeparator:i}:r==null?i==null?{}:{seriesSeparator:i}:{includeSeriesPrefix:r}}shouldSkipDueToPlugin(e,t){let n=e.registeredPluginNames;return n==null?!1:n.includes(t)}async onWriteComplete(e,t){let n=t.files.filter(e=>e.success).length,r=t.files.filter(e=>e.skipped).length,i=t.files.filter(e=>!e.success&&!e.skipped).length;this.log.trace({action:e.dryRun===!0?`dryRun`:`complete`,type:`writeSummary`,success:n,skipped:r,failed:i}),await this.executeWriteEffects(e)}async onCleanComplete(e){await this.executeCleanEffects(e)}getRegistryWriter(e){let t=e.name,n=this.registryWriterCache.get(t);if(n!=null)return n;let r=new e(this.log);return this.registryWriterCache.set(t,r),r}async registerInRegistry(e,t,n){return e.register(t,n.dryRun)}};const Ed=`AGENTS.md`;var Dd=class extends Td{constructor(){super(`AgentsOutputPlugin`,{outputFileName:Ed})}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.rootMemoryPrompt!=null&&e.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,Ed)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,Ed));return t}async canWrite(e){let{workspace:t}=e.collectedInputContext;return t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0)?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],r=[];for(let r of t){let t=r.name??`unknown`,i=r.dirFromWorkspacePath;if(i!=null){if(r.rootMemoryPrompt!=null){let a=await this.writePromptFile(e,i,r.rootMemoryPrompt.content,`project:${t}/root`);n.push(a)}if(r.childMemoryPrompts!=null)for(let i of r.childMemoryPrompts){let r=await this.writePromptFile(e,i.dir,i.content,`project:${t}/child:${i.workingChildDirectoryPath?.path??`unknown`}`);n.push(r)}}}return{files:n,dirs:r}}},X=class extends wd{inputEffects=[];constructor(e,t){super(e,mt.Input,t)}registerEffect(e,t,n=0){this.inputEffects.push({name:e,handler:t,priority:n}),this.inputEffects.sort((e,t)=>(e.priority??0)-(t.priority??0))}async executeEffects(e,t=!1){let n=[];if(this.inputEffects.length===0)return n;let{workspaceDir:r,shadowProjectDir:i}=this.resolveBasePaths(e.userConfigOptions),a={logger:this.log,fs:e.fs,path:e.path,glob:e.glob,spawn:l,userConfigOptions:e.userConfigOptions,workspaceDir:r,shadowProjectDir:i,dryRun:t};for(let e of this.inputEffects){if(t){this.log.trace({action:`dryRun`,type:`inputEffect`,name:e.name}),n.push({success:!0,description:`Would execute input effect: ${e.name}`});continue}try{let t=await e.handler(a);if(t.success)this.log.trace({action:`inputEffect`,name:e.name,status:`success`,description:t.description}),t.modifiedFiles!=null&&t.modifiedFiles.length>0&&this.log.debug({action:`inputEffect`,name:e.name,modifiedFiles:t.modifiedFiles}),t.deletedFiles!=null&&t.deletedFiles.length>0&&this.log.debug({action:`inputEffect`,name:e.name,deletedFiles:t.deletedFiles});else{let n=t.error instanceof Error?t.error.message:String(t.error);this.log.error({action:`inputEffect`,name:e.name,status:`failed`,error:n})}n.push(t)}catch(t){let r=t instanceof Error?t.message:String(t);this.log.error({action:`inputEffect`,name:e.name,status:`failed`,error:r}),n.push({success:!1,error:t,description:`Input effect failed: ${e.name}`})}}return n}hasEffects(){return this.inputEffects.length>0}getEffectCount(){return this.inputEffects.length}resolveBasePaths(e){let t=e.workspaceDir,n=this.resolvePath(t,``,``),r=e.shadowSourceProjectDir;return{workspaceDir:n,shadowProjectDir:this.resolvePath(r,n,``)}}resolvePath(e,t,n){let r=e;return r.startsWith(Mt.USER_HOME)&&(r=r.replace(Mt.USER_HOME,o.homedir())),r.includes(Mt.SHADOW_SOURCE_PROJECT)&&(r=r.replace(Mt.SHADOW_SOURCE_PROJECT,n)),r.includes(Mt.WORKSPACE)&&(r=r.replace(Mt.WORKSPACE,t)),i.normalize(r)}readAndParseMarkdown(e,t){return Cd(t.readFileSync(e,`utf-8`))}};const Od=[`.qoderignore`,`.cursorignore`,`.warpindexignore`];var kd=class extends X{constructor(){super(`AIAgentIgnoreConfigFileInputPlugin`)}collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i}=e,{shadowProjectDir:a}=this.resolveBasePaths(t),o=[];for(let e of Od){let t=i.join(a,e);if(r.existsSync(t)&&r.statSync(t).isFile())try{let i=r.readFileSync(t,`utf-8`);o.push({fileName:e,content:i}),n.debug(`read ignore file`,{path:t})}catch(e){n.warn(`failed to read ignore file`,{path:t,error:e})}}return{aiAgentIgnoreConfigFiles:o}}};const Ad=[`.qoderignore`,`.cursorignore`,`.warpindexignore`];var jd=class extends Td{constructor(){super(`AIAgentIgnoreConfigFileOutputPlugin`)}async registerProjectOutputDirs(){return[]}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.dirFromWorkspacePath!=null&&e.isPromptSourceProject!==!0)for(let n of Ad){let r=i.join(e.dirFromWorkspacePath.path,n);t.push({pathKind:M.Relative,path:r,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>i.basename(e.dirFromWorkspacePath.path),getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,r)})}return t}async registerGlobalOutputDirs(){return[]}async registerGlobalOutputFiles(){return[]}async canWrite(e){let{aiAgentIgnoreConfigFiles:t}=e.collectedInputContext;return t==null||t.length===0?(this.log.debug(`skipped`,{reason:`no ignore config files to write`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{aiAgentIgnoreConfigFiles:n}=e.collectedInputContext,r=[],i=[];if(n==null||n.length===0)return{files:r,dirs:i};for(let i of t){let t=i.dirFromWorkspacePath;if(t==null)continue;let a=i.name??`unknown`;for(let i of n){let n=await this.writeIgnoreFile(e,t,i,`project:${a}/${i.fileName}`);r.push(n)}}return{files:r,dirs:i}}async writeIgnoreFile(e,t,n,a){let o=i.join(t.path,n.fileName),s=i.join(t.basePath,o),c={pathKind:M.Relative,path:o,basePath:t.basePath,getDirectoryName:()=>i.basename(t.path),getAbsolutePath:()=>s};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`ignoreFile`,path:s,label:a}),{path:c,success:!0,skipped:!1};try{return r.writeFileSync(s,n.content,`utf-8`),this.log.trace({action:`write`,type:`ignoreFile`,path:s,label:a}),{path:c,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`ignoreFile`,path:s,label:a,error:t}),{path:c,success:!1,error:e}}}};const Md=`CLAUDE.md`,Z=`.claude`,Nd=`commands`,Pd=`agents`,Fd=`skills`,Id=[Nd,Pd,Fd];var Ld=class extends Td{constructor(){super(`ClaudeCodeCLIOutputPlugin`,{globalConfigDir:Z,outputFileName:Md})}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.dirFromWorkspacePath!=null)for(let n of Id){let r=i.join(e.dirFromWorkspacePath.path,Z,n);t.push({pathKind:M.Relative,path:r,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,r)})}return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{skills:r}=e.collectedInputContext;for(let e of n){if(e.rootMemoryPrompt!=null&&e.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,Md)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,Md));if(r!=null&&e.dirFromWorkspacePath!=null)for(let n of r){let r=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),a=i.join(e.dirFromWorkspacePath.path,Z,Fd,r);if(t.push({pathKind:M.Relative,path:i.join(a,`SKILL.md`),basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,a,`SKILL.md`)}),n.childDocs!=null)for(let o of n.childDocs){let n=i.join(a,o.dir.path);t.push({pathKind:M.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,n)})}if(n.resources!=null)for(let o of n.resources){let n=i.join(a,o.relativePath);t.push({pathKind:M.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,n)})}}}return t}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext;if(t==null)return[];let n=this.getGlobalConfigDir();return[{pathKind:M.Relative,path:Md,basePath:n,getDirectoryName:()=>Z,getAbsolutePath:()=>i.join(n,Md)}]}async canWrite(e){let{workspace:t,globalMemory:n,fastCommands:r,subAgents:i,skills:a}=e.collectedInputContext,o=t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0),s=n!=null,c=(r?.length??0)>0,l=(i?.length??0)>0,u=(a?.length??0)>0;return!o&&!s&&!c&&!l&&!u?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{fastCommands:n,subAgents:r,skills:i}=e.collectedInputContext,a=[],o=[];for(let o of t){let t=o.name??`unknown`,s=o.dirFromWorkspacePath;if(s!=null){if(o.rootMemoryPrompt!=null){let n=await this.writePromptFile(e,s,o.rootMemoryPrompt.content,`project:${t}/root`);a.push(n)}if(o.childMemoryPrompts!=null)for(let n of o.childMemoryPrompts){let r=await this.writePromptFile(e,n.dir,n.content,`project:${t}/child:${n.workingChildDirectoryPath?.path??`unknown`}`);a.push(r)}if(n!=null)for(let t of n){let n=await this.writeFastCommand(e,s,t);a.push(...n)}if(r!=null)for(let t of r){let n=await this.writeSubAgent(e,s,t);a.push(...n)}if(i!=null)for(let t of i){let n=await this.writeSkill(e,s,t);a.push(...n)}}}return{files:a,dirs:o}}async writeGlobalOutputs(e){let{globalMemory:t}=e.collectedInputContext,n=[],a=[];if(t==null)return{files:n,dirs:a};let o=this.getGlobalConfigDir(),s=i.join(o,Md),c={pathKind:M.Relative,path:Md,basePath:o,getDirectoryName:()=>Z,getAbsolutePath:()=>s};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMemory`,path:s}),{files:[{path:c,success:!0,skipped:!1}],dirs:a};try{this.ensureDirectory(o),r.writeFileSync(s,t.content,`utf-8`),this.log.trace({action:`write`,type:`globalMemory`,path:s}),n.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:s,error:t}),n.push({path:c,success:!1,error:e})}return{files:n,dirs:a}}async writeFastCommand(e,t,n){let a=[],o=this.getTransformOptionsFromContext(e),s=this.transformFastCommandName(n,o),c=i.join(t.basePath,t.path,Z,Nd),l=i.join(c,s),u={pathKind:M.Relative,path:i.join(t.path,Z,Nd,s),basePath:t.basePath,getDirectoryName:()=>Nd,getAbsolutePath:()=>l},d=this.buildMarkdownContent(n.content,n.yamlFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`fastCommand`,path:l}),[{path:u,success:!0,skipped:!1}];try{this.ensureDirectory(c),r.writeFileSync(l,d,`utf-8`),this.log.trace({action:`write`,type:`fastCommand`,path:l}),a.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`fastCommand`,path:l,error:t}),a.push({path:u,success:!1,error:e})}return a}async writeSubAgent(e,t,n){let a=[],o=n.dir.path.endsWith(`.md`)?n.dir.path:`${n.dir.path}.md`,s=i.join(t.basePath,t.path,Z,Pd),c=i.join(s,o),l={pathKind:M.Relative,path:i.join(t.path,Z,Pd,o),basePath:t.basePath,getDirectoryName:()=>Pd,getAbsolutePath:()=>c},u=this.buildMarkdownContent(n.content,n.yamlFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`subAgent`,path:c}),[{path:l,success:!0,skipped:!1}];try{this.ensureDirectory(s),r.writeFileSync(c,u,`utf-8`),this.log.trace({action:`write`,type:`subAgent`,path:c}),a.push({path:l,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`subAgent`,path:c,error:t}),a.push({path:l,success:!1,error:e})}return a}async writeSkill(e,t,n){let a=[],o=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),s=i.join(t.basePath,t.path,Z,Fd,o),c=i.join(s,`SKILL.md`),l={pathKind:M.Relative,path:i.join(t.path,Z,Fd,o,`SKILL.md`),basePath:t.basePath,getDirectoryName:()=>o,getAbsolutePath:()=>c},u=this.buildMarkdownContent(n.content,n.yamlFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skill`,path:c}),[{path:l,success:!0,skipped:!1}];try{if(this.ensureDirectory(s),r.writeFileSync(c,u,`utf-8`),this.log.trace({action:`write`,type:`skill`,path:c}),a.push({path:l,success:!0}),n.childDocs!=null)for(let r of n.childDocs){let n=await this.writeSkillReferenceDocument(e,s,o,r,t);a.push(...n)}if(n.resources!=null)for(let r of n.resources){let n=await this.writeSkillResource(e,s,o,r,t);a.push(...n)}}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:c,error:t}),a.push({path:l,success:!1,error:e})}return a}async writeSkillReferenceDocument(e,t,n,a,o){let s=[],c=a.dir.path,l=i.join(t,c),u={pathKind:M.Relative,path:i.join(o.path,Z,Fd,n,c),basePath:o.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>l};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillRefDoc`,path:l}),[{path:u,success:!0,skipped:!1}];try{let e=i.dirname(l);this.ensureDirectory(e),r.writeFileSync(l,a.content,`utf-8`),this.log.trace({action:`write`,type:`skillRefDoc`,path:l}),s.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillRefDoc`,path:l,error:t}),s.push({path:u,success:!1,error:e})}return s}async writeSkillResource(e,t,n,a,o){let s=[],c=i.join(t,a.relativePath),l={pathKind:M.Relative,path:i.join(o.path,Z,Fd,n,a.relativePath),basePath:o.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>c};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillResource`,path:c}),[{path:l,success:!0,skipped:!1}];try{let e=i.dirname(c);this.ensureDirectory(e),r.writeFileSync(c,a.content,`utf-8`),this.log.trace({action:`write`,type:`skillResource`,path:c}),s.push({path:l,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillResource`,path:c,error:t}),s.push({path:l,success:!1,error:e})}return s}};const Rd=`AGENTS.md`,zd=`.codex`,Bd=`prompts`,Vd=`skills`,Hd=`SKILL.md`;var Ud=class extends Td{constructor(){super(`CodexCLIOutputPlugin`,{globalConfigDir:zd,outputFileName:Rd,dependsOn:[`AgentsOutputPlugin`]})}async registerProjectOutputDirs(){return[]}async registerProjectOutputFiles(){return[]}async registerGlobalOutputDirs(e){let t=this.getGlobalConfigDir(),n=[],r=i.join(t,Bd);n.push({pathKind:M.Relative,path:Bd,basePath:t,getDirectoryName:()=>Bd,getAbsolutePath:()=>r});let{skills:a}=e.collectedInputContext;if(a!=null&&a.length>0)for(let e of a){let r=e.yamlFrontMatter?.name??e.dir.getDirectoryName(),a=i.join(t,Vd,r);n.push({pathKind:M.Relative,path:i.join(Vd,r),basePath:t,getDirectoryName:()=>r,getAbsolutePath:()=>a})}return n}async registerGlobalOutputFiles(){let e=this.getGlobalConfigDir();return[{pathKind:M.Relative,path:Rd,basePath:e,getDirectoryName:()=>zd,getAbsolutePath:()=>i.join(e,Rd)}]}async canWrite(e){let{globalMemory:t,fastCommands:n,skills:r}=e.collectedInputContext,i=t!=null,a=(n?.length??0)>0,o=(r?.length??0)>0;return!i&&!a&&!o?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(){return{files:[],dirs:[]}}async writeGlobalOutputs(e){let{globalMemory:t,fastCommands:n,skills:a}=e.collectedInputContext,o=[],s=[];if(t!=null){let n=this.getGlobalConfigDir(),a=i.join(n,Rd),s={pathKind:M.Relative,path:Rd,basePath:n,getDirectoryName:()=>zd,getAbsolutePath:()=>a};if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`globalMemory`,path:a}),o.push({path:s,success:!0,skipped:!1});else try{this.ensureDirectory(n),r.writeFileSync(a,t.content,`utf-8`),this.log.trace({action:`write`,type:`globalMemory`,path:a}),o.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:a,error:t}),o.push({path:s,success:!1,error:e})}}if(n!=null&&n.length>0){let t=this.getGlobalConfigDir();for(let r of n){let n=await this.writeGlobalFastCommand(e,t,r);o.push(...n)}}if(a!=null&&a.length>0){let t=this.getGlobalConfigDir();for(let n of a){let r=await this.writeGlobalSkill(e,t,n);o.push(...r)}}return{files:o,dirs:s}}async writeGlobalFastCommand(e,t,n){let a=[],o=this.getTransformOptionsFromContext(e),s=this.transformFastCommandName(n,o),c=i.join(t,Bd),l=i.join(c,s),u={pathKind:M.Relative,path:i.join(Bd,s),basePath:t,getDirectoryName:()=>Bd,getAbsolutePath:()=>l},d=this.buildMarkdownContent(n.content,n.yamlFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalFastCommand`,path:l}),[{path:u,success:!0,skipped:!1}];try{this.ensureDirectory(c),r.writeFileSync(l,d,`utf-8`),this.log.trace({action:`write`,type:`globalFastCommand`,path:l}),a.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalFastCommand`,path:l,error:t}),a.push({path:u,success:!1,error:e})}return a}async writeGlobalSkill(e,t,n){let a=[],o=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),s=i.join(t,Vd,o),c=i.join(s,Hd),l={pathKind:M.Relative,path:i.join(Vd,o,Hd),basePath:t,getDirectoryName:()=>o,getAbsolutePath:()=>c},u=this.buildCodexSkillContent(n);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalSkill`,path:c}),[{path:l,success:!0,skipped:!1}];try{if(this.ensureDirectory(s),r.writeFileSync(c,u,`utf-8`),this.log.trace({action:`write`,type:`globalSkill`,path:c}),a.push({path:l,success:!0}),n.childDocs!=null)for(let r of n.childDocs){let n=await this.writeSkillReferenceDocument(e,s,o,r,t);a.push(...n)}if(n.resources!=null)for(let r of n.resources){let n=await this.writeSkillResource(e,s,o,r,t);a.push(...n)}}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalSkill`,path:c,error:t}),a.push({path:l,success:!1,error:e})}return a}buildCodexSkillContent(e){let t=e.yamlFrontMatter,n=this.normalizeSkillName(t.name,64),r=this.normalizeToSingleLine(t.description,1024),i={};t.displayName!=null&&(i[`short-description`]=t.displayName),t.version!=null&&(i.version=t.version),t.author!=null&&(i.author=t.author),t.keywords!=null&&t.keywords.length>0&&(i.keywords=[...t.keywords]);let a={name:n,description:r};return Object.keys(i).length>0&&(a.metadata=i),t.allowTools!=null&&t.allowTools.length>0&&(a[`allowed-tools`]=t.allowTools.join(` `)),Sd(a,e.content)}normalizeSkillName(e,t){let n=e.toLowerCase().replace(/[^a-z0-9-]/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n.length>t&&(n=n.slice(0,t).replace(/-+$/,``)),n}normalizeToSingleLine(e,t){let n=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-3)}...`:n}async writeSkillReferenceDocument(e,t,n,a,o){let s=[],c=a.dir.path,l=i.join(t,c),u={pathKind:M.Relative,path:i.join(Vd,n,c),basePath:o,getDirectoryName:()=>n,getAbsolutePath:()=>l};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillRefDoc`,path:l}),[{path:u,success:!0,skipped:!1}];try{let e=i.dirname(l);this.ensureDirectory(e),r.writeFileSync(l,a.content,`utf-8`),this.log.trace({action:`write`,type:`skillRefDoc`,path:l}),s.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillRefDoc`,path:l,error:t}),s.push({path:u,success:!1,error:e})}return s}async writeSkillResource(e,t,n,a,o){let s=[],c=i.join(t,a.relativePath),l={pathKind:M.Relative,path:i.join(Vd,n,a.relativePath),basePath:o,getDirectoryName:()=>n,getAbsolutePath:()=>c};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillResource`,path:c}),[{path:l,success:!0,skipped:!1}];try{let e=i.dirname(c);this.ensureDirectory(e),r.writeFileSync(c,a.content,`utf-8`),this.log.trace({action:`write`,type:`skillResource`,path:c}),s.push({path:l,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillResource`,path:c,error:t}),s.push({path:l,success:!1,error:e})}return s}};const Wd=`AGENTS.md`,Q=`.factory`,Gd=`commands`,Kd=`agents`,qd=`skills`,Jd=[Gd,Kd,qd];var Yd=class extends Td{constructor(){super(`DroidCLIOutputPlugin`,{globalConfigDir:Q,outputFileName:Wd})}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.dirFromWorkspacePath!=null)for(let n of Jd){let r=i.join(e.dirFromWorkspacePath.path,Q,n);t.push({pathKind:M.Relative,path:r,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,r)})}return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{skills:r}=e.collectedInputContext;for(let e of n)if(e.dirFromWorkspacePath!=null&&r!=null)for(let n of r){let r=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),a=i.join(e.dirFromWorkspacePath.path,Q,qd,r);if(t.push({pathKind:M.Relative,path:i.join(a,`SKILL.md`),basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,a,`SKILL.md`)}),n.childDocs!=null)for(let o of n.childDocs){let n=i.join(a,o.dir.path);t.push({pathKind:M.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,n)})}if(n.resources!=null)for(let o of n.resources){let n=i.join(a,o.relativePath);t.push({pathKind:M.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>i.join(e.dirFromWorkspacePath.basePath,n)})}}return t}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext;if(t==null)return[];let n=this.getGlobalConfigDir();return[{pathKind:M.Relative,path:Wd,basePath:n,getDirectoryName:()=>Q,getAbsolutePath:()=>i.join(n,Wd)}]}async canWrite(e){let{globalMemory:t,fastCommands:n,subAgents:r,skills:i}=e.collectedInputContext,a=t!=null,o=(n?.length??0)>0,s=(r?.length??0)>0,c=(i?.length??0)>0;return!a&&!o&&!s&&!c?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{fastCommands:n,subAgents:r,skills:i}=e.collectedInputContext,a=[],o=[];for(let o of t){let t=o.dirFromWorkspacePath;if(t!=null){if(n!=null)for(let r of n){let n=await this.writeFastCommand(e,t,r);a.push(...n)}if(r!=null)for(let n of r){let r=await this.writeSubAgent(e,t,n);a.push(...r)}if(i!=null)for(let n of i){let r=await this.writeSkill(e,t,n);a.push(...r)}}}return{files:a,dirs:o}}async writeGlobalOutputs(e){let{globalMemory:t}=e.collectedInputContext,n=[],a=[];if(t==null)return{files:n,dirs:a};let o=this.getGlobalConfigDir(),s=i.join(o,Wd),c={pathKind:M.Relative,path:Wd,basePath:o,getDirectoryName:()=>Q,getAbsolutePath:()=>s};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMemory`,path:s}),{files:[{path:c,success:!0,skipped:!1}],dirs:a};try{this.ensureDirectory(o),r.writeFileSync(s,t.content,`utf-8`),this.log.trace({action:`write`,type:`globalMemory`,path:s}),n.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:s,error:t}),n.push({path:c,success:!1,error:e})}return{files:n,dirs:a}}async writeFastCommand(e,t,n){let a=[],o=this.getTransformOptionsFromContext(e),s=this.transformFastCommandName(n,o),c=i.join(t.basePath,t.path,Q,Gd),l=i.join(c,s),u={pathKind:M.Relative,path:i.join(t.path,Q,Gd,s),basePath:t.basePath,getDirectoryName:()=>Gd,getAbsolutePath:()=>l},d=this.buildMarkdownContent(n.content,n.yamlFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`fastCommand`,path:l}),[{path:u,success:!0,skipped:!1}];try{this.ensureDirectory(c),r.writeFileSync(l,d,`utf-8`),this.log.trace({action:`write`,type:`fastCommand`,path:l}),a.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`fastCommand`,path:l,error:t}),a.push({path:u,success:!1,error:e})}return a}async writeSubAgent(e,t,n){let a=[],o=n.dir.path.endsWith(`.md`)?n.dir.path:`${n.dir.path}.md`,s=i.join(t.basePath,t.path,Q,Kd),c=i.join(s,o),l={pathKind:M.Relative,path:i.join(t.path,Q,Kd,o),basePath:t.basePath,getDirectoryName:()=>Kd,getAbsolutePath:()=>c},u=this.buildMarkdownContent(n.content,n.yamlFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`subAgent`,path:c}),[{path:l,success:!0,skipped:!1}];try{this.ensureDirectory(s),r.writeFileSync(c,u,`utf-8`),this.log.trace({action:`write`,type:`subAgent`,path:c}),a.push({path:l,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`subAgent`,path:c,error:t}),a.push({path:l,success:!1,error:e})}return a}async writeSkill(e,t,n){let a=[],o=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),s=i.join(t.basePath,t.path,Q,qd,o),c=i.join(s,`SKILL.md`),l={pathKind:M.Relative,path:i.join(t.path,Q,qd,o,`SKILL.md`),basePath:t.basePath,getDirectoryName:()=>o,getAbsolutePath:()=>c},u=n.yamlFrontMatter==null?void 0:{name:n.yamlFrontMatter.name,description:n.yamlFrontMatter.description},d=this.buildMarkdownContent(n.content,u);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skill`,path:c}),[{path:l,success:!0,skipped:!1}];try{if(this.ensureDirectory(s),r.writeFileSync(c,d,`utf-8`),this.log.trace({action:`write`,type:`skill`,path:c}),a.push({path:l,success:!0}),n.childDocs!=null)for(let r of n.childDocs){let n=await this.writeSkillReferenceDocument(e,s,o,r,t);a.push(...n)}if(n.resources!=null)for(let r of n.resources){let n=await this.writeSkillResource(e,s,o,r,t);a.push(...n)}}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:c,error:t}),a.push({path:l,success:!1,error:e})}return a}async writeSkillReferenceDocument(e,t,n,a,o){let s=[],c=a.dir.path,l=i.join(t,c),u={pathKind:M.Relative,path:i.join(o.path,Q,qd,n,c),basePath:o.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>l};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillRefDoc`,path:l}),[{path:u,success:!0,skipped:!1}];try{let e=i.dirname(l);this.ensureDirectory(e),r.writeFileSync(l,a.content,`utf-8`),this.log.trace({action:`write`,type:`skillRefDoc`,path:l}),s.push({path:u,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillRefDoc`,path:l,error:t}),s.push({path:u,success:!1,error:e})}return s}async writeSkillResource(e,t,n,a,o){let s=[],c=i.join(t,a.relativePath),l={pathKind:M.Relative,path:i.join(o.path,Q,qd,n,a.relativePath),basePath:o.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>c};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillResource`,path:c}),[{path:l,success:!0,skipped:!1}];try{let e=i.dirname(c);this.ensureDirectory(e),r.writeFileSync(c,a.content,`utf-8`),this.log.trace({action:`write`,type:`skillResource`,path:c}),s.push({path:l,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillResource`,path:c,error:t}),s.push({path:l,success:!1,error:e})}return s}},Xd=class extends X{constructor(){super(`FastCommandInputPlugin`)}extractSeriesInfo(e){let t=e.replace(/\.md$/,``),n=t.indexOf(`_`);return n===-1?{commandName:t}:{series:t.substring(0,n),commandName:t.substring(n+1)}}collect(e){let{userConfigOptions:t,logger:n}=e,{workspaceDir:r,shadowProjectDir:i}=this.resolveBasePaths(t),a=t.shadowFastCommandDir,o=this.resolvePath(a,r,i),s=[];if(e.fs.existsSync(o)&&e.fs.statSync(o).isDirectory())try{let t=e.fs.readdirSync(o,{withFileTypes:!0});for(let n of t)if(n.isFile()&&n.name.endsWith(`.md`)){let t=e.path.join(o,n.name),r=Cd(e.fs.readFileSync(t,`utf-8`)),i=r.contentWithoutFrontMatter,a=this.extractSeriesInfo(n.name);s.push({type:ht.FastCommand,content:i,length:i.length,filePathKind:M.Relative,...r.yamlFrontMatter!=null&&{yamlFrontMatter:r.yamlFrontMatter},...r.rawFrontMatter!=null&&{rawFrontMatter:r.rawFrontMatter},markdownAst:r.markdownAst,markdownContents:r.markdownContents,dir:{pathKind:M.Relative,path:n.name,basePath:o,getDirectoryName:()=>n.name.replace(/\.md$/,``),getAbsolutePath:()=>t},...a.series!=null&&{series:a.series},commandName:a.commandName})}}catch(e){n.error(`Failed to scan fast commands at ${o}`,{error:e})}return{fastCommands:s}}};const Zd=`GEMINI.md`,Qd=`.gemini`;var $d=class extends Td{constructor(){super(`GeminiCLIOutputPlugin`,{globalConfigDir:Qd,outputFileName:Zd})}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.rootMemoryPrompt!=null&&e.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,Zd)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,Zd));return t}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext;if(t==null)return[];let n=this.getGlobalConfigDir();return[{pathKind:M.Relative,path:Zd,basePath:n,getDirectoryName:()=>Qd,getAbsolutePath:()=>i.join(n,Zd)}]}async canWrite(e){let{workspace:t,globalMemory:n}=e.collectedInputContext;return!t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0)&&n==null?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],r=[];for(let r of t){let t=r.name??`unknown`,i=r.dirFromWorkspacePath;if(i!=null){if(r.rootMemoryPrompt!=null){let a=await this.writePromptFile(e,i,r.rootMemoryPrompt.content,`project:${t}/root`);n.push(a)}if(r.childMemoryPrompts!=null)for(let i of r.childMemoryPrompts){let r=await this.writePromptFile(e,i.dir,i.content,`project:${t}/child:${i.workingChildDirectoryPath?.path??`unknown`}`);n.push(r)}}}return{files:n,dirs:r}}async writeGlobalOutputs(e){let{globalMemory:t}=e.collectedInputContext,n=[],a=[];if(t==null)return{files:n,dirs:a};let o=this.getGlobalConfigDir(),s=i.join(o,Zd),c={pathKind:M.Relative,path:Zd,basePath:o,getDirectoryName:()=>Qd,getAbsolutePath:()=>s};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMemory`,path:s}),{files:[{path:c,success:!0,skipped:!1}],dirs:a};try{this.ensureDirectory(o),r.writeFileSync(s,t.content,`utf-8`),this.log.trace({action:`write`,type:`globalMemory`,path:s}),n.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:s,error:t}),n.push({path:c,success:!1,error:e})}return{files:n,dirs:a}}};const ef=`.skills`,tf=`SKILL.md`,nf=`mcp.json`;var rf=class extends Td{constructor(){super(`GenericSkillsOutputPlugin`,{globalConfigDir:``,outputFileName:tf})}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{skills:r}=e.collectedInputContext;if(r==null||r.length===0)return t;for(let e of n){if(e.dirFromWorkspacePath==null)continue;let n=this.joinPath(e.dirFromWorkspacePath.path,ef);t.push({pathKind:M.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>ef,getAbsolutePath:()=>this.joinPath(e.dirFromWorkspacePath.basePath,n)})}return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{skills:r}=e.collectedInputContext;if(r==null||r.length===0)return t;for(let e of n){if(e.dirFromWorkspacePath==null)continue;let n=this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path,ef);for(let i of r){let r=i.yamlFrontMatter.name,a=this.joinPath(n,r);if(t.push({pathKind:M.Relative,path:this.joinPath(ef,r,tf),basePath:this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path),getDirectoryName:()=>r,getAbsolutePath:()=>this.joinPath(a,tf)}),i.mcpConfig!=null&&t.push({pathKind:M.Relative,path:this.joinPath(ef,r,nf),basePath:this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path),getDirectoryName:()=>r,getAbsolutePath:()=>this.joinPath(a,nf)}),i.childDocs!=null)for(let n of i.childDocs)t.push({pathKind:M.Relative,path:this.joinPath(ef,r,n.relativePath),basePath:this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path),getDirectoryName:()=>r,getAbsolutePath:()=>this.joinPath(a,n.relativePath)});if(i.resources!=null)for(let n of i.resources)t.push({pathKind:M.Relative,path:this.joinPath(ef,r,n.relativePath),basePath:this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path),getDirectoryName:()=>r,getAbsolutePath:()=>this.joinPath(a,n.relativePath)})}}return t}async registerGlobalOutputDirs(){return[]}async registerGlobalOutputFiles(){return[]}async canWrite(e){let{skills:t}=e.collectedInputContext,{projects:n}=e.collectedInputContext.workspace;return t==null||t.length===0?(this.log.trace({action:`skip`,reason:`noSkills`}),!1):n.length===0?(this.log.trace({action:`skip`,reason:`noProjects`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{skills:n}=e.collectedInputContext,r=[],i=[];if(n==null||n.length===0)return{files:r,dirs:i};for(let i of t){if(i.dirFromWorkspacePath==null)continue;let t=this.joinPath(i.dirFromWorkspacePath.basePath,i.dirFromWorkspacePath.path,ef);for(let i of n){let n=await this.writeSkill(e,i,t);r.push(...n)}}return{files:r,dirs:i}}async writeGlobalOutputs(){return{files:[],dirs:[]}}async writeSkill(e,t,n){let r=[],i=t.yamlFrontMatter.name,a=this.joinPath(n,i),o=this.joinPath(a,tf),s={pathKind:M.Relative,path:tf,basePath:a,getDirectoryName:()=>i,getAbsolutePath:()=>o},c=this.buildSkillFrontMatter(t),l=t.content,u=Sd(c,l);if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`skill`,path:o}),r.push({path:s,success:!0,skipped:!1});else try{this.ensureDirectory(a),this.writeFileSync(o,u),this.log.trace({action:`write`,type:`skill`,path:o}),r.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:o,error:t}),r.push({path:s,success:!1,error:e})}if(t.mcpConfig!=null){let n=await this.writeMcpConfig(e,t,a);r.push(n)}if(t.childDocs!=null)for(let n of t.childDocs){let t=await this.writeChildDoc(e,n,a,i);r.push(t)}if(t.resources!=null)for(let n of t.resources){let t=await this.writeResource(e,n,a,i);r.push(t)}return r}buildSkillFrontMatter(e){let t=e.yamlFrontMatter;return{name:t.name,description:t.description,...t.displayName!=null&&{displayName:t.displayName},...t.keywords!=null&&t.keywords.length>0&&{keywords:t.keywords},...t.author!=null&&{author:t.author},...t.version!=null&&{version:t.version},...t.allowTools!=null&&t.allowTools.length>0&&{allowTools:t.allowTools}}}async writeMcpConfig(e,t,n){let r=t.yamlFrontMatter.name,i=this.joinPath(n,nf),a={pathKind:M.Relative,path:nf,basePath:n,getDirectoryName:()=>r,getAbsolutePath:()=>i},o=t.mcpConfig.rawContent;if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpConfig`,path:i}),{path:a,success:!0,skipped:!1};try{return this.ensureDirectory(n),this.writeFileSync(i,o),this.log.trace({action:`write`,type:`mcpConfig`,path:i}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`mcpConfig`,path:i,error:t}),{path:a,success:!1,error:e}}}async writeChildDoc(e,t,n,r){let i=this.joinPath(n,t.relativePath),a={pathKind:M.Relative,path:t.relativePath,basePath:n,getDirectoryName:()=>r,getAbsolutePath:()=>i},o=t.content;if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`childDoc`,path:i}),{path:a,success:!0,skipped:!1};try{let e=this.dirname(i);return this.ensureDirectory(e),this.writeFileSync(i,o),this.log.trace({action:`write`,type:`childDoc`,path:i}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`childDoc`,path:i,error:t}),{path:a,success:!1,error:e}}}async writeResource(e,t,n,r){let i=this.joinPath(n,t.relativePath),a={pathKind:M.Relative,path:t.relativePath,basePath:n,getDirectoryName:()=>r,getAbsolutePath:()=>i};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`resource`,path:i}),{path:a,success:!0,skipped:!1};try{let e=this.dirname(i);if(this.ensureDirectory(e),t.encoding===`base64`){let e=u.from(t.content,`base64`);this.writeFileSyncBuffer(i,e)}else this.writeFileSync(i,t.content);return this.log.trace({action:`write`,type:`resource`,path:i}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`resource`,path:i,error:t}),{path:a,success:!1,error:e}}}},af=class extends X{constructor(){super(`GlobalMemoryInputPlugin`)}collect(e){let{userConfigOptions:t,fs:n,path:r}=e,{workspaceDir:i,shadowProjectDir:a}=this.resolveBasePaths(t),s=t.globalMemoryFile,c=this.resolvePath(s,i,a);if(n.existsSync(c)&&n.statSync(c).isFile()){let e=Cd(n.readFileSync(c,`utf-8`)),t=e.contentWithoutFrontMatter;return{globalMemory:{type:ht.GlobalMemory,content:t,length:t.length,filePathKind:M.Relative,...e.rawFrontMatter!=null&&{rawFrontMatter:e.rawFrontMatter},markdownAst:e.markdownAst,markdownContents:e.markdownContents,dir:{pathKind:M.Relative,path:r.basename(c),basePath:r.dirname(c),getDirectoryName:()=>r.basename(c),getAbsolutePath:()=>c},parentDirectoryPath:{type:yt.UserHome,directory:{pathKind:M.Relative,path:``,basePath:o.homedir(),getDirectoryName:()=>r.basename(o.homedir()),getAbsolutePath:()=>o.homedir()}}}}}return{}}},of=class extends X{constructor(){super(`IdeConfigInputPlugin`)}collect(e){let{userConfigOptions:t,fs:n,path:r}=e,{shadowProjectDir:i}=this.resolveBasePaths(t),a=[`.editorconfig`,`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`,`.vscode/settings.json`,`.vscode/extensions.json`],o=[];for(let e of a){let t=r.join(i,e);if(n.existsSync(t)&&n.statSync(t).isFile()){let i=n.readFileSync(t,`utf-8`),a=N.Original;e.includes(`.vscode`)?a=N.VSCode:e.includes(`.idea`)?a=N.IntellijIDEA:e.includes(`.editorconfig`)&&(a=N.EditorConfig),o.push({type:a,content:i,length:i.length,filePathKind:M.Absolute,dir:{pathKind:M.Absolute,path:t,getDirectoryName:()=>r.basename(t)}})}}return{ideConfigFiles:o}}};const sf=`.idea`,cf=[`.editorconfig`,`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`];var lf=class extends Td{constructor(){super(`JetBrainsIDECodeStyleConfigOutputPlugin`)}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{ideConfigFiles:r}=e.collectedInputContext;if(!r.some(e=>e.type===N.IntellijIDEA||e.type===N.EditorConfig))return t;for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null&&e.isPromptSourceProject!==!0)for(let e of cf){let r=this.joinPath(n.path,e);t.push({pathKind:M.Relative,path:r,basePath:n.basePath,getDirectoryName:()=>this.dirname(e),getAbsolutePath:()=>this.resolvePath(n.basePath,r)})}}return t}async canWrite(e){let{ideConfigFiles:t}=e.collectedInputContext;return t.some(e=>e.type===N.IntellijIDEA||e.type===N.EditorConfig)?!0:(this.log.debug(`skipped`,{reason:`no JetBrains IDE config files found`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{ideConfigFiles:n}=e.collectedInputContext,r=[],i=[],a=n.filter(e=>e.type===N.IntellijIDEA||e.type===N.EditorConfig);for(let n of t){let t=n.dirFromWorkspacePath;if(t==null)continue;let i=n.name??`unknown`;for(let n of a){let a=await this.writeConfigFile(e,t,n,`project:${i}`);r.push(a)}}return{files:r,dirs:i}}async writeConfigFile(e,t,n,r){let i=this.getTargetRelativePath(n),a=this.resolvePath(t.basePath,t.path,i),o={pathKind:M.Relative,path:this.joinPath(t.path,i),basePath:t.basePath,getDirectoryName:()=>this.dirname(i),getAbsolutePath:()=>a};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`config`,path:a,label:r}),{path:o,success:!0,skipped:!1};try{let e=this.dirname(a);return this.ensureDirectory(e),this.writeFileSync(a,n.content),this.log.trace({action:`write`,type:`config`,path:a,label:r}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`config`,path:a,label:r,error:t}),{path:o,success:!1,error:e}}}getTargetRelativePath(e){let t=e.dir.path;if(e.type===N.EditorConfig)return`.editorconfig`;if(e.type===N.IntellijIDEA){let e=t.indexOf(sf);return e===-1?this.joinPath(sf,`codeStyles`,this.basename(t)):t.substring(e)}return this.basename(t)}},uf=class{registryPath;log;constructor(e,t){this.registryPath=this.resolvePath(e),this.log=t??yn(this.constructor.name)}resolvePath(e){return e.startsWith(`~`)?i.join(o.homedir(),e.slice(1)):i.resolve(e)}getRegistryDir(){return i.dirname(this.registryPath)}ensureRegistryDir(){let e=this.getRegistryDir();r.existsSync(e)||r.mkdirSync(e,{recursive:!0})}read(){if(!r.existsSync(this.registryPath))return this.log.debug(`registry not found`,{path:this.registryPath}),this.createInitialRegistry();try{let e=r.readFileSync(this.registryPath,`utf-8`);return JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error(`parse failed`,{path:this.registryPath,error:t}),this.createInitialRegistry()}}write(e,t){let n={...e,lastUpdated:new Date().toISOString()};if(t===!0)return this.log.trace({action:`dryRun`,type:`registry`,path:this.registryPath}),!0;let i=`${this.registryPath}.tmp.${Date.now()}`;try{this.ensureRegistryDir();let e=JSON.stringify(n,null,2);return r.writeFileSync(i,e,`utf-8`),r.renameSync(i,this.registryPath),this.log.trace({action:`write`,type:`registry`,path:this.registryPath}),!0}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`registry`,path:this.registryPath,error:t});try{r.existsSync(i)&&r.unlinkSync(i)}catch{}return!1}}register(e,t){let n=[],r=this.read(),i=this.merge(r,e),a=this.write(i,t);for(let r of e){let e=this.getEntryName(r);a?(n.push({success:!0,entryName:e}),t===!0?this.log.trace({action:`dryRun`,type:`registerEntry`,entryName:e}):this.log.trace({action:`register`,type:`entry`,entryName:e})):(n.push({success:!1,entryName:e,error:Error(`Failed to write registry file`)}),this.log.error(`register entry failed`,{entryName:e}))}return n}generateEntryId(e){let t=`${Date.now()}-${Math.random().toString(36).substring(2,8)}`;return e==null?t:`${e}-${t}`}},df=class e extends uf{static REGISTRY_PATH=`~/.kiro/powers/registry.json`;static DEFAULT_VERSION=`1.0.0`;constructor(t){super(e.REGISTRY_PATH,t)}createInitialRegistry(){return{version:e.DEFAULT_VERSION,powers:{},repoSources:{},lastUpdated:new Date().toISOString()}}getEntryName(e){return e.name}merge(e,t){let n={...e.powers},r={...e.repoSources};for(let e of t){n[e.name]=e;let t=this.buildRepoSource(e),i=e.source.repoId??e.name;r[i]=t}return{version:e.version,powers:n,repoSources:r,...e.kiroRecommendedRepo!=null&&{kiroRecommendedRepo:e.kiroRecommendedRepo},lastUpdated:e.lastUpdated}}buildPowerEntry(e,t){let{yamlFrontMatter:n,mcpConfig:r}=e,i={type:`repo`,repoId:this.generateEntryId(`local`),repoName:t},a=r==null?null:Object.keys(r.mcpServers);return{name:n.name,description:n.description,...a!=null&&a.length>0&&{mcpServers:a},...n.author!=null&&{author:n.author},keywords:n.keywords??[],...n.displayName!=null&&{displayName:n.displayName},installed:!0,installedAt:new Date().toISOString(),installPath:t,source:i,sourcePath:t}}getOfficialRegistry(){try{return JSON.parse({version:`1.0.0`,powers:{postman:{name:`postman`,description:`Automate API testing and collection management with Postman - create workspaces, collections, environments, and run tests programmatically`,displayName:`API Testing with Postman`,author:`Postman`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/postman.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/postman`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`postman`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},figma:{name:`figma`,description:`Connect Figma designs to code components - automatically generate design system rules, map UI components to Figma designs, and maintain design-code consistency`,displayName:`Design to Code with Figma`,author:`Figma`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/figma.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/figma`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`figma`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"netlify-deployment":{name:`netlify-deployment`,description:`Deploy React, Next.js, Vue, and other modern web apps to Netlify's global CDN with automatic builds.`,displayName:`Deploy web apps with Netlify`,author:`Netlify`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/netlify.png`,repositoryUrl:`https://github.com/netlify/context-and-tools/tree/main/context/steering/netlify-deployment-power`,license:``,repositoryCloneUrl:`git@github.com:netlify/context-and-tools.git`,pathInRepo:`context/steering/netlify-deployment-power`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"amazon-aurora-postgresql":{name:`amazon-aurora-postgresql`,description:`Build applications backed by Aurora PostgreSQL by leveraging Aurora PostgreSQL specific best practices.`,displayName:`Build applications with Aurora PostgreSQL`,author:`AWS`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/amazon-aurora.png`,repositoryUrl:`https://github.com/awslabs/mcp/tree/main/src/postgres-mcp-server/kiro_power`,license:``,repositoryCloneUrl:`git@github.com:awslabs/mcp.git`,pathInRepo:`src/postgres-mcp-server/kiro_power`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"supabase-hosted":{name:`supabase-hosted`,description:`Build applications with Supabase's Postgres database, authentication, storage, and real-time subscriptions`,displayName:`Build a backend with Supabase`,author:`Supabase`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/supabase.png`,repositoryUrl:`https://github.com/supabase-community/kiro-powers/tree/main/powers/supabase-hosted`,license:``,repositoryCloneUrl:`git@github.com:supabase-community/kiro-powers.git`,pathInRepo:`powers/supabase-hosted`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"supabase-local":{name:`supabase-local`,description:`Local development with Supabase allows you to work on your projects in a self-contained environment on your local machine.`,displayName:`Build a backend (local) with Supabase`,author:`Supabase`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/supabase.png`,repositoryUrl:`https://github.com/supabase-community/kiro-powers/tree/main/powers/supabase-local`,license:``,repositoryCloneUrl:`git@github.com:supabase-community/kiro-powers.git`,pathInRepo:`powers/supabase-local`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},terraform:{name:`terraform`,description:`Build and manage Infrastructure as Code with Terraform - access registry providers, modules, policies, and HCP Terraform workflow management`,displayName:`Deploy infrastructure with Terraform`,author:`HashiCorp`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/terraform.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/terraform`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`terraform`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},strands:{name:`strands`,description:`Build AI agents with Strands Agent SDK using Bedrock, Anthropic, OpenAI, Gemini, or Llama models`,displayName:`Build an agent with Strands`,author:`AWS`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/strands.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/strands`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`strands`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"aws-agentcore":{name:`aws-agentcore`,description:`Amazon Bedrock AgentCore is an agentic platform for building, deploying, and operating effective agents.`,displayName:`Build an agent with Amazon Bedrock AgentCore`,author:`AWS`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/agentcore.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/aws-agentcore`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`aws-agentcore`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},neon:{name:`neon`,description:`Serverless Postgres with database branching, autoscaling, and scale-to-zero - perfect for modern development workflows`,displayName:`Build a database with Neon`,author:`Neon`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/neon.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/neon`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`neon`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},datadog:{name:`datadog`,description:`Query logs, metrics, traces, RUM events, incidents, and monitors from Datadog for production debugging and performance analysis`,displayName:`Datadog Observability`,author:`Datadog`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/datadog.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/datadog`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`datadog`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},dynatrace:{name:`dynatrace`,description:`Query logs, metrics, traces, problems, and Kubernetes events from Dynatrace using DQL for production debugging and performance analysis`,displayName:`Dynatrace Observability`,author:`Dynatrace`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/dynatrace.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/dynatrace`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`dynatrace`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},stripe:{name:`stripe`,description:`Build payment integrations with Stripe - accept payments, manage subscriptions, handle billing, and process refunds`,displayName:`Stripe Payments`,author:`Stripe`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/stripe.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/stripe`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`stripe`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"aws-infrastructure-as-code":{name:`aws-infrastructure-as-code`,description:`Build well-architected AWS infrastructure with CDK using latest documentation, best practices, and code samples. Validate CloudFormation templates, check resource configuration security compliance, and troubleshoot deployments.`,displayName:`Build AWS infrastructure with CDK and CloudFormation`,author:`AWS`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/iac.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/aws-infrastructure-as-code`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`aws-infrastructure-as-code`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"power-builder":{name:`power-builder`,description:`Complete guide for building and testing new Kiro Powers with templates, best practices, and validation`,displayName:`Build a Power`,author:`Kiro Team`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/power.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/power-builder`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`power-builder`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"saas-builder":{name:`saas-builder`,description:`Build production ready multi-tenant SaaS applications with serverless architecture, integrated billing, and enterprise grade security`,displayName:`SaaS Builder`,author:`Allen Helton`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/power.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/saas-builder`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`saas-builder`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"cloud-architect":{name:`cloud-architect`,description:`Build AWS infrastructure with CDK in Python following AWS Well-Architected framework best practices`,displayName:`Build infrastructure on AWS`,author:`Christian Bonzelet`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/power.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/cloud-architect`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`cloud-architect`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"aurora-dsql":{name:`aurora-dsql`,description:`For PostgreSQL compatible serverless distributed SQL database with Aurora DSQL, manage schemas, execute queries, and handle migrations with DSQL-specific constraints`,displayName:`Deploy a distributed SQL database on AWS`,author:`Rolf Koski`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/power.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/aurora-dsql`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`aurora-dsql`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}}},repoSources:{},lastUpdated:`2025-12-28T20:19:10.824Z`,kiroRecommendedRepo:{url:`https://prod.download.desktop.kiro.dev/powers/default_registry.json`,lastFetch:`2025-12-28T20:19:10.823Z`,powerCount:18}})}catch{this.log.debug(`Failed to parse official registry, using empty registry`)}return this.createInitialRegistry()}unregisterLocalPowers(e){let t={...this.getOfficialRegistry(),lastUpdated:new Date().toISOString()};return this.log.trace({action:e===!0?`dryRun`:`reset`,type:`registry`,powerCount:Object.keys(t.powers).length}),this.write(t,e)}buildRepoSource(e){let t=new Date().toISOString();return{name:e.sourcePath??e.installPath??e.name,type:`local`,enabled:!0,addedAt:t,powerCount:1,...e.sourcePath!=null&&{path:e.sourcePath},lastSync:t}}};const ff=`GLOBAL.md`,pf=`.kiro`,$=`steering`,mf=`settings`,hf=`mcp.json`,gf=`POWER.md`;var _f=class extends Td{constructor(){super(`KiroCLIOutputPlugin`,{globalConfigDir:pf,outputFileName:ff}),this.registerCleanEffect(`registry-cleanup`,async e=>this.getRegistryWriter(df).unregisterLocalPowers(e.dryRun)?{success:!0,description:`Reset registry to official state`}:{success:!1,error:Error(`Failed to clean registry`),description:`Failed to reset registry`}),this.registerCleanEffect(`mcp-settings-cleanup`,async e=>{let t=this.getGlobalSettingsDir(),n=this.joinPath(t,hf),r={mcpServers:{},powers:{mcpServers:{}}};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpSettingsCleanup`,path:n}),{success:!0,description:`Would reset mcp.json to empty shell`};try{return this.ensureDirectory(t),this.writeFileSync(n,JSON.stringify(r,null,2)),this.log.trace({action:`clean`,type:`mcpSettingsCleanup`,path:n}),{success:!0,description:`Reset mcp.json to empty shell`}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`clean`,type:`mcpSettingsCleanup`,path:n,error:t}),{success:!1,error:e,description:`Failed to reset mcp.json`}}})}getGlobalSettingsDir(){return this.joinPath(this.getHomeDir(),pf,mf)}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n){if(e.dirFromWorkspacePath==null)continue;let n=this.joinPath(e.dirFromWorkspacePath.path,pf,$);t.push({pathKind:M.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(e.dirFromWorkspacePath.basePath,n)})}return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.dirFromWorkspacePath!=null&&e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts){let r=this.buildSteeringFileName(n),i=this.joinPath(e.dirFromWorkspacePath.path,pf,$,r);t.push({pathKind:M.Relative,path:i,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(e.dirFromWorkspacePath.basePath,i)})}return t}async registerGlobalOutputDirs(){let e=this.getGlobalSteeringDir(),t=[{pathKind:M.Relative,path:$,basePath:this.joinPath(this.getGlobalConfigDir()),getDirectoryName:()=>$,getAbsolutePath:()=>e}],n=this.getKiroPowersDir(),r=this.listInstalledPowers(n);for(let e of r){let r=this.joinPath(n,e);t.push({pathKind:M.Relative,path:e,basePath:n,getDirectoryName:()=>e,getAbsolutePath:()=>r})}let i=this.getKiroPowersReposDir();return t.push({pathKind:M.Relative,path:`repos`,basePath:this.joinPath(this.getHomeDir(),`.kiro/powers`),getDirectoryName:()=>`repos`,getAbsolutePath:()=>i}),t}listInstalledPowers(e){try{return this.existsSync(e)?this.readdirSync(e,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name):[]}catch{return this.log.debug({action:`listInstalledPowers`,error:`Failed to read powers directory`}),[]}}async registerGlobalOutputFiles(e){let{globalMemory:t,fastCommands:n,skills:r}=e.collectedInputContext,i=[],a=this.getGlobalSteeringDir();if(t!=null&&i.push({pathKind:M.Relative,path:ff,basePath:a,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(a,ff)}),n!=null)for(let e of n){let t=this.buildFastCommandSteeringFileName(e);i.push({pathKind:M.Relative,path:t,basePath:a,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(a,t)})}if(r!=null){let e=this.getKiroPowersDir();for(let t of r){let n=t.yamlFrontMatter.name,r=this.joinPath(e,n);if(i.push({pathKind:M.Relative,path:gf,basePath:r,getDirectoryName:()=>n,getAbsolutePath:()=>this.joinPath(r,gf)}),t.mcpConfig!=null&&i.push({pathKind:M.Relative,path:hf,basePath:r,getDirectoryName:()=>n,getAbsolutePath:()=>this.joinPath(r,hf)}),t.childDocs!=null){let e=this.joinPath(r,$);for(let n of t.childDocs){let t=n.dir.path;i.push({pathKind:M.Relative,path:this.joinPath($,t),basePath:r,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(e,t)})}}if(t.resources!=null){let e=this.joinPath(r,$);for(let n of t.resources)i.push({pathKind:M.Relative,path:this.joinPath($,n.relativePath),basePath:r,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(e,n.relativePath)})}}if(r.some(e=>e.mcpConfig!=null)){let e=this.getGlobalSettingsDir();i.push({pathKind:M.Relative,path:hf,basePath:e,getDirectoryName:()=>mf,getAbsolutePath:()=>this.joinPath(e,hf)})}}return i}async canWrite(e){let{workspace:t,globalMemory:n,fastCommands:r,skills:i}=e.collectedInputContext,a=t.projects.some(e=>(e.childMemoryPrompts?.length??0)>0),o=n!=null,s=(r?.length??0)>0,c=(i?.length??0)>0;return!a&&!o&&!s&&!c?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],r=[];for(let r of t)if(r.dirFromWorkspacePath!=null&&r.childMemoryPrompts!=null)for(let t of r.childMemoryPrompts){let i=await this.writeSteeringFile(e,r,t);n.push(i)}return{files:n,dirs:r}}async writeGlobalOutputs(e){let{globalMemory:t,fastCommands:n,skills:r}=e.collectedInputContext,i=[],a=[],o=[];if(t!=null){let n=this.getGlobalSteeringDir(),r=this.joinPath(n,ff),a={pathKind:M.Relative,path:ff,basePath:n,getDirectoryName:()=>$,getAbsolutePath:()=>r};if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`globalMemory`,path:r}),i.push({path:a,success:!0,skipped:!1});else try{this.ensureDirectory(n),this.writeFileSync(r,t.content),this.log.trace({action:`write`,type:`globalMemory`,path:r}),i.push({path:a,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:r,error:t}),i.push({path:a,success:!1,error:e})}}if(n!=null)for(let t of n){let n=await this.writeFastCommandSteeringFile(e,t);i.push(n)}if(r!=null&&r.length>0){this.log.debug(`Processing ${r.length} skills as Kiro Powers`);for(let t of r){let{fileResults:n,registryResult:r}=await this.writeSkillAsPower(e,t);i.push(...n),o.push(r)}let t=await this.writeGlobalMcpSettings(e,r);t!=null&&i.push(t),this.logRegistryResults(o,e.dryRun)}return{files:i,dirs:a}}async writeGlobalMcpSettings(e,t){let n={};for(let e of t){if(e.mcpConfig==null)continue;let t=e.yamlFrontMatter.name,r=e.mcpConfig.mcpServers;for(let[e,i]of Object.entries(r)){let r=`power-${t}-${e}`;n[r]=i}}if(Object.keys(n).length===0)return null;let r=this.getGlobalSettingsDir(),i=this.joinPath(r,hf),a={pathKind:M.Relative,path:hf,basePath:r,getDirectoryName:()=>mf,getAbsolutePath:()=>i},o={mcpServers:{},powers:{mcpServers:n}},s=JSON.stringify(o,null,2);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMcpSettings`,path:i,serverCount:Object.keys(n).length}),{path:a,success:!0,skipped:!1};try{return this.ensureDirectory(r),this.writeFileSync(i,s),this.log.trace({action:`write`,type:`globalMcpSettings`,path:i,serverCount:Object.keys(n).length}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`globalMcpSettings`,path:i,error:t}),{path:a,success:!1,error:e}}}logRegistryResults(e,t){let n=e.filter(e=>e.success).length,r=e.filter(e=>!e.success).length;if(n>0&&this.log.trace({action:t===!0?`dryRun`:`register`,type:`registrySummary`,successCount:n}),r>0){this.log.error({action:`register`,type:`registrySummary`,failCount:r});for(let t of e)if(!t.success){let e=t.error?.message??`Unknown error`;this.log.error({action:`register`,type:`registryEntry`,entryName:t.entryName,error:e})}}}getGlobalSteeringDir(){return this.joinPath(this.getGlobalConfigDir(),$)}getKiroPowersDir(){return this.joinPath(this.getHomeDir(),`.kiro/powers/installed`)}getKiroPowersReposDir(){return this.joinPath(this.getHomeDir(),`.kiro/powers/repos`)}buildPowerFrontMatter(e){return Sd({name:e.name,displayName:e.displayName,description:e.description,keywords:e.keywords,author:e.author},``).trimEnd()}async writeSkillAsPower(e,t){let n=[],r=t.yamlFrontMatter.name,i=this.joinPath(this.getKiroPowersDir(),r),a=this.joinPath(i,gf),o={pathKind:M.Relative,path:gf,basePath:i,getDirectoryName:()=>r,getAbsolutePath:()=>a},s=`${this.buildPowerFrontMatter(t.yamlFrontMatter)}\n${t.content}`;if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`skillPower`,path:a}),n.push({path:o,success:!0,skipped:!1});else try{this.ensureDirectory(i),this.writeFileSync(a,s),this.log.trace({action:`write`,type:`skillPower`,path:a}),n.push({path:o,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillPower`,path:a,error:t}),n.push({path:o,success:!1,error:e})}if(t.childDocs!=null){let r=this.joinPath(i,$);for(let a of t.childDocs){let t=a.dir.path,o=this.joinPath(r,t),s={pathKind:M.Relative,path:this.joinPath($,t),basePath:i,getDirectoryName:()=>$,getAbsolutePath:()=>o},c=a.content;if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`refDoc`,path:o}),n.push({path:s,success:!0,skipped:!1});else try{let e=this.dirname(o);this.ensureDirectory(e),this.writeFileSync(o,c),this.log.trace({action:`write`,type:`refDoc`,path:o}),n.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`refDoc`,path:o,error:t}),n.push({path:s,success:!1,error:e})}}}if(t.resources!=null){let r=this.joinPath(i,$);for(let a of t.resources){let t=this.joinPath(r,a.relativePath),o={pathKind:M.Relative,path:this.joinPath($,a.relativePath),basePath:i,getDirectoryName:()=>$,getAbsolutePath:()=>t};if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`resource`,path:t}),n.push({path:o,success:!0,skipped:!1});else try{let e=this.dirname(t);this.ensureDirectory(e),this.writeFileSync(t,a.content),this.log.trace({action:`write`,type:`resource`,path:t}),n.push({path:o,success:!0})}catch(e){let r=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`resource`,path:t,error:r}),n.push({path:o,success:!1,error:e})}}}if(t.mcpConfig!=null){let r=await this.writeSkillMcpConfig(e,t,i);n.push(r)}let c=this.getRegistryWriter(df),l=c.buildPowerEntry(t,i);return{fileResults:n,registryResult:(await this.registerInRegistry(c,[l],e))[0]??{success:!1,entryName:r,error:Error(`No registry result returned`)}}}async writeSkillMcpConfig(e,t,n){let r=t.yamlFrontMatter.name,i=this.joinPath(n,hf),a={pathKind:M.Relative,path:hf,basePath:n,getDirectoryName:()=>r,getAbsolutePath:()=>i},o=t.mcpConfig.rawContent;if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpConfig`,path:i,skill:r}),{path:a,success:!0,skipped:!1};try{return this.ensureDirectory(n),this.writeFileSync(i,o),this.log.trace({action:`write`,type:`mcpConfig`,path:i,skill:r}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`mcpConfig`,path:i,error:t}),{path:a,success:!1,error:e}}}buildFastCommandSteeringFileName(e){return this.transformFastCommandName(e,{includeSeriesPrefix:!0,seriesSeparator:`-`})}buildFastCommandSteeringContent(e){let t=e.yamlFrontMatter?.description;return Sd({inclusion:`manual`,description:t!=null&&t.length>0?t:null},e.content)}async writeFastCommandSteeringFile(e,t){let n=this.getGlobalSteeringDir(),r=this.buildFastCommandSteeringFileName(t),i=this.joinPath(n,r),a={pathKind:M.Relative,path:r,basePath:n,getDirectoryName:()=>$,getAbsolutePath:()=>i},o=this.buildFastCommandSteeringContent(t);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`fastCommandSteering`,path:i}),{path:a,success:!0,skipped:!1};try{return this.ensureDirectory(n),this.writeFileSync(i,o),this.log.trace({action:`write`,type:`fastCommandSteering`,path:i}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`fastCommandSteering`,path:i,error:t}),{path:a,success:!1,error:e}}}buildSteeringFileName(e){return`kiro-${(e.workingChildDirectoryPath?.path??e.dir.path).replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``).replace(/\//g,`-`)}.md`}buildSteeringContent(e){return Sd({inclusion:`fileMatch`,fileMatchPattern:`${(e.workingChildDirectoryPath?.path??e.dir.path).replace(/\\/g,`/`)}/**`},e.content)}async writeSteeringFile(e,t,n){let r=t.dirFromWorkspacePath,i=this.buildSteeringFileName(n),a=this.joinPath(r.basePath,r.path,pf,$),o=this.joinPath(a,i),s={pathKind:M.Relative,path:this.joinPath(r.path,pf,$,i),basePath:r.basePath,getDirectoryName:()=>$,getAbsolutePath:()=>o},c=this.buildSteeringContent(n);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`steeringFile`,path:o}),{path:s,success:!0,skipped:!1};try{return this.ensureDirectory(a),this.writeFileSync(o,c),this.log.trace({action:`write`,type:`steeringFile`,path:o}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`steeringFile`,path:o,error:t}),{path:s,success:!1,error:e}}}},vf=class extends X{constructor(){super(`MarkdownWhitespaceCleanupEffectInputPlugin`),this.registerEffect(`markdown-whitespace-cleanup`,this.cleanupWhitespace.bind(this),30)}async cleanupWhitespace(e){let{fs:t,path:n,shadowProjectDir:r,dryRun:i,logger:a}=e,o=[],s=[],c=[],l=[n.join(r,`src`),n.join(r,`app`),n.join(r,`dist`)];for(let n of l){if(!t.existsSync(n)){a.debug({action:`whitespace-cleanup`,message:`Directory does not exist, skipping`,dir:n});continue}this.processDirectory(e,n,o,s,c,i??!1)}let u=c.length>0;return u&&a.warn({action:`whitespace-cleanup`,errors:c.map(e=>({path:e.path,error:e.error.message}))}),{success:!u,description:i?`Would modify ${o.length} files, skip ${s.length} files`:`Modified ${o.length} files, skipped ${s.length} files`,modifiedFiles:o,skippedFiles:s,...u&&{error:Error(`${c.length} errors occurred during cleanup`)}}}processDirectory(e,t,n,r,i,a){let{fs:o,path:s,logger:c}=e,l;try{l=o.readdirSync(t,{withFileTypes:!0})}catch(e){i.push({path:t,error:e}),c.warn({action:`whitespace-cleanup`,message:`Failed to read directory`,path:t,error:e.message});return}for(let o of l){let c=s.join(t,o.name);o.isDirectory()?this.processDirectory(e,c,n,r,i,a):o.isFile()&&o.name.endsWith(`.md`)&&this.processMarkdownFile(e,c,n,r,i,a)}}processMarkdownFile(e,t,n,r,i,a){let{fs:o,logger:s}=e;try{let e=o.readFileSync(t,`utf-8`),i=this.cleanMarkdownContent(e);if(e===i){r.push(t),s.debug({action:`whitespace-cleanup`,skipped:t,reason:`no changes needed`});return}a?(s.debug({action:`whitespace-cleanup`,dryRun:!0,wouldModify:t}),n.push(t)):(o.writeFileSync(t,i,`utf-8`),n.push(t),s.debug({action:`whitespace-cleanup`,modified:t}))}catch(e){i.push({path:t,error:e}),s.warn({action:`whitespace-cleanup`,message:`Failed to process file`,path:t,error:e.message})}}cleanMarkdownContent(e){let t=this.detectLineEnding(e),n=e.split(/\r?\n/).map(e=>e.replace(/[ \t]+$/,``)),r=[],i=0;for(let e of n)e===``?(i++,i<=2&&r.push(e)):(i=0,r.push(e));return r.join(t)}detectLineEnding(e){return e.includes(`\r
280
+ `,skipIfEmpty:i=!0,position:a=`before`}=n??{};if(i&&(e==null||e.trim().length===0))return t;let o=e??``;return a===`after`?`${t}${r}${o}`:`${o}${r}${t}`}transformFastCommandName(e,t){let{includeSeriesPrefix:n=!0,seriesSeparator:r=`_`}=t??{};return!n||e.series==null?`${e.commandName}.md`:`${e.series}${r}${e.commandName}.md`}getFastCommandSeriesOptions(e){let t=e.pluginOptions?.fastCommandSeriesOptions,n=t?.pluginOverrides?.[this.name],r=n?.includeSeriesPrefix??t?.includeSeriesPrefix,i=n?.seriesSeparator;return r!=null&&i!=null?{includeSeriesPrefix:r,seriesSeparator:i}:r==null?i==null?{}:{seriesSeparator:i}:{includeSeriesPrefix:r}}getTransformOptionsFromContext(e,t){let n=this.getFastCommandSeriesOptions(e),r=n.includeSeriesPrefix??t?.includeSeriesPrefix,i=n.seriesSeparator??t?.seriesSeparator;return r!=null&&i!=null?{includeSeriesPrefix:r,seriesSeparator:i}:r==null?i==null?{}:{seriesSeparator:i}:{includeSeriesPrefix:r}}shouldSkipDueToPlugin(e,t){let n=e.registeredPluginNames;return n==null?!1:n.includes(t)}async onWriteComplete(e,t){let n=t.files.filter(e=>e.success).length,r=t.files.filter(e=>e.skipped).length,i=t.files.filter(e=>!e.success&&!e.skipped).length;this.log.trace({action:e.dryRun===!0?`dryRun`:`complete`,type:`writeSummary`,success:n,skipped:r,failed:i}),await this.executeWriteEffects(e)}async onCleanComplete(e){await this.executeCleanEffects(e)}getRegistryWriter(e){let t=e.name,n=this.registryWriterCache.get(t);if(n!=null)return n;let r=new e(this.log);return this.registryWriterCache.set(t,r),r}async registerInRegistry(e,t,n){return e.register(t,n.dryRun)}};const Yd=`AGENTS.md`;var Xd=class extends Jd{constructor(){super(`AgentsOutputPlugin`,{outputFileName:Yd})}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.rootMemoryPrompt!=null&&e.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,Yd)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,Yd));return t}async canWrite(e){let{workspace:t}=e.collectedInputContext;return t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0)?!0:(this.log.trace({action:`skip`,reason:`noOutputs`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],r=[];for(let r of t){let t=r.name??`unknown`,i=r.dirFromWorkspacePath;if(i!=null){if(r.rootMemoryPrompt!=null){let a=await this.writePromptFile(e,i,r.rootMemoryPrompt.content,`project:${t}/root`);n.push(a)}if(r.childMemoryPrompts!=null)for(let i of r.childMemoryPrompts){let r=await this.writePromptFile(e,i.dir,i.content,`project:${t}/child:${i.workingChildDirectoryPath?.path??`unknown`}`);n.push(r)}}}return{files:n,dirs:r}}},X=class extends qd{inputEffects=[];registeredScopes=[];constructor(e,t){super(e,Dt.Input,t)}registerEffect(e,t,n=0){this.inputEffects.push({name:e,handler:t,priority:n}),this.inputEffects.sort((e,t)=>(e.priority??0)-(t.priority??0))}async executeEffects(e,t=!1){let n=[];if(this.inputEffects.length===0)return n;let{workspaceDir:r,shadowProjectDir:i}=this.resolveBasePaths(e.userConfigOptions),a={logger:this.log,fs:e.fs,path:e.path,glob:e.glob,spawn:x,userConfigOptions:e.userConfigOptions,workspaceDir:r,shadowProjectDir:i,dryRun:t};for(let e of this.inputEffects){if(t){this.log.trace({action:`dryRun`,type:`inputEffect`,name:e.name}),n.push({success:!0,description:`Would execute input effect: ${e.name}`});continue}try{let t=await e.handler(a);if(t.success)this.log.trace({action:`inputEffect`,name:e.name,status:`success`,description:t.description}),t.modifiedFiles!=null&&t.modifiedFiles.length>0&&this.log.debug({action:`inputEffect`,name:e.name,modifiedFiles:t.modifiedFiles}),t.deletedFiles!=null&&t.deletedFiles.length>0&&this.log.debug({action:`inputEffect`,name:e.name,deletedFiles:t.deletedFiles});else{let n=t.error instanceof Error?t.error.message:String(t.error);this.log.error({action:`inputEffect`,name:e.name,status:`failed`,error:n})}n.push(t)}catch(t){let r=t instanceof Error?t.message:String(t);this.log.error({action:`inputEffect`,name:e.name,status:`failed`,error:r}),n.push({success:!1,error:t,description:`Input effect failed: ${e.name}`})}}return n}hasEffects(){return this.inputEffects.length>0}getEffectCount(){return this.inputEffects.length}registerScope(e,t){this.registeredScopes.push({namespace:e,values:t}),this.log.debug({action:`registerScope`,namespace:e,keys:Object.keys(t)})}getRegisteredScopes(){return this.registeredScopes}clearRegisteredScopes(){this.registeredScopes.length=0,this.log.debug({action:`clearRegisteredScopes`})}resolveBasePaths(e){let t=e.workspaceDir,n=this.resolvePath(t,``,``),r=e.shadowSourceProjectDir;return{workspaceDir:n,shadowProjectDir:this.resolvePath(r,n,``)}}resolvePath(e,t,n){let r=e;return r.startsWith(Jt.USER_HOME)&&(r=r.replace(Jt.USER_HOME,v.homedir())),r.includes(Jt.SHADOW_SOURCE_PROJECT)&&(r=r.replace(Jt.SHADOW_SOURCE_PROJECT,n)),r.includes(Jt.WORKSPACE)&&(r=r.replace(Jt.WORKSPACE,t)),g.normalize(r)}readAndParseMarkdown(e,t){return Kd(t.readFileSync(e,`utf-8`))}};const Zd=[`.qoderignore`,`.cursorignore`,`.warpindexignore`];var Qd=class extends X{constructor(){super(`AIAgentIgnoreConfigFileInputPlugin`)}collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i}=e,{shadowProjectDir:a}=this.resolveBasePaths(t),o=[];for(let e of Zd){let t=i.join(a,e);if(r.existsSync(t)&&r.statSync(t).isFile())try{let i=r.readFileSync(t,`utf-8`);o.push({fileName:e,content:i}),n.debug(`read ignore file`,{path:t})}catch(e){n.warn(`failed to read ignore file`,{path:t,error:e})}}return{aiAgentIgnoreConfigFiles:o}}};const $d=[`.qoderignore`,`.cursorignore`,`.warpindexignore`];var ef=class extends Jd{constructor(){super(`AIAgentIgnoreConfigFileOutputPlugin`)}async registerProjectOutputDirs(){return[]}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.dirFromWorkspacePath!=null&&e.isPromptSourceProject!==!0)for(let n of $d){let r=g.join(e.dirFromWorkspacePath.path,n);t.push({pathKind:N.Relative,path:r,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>g.basename(e.dirFromWorkspacePath.path),getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,r)})}return t}async registerGlobalOutputDirs(){return[]}async registerGlobalOutputFiles(){return[]}async canWrite(e){let{aiAgentIgnoreConfigFiles:t}=e.collectedInputContext;return t==null||t.length===0?(this.log.debug(`skipped`,{reason:`no ignore config files to write`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{aiAgentIgnoreConfigFiles:n}=e.collectedInputContext,r=[],i=[];if(n==null||n.length===0)return{files:r,dirs:i};for(let i of t){let t=i.dirFromWorkspacePath;if(t==null)continue;let a=i.name??`unknown`;for(let i of n){let n=await this.writeIgnoreFile(e,t,i,`project:${a}/${i.fileName}`);r.push(n)}}return{files:r,dirs:i}}async writeIgnoreFile(e,t,n,r){let i=g.join(t.path,n.fileName),a=g.join(t.basePath,i),o={pathKind:N.Relative,path:i,basePath:t.basePath,getDirectoryName:()=>g.basename(t.path),getAbsolutePath:()=>a};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`ignoreFile`,path:a,label:r}),{path:o,success:!0,skipped:!1};try{return h.writeFileSync(a,n.content,`utf-8`),this.log.trace({action:`write`,type:`ignoreFile`,path:a,label:r}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`ignoreFile`,path:a,label:r,error:t}),{path:o,success:!1,error:e}}}};function tf(e,t={}){let n={},{yamlFrontMatter:r,scope:i,filePath:a}=t;for(let t of e){let e=nf(t,i,a);Object.assign(n,e)}let o=Object.keys(n).length>0,s=r!=null&&Object.keys(r).length>0,c;return c=o&&s?`mixed`:o?`export`:`yaml`,{fields:{...r,...n},source:c}}function nf(e,t,n){let r={},i=e.value.trim(),a=/^export\s+default\s+/.exec(i);if(a!=null){let e=a[0].length,o=rf(i,e);if(o!=null)try{let e=af(o.trim(),t,n);typeof e==`object`&&e&&!Array.isArray(e)&&Object.assign(r,e)}catch(e){let t=e instanceof Error?e.message:String(e),r=n==null?``:` in file "${n}"`;throw Error(`Cannot statically evaluate export default${r}: ${t}`)}return r}let o=/export\s+const\s+(\w+)\s*=\s*/g,s=o.exec(i);for(;s!==null;){let e=s[1];if(e==null){s=o.exec(i);continue}let a=rf(i,s.index+s[0].length);if(a==null){s=o.exec(i);continue}try{let i=af(a.trim(),t,n);e===`metadata`&&typeof i==`object`&&i&&!Array.isArray(i)?Object.assign(r,i):r[e]=i}catch(t){let r=t instanceof Error?t.message:String(t),i=n==null?``:` in file "${n}"`;throw Error(`Cannot statically evaluate export "${e}"${i}: ${r}`)}s=o.exec(i)}return r}function rf(e,t){let n=0,r=null,i=!1,a=t;for(let o=t;o<e.length;o++){let t=e[o];if(i){i=!1;continue}if(t===`\\`){i=!0;continue}if(r!=null){t===r&&(r=null);continue}if(t===`"`||t===`'`||t==="`"){r=t;continue}if(t===`{`||t===`[`){n++;continue}if(t===`}`||t===`]`){n--;continue}if(n===0&&(t===`;`||t===`
281
+ `)){a=o;break}o===e.length-1&&(a=e.length)}a<=t&&(a=e.length);let o=e.slice(t,a).trim();return o.endsWith(`;`)?o.slice(0,-1).trim():o}function af(e,t,n){let r=e.trim();if(r===``)throw Error(`Empty value cannot be evaluated`);if(r===`true`)return!0;if(r===`false`)return!1;if(r===`null`)return null;if(/^-?\d+(?:\.\d+)?$/.test(r))return Number(r);if(r.startsWith(`"`)&&r.endsWith(`"`))return of(r.slice(1,-1),`"`);if(r.startsWith(`'`)&&r.endsWith(`'`))return of(r.slice(1,-1),`'`);if(r.startsWith("`")&&r.endsWith("`")){let e=r.slice(1,-1);if(/\$\{/.test(e))throw Error(`Template literal with expressions cannot be statically evaluated: ${r}`);return of(e,"`")}if(r.startsWith(`[`)&&r.endsWith(`]`))return cf(r,t,n);if(r.startsWith(`{`)&&r.endsWith(`}`))return lf(r,t,n);if(/^[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*$/i.test(r))return sf(r,t,n);let i=n==null?``:` in file "${n}"`;throw Error(`Expression "${r}" cannot be statically evaluated${i}`)}function of(e,t){return e.replace(/\\n/g,`
282
+ `).replace(/\\r/g,`\r`).replace(/\\t/g,` `).replace(/\\"/g,`"`).replace(/\\'/g,`'`).replace(/\\\\/g,`\\`)}function sf(e,t,n){if(t==null){let t=n==null?``:` in file "${n}"`;throw Error(`Variable reference "${e}" cannot be resolved without scope${t}`)}let r=e.split(`.`),i=r[0];if(i==null||!(i in t)){let r=n==null?``:` in file "${n}"`,a=Object.keys(t).join(`, `);throw Error(`Undefined namespace "${i}" in expression "${e}"${r}. Available: ${a}`)}let a=t[i];for(let t=1;t<r.length;t++){let i=r[t];if(i==null)continue;if(a==null){let t=n==null?``:` in file "${n}"`;throw Error(`Cannot read property "${i}" of null/undefined in "${e}"${t}`)}if(typeof a!=`object`){let t=n==null?``:` in file "${n}"`;throw Error(`Cannot read property "${i}" of ${typeof a} in "${e}"${t}`)}let o=a;if(!(i in o)){let t=n==null?``:` in file "${n}"`,r=Object.keys(o).join(`, `);throw Error(`Undefined property "${i}" in "${e}"${t}. Available: ${r}`)}a=o[i]}if(typeof a==`string`||typeof a==`number`||typeof a==`boolean`||a===null||Array.isArray(a)||typeof a==`object`&&a)return a;let o=n==null?``:` in file "${n}"`;throw Error(`Variable "${e}" resolved to unsupported type: ${typeof a}${o}`)}function cf(e,t,n){let r=e.slice(1,-1).trim();if(r===``)return[];if(t==null)try{let t=uf(e),n=JSON.parse(t);if(Array.isArray(n))return n}catch{}return df(r).map(e=>af(e.trim(),t,n))}function lf(e,t,n){let r=e.slice(1,-1).trim();if(r===``)return{};if(t==null)try{let t=uf(e),n=JSON.parse(t);if(typeof n==`object`&&n&&!Array.isArray(n))return n}catch{}let i={},a=ff(r);for(let e of a){let r=pf(e);if(r===-1)continue;let a=e.slice(0,r).trim(),o=e.slice(r+1).trim();(a.startsWith(`"`)&&a.endsWith(`"`)||a.startsWith(`'`)&&a.endsWith(`'`))&&(a=a.slice(1,-1)),i[a]=af(o,t,n)}return i}function uf(e){let t=``,n=null,r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(r){t+=a,r=!1;continue}if(a===`\\`){t+=a,r=!0;continue}if(n!=null){a===n?(t+=`"`,n=null):a===`"`&&n===`'`?t+=`\\"`:t+=a;continue}if(a===`"`||a===`'`){t+=`"`,n=a;continue}if(a===`:`&&i>0){let e=t.length-1;for(;e>=0&&/\s/.test(t.charAt(e));)e--;let n=e+1;for(;e>=0&&/[\w$]/.test(t.charAt(e));)e--;if(e++,e>0&&t.charAt(e-1)!==`"`){let r=t.slice(e,n);r.length>0&&/^[\w$]+$/.test(r)&&(t=`${t.slice(0,e)}"${r}"`)}}t+=a}return t}function df(e){let t=[],n=``,r=0,i=null,a=!1;for(let o of e){if(a){n+=o,a=!1;continue}if(o===`\\`){n+=o,a=!0;continue}if(i!=null){n+=o,o===i&&(i=null);continue}if(o===`"`||o===`'`||o==="`"){n+=o,i=o;continue}if(o===`[`||o===`{`){r++,n+=o;continue}if(o===`]`||o===`}`){r--,n+=o;continue}if(o===`,`&&r===0){n.trim()!==``&&t.push(n.trim()),n=``;continue}n+=o}return n.trim()!==``&&t.push(n.trim()),t}function ff(e){return df(e)}function pf(e){let t=null,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){n=!1;continue}if(i===`\\`){n=!0;continue}if(t!=null){i===t&&(t=null);continue}if(i===`"`||i===`'`||i==="`"){t=i;continue}if(i===`:`)return r}return-1}function mf(e,t){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`when`);if(n==null||n.type!==`mdxJsxAttribute`)return!0;if(typeof n.value==`string`)return n.value===`true`;if(n.value!=null&&typeof n.value==`object`&&n.value.type===`mdxJsxAttributeValueExpression`)try{let e=o(n.value.value,t.scope);return e===`true`||e===`1`}catch{return!1}return!1}async function hf(e,t,n){return!mf(e,t)||e.children.length===0?[]:n(e.children,t)}async function gf(e,t){if(!mf(e,t)||e.children.length===0)return[];let n=_f(e.children,t);return n===``?[]:[{type:`text`,value:n}]}function _f(e,t){let n=``;for(let r of e)if(r.type===`text`)n+=r.value;else if(r.type===`mdxTextExpression`)try{n+=o(r.value,t.scope)}catch{}else `children`in r&&Array.isArray(r.children)&&(n+=_f(r.children,t));return n}function vf(){i(`Md`,hf),i(`Md.Line`,gf)}function yf(e){return vu().use(nu).use(pl).use(ei,[`yaml`]).use(C).parse(e)}vf();function bf(e,t){let n={};if(e!=null&&(n.os={...e.os},n.env={...e.env},n.profile={...e.profile},n.tool={...e.tool}),t!=null)for(let[e,r]of Object.entries(t))typeof r==`object`&&r&&!Array.isArray(r)&&typeof n[e]==`object`&&n[e]!==null&&!Array.isArray(n[e])?n[e]={...n[e],...r}:n[e]=r;return n}async function xf(e,t){let n=yf(e),r=bf(t?.globalScope,t?.scope),i=c(),a;if(t?.extractMetadata===!0){let e=n.children.find(e=>e.type===`yaml`),i;if(e!=null)try{i=Ud.parse(e.value)}catch{}a=tf(n.children.filter(e=>e.type===`mdxjsEsm`),{...i!=null&&{yamlFrontMatter:i},scope:r,...t?.basePath!=null&&{filePath:t.basePath}}),n.children=n.children.filter(e=>e.type!==`yaml`&&e.type!==`mdxjsEsm`)}let o=await u(n,{scope:r,components:i,processingStack:[],...t?.basePath!=null&&{basePath:t.basePath}}),s=vu().use(ei,[`yaml`]).use(pl).use(S,{bullet:`-`,fence:"`",fences:!0,emphasis:`*`,strong:`*`,rule:`-`,handlers:{text(e){return e.value}}}).stringify(o).trim();return t?.extractMetadata===!0&&a!=null?{content:s,metadata:a}:s}const Sf=`CLAUDE.md`,Z=`.claude`,Cf=`commands`,wf=`agents`,Tf=`skills`,Ef=[Cf,wf,Tf];var Df=class extends Jd{constructor(){super(`ClaudeCodeCLIOutputPlugin`,{globalConfigDir:Z,outputFileName:Sf})}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.dirFromWorkspacePath!=null)for(let n of Ef){let r=g.join(e.dirFromWorkspacePath.path,Z,n);t.push({pathKind:N.Relative,path:r,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,r)})}return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{skills:r}=e.collectedInputContext;for(let e of n){if(e.rootMemoryPrompt!=null&&e.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,Sf)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,Sf));if(r!=null&&e.dirFromWorkspacePath!=null)for(let n of r){let r=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),i=g.join(e.dirFromWorkspacePath.path,Z,Tf,r);if(t.push({pathKind:N.Relative,path:g.join(i,`SKILL.md`),basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,i,`SKILL.md`)}),n.childDocs!=null)for(let a of n.childDocs){let n=a.dir.path.replace(/\.mdx$/,`.md`),o=g.join(i,n);t.push({pathKind:N.Relative,path:o,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,o)})}if(n.resources!=null)for(let a of n.resources){let n=g.join(i,a.relativePath);t.push({pathKind:N.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,n)})}}}return t}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext;if(t==null)return[];let n=this.getGlobalConfigDir();return[{pathKind:N.Relative,path:Sf,basePath:n,getDirectoryName:()=>Z,getAbsolutePath:()=>g.join(n,Sf)}]}async canWrite(e){let{workspace:t,globalMemory:n,fastCommands:r,subAgents:i,skills:a}=e.collectedInputContext,o=t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0),s=n!=null,c=(r?.length??0)>0,l=(i?.length??0)>0,u=(a?.length??0)>0;return!o&&!s&&!c&&!l&&!u?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{fastCommands:n,subAgents:r,skills:i}=e.collectedInputContext,a=[],o=[];for(let o of t){let t=o.name??`unknown`,s=o.dirFromWorkspacePath;if(s!=null){if(o.rootMemoryPrompt!=null){let n=await this.writePromptFile(e,s,o.rootMemoryPrompt.content,`project:${t}/root`);a.push(n)}if(o.childMemoryPrompts!=null)for(let n of o.childMemoryPrompts){let r=await this.writePromptFile(e,n.dir,n.content,`project:${t}/child:${n.workingChildDirectoryPath?.path??`unknown`}`);a.push(r)}if(n!=null)for(let t of n){let n=await this.writeFastCommand(e,s,t);a.push(...n)}if(r!=null)for(let t of r){let n=await this.writeSubAgent(e,s,t);a.push(...n)}if(i!=null)for(let t of i){let n=await this.writeSkill(e,s,t);a.push(...n)}}}return{files:a,dirs:o}}async writeGlobalOutputs(e){let{globalMemory:t}=e.collectedInputContext,n=[],r=[];if(t==null)return{files:n,dirs:r};let i=this.getGlobalConfigDir(),a=g.join(i,Sf),o={pathKind:N.Relative,path:Sf,basePath:i,getDirectoryName:()=>Z,getAbsolutePath:()=>a};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMemory`,path:a}),{files:[{path:o,success:!0,skipped:!1}],dirs:r};try{this.ensureDirectory(i),h.writeFileSync(a,t.content,`utf-8`),this.log.trace({action:`write`,type:`globalMemory`,path:a}),n.push({path:o,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:a,error:t}),n.push({path:o,success:!1,error:e})}return{files:n,dirs:r}}async writeFastCommand(e,t,n){let r=[],i=this.getTransformOptionsFromContext(e),a=this.transformFastCommandName(n,i),o=g.join(t.basePath,t.path,Z,Cf),s=g.join(o,a),c={pathKind:N.Relative,path:g.join(t.path,Z,Cf,a),basePath:t.basePath,getDirectoryName:()=>Cf,getAbsolutePath:()=>s},l=n.content,u=n.yamlFrontMatter,d=!1;if(n.rawMdxContent!=null){this.log.debug(`recompiling fast command with claudeCode preset`,{file:n.dir.getAbsolutePath(),hasRawContent:!0,rawContentLength:n.rawMdxContent.length});try{let e=new ar({toolPreset:`claudeCode`}).collect();this.log.debug(`claudeCode tool scope`,{tool:e.tool});let t=await xf(n.rawMdxContent,{globalScope:e,extractMetadata:!0,basePath:n.dir.basePath});l=t.content,u=t.metadata.fields,d=!0,this.log.debug(`recompiled front matter`,{frontMatter:u})}catch(e){this.log.warn(`failed to recompile fast command with claudeCode preset, using default`,{file:n.dir.getAbsolutePath(),error:e instanceof Error?e.message:String(e)})}}else this.log.debug(`no rawMdxContent available for fast command`,{file:n.dir.getAbsolutePath()});let f=d?this.buildMarkdownContent(l,u):this.buildMarkdownContentWithRaw(l,u,n.rawFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`fastCommand`,path:s}),[{path:c,success:!0,skipped:!1}];try{this.ensureDirectory(o),h.writeFileSync(s,f,`utf-8`),this.log.trace({action:`write`,type:`fastCommand`,path:s}),r.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`fastCommand`,path:s,error:t}),r.push({path:c,success:!1,error:e})}return r}async writeSubAgent(e,t,n){let r=[],i=n.dir.path.endsWith(`.md`)?n.dir.path:`${n.dir.path}.md`,a=g.join(t.basePath,t.path,Z,wf),o=g.join(a,i),s={pathKind:N.Relative,path:g.join(t.path,Z,wf,i),basePath:t.basePath,getDirectoryName:()=>wf,getAbsolutePath:()=>o},c=this.buildMarkdownContentWithRaw(n.content,n.yamlFrontMatter,n.rawFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`subAgent`,path:o}),[{path:s,success:!0,skipped:!1}];try{this.ensureDirectory(a),h.writeFileSync(o,c,`utf-8`),this.log.trace({action:`write`,type:`subAgent`,path:o}),r.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`subAgent`,path:o,error:t}),r.push({path:s,success:!1,error:e})}return r}async writeSkill(e,t,n){let r=[],i=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),a=g.join(t.basePath,t.path,Z,Tf,i),o=g.join(a,`SKILL.md`),s={pathKind:N.Relative,path:g.join(t.path,Z,Tf,i,`SKILL.md`),basePath:t.basePath,getDirectoryName:()=>i,getAbsolutePath:()=>o},c=this.buildMarkdownContentWithRaw(n.content,n.yamlFrontMatter,n.rawFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skill`,path:o}),[{path:s,success:!0,skipped:!1}];try{if(this.ensureDirectory(a),h.writeFileSync(o,c,`utf-8`),this.log.trace({action:`write`,type:`skill`,path:o}),r.push({path:s,success:!0}),n.childDocs!=null)for(let o of n.childDocs){let n=await this.writeSkillReferenceDocument(e,a,i,o,t);r.push(...n)}if(n.resources!=null)for(let o of n.resources){let n=await this.writeSkillResource(e,a,i,o,t);r.push(...n)}}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:o,error:t}),r.push({path:s,success:!1,error:e})}return r}async writeSkillReferenceDocument(e,t,n,r,i){let a=[],o=r.dir.path.replace(/\.mdx$/,`.md`),s=g.join(t,o),c={pathKind:N.Relative,path:g.join(i.path,Z,Tf,n,o),basePath:i.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>s};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillRefDoc`,path:s}),[{path:c,success:!0,skipped:!1}];try{let e=g.dirname(s);this.ensureDirectory(e),h.writeFileSync(s,r.content,`utf-8`),this.log.trace({action:`write`,type:`skillRefDoc`,path:s}),a.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillRefDoc`,path:s,error:t}),a.push({path:c,success:!1,error:e})}return a}async writeSkillResource(e,t,n,r,i){let a=[],o=g.join(t,r.relativePath),s={pathKind:N.Relative,path:g.join(i.path,Z,Tf,n,r.relativePath),basePath:i.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>o};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillResource`,path:o}),[{path:s,success:!0,skipped:!1}];try{let e=g.dirname(o);this.ensureDirectory(e),h.writeFileSync(o,r.content,`utf-8`),this.log.trace({action:`write`,type:`skillResource`,path:o}),a.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillResource`,path:o,error:t}),a.push({path:s,success:!1,error:e})}return a}};const Of=`AGENTS.md`,kf=`.codex`,Af=`prompts`,jf=`skills`,Mf=`SKILL.md`;var Nf=class extends Jd{constructor(){super(`CodexCLIOutputPlugin`,{globalConfigDir:kf,outputFileName:Of,dependsOn:[`AgentsOutputPlugin`]})}async registerProjectOutputDirs(){return[]}async registerProjectOutputFiles(){return[]}async registerGlobalOutputDirs(e){let t=this.getGlobalConfigDir(),n=[],r=g.join(t,Af);n.push({pathKind:N.Relative,path:Af,basePath:t,getDirectoryName:()=>Af,getAbsolutePath:()=>r});let{skills:i}=e.collectedInputContext;if(i!=null&&i.length>0)for(let e of i){let r=e.yamlFrontMatter?.name??e.dir.getDirectoryName(),i=g.join(t,jf,r);n.push({pathKind:N.Relative,path:g.join(jf,r),basePath:t,getDirectoryName:()=>r,getAbsolutePath:()=>i})}return n}async registerGlobalOutputFiles(){let e=this.getGlobalConfigDir();return[{pathKind:N.Relative,path:Of,basePath:e,getDirectoryName:()=>kf,getAbsolutePath:()=>g.join(e,Of)}]}async canWrite(e){let{globalMemory:t,fastCommands:n,skills:r}=e.collectedInputContext,i=t!=null,a=(n?.length??0)>0,o=(r?.length??0)>0;return!i&&!a&&!o?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(){return{files:[],dirs:[]}}async writeGlobalOutputs(e){let{globalMemory:t,fastCommands:n,skills:r}=e.collectedInputContext,i=[],a=[];if(t!=null){let n=this.getGlobalConfigDir(),r=g.join(n,Of),a={pathKind:N.Relative,path:Of,basePath:n,getDirectoryName:()=>kf,getAbsolutePath:()=>r};if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`globalMemory`,path:r}),i.push({path:a,success:!0,skipped:!1});else try{this.ensureDirectory(n),h.writeFileSync(r,t.content,`utf-8`),this.log.trace({action:`write`,type:`globalMemory`,path:r}),i.push({path:a,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:r,error:t}),i.push({path:a,success:!1,error:e})}}if(n!=null&&n.length>0){let t=this.getGlobalConfigDir();for(let r of n){let n=await this.writeGlobalFastCommand(e,t,r);i.push(...n)}}if(r!=null&&r.length>0){let t=this.getGlobalConfigDir();for(let n of r){let r=await this.writeGlobalSkill(e,t,n);i.push(...r)}}return{files:i,dirs:a}}async writeGlobalFastCommand(e,t,n){let r=[],i=this.getTransformOptionsFromContext(e),a=this.transformFastCommandName(n,i),o=g.join(t,Af),s=g.join(o,a),c={pathKind:N.Relative,path:g.join(Af,a),basePath:t,getDirectoryName:()=>Af,getAbsolutePath:()=>s},l=this.buildMarkdownContentWithRaw(n.content,n.yamlFrontMatter,n.rawFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalFastCommand`,path:s}),[{path:c,success:!0,skipped:!1}];try{this.ensureDirectory(o),h.writeFileSync(s,l,`utf-8`),this.log.trace({action:`write`,type:`globalFastCommand`,path:s}),r.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalFastCommand`,path:s,error:t}),r.push({path:c,success:!1,error:e})}return r}async writeGlobalSkill(e,t,n){let r=[],i=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),a=g.join(t,jf,i),o=g.join(a,Mf),s={pathKind:N.Relative,path:g.join(jf,i,Mf),basePath:t,getDirectoryName:()=>i,getAbsolutePath:()=>o},c=this.buildCodexSkillContent(n);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalSkill`,path:o}),[{path:s,success:!0,skipped:!1}];try{if(this.ensureDirectory(a),h.writeFileSync(o,c,`utf-8`),this.log.trace({action:`write`,type:`globalSkill`,path:o}),r.push({path:s,success:!0}),n.childDocs!=null)for(let o of n.childDocs){let n=await this.writeSkillReferenceDocument(e,a,i,o,t);r.push(...n)}if(n.resources!=null)for(let o of n.resources){let n=await this.writeSkillResource(e,a,i,o,t);r.push(...n)}}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalSkill`,path:o,error:t}),r.push({path:s,success:!1,error:e})}return r}buildCodexSkillContent(e){let t=e.yamlFrontMatter,n=this.normalizeSkillName(t.name,64),r=this.normalizeToSingleLine(t.description,1024),i={};t.displayName!=null&&(i[`short-description`]=t.displayName),t.version!=null&&(i.version=t.version),t.author!=null&&(i.author=t.author),t.keywords!=null&&t.keywords.length>0&&(i.keywords=[...t.keywords]);let a={name:n,description:r};return Object.keys(i).length>0&&(a.metadata=i),t.allowTools!=null&&t.allowTools.length>0&&(a[`allowed-tools`]=t.allowTools.join(` `)),Gd(a,e.content)}normalizeSkillName(e,t){let n=e.toLowerCase().replace(/[^a-z0-9-]/g,`-`).replace(/-+/g,`-`).replace(/^-+|-+$/g,``);return n.length>t&&(n=n.slice(0,t).replace(/-+$/,``)),n}normalizeToSingleLine(e,t){let n=e.replace(/[\r\n]+/g,` `).replace(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-3)}...`:n}async writeSkillReferenceDocument(e,t,n,r,i){let a=[],o=r.dir.path.replace(/\.mdx$/,`.md`),s=g.join(t,o),c={pathKind:N.Relative,path:g.join(jf,n,o),basePath:i,getDirectoryName:()=>n,getAbsolutePath:()=>s};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillRefDoc`,path:s}),[{path:c,success:!0,skipped:!1}];try{let e=g.dirname(s);this.ensureDirectory(e),h.writeFileSync(s,r.content,`utf-8`),this.log.trace({action:`write`,type:`skillRefDoc`,path:s}),a.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillRefDoc`,path:s,error:t}),a.push({path:c,success:!1,error:e})}return a}async writeSkillResource(e,t,n,r,i){let a=[],o=g.join(t,r.relativePath),s={pathKind:N.Relative,path:g.join(jf,n,r.relativePath),basePath:i,getDirectoryName:()=>n,getAbsolutePath:()=>o};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillResource`,path:o}),[{path:s,success:!0,skipped:!1}];try{let e=g.dirname(o);this.ensureDirectory(e),h.writeFileSync(o,r.content,`utf-8`),this.log.trace({action:`write`,type:`skillResource`,path:o}),a.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillResource`,path:o,error:t}),a.push({path:s,success:!1,error:e})}return a}};const Pf=`AGENTS.md`,Q=`.factory`,Ff=`commands`,If=`agents`,Lf=`skills`,Rf=[Ff,If,Lf];var zf=class extends Jd{constructor(){super(`DroidCLIOutputPlugin`,{globalConfigDir:Q,outputFileName:Pf})}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.dirFromWorkspacePath!=null)for(let n of Rf){let r=g.join(e.dirFromWorkspacePath.path,Q,n);t.push({pathKind:N.Relative,path:r,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,r)})}return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{skills:r}=e.collectedInputContext;for(let e of n)if(e.dirFromWorkspacePath!=null&&r!=null)for(let n of r){let r=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),i=g.join(e.dirFromWorkspacePath.path,Q,Lf,r);if(t.push({pathKind:N.Relative,path:g.join(i,`SKILL.md`),basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,i,`SKILL.md`)}),n.childDocs!=null)for(let a of n.childDocs){let n=a.dir.path.replace(/\.mdx$/,`.md`),o=g.join(i,n);t.push({pathKind:N.Relative,path:o,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,o)})}if(n.resources!=null)for(let a of n.resources){let n=g.join(i,a.relativePath);t.push({pathKind:N.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>r,getAbsolutePath:()=>g.join(e.dirFromWorkspacePath.basePath,n)})}}return t}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext;if(t==null)return[];let n=this.getGlobalConfigDir();return[{pathKind:N.Relative,path:Pf,basePath:n,getDirectoryName:()=>Q,getAbsolutePath:()=>g.join(n,Pf)}]}async canWrite(e){let{globalMemory:t,fastCommands:n,subAgents:r,skills:i}=e.collectedInputContext,a=t!=null,o=(n?.length??0)>0,s=(r?.length??0)>0,c=(i?.length??0)>0;return!a&&!o&&!s&&!c?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{fastCommands:n,subAgents:r,skills:i}=e.collectedInputContext,a=[],o=[];for(let o of t){let t=o.dirFromWorkspacePath;if(t!=null){if(n!=null)for(let r of n){let n=await this.writeFastCommand(e,t,r);a.push(...n)}if(r!=null)for(let n of r){let r=await this.writeSubAgent(e,t,n);a.push(...r)}if(i!=null)for(let n of i){let r=await this.writeSkill(e,t,n);a.push(...r)}}}return{files:a,dirs:o}}async writeGlobalOutputs(e){let{globalMemory:t}=e.collectedInputContext,n=[],r=[];if(t==null)return{files:n,dirs:r};let i=this.getGlobalConfigDir(),a=g.join(i,Pf),o={pathKind:N.Relative,path:Pf,basePath:i,getDirectoryName:()=>Q,getAbsolutePath:()=>a};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMemory`,path:a}),{files:[{path:o,success:!0,skipped:!1}],dirs:r};try{this.ensureDirectory(i),h.writeFileSync(a,t.content,`utf-8`),this.log.trace({action:`write`,type:`globalMemory`,path:a}),n.push({path:o,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:a,error:t}),n.push({path:o,success:!1,error:e})}return{files:n,dirs:r}}async writeFastCommand(e,t,n){let r=[],i=this.getTransformOptionsFromContext(e),a=this.transformFastCommandName(n,i),o=g.join(t.basePath,t.path,Q,Ff),s=g.join(o,a),c={pathKind:N.Relative,path:g.join(t.path,Q,Ff,a),basePath:t.basePath,getDirectoryName:()=>Ff,getAbsolutePath:()=>s},l=this.buildMarkdownContentWithRaw(n.content,n.yamlFrontMatter,n.rawFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`fastCommand`,path:s}),[{path:c,success:!0,skipped:!1}];try{this.ensureDirectory(o),h.writeFileSync(s,l,`utf-8`),this.log.trace({action:`write`,type:`fastCommand`,path:s}),r.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`fastCommand`,path:s,error:t}),r.push({path:c,success:!1,error:e})}return r}async writeSubAgent(e,t,n){let r=[],i=n.dir.path.endsWith(`.md`)?n.dir.path:`${n.dir.path}.md`,a=g.join(t.basePath,t.path,Q,If),o=g.join(a,i),s={pathKind:N.Relative,path:g.join(t.path,Q,If,i),basePath:t.basePath,getDirectoryName:()=>If,getAbsolutePath:()=>o},c=this.buildMarkdownContentWithRaw(n.content,n.yamlFrontMatter,n.rawFrontMatter);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`subAgent`,path:o}),[{path:s,success:!0,skipped:!1}];try{this.ensureDirectory(a),h.writeFileSync(o,c,`utf-8`),this.log.trace({action:`write`,type:`subAgent`,path:o}),r.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`subAgent`,path:o,error:t}),r.push({path:s,success:!1,error:e})}return r}async writeSkill(e,t,n){let r=[],i=n.yamlFrontMatter?.name??n.dir.getDirectoryName(),a=g.join(t.basePath,t.path,Q,Lf,i),o=g.join(a,`SKILL.md`),s={pathKind:N.Relative,path:g.join(t.path,Q,Lf,i,`SKILL.md`),basePath:t.basePath,getDirectoryName:()=>i,getAbsolutePath:()=>o},c=n.yamlFrontMatter==null?void 0:{name:n.yamlFrontMatter.name,description:n.yamlFrontMatter.description},l=this.buildMarkdownContent(n.content,c);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skill`,path:o}),[{path:s,success:!0,skipped:!1}];try{if(this.ensureDirectory(a),h.writeFileSync(o,l,`utf-8`),this.log.trace({action:`write`,type:`skill`,path:o}),r.push({path:s,success:!0}),n.childDocs!=null)for(let o of n.childDocs){let n=await this.writeSkillReferenceDocument(e,a,i,o,t);r.push(...n)}if(n.resources!=null)for(let o of n.resources){let n=await this.writeSkillResource(e,a,i,o,t);r.push(...n)}}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:o,error:t}),r.push({path:s,success:!1,error:e})}return r}async writeSkillReferenceDocument(e,t,n,r,i){let a=[],o=r.dir.path.replace(/\.mdx$/,`.md`),s=g.join(t,o),c={pathKind:N.Relative,path:g.join(i.path,Q,Lf,n,o),basePath:i.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>s};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillRefDoc`,path:s}),[{path:c,success:!0,skipped:!1}];try{let e=g.dirname(s);this.ensureDirectory(e),h.writeFileSync(s,r.content,`utf-8`),this.log.trace({action:`write`,type:`skillRefDoc`,path:s}),a.push({path:c,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillRefDoc`,path:s,error:t}),a.push({path:c,success:!1,error:e})}return a}async writeSkillResource(e,t,n,r,i){let a=[],o=g.join(t,r.relativePath),s={pathKind:N.Relative,path:g.join(i.path,Q,Lf,n,r.relativePath),basePath:i.basePath,getDirectoryName:()=>n,getAbsolutePath:()=>o};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`skillResource`,path:o}),[{path:s,success:!0,skipped:!1}];try{let e=g.dirname(o);this.ensureDirectory(e),h.writeFileSync(o,r.content,`utf-8`),this.log.trace({action:`write`,type:`skillResource`,path:o}),a.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillResource`,path:o,error:t}),a.push({path:s,success:!1,error:e})}return a}},Bf=class extends X{constructor(){super(`FastCommandInputPlugin`)}extractSeriesInfo(e){let t=e.replace(/\.mdx$/,``),n=t.indexOf(`_`);return n===-1?{commandName:t}:{series:t.substring(0,n),commandName:t.substring(n+1)}}async collect(e){let{userConfigOptions:n,logger:r,globalScope:i}=e,{workspaceDir:a,shadowProjectDir:o}=this.resolveBasePaths(n),s=n.shadowFastCommandDir,c=this.resolvePath(s,a,o),l=[];if(e.fs.existsSync(c)&&e.fs.statSync(c).isDirectory()){let n=e.fs.readdirSync(c,{withFileTypes:!0});for(let a of n)if(a.isFile()&&a.name.endsWith(`.mdx`)){let n=e.path.join(c,a.name);try{let o=e.fs.readFileSync(n,`utf-8`),s=Kd(o),u=await xf(o,{globalScope:i,extractMetadata:!0,basePath:c}),d=s.yamlFrontMatter!=null||Object.keys(u.metadata.fields).length>0?{...s.yamlFrontMatter,...u.metadata.fields}:void 0;if(d!=null){let e=Ft(d,n);for(let t of e.warnings)r.debug(t);if(!e.valid)throw new t(e.errors,n)}let f=u.content,p=this.extractSeriesInfo(a.name);r.debug(`fast command metadata extracted`,{command:a.name,source:u.metadata.source,hasYaml:s.yamlFrontMatter!=null,hasExport:Object.keys(u.metadata.fields).length>0}),l.push({type:Ot.FastCommand,content:f,length:f.length,filePathKind:N.Relative,...d!=null&&{yamlFrontMatter:d},...s.rawFrontMatter!=null&&{rawFrontMatter:s.rawFrontMatter},markdownAst:s.markdownAst,markdownContents:s.markdownContents,dir:{pathKind:N.Relative,path:a.name,basePath:c,getDirectoryName:()=>a.name.replace(/\.mdx$/,``),getAbsolutePath:()=>n},...p.series!=null&&{series:p.series},commandName:p.commandName,rawMdxContent:o})}catch(e){r.error(`failed to parse fast command`,{file:n,error:e})}}}return{fastCommands:l}}};const Vf=`GEMINI.md`,Hf=`.gemini`;var Uf=class extends Jd{constructor(){super(`GeminiCLIOutputPlugin`,{globalConfigDir:Hf,outputFileName:Vf})}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.rootMemoryPrompt!=null&&e.dirFromWorkspacePath!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,Vf)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,Vf));return t}async registerGlobalOutputFiles(e){let{globalMemory:t}=e.collectedInputContext;if(t==null)return[];let n=this.getGlobalConfigDir();return[{pathKind:N.Relative,path:Vf,basePath:n,getDirectoryName:()=>Hf,getAbsolutePath:()=>g.join(n,Vf)}]}async canWrite(e){let{workspace:t,globalMemory:n}=e.collectedInputContext;return!t.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0)&&n==null?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],r=[];for(let r of t){let t=r.name??`unknown`,i=r.dirFromWorkspacePath;if(i!=null){if(r.rootMemoryPrompt!=null){let a=await this.writePromptFile(e,i,r.rootMemoryPrompt.content,`project:${t}/root`);n.push(a)}if(r.childMemoryPrompts!=null)for(let i of r.childMemoryPrompts){let r=await this.writePromptFile(e,i.dir,i.content,`project:${t}/child:${i.workingChildDirectoryPath?.path??`unknown`}`);n.push(r)}}}return{files:n,dirs:r}}async writeGlobalOutputs(e){let{globalMemory:t}=e.collectedInputContext,n=[],r=[];if(t==null)return{files:n,dirs:r};let i=this.getGlobalConfigDir(),a=g.join(i,Vf),o={pathKind:N.Relative,path:Vf,basePath:i,getDirectoryName:()=>Hf,getAbsolutePath:()=>a};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMemory`,path:a}),{files:[{path:o,success:!0,skipped:!1}],dirs:r};try{this.ensureDirectory(i),h.writeFileSync(a,t.content,`utf-8`),this.log.trace({action:`write`,type:`globalMemory`,path:a}),n.push({path:o,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:a,error:t}),n.push({path:o,success:!1,error:e})}return{files:n,dirs:r}}};const Wf=`.skills`,Gf=`SKILL.md`,Kf=`mcp.json`;var qf=class extends Jd{constructor(){super(`GenericSkillsOutputPlugin`,{globalConfigDir:``,outputFileName:Gf})}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{skills:r}=e.collectedInputContext;if(r==null||r.length===0)return t;for(let e of n){if(e.dirFromWorkspacePath==null)continue;let n=this.joinPath(e.dirFromWorkspacePath.path,Wf);t.push({pathKind:N.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>Wf,getAbsolutePath:()=>this.joinPath(e.dirFromWorkspacePath.basePath,n)})}return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{skills:r}=e.collectedInputContext;if(r==null||r.length===0)return t;for(let e of n){if(e.dirFromWorkspacePath==null)continue;let n=this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path,Wf);for(let i of r){let r=i.yamlFrontMatter.name,a=this.joinPath(n,r);if(t.push({pathKind:N.Relative,path:this.joinPath(Wf,r,Gf),basePath:this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path),getDirectoryName:()=>r,getAbsolutePath:()=>this.joinPath(a,Gf)}),i.mcpConfig!=null&&t.push({pathKind:N.Relative,path:this.joinPath(Wf,r,Kf),basePath:this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path),getDirectoryName:()=>r,getAbsolutePath:()=>this.joinPath(a,Kf)}),i.childDocs!=null)for(let n of i.childDocs){let i=n.relativePath.replace(/\.mdx$/,`.md`);t.push({pathKind:N.Relative,path:this.joinPath(Wf,r,i),basePath:this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path),getDirectoryName:()=>r,getAbsolutePath:()=>this.joinPath(a,i)})}if(i.resources!=null)for(let n of i.resources)t.push({pathKind:N.Relative,path:this.joinPath(Wf,r,n.relativePath),basePath:this.joinPath(e.dirFromWorkspacePath.basePath,e.dirFromWorkspacePath.path),getDirectoryName:()=>r,getAbsolutePath:()=>this.joinPath(a,n.relativePath)})}}return t}async registerGlobalOutputDirs(){return[]}async registerGlobalOutputFiles(){return[]}async canWrite(e){let{skills:t}=e.collectedInputContext,{projects:n}=e.collectedInputContext.workspace;return t==null||t.length===0?(this.log.trace({action:`skip`,reason:`noSkills`}),!1):n.length===0?(this.log.trace({action:`skip`,reason:`noProjects`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{skills:n}=e.collectedInputContext,r=[],i=[];if(n==null||n.length===0)return{files:r,dirs:i};for(let i of t){if(i.dirFromWorkspacePath==null)continue;let t=this.joinPath(i.dirFromWorkspacePath.basePath,i.dirFromWorkspacePath.path,Wf);for(let i of n){let n=await this.writeSkill(e,i,t);r.push(...n)}}return{files:r,dirs:i}}async writeGlobalOutputs(){return{files:[],dirs:[]}}async writeSkill(e,t,n){let r=[],i=t.yamlFrontMatter.name,a=this.joinPath(n,i),o=this.joinPath(a,Gf),s={pathKind:N.Relative,path:Gf,basePath:a,getDirectoryName:()=>i,getAbsolutePath:()=>o},c=this.buildSkillFrontMatter(t),l=t.content,u=Gd(c,l);if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`skill`,path:o}),r.push({path:s,success:!0,skipped:!1});else try{this.ensureDirectory(a),this.writeFileSync(o,u),this.log.trace({action:`write`,type:`skill`,path:o}),r.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skill`,path:o,error:t}),r.push({path:s,success:!1,error:e})}if(t.mcpConfig!=null){let n=await this.writeMcpConfig(e,t,a);r.push(n)}if(t.childDocs!=null)for(let n of t.childDocs){let t=await this.writeChildDoc(e,n,a,i);r.push(t)}if(t.resources!=null)for(let n of t.resources){let t=await this.writeResource(e,n,a,i);r.push(t)}return r}buildSkillFrontMatter(e){let t=e.yamlFrontMatter;return{name:t.name,description:t.description,...t.displayName!=null&&{displayName:t.displayName},...t.keywords!=null&&t.keywords.length>0&&{keywords:t.keywords},...t.author!=null&&{author:t.author},...t.version!=null&&{version:t.version},...t.allowTools!=null&&t.allowTools.length>0&&{allowTools:t.allowTools}}}async writeMcpConfig(e,t,n){let r=t.yamlFrontMatter.name,i=this.joinPath(n,Kf),a={pathKind:N.Relative,path:Kf,basePath:n,getDirectoryName:()=>r,getAbsolutePath:()=>i},o=t.mcpConfig.rawContent;if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpConfig`,path:i}),{path:a,success:!0,skipped:!1};try{return this.ensureDirectory(n),this.writeFileSync(i,o),this.log.trace({action:`write`,type:`mcpConfig`,path:i}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`mcpConfig`,path:i,error:t}),{path:a,success:!1,error:e}}}async writeChildDoc(e,t,n,r){let i=t.relativePath.replace(/\.mdx$/,`.md`),a=this.joinPath(n,i),o={pathKind:N.Relative,path:i,basePath:n,getDirectoryName:()=>r,getAbsolutePath:()=>a},s=t.content;if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`childDoc`,path:a}),{path:o,success:!0,skipped:!1};try{let e=this.dirname(a);return this.ensureDirectory(e),this.writeFileSync(a,s),this.log.trace({action:`write`,type:`childDoc`,path:a}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`childDoc`,path:a,error:t}),{path:o,success:!1,error:e}}}async writeResource(e,t,n,r){let i=this.joinPath(n,t.relativePath),a={pathKind:N.Relative,path:t.relativePath,basePath:n,getDirectoryName:()=>r,getAbsolutePath:()=>i};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`resource`,path:i}),{path:a,success:!0,skipped:!1};try{let e=this.dirname(i);if(this.ensureDirectory(e),t.encoding===`base64`){let e=w.from(t.content,`base64`);this.writeFileSyncBuffer(i,e)}else this.writeFileSync(i,t.content);return this.log.trace({action:`write`,type:`resource`,path:i}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`resource`,path:i,error:t}),{path:a,success:!1,error:e}}}},Jf=class extends X{constructor(){super(`GlobalMemoryInputPlugin`)}async collect(e){let{userConfigOptions:t,fs:n,path:r,globalScope:i}=e,{workspaceDir:a,shadowProjectDir:o}=this.resolveBasePaths(t),s=t.globalMemoryFile,c=this.resolvePath(s,a,o);if(!n.existsSync(c))return this.log.warn({action:`collect`,reason:`fileNotFound`,path:c}),{};if(!n.statSync(c).isFile())return this.log.warn({action:`collect`,reason:`notAFile`,path:c}),{};let l=n.readFileSync(c,`utf-8`),u=Kd(l),f;if(i!=null)try{f=await xf(l,{globalScope:i,basePath:r.dirname(c)})}catch(e){throw e instanceof d&&(this.log.error(`MDX compilation failed: ${e.message}`),this.log.error(`Please check your configuration file (~/.aindex/.tnmsc.json) and ensure all required variables are defined.`),this.log.error(`For example, if using {profile.name}, add a "profile" section with "name" field to your config.`),m.exit(1)),e}else f=u.contentWithoutFrontMatter;return this.log.debug({action:`collect`,path:c,contentLength:f.length}),{globalMemory:{type:Ot.GlobalMemory,content:f,length:f.length,filePathKind:N.Relative,...u.rawFrontMatter!=null&&{rawFrontMatter:u.rawFrontMatter},markdownAst:u.markdownAst,markdownContents:u.markdownContents,dir:{pathKind:N.Relative,path:r.basename(c),basePath:r.dirname(c),getDirectoryName:()=>r.basename(c),getAbsolutePath:()=>c},parentDirectoryPath:{type:Mt.UserHome,directory:{pathKind:N.Relative,path:``,basePath:v.homedir(),getDirectoryName:()=>r.basename(v.homedir()),getAbsolutePath:()=>v.homedir()}}}}}},Yf=class extends X{constructor(){super(`IdeConfigInputPlugin`)}collect(e){let{userConfigOptions:t,fs:n,path:r}=e,{shadowProjectDir:i}=this.resolveBasePaths(t),a=[`.editorconfig`,`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`,`.vscode/settings.json`,`.vscode/extensions.json`],o=[];for(let e of a){let t=r.join(i,e);if(n.existsSync(t)&&n.statSync(t).isFile()){let i=n.readFileSync(t,`utf-8`),a=P.Original;e.includes(`.vscode`)?a=P.VSCode:e.includes(`.idea`)?a=P.IntellijIDEA:e.includes(`.editorconfig`)&&(a=P.EditorConfig),o.push({type:a,content:i,length:i.length,filePathKind:N.Absolute,dir:{pathKind:N.Absolute,path:t,getDirectoryName:()=>r.basename(t)}})}}return{ideConfigFiles:o}}};const Xf=`.idea`,Zf=[`.editorconfig`,`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`];var Qf=class extends Jd{constructor(){super(`JetBrainsIDECodeStyleConfigOutputPlugin`)}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{ideConfigFiles:r}=e.collectedInputContext;if(!r.some(e=>e.type===P.IntellijIDEA||e.type===P.EditorConfig))return t;for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null&&e.isPromptSourceProject!==!0)for(let e of Zf){let r=this.joinPath(n.path,e);t.push({pathKind:N.Relative,path:r,basePath:n.basePath,getDirectoryName:()=>this.dirname(e),getAbsolutePath:()=>this.resolvePath(n.basePath,r)})}}return t}async canWrite(e){let{ideConfigFiles:t}=e.collectedInputContext;return t.some(e=>e.type===P.IntellijIDEA||e.type===P.EditorConfig)?!0:(this.log.debug(`skipped`,{reason:`no JetBrains IDE config files found`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{ideConfigFiles:n}=e.collectedInputContext,r=[],i=[],a=n.filter(e=>e.type===P.IntellijIDEA||e.type===P.EditorConfig);for(let n of t){let t=n.dirFromWorkspacePath;if(t==null)continue;let i=n.name??`unknown`;for(let n of a){let a=await this.writeConfigFile(e,t,n,`project:${i}`);r.push(a)}}return{files:r,dirs:i}}async writeConfigFile(e,t,n,r){let i=this.getTargetRelativePath(n),a=this.resolvePath(t.basePath,t.path,i),o={pathKind:N.Relative,path:this.joinPath(t.path,i),basePath:t.basePath,getDirectoryName:()=>this.dirname(i),getAbsolutePath:()=>a};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`config`,path:a,label:r}),{path:o,success:!0,skipped:!1};try{let e=this.dirname(a);return this.ensureDirectory(e),this.writeFileSync(a,n.content),this.log.trace({action:`write`,type:`config`,path:a,label:r}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`config`,path:a,label:r,error:t}),{path:o,success:!1,error:e}}}getTargetRelativePath(e){let t=e.dir.path;if(e.type===P.EditorConfig)return`.editorconfig`;if(e.type===P.IntellijIDEA){let e=t.indexOf(Xf);return e===-1?this.joinPath(Xf,`codeStyles`,this.basename(t)):t.substring(e)}return this.basename(t)}},$f=class{registryPath;log;constructor(e,t){this.registryPath=this.resolvePath(e),this.log=t??Fn(this.constructor.name)}resolvePath(e){return e.startsWith(`~`)?g.join(v.homedir(),e.slice(1)):g.resolve(e)}getRegistryDir(){return g.dirname(this.registryPath)}ensureRegistryDir(){let e=this.getRegistryDir();h.existsSync(e)||h.mkdirSync(e,{recursive:!0})}read(){if(!h.existsSync(this.registryPath))return this.log.debug(`registry not found`,{path:this.registryPath}),this.createInitialRegistry();try{let e=h.readFileSync(this.registryPath,`utf-8`);return JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error(`parse failed`,{path:this.registryPath,error:t}),this.createInitialRegistry()}}write(e,t){let n={...e,lastUpdated:new Date().toISOString()};if(t===!0)return this.log.trace({action:`dryRun`,type:`registry`,path:this.registryPath}),!0;let r=`${this.registryPath}.tmp.${Date.now()}`;try{this.ensureRegistryDir();let e=JSON.stringify(n,null,2);return h.writeFileSync(r,e,`utf-8`),h.renameSync(r,this.registryPath),this.log.trace({action:`write`,type:`registry`,path:this.registryPath}),!0}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`registry`,path:this.registryPath,error:t});try{h.existsSync(r)&&h.unlinkSync(r)}catch{}return!1}}register(e,t){let n=[],r=this.read(),i=this.merge(r,e),a=this.write(i,t);for(let r of e){let e=this.getEntryName(r);a?(n.push({success:!0,entryName:e}),t===!0?this.log.trace({action:`dryRun`,type:`registerEntry`,entryName:e}):this.log.trace({action:`register`,type:`entry`,entryName:e})):(n.push({success:!1,entryName:e,error:Error(`Failed to write registry file`)}),this.log.error(`register entry failed`,{entryName:e}))}return n}generateEntryId(e){let t=`${Date.now()}-${Math.random().toString(36).substring(2,8)}`;return e==null?t:`${e}-${t}`}},ep=class e extends $f{static REGISTRY_PATH=`~/.kiro/powers/registry.json`;static DEFAULT_VERSION=`1.0.0`;constructor(t){super(e.REGISTRY_PATH,t)}createInitialRegistry(){return{version:e.DEFAULT_VERSION,powers:{},repoSources:{},lastUpdated:new Date().toISOString()}}getEntryName(e){return e.name}merge(e,t){let n={...e.powers},r={...e.repoSources};for(let e of t){n[e.name]=e;let t=this.buildRepoSource(e),i=e.source.repoId??e.name;r[i]=t}return{version:e.version,powers:n,repoSources:r,...e.kiroRecommendedRepo!=null&&{kiroRecommendedRepo:e.kiroRecommendedRepo},lastUpdated:e.lastUpdated}}buildPowerEntry(e,t){let{yamlFrontMatter:n,mcpConfig:r}=e,i={type:`repo`,repoId:this.generateEntryId(`local`),repoName:t},a=r==null?null:Object.keys(r.mcpServers);return{name:n.name,description:n.description,...a!=null&&a.length>0&&{mcpServers:a},...n.author!=null&&{author:n.author},keywords:n.keywords??[],...n.displayName!=null&&{displayName:n.displayName},installed:!0,installedAt:new Date().toISOString(),installPath:t,source:i,sourcePath:t}}getOfficialRegistry(){try{return JSON.parse({version:`1.0.0`,powers:{postman:{name:`postman`,description:`Automate API testing and collection management with Postman - create workspaces, collections, environments, and run tests programmatically`,displayName:`API Testing with Postman`,author:`Postman`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/postman.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/postman`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`postman`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},figma:{name:`figma`,description:`Connect Figma designs to code components - automatically generate design system rules, map UI components to Figma designs, and maintain design-code consistency`,displayName:`Design to Code with Figma`,author:`Figma`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/figma.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/figma`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`figma`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"netlify-deployment":{name:`netlify-deployment`,description:`Deploy React, Next.js, Vue, and other modern web apps to Netlify's global CDN with automatic builds.`,displayName:`Deploy web apps with Netlify`,author:`Netlify`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/netlify.png`,repositoryUrl:`https://github.com/netlify/context-and-tools/tree/main/context/steering/netlify-deployment-power`,license:``,repositoryCloneUrl:`git@github.com:netlify/context-and-tools.git`,pathInRepo:`context/steering/netlify-deployment-power`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"amazon-aurora-postgresql":{name:`amazon-aurora-postgresql`,description:`Build applications backed by Aurora PostgreSQL by leveraging Aurora PostgreSQL specific best practices.`,displayName:`Build applications with Aurora PostgreSQL`,author:`AWS`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/amazon-aurora.png`,repositoryUrl:`https://github.com/awslabs/mcp/tree/main/src/postgres-mcp-server/kiro_power`,license:``,repositoryCloneUrl:`git@github.com:awslabs/mcp.git`,pathInRepo:`src/postgres-mcp-server/kiro_power`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"supabase-hosted":{name:`supabase-hosted`,description:`Build applications with Supabase's Postgres database, authentication, storage, and real-time subscriptions`,displayName:`Build a backend with Supabase`,author:`Supabase`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/supabase.png`,repositoryUrl:`https://github.com/supabase-community/kiro-powers/tree/main/powers/supabase-hosted`,license:``,repositoryCloneUrl:`git@github.com:supabase-community/kiro-powers.git`,pathInRepo:`powers/supabase-hosted`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"supabase-local":{name:`supabase-local`,description:`Local development with Supabase allows you to work on your projects in a self-contained environment on your local machine.`,displayName:`Build a backend (local) with Supabase`,author:`Supabase`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/supabase.png`,repositoryUrl:`https://github.com/supabase-community/kiro-powers/tree/main/powers/supabase-local`,license:``,repositoryCloneUrl:`git@github.com:supabase-community/kiro-powers.git`,pathInRepo:`powers/supabase-local`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},terraform:{name:`terraform`,description:`Build and manage Infrastructure as Code with Terraform - access registry providers, modules, policies, and HCP Terraform workflow management`,displayName:`Deploy infrastructure with Terraform`,author:`HashiCorp`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/terraform.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/terraform`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`terraform`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},strands:{name:`strands`,description:`Build AI agents with Strands Agent SDK using Bedrock, Anthropic, OpenAI, Gemini, or Llama models`,displayName:`Build an agent with Strands`,author:`AWS`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/strands.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/strands`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`strands`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"aws-agentcore":{name:`aws-agentcore`,description:`Amazon Bedrock AgentCore is an agentic platform for building, deploying, and operating effective agents.`,displayName:`Build an agent with Amazon Bedrock AgentCore`,author:`AWS`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/agentcore.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/aws-agentcore`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`aws-agentcore`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},neon:{name:`neon`,description:`Serverless Postgres with database branching, autoscaling, and scale-to-zero - perfect for modern development workflows`,displayName:`Build a database with Neon`,author:`Neon`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/neon.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/neon`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`neon`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},datadog:{name:`datadog`,description:`Query logs, metrics, traces, RUM events, incidents, and monitors from Datadog for production debugging and performance analysis`,displayName:`Datadog Observability`,author:`Datadog`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/datadog.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/datadog`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`datadog`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},dynatrace:{name:`dynatrace`,description:`Query logs, metrics, traces, problems, and Kubernetes events from Dynatrace using DQL for production debugging and performance analysis`,displayName:`Dynatrace Observability`,author:`Dynatrace`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/dynatrace.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/dynatrace`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`dynatrace`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},stripe:{name:`stripe`,description:`Build payment integrations with Stripe - accept payments, manage subscriptions, handle billing, and process refunds`,displayName:`Stripe Payments`,author:`Stripe`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/stripe.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/stripe`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`stripe`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"aws-infrastructure-as-code":{name:`aws-infrastructure-as-code`,description:`Build well-architected AWS infrastructure with CDK using latest documentation, best practices, and code samples. Validate CloudFormation templates, check resource configuration security compliance, and troubleshoot deployments.`,displayName:`Build AWS infrastructure with CDK and CloudFormation`,author:`AWS`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/iac.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/aws-infrastructure-as-code`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`aws-infrastructure-as-code`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"power-builder":{name:`power-builder`,description:`Complete guide for building and testing new Kiro Powers with templates, best practices, and validation`,displayName:`Build a Power`,author:`Kiro Team`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/power.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/power-builder`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`power-builder`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"saas-builder":{name:`saas-builder`,description:`Build production ready multi-tenant SaaS applications with serverless architecture, integrated billing, and enterprise grade security`,displayName:`SaaS Builder`,author:`Allen Helton`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/power.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/saas-builder`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`saas-builder`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"cloud-architect":{name:`cloud-architect`,description:`Build AWS infrastructure with CDK in Python following AWS Well-Architected framework best practices`,displayName:`Build infrastructure on AWS`,author:`Christian Bonzelet`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/power.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/cloud-architect`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`cloud-architect`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}},"aurora-dsql":{name:`aurora-dsql`,description:`For PostgreSQL compatible serverless distributed SQL database with Aurora DSQL, manage schemas, execute queries, and handle migrations with DSQL-specific constraints`,displayName:`Deploy a distributed SQL database on AWS`,author:`Rolf Koski`,iconUrl:`https://prod.download.desktop.kiro.dev/powers/icons/power.png`,repositoryUrl:`https://github.com/kirodotdev/powers/tree/main/aurora-dsql`,license:``,repositoryCloneUrl:`git@github.com:kirodotdev/powers.git`,pathInRepo:`aurora-dsql`,repositoryBranch:`main`,installed:!1,keywords:[],source:{type:`registry`}}},repoSources:{},lastUpdated:`2025-12-28T20:19:10.824Z`,kiroRecommendedRepo:{url:`https://prod.download.desktop.kiro.dev/powers/default_registry.json`,lastFetch:`2025-12-28T20:19:10.823Z`,powerCount:18}})}catch{this.log.debug(`Failed to parse official registry, using empty registry`)}return this.createInitialRegistry()}unregisterLocalPowers(e){let t={...this.getOfficialRegistry(),lastUpdated:new Date().toISOString()};return this.log.trace({action:e===!0?`dryRun`:`reset`,type:`registry`,powerCount:Object.keys(t.powers).length}),this.write(t,e)}buildRepoSource(e){let t=new Date().toISOString();return{name:e.sourcePath??e.installPath??e.name,type:`local`,enabled:!0,addedAt:t,powerCount:1,...e.sourcePath!=null&&{path:e.sourcePath},lastSync:t}}};const tp=`GLOBAL.md`,np=`.kiro`,$=`steering`,rp=`settings`,ip=`mcp.json`,ap=`POWER.md`;var op=class extends Jd{constructor(){super(`KiroCLIOutputPlugin`,{globalConfigDir:np,outputFileName:tp}),this.registerCleanEffect(`registry-cleanup`,async e=>this.getRegistryWriter(ep).unregisterLocalPowers(e.dryRun)?{success:!0,description:`Reset registry to official state`}:{success:!1,error:Error(`Failed to clean registry`),description:`Failed to reset registry`}),this.registerCleanEffect(`mcp-settings-cleanup`,async e=>{let t=this.getGlobalSettingsDir(),n=this.joinPath(t,ip),r={mcpServers:{},powers:{mcpServers:{}}};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpSettingsCleanup`,path:n}),{success:!0,description:`Would reset mcp.json to empty shell`};try{return this.ensureDirectory(t),this.writeFileSync(n,JSON.stringify(r,null,2)),this.log.trace({action:`clean`,type:`mcpSettingsCleanup`,path:n}),{success:!0,description:`Reset mcp.json to empty shell`}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`clean`,type:`mcpSettingsCleanup`,path:n,error:t}),{success:!1,error:e,description:`Failed to reset mcp.json`}}})}getGlobalSettingsDir(){return this.joinPath(this.getHomeDir(),np,rp)}async registerProjectOutputDirs(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n){if(e.dirFromWorkspacePath==null)continue;let n=this.joinPath(e.dirFromWorkspacePath.path,np,$);t.push({pathKind:N.Relative,path:n,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(e.dirFromWorkspacePath.basePath,n)})}return t}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace;for(let e of n)if(e.dirFromWorkspacePath!=null&&e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts){let r=this.buildSteeringFileName(n),i=this.joinPath(e.dirFromWorkspacePath.path,np,$,r);t.push({pathKind:N.Relative,path:i,basePath:e.dirFromWorkspacePath.basePath,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(e.dirFromWorkspacePath.basePath,i)})}return t}async registerGlobalOutputDirs(){let e=this.getGlobalSteeringDir(),t=[{pathKind:N.Relative,path:$,basePath:this.joinPath(this.getGlobalConfigDir()),getDirectoryName:()=>$,getAbsolutePath:()=>e}],n=this.getKiroPowersDir(),r=this.listInstalledPowers(n);for(let e of r){let r=this.joinPath(n,e);t.push({pathKind:N.Relative,path:e,basePath:n,getDirectoryName:()=>e,getAbsolutePath:()=>r})}let i=this.getKiroPowersReposDir();return t.push({pathKind:N.Relative,path:`repos`,basePath:this.joinPath(this.getHomeDir(),`.kiro/powers`),getDirectoryName:()=>`repos`,getAbsolutePath:()=>i}),t}listInstalledPowers(e){try{return this.existsSync(e)?this.readdirSync(e,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name):[]}catch{return this.log.debug({action:`listInstalledPowers`,error:`Failed to read powers directory`}),[]}}async registerGlobalOutputFiles(e){let{globalMemory:t,fastCommands:n,skills:r}=e.collectedInputContext,i=[],a=this.getGlobalSteeringDir();if(t!=null&&i.push({pathKind:N.Relative,path:tp,basePath:a,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(a,tp)}),n!=null)for(let e of n){let t=this.buildFastCommandSteeringFileName(e);i.push({pathKind:N.Relative,path:t,basePath:a,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(a,t)})}if(r!=null){let e=this.getKiroPowersDir();for(let t of r){let n=t.yamlFrontMatter.name,r=this.joinPath(e,n);if(i.push({pathKind:N.Relative,path:ap,basePath:r,getDirectoryName:()=>n,getAbsolutePath:()=>this.joinPath(r,ap)}),t.mcpConfig!=null&&i.push({pathKind:N.Relative,path:ip,basePath:r,getDirectoryName:()=>n,getAbsolutePath:()=>this.joinPath(r,ip)}),t.childDocs!=null){let e=this.joinPath(r,$);for(let n of t.childDocs){let t=n.dir.path.replace(/\.mdx$/,`.md`);i.push({pathKind:N.Relative,path:this.joinPath($,t),basePath:r,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(e,t)})}}if(t.resources!=null){let e=this.joinPath(r,$);for(let n of t.resources)i.push({pathKind:N.Relative,path:this.joinPath($,n.relativePath),basePath:r,getDirectoryName:()=>$,getAbsolutePath:()=>this.joinPath(e,n.relativePath)})}}if(r.some(e=>e.mcpConfig!=null)){let e=this.getGlobalSettingsDir();i.push({pathKind:N.Relative,path:ip,basePath:e,getDirectoryName:()=>rp,getAbsolutePath:()=>this.joinPath(e,ip)})}}return i}async canWrite(e){let{workspace:t,globalMemory:n,fastCommands:r,skills:i}=e.collectedInputContext,a=t.projects.some(e=>(e.childMemoryPrompts?.length??0)>0),o=n!=null,s=(r?.length??0)>0,c=(i?.length??0)>0;return!a&&!o&&!s&&!c?(this.log.trace({action:`skip`,reason:`noOutputs`}),!1):!0}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,n=[],r=[];for(let r of t)if(r.dirFromWorkspacePath!=null&&r.childMemoryPrompts!=null)for(let t of r.childMemoryPrompts){let i=await this.writeSteeringFile(e,r,t);n.push(i)}return{files:n,dirs:r}}async writeGlobalOutputs(e){let{globalMemory:t,fastCommands:n,skills:r}=e.collectedInputContext,i=[],a=[],o=[];if(t!=null){let n=this.getGlobalSteeringDir(),r=this.joinPath(n,tp),a={pathKind:N.Relative,path:tp,basePath:n,getDirectoryName:()=>$,getAbsolutePath:()=>r};if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`globalMemory`,path:r}),i.push({path:a,success:!0,skipped:!1});else try{this.ensureDirectory(n),this.writeFileSync(r,t.content),this.log.trace({action:`write`,type:`globalMemory`,path:r}),i.push({path:a,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`globalMemory`,path:r,error:t}),i.push({path:a,success:!1,error:e})}}if(n!=null)for(let t of n){let n=await this.writeFastCommandSteeringFile(e,t);i.push(n)}if(r!=null&&r.length>0){this.log.debug(`Processing ${r.length} skills as Kiro Powers`);for(let t of r){let{fileResults:n,registryResult:r}=await this.writeSkillAsPower(e,t);i.push(...n),o.push(r)}let t=await this.writeGlobalMcpSettings(e,r);t!=null&&i.push(t),this.logRegistryResults(o,e.dryRun)}return{files:i,dirs:a}}async writeGlobalMcpSettings(e,t){let n={};for(let e of t){if(e.mcpConfig==null)continue;let t=e.yamlFrontMatter.name,r=e.mcpConfig.mcpServers;for(let[e,i]of Object.entries(r)){let r=`power-${t}-${e}`;n[r]=i}}if(Object.keys(n).length===0)return null;let r=this.getGlobalSettingsDir(),i=this.joinPath(r,ip),a={pathKind:N.Relative,path:ip,basePath:r,getDirectoryName:()=>rp,getAbsolutePath:()=>i},o={mcpServers:{},powers:{mcpServers:n}},s=JSON.stringify(o,null,2);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`globalMcpSettings`,path:i,serverCount:Object.keys(n).length}),{path:a,success:!0,skipped:!1};try{return this.ensureDirectory(r),this.writeFileSync(i,s),this.log.trace({action:`write`,type:`globalMcpSettings`,path:i,serverCount:Object.keys(n).length}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`globalMcpSettings`,path:i,error:t}),{path:a,success:!1,error:e}}}logRegistryResults(e,t){let n=e.filter(e=>e.success).length,r=e.filter(e=>!e.success).length;if(n>0&&this.log.trace({action:t===!0?`dryRun`:`register`,type:`registrySummary`,successCount:n}),r>0){this.log.error({action:`register`,type:`registrySummary`,failCount:r});for(let t of e)if(!t.success){let e=t.error?.message??`Unknown error`;this.log.error({action:`register`,type:`registryEntry`,entryName:t.entryName,error:e})}}}getGlobalSteeringDir(){return this.joinPath(this.getGlobalConfigDir(),$)}getKiroPowersDir(){return this.joinPath(this.getHomeDir(),`.kiro/powers/installed`)}getKiroPowersReposDir(){return this.joinPath(this.getHomeDir(),`.kiro/powers/repos`)}buildPowerFrontMatter(e){return Gd({name:e.name,displayName:e.displayName,description:e.description,keywords:e.keywords,author:e.author},``).trimEnd()}async writeSkillAsPower(e,t){let n=[],r=t.yamlFrontMatter.name,i=this.joinPath(this.getKiroPowersDir(),r),a=this.joinPath(i,ap),o={pathKind:N.Relative,path:ap,basePath:i,getDirectoryName:()=>r,getAbsolutePath:()=>a},s=`${this.buildPowerFrontMatter(t.yamlFrontMatter)}\n${t.content}`;if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`skillPower`,path:a}),n.push({path:o,success:!0,skipped:!1});else try{this.ensureDirectory(i),this.writeFileSync(a,s),this.log.trace({action:`write`,type:`skillPower`,path:a}),n.push({path:o,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`skillPower`,path:a,error:t}),n.push({path:o,success:!1,error:e})}if(t.childDocs!=null){let r=this.joinPath(i,$);for(let a of t.childDocs){let t=a.dir.path.replace(/\.mdx$/,`.md`),o=this.joinPath(r,t),s={pathKind:N.Relative,path:this.joinPath($,t),basePath:i,getDirectoryName:()=>$,getAbsolutePath:()=>o},c=a.content;if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`refDoc`,path:o}),n.push({path:s,success:!0,skipped:!1});else try{let e=this.dirname(o);this.ensureDirectory(e),this.writeFileSync(o,c),this.log.trace({action:`write`,type:`refDoc`,path:o}),n.push({path:s,success:!0})}catch(e){let t=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`refDoc`,path:o,error:t}),n.push({path:s,success:!1,error:e})}}}if(t.resources!=null){let r=this.joinPath(i,$);for(let a of t.resources){let t=this.joinPath(r,a.relativePath),o={pathKind:N.Relative,path:this.joinPath($,a.relativePath),basePath:i,getDirectoryName:()=>$,getAbsolutePath:()=>t};if(e.dryRun===!0)this.log.trace({action:`dryRun`,type:`resource`,path:t}),n.push({path:o,success:!0,skipped:!1});else try{let e=this.dirname(t);this.ensureDirectory(e),this.writeFileSync(t,a.content),this.log.trace({action:`write`,type:`resource`,path:t}),n.push({path:o,success:!0})}catch(e){let r=e instanceof Error?e.message:String(e);this.log.error({action:`write`,type:`resource`,path:t,error:r}),n.push({path:o,success:!1,error:e})}}}if(t.mcpConfig!=null){let r=await this.writeSkillMcpConfig(e,t,i);n.push(r)}let c=this.getRegistryWriter(ep),l=c.buildPowerEntry(t,i);return{fileResults:n,registryResult:(await this.registerInRegistry(c,[l],e))[0]??{success:!1,entryName:r,error:Error(`No registry result returned`)}}}async writeSkillMcpConfig(e,t,n){let r=t.yamlFrontMatter.name,i=this.joinPath(n,ip),a={pathKind:N.Relative,path:ip,basePath:n,getDirectoryName:()=>r,getAbsolutePath:()=>i},o=t.mcpConfig.rawContent;if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`mcpConfig`,path:i,skill:r}),{path:a,success:!0,skipped:!1};try{return this.ensureDirectory(n),this.writeFileSync(i,o),this.log.trace({action:`write`,type:`mcpConfig`,path:i,skill:r}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`mcpConfig`,path:i,error:t}),{path:a,success:!1,error:e}}}buildFastCommandSteeringFileName(e){return this.transformFastCommandName(e,{includeSeriesPrefix:!0,seriesSeparator:`-`})}buildFastCommandSteeringContent(e){let t=e.yamlFrontMatter?.description;return Gd({inclusion:`manual`,description:t!=null&&t.length>0?t:null},e.content)}async writeFastCommandSteeringFile(e,t){let n=this.getGlobalSteeringDir(),r=this.buildFastCommandSteeringFileName(t),i=this.joinPath(n,r),a={pathKind:N.Relative,path:r,basePath:n,getDirectoryName:()=>$,getAbsolutePath:()=>i},o=this.buildFastCommandSteeringContent(t);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`fastCommandSteering`,path:i}),{path:a,success:!0,skipped:!1};try{return this.ensureDirectory(n),this.writeFileSync(i,o),this.log.trace({action:`write`,type:`fastCommandSteering`,path:i}),{path:a,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`fastCommandSteering`,path:i,error:t}),{path:a,success:!1,error:e}}}buildSteeringFileName(e){return`kiro-${(e.workingChildDirectoryPath?.path??e.dir.path).replace(/\\/g,`/`).replace(/^\/+|\/+$/g,``).replace(/\//g,`-`)}.md`}buildSteeringContent(e){return Gd({inclusion:`fileMatch`,fileMatchPattern:`${(e.workingChildDirectoryPath?.path??e.dir.path).replace(/\\/g,`/`)}/**`},e.content)}async writeSteeringFile(e,t,n){let r=t.dirFromWorkspacePath,i=this.buildSteeringFileName(n),a=this.joinPath(r.basePath,r.path,np,$),o=this.joinPath(a,i),s={pathKind:N.Relative,path:this.joinPath(r.path,np,$,i),basePath:r.basePath,getDirectoryName:()=>$,getAbsolutePath:()=>o},c=this.buildSteeringContent(n);if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`steeringFile`,path:o}),{path:s,success:!0,skipped:!1};try{return this.ensureDirectory(a),this.writeFileSync(o,c),this.log.trace({action:`write`,type:`steeringFile`,path:o}),{path:s,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`steeringFile`,path:o,error:t}),{path:s,success:!1,error:e}}}},sp=class extends X{constructor(){super(`MarkdownWhitespaceCleanupEffectInputPlugin`),this.registerEffect(`markdown-whitespace-cleanup`,this.cleanupWhitespace.bind(this),30)}async cleanupWhitespace(e){let{fs:t,path:n,shadowProjectDir:r,dryRun:i,logger:a}=e,o=[],s=[],c=[],l=[n.join(r,`src`),n.join(r,`app`),n.join(r,`dist`)];for(let n of l){if(!t.existsSync(n)){a.debug({action:`whitespace-cleanup`,message:`Directory does not exist, skipping`,dir:n});continue}this.processDirectory(e,n,o,s,c,i??!1)}let u=c.length>0;return u&&a.warn({action:`whitespace-cleanup`,errors:c.map(e=>({path:e.path,error:e.error.message}))}),{success:!u,description:i?`Would modify ${o.length} files, skip ${s.length} files`:`Modified ${o.length} files, skipped ${s.length} files`,modifiedFiles:o,skippedFiles:s,...u&&{error:Error(`${c.length} errors occurred during cleanup`)}}}processDirectory(e,t,n,r,i,a){let{fs:o,path:s,logger:c}=e,l;try{l=o.readdirSync(t,{withFileTypes:!0})}catch(e){i.push({path:t,error:e}),c.warn({action:`whitespace-cleanup`,message:`Failed to read directory`,path:t,error:e.message});return}for(let o of l){let c=s.join(t,o.name);o.isDirectory()?this.processDirectory(e,c,n,r,i,a):o.isFile()&&o.name.endsWith(`.md`)&&this.processMarkdownFile(e,c,n,r,i,a)}}processMarkdownFile(e,t,n,r,i,a){let{fs:o,logger:s}=e;try{let e=o.readFileSync(t,`utf-8`),i=this.cleanMarkdownContent(e);if(e===i){r.push(t),s.debug({action:`whitespace-cleanup`,skipped:t,reason:`no changes needed`});return}a?(s.debug({action:`whitespace-cleanup`,dryRun:!0,wouldModify:t}),n.push(t)):(o.writeFileSync(t,i,`utf-8`),n.push(t),s.debug({action:`whitespace-cleanup`,modified:t}))}catch(e){i.push({path:t,error:e}),s.warn({action:`whitespace-cleanup`,message:`Failed to process file`,path:t,error:e.message})}}cleanMarkdownContent(e){let t=this.detectLineEnding(e),n=e.split(/\r?\n/).map(e=>e.replace(/[ \t]+$/,``)),r=[],i=0;for(let e of n)e===``?(i++,i<=2&&r.push(e)):(i=0,r.push(e));return r.join(t)}detectLineEnding(e){return e.includes(`\r
275
283
  `)?`\r
276
284
  `:`
277
- `}collect(e){return{}}},yf=class extends X{constructor(){super(`OrphanFileCleanupEffectInputPlugin`),this.registerEffect(`orphan-file-cleanup`,this.cleanupOrphanFiles.bind(this),20)}async cleanupOrphanFiles(e){let{fs:t,path:n,shadowProjectDir:r,dryRun:i,logger:a}=e,o=n.join(r,`dist`),s=[],c=[],l=[];if(!t.existsSync(o))return a.debug({action:`orphan-cleanup`,message:`dist/ directory does not exist, skipping`,distDir:o}),{success:!0,description:`dist/ directory does not exist, nothing to clean`,deletedFiles:s,deletedDirs:c};for(let r of[`skills`,`commands`,`agents`,`app`]){let a=n.join(o,r);t.existsSync(a)&&this.cleanupDirectory(e,a,r,s,c,l,i??!1)}let u=l.length>0;return u&&a.warn({action:`orphan-cleanup`,errors:l.map(e=>({path:e.path,error:e.error.message}))}),{success:!u,description:i?`Would delete ${s.length} files and ${c.length} directories`:`Deleted ${s.length} files and ${c.length} directories`,deletedFiles:s,deletedDirs:c,...u&&{error:Error(`${l.length} errors occurred during cleanup`)}}}cleanupDirectory(e,t,n,r,i,a,o){let{fs:s,path:c,shadowProjectDir:l,logger:u}=e,d;try{d=s.readdirSync(t,{withFileTypes:!0})}catch(e){a.push({path:t,error:e}),u.warn({action:`orphan-cleanup`,message:`Failed to read directory`,path:t,error:e.message});return}for(let f of d){let d=c.join(t,f.name);if(f.isDirectory())this.cleanupDirectory(e,d,n,r,i,a,o),this.removeEmptyDirectory(e,d,i,a,o);else if(f.isFile()&&this.isOrphanFile(e,d,n,l))if(o)u.debug({action:`orphan-cleanup`,dryRun:!0,wouldDelete:d}),r.push(d);else try{s.unlinkSync(d),r.push(d),u.debug({action:`orphan-cleanup`,deleted:d})}catch(e){a.push({path:d,error:e}),u.warn({action:`orphan-cleanup`,message:`Failed to delete file`,path:d,error:e.message})}}}isOrphanFile(e,t,n,r){let{fs:i,path:a}=e,o=a.basename(t),s=o.endsWith(`.md`),c=a.join(r,`dist`,n),l=a.relative(c,t),u=a.dirname(l),d=o.replace(/\.md$/,``);if(s)return!this.getPossibleSourcePaths(a,r,n,d,u).some(e=>i.existsSync(e));{let e=[];return n===`app`?e.push(a.join(r,`app`,l)):e.push(a.join(r,`src`,n,l)),!e.some(e=>i.existsSync(e))}}getPossibleSourcePaths(e,t,n,r,i){switch(n){case`skills`:return i===`.`?[e.join(t,`src`,`skills`,r,`SKILL.cn.mdx`),e.join(t,`src`,`skills`,`${r}.cn.mdx`)]:[e.join(t,`src`,`skills`,i,`${r}.cn.mdx`)];case`commands`:return i===`.`?[e.join(t,`src`,`commands`,`${r}.cn.mdx`)]:[e.join(t,`src`,`commands`,i,`${r}.cn.mdx`)];case`agents`:return i===`.`?[e.join(t,`src`,`agents`,`${r}.cn.mdx`)]:[e.join(t,`src`,`agents`,i,`${r}.cn.mdx`)];case`app`:return i===`.`?[e.join(t,`app`,`${r}.cn.mdx`)]:[e.join(t,`app`,i,`${r}.cn.mdx`)];default:return[]}}removeEmptyDirectory(e,t,n,r,i){let{fs:a,logger:o}=e;try{a.readdirSync(t).length===0&&(i?(o.debug({action:`orphan-cleanup`,dryRun:!0,wouldDeleteDir:t}),n.push(t)):(a.rmdirSync(t),n.push(t),o.debug({action:`orphan-cleanup`,deletedDir:t})))}catch(e){r.push({path:t,error:e}),o.warn({action:`orphan-cleanup`,message:`Failed to check/remove directory`,path:t,error:e.message})}}collect(e){return{}}};const bf=`agt.md`;var xf=class extends X{constructor(){super(`ProjectPromptInputPlugin`,[`ShadowProjectInputPlugin`])}collect(e){let{dependencyContext:t,fs:n,userConfigOptions:r,path:i}=e,{workspaceDir:a,shadowProjectDir:o}=this.resolveBasePaths(r),s=r.shadowProjectsDir,c=this.resolvePath(s,a,o),l=t.workspace;if(l==null)return this.log.warn(`No workspace found in dependency context, skipping project prompt enhancement`),{};let u=(l.projects??[]).map(t=>{let r=t.name;if(r==null)return t;let a=i.join(c,r);if(!n.existsSync(a)||!n.statSync(a).isDirectory())return t;let o=t.dirFromWorkspacePath?.getAbsolutePath(),s=this.readRootMemoryPrompt(e,a),l=o==null?[]:this.scanChildMemoryPrompts(e,a,o);return{...t,...s!=null&&{rootMemoryPrompt:s},...l.length>0&&{childMemoryPrompts:l}}});return{workspace:{directory:l.directory,projects:u}}}readRootMemoryPrompt(e,t){let{fs:n,path:r,logger:i}=e,a=r.join(t,bf);if(!(!n.existsSync(a)||!n.statSync(a).isFile()))try{let e=Cd(n.readFileSync(a,`utf-8`)),t=e.contentWithoutFrontMatter;return{type:ht.ProjectRootMemory,content:t,length:t.length,filePathKind:M.Relative,...e.yamlFrontMatter!=null&&{yamlFrontMatter:e.yamlFrontMatter},...e.rawFrontMatter!=null&&{rawFrontMatter:e.rawFrontMatter},markdownAst:e.markdownAst,markdownContents:e.markdownContents,dir:{pathKind:M.Root,path:``,getDirectoryName:()=>``}}}catch(e){i.error(`Failed to read root memory prompt at ${a}`,{error:e});return}}scanChildMemoryPrompts(e,t,n){let{logger:r}=e,i=[];try{this.scanDirectoryRecursive(e,t,t,n,i)}catch(e){r.error(`Failed to scan child memory prompts at ${t}`,{error:e})}return i}scanDirectoryRecursive(e,t,n,r,i){let{fs:a,path:o}=e,s=a.readdirSync(n,{withFileTypes:!0});for(let c of s){if(!c.isDirectory()||c.name.startsWith(`.`)||c.name===`node_modules`)continue;let s=o.join(n,c.name),l=o.join(s,bf);if(a.existsSync(l)&&a.statSync(l).isFile()){let n=this.readChildMemoryPrompt(e,t,s,r);n!=null&&i.push(n)}this.scanDirectoryRecursive(e,t,s,r,i)}}readChildMemoryPrompt(e,t,n,r){let{fs:i,path:a,logger:o}=e,s=a.join(n,bf);try{let e=Cd(i.readFileSync(s,`utf-8`)),o=e.contentWithoutFrontMatter,c=a.relative(t,n),l=a.join(r,c),u=a.basename(n);return{type:ht.ProjectChildrenMemory,content:o,length:o.length,filePathKind:M.Relative,...e.yamlFrontMatter!=null&&{yamlFrontMatter:e.yamlFrontMatter},...e.rawFrontMatter!=null&&{rawFrontMatter:e.rawFrontMatter},markdownAst:e.markdownAst,markdownContents:e.markdownContents,dir:{pathKind:M.Relative,path:c,basePath:r,getDirectoryName:()=>u,getAbsolutePath:()=>l},workingChildDirectoryPath:{pathKind:M.Relative,path:c,basePath:r,getDirectoryName:()=>u,getAbsolutePath:()=>l}}}catch(e){o.error(`Failed to read child memory prompt at ${s}`,{error:e});return}}};const Sf=`README.md`;var Cf=class extends Td{constructor(){super(`ReadmeMdConfigFileOutputPlugin`,{outputFileName:Sf})}async registerProjectOutputFiles(e){let t=[],{readmePrompts:n}=e.collectedInputContext;if(n==null||n.length===0)return t;for(let e of n){let n=e.targetDir,r=i.join(n.path,Sf);t.push({pathKind:M.Relative,path:r,basePath:n.basePath,getDirectoryName:()=>n.getDirectoryName(),getAbsolutePath:()=>i.join(n.basePath,r)})}return t}async canWrite(e){let{readmePrompts:t}=e.collectedInputContext;return t==null||t.length===0?(this.log.debug(`skipped`,{reason:`no README prompts to write`}),!1):!0}async writeProjectOutputs(e){let t=[],n=[],{readmePrompts:r}=e.collectedInputContext;if(r==null||r.length===0)return{files:t,dirs:n};for(let n of r){let r=await this.writeReadmeFile(e,n);t.push(r)}return{files:t,dirs:n}}async writeReadmeFile(e,t){let n=t.targetDir,a=i.join(n.path,Sf),o=i.join(n.basePath,a),s=t.content,c={pathKind:M.Relative,path:a,basePath:n.basePath,getDirectoryName:()=>n.getDirectoryName(),getAbsolutePath:()=>o},l=t.isRoot?`project:${t.projectName}/README.md`:`project:${t.projectName}/${n.path}/README.md`;if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`readme`,path:o,label:l}),{path:c,success:!0,skipped:!1};try{let e=i.dirname(o);return r.existsSync(e)||r.mkdirSync(e,{recursive:!0}),r.writeFileSync(o,s,`utf-8`),this.log.trace({action:`write`,type:`readme`,path:o,label:l}),{path:c,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`readme`,path:o,label:l,error:t}),{path:c,success:!1,error:e}}}},wf=class extends X{constructor(){super(`ReadmeMdInputPlugin`,[`ShadowProjectInputPlugin`])}collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i}=e,{workspaceDir:a,shadowProjectDir:o}=this.resolveBasePaths(t),s=t.shadowProjectsDir,c=this.resolvePath(s,a,o),l=[];if(!r.existsSync(c)||!r.statSync(c).isDirectory())return n.debug(`shadow projects directory does not exist`,{path:c}),{readmePrompts:l};try{let t=r.readdirSync(c,{withFileTypes:!0});for(let n of t){if(!n.isDirectory())continue;let t=n.name,r=i.join(c,t);this.collectReadmeFiles(e,r,t,a,``,l)}}catch(e){n.error(`failed to scan shadow projects`,{path:c,error:e})}return{readmePrompts:l}}collectReadmeFiles(e,t,n,r,i,a){let{fs:o,path:s,logger:c}=e,l=i===``,u=s.join(t,`readme.md`);if(o.existsSync(u)&&o.statSync(u).isFile())try{let e=o.readFileSync(u,`utf-8`),t=l?n:s.join(n,i),c={pathKind:M.Relative,path:t,basePath:r,getDirectoryName:()=>l?n:s.basename(i),getAbsolutePath:()=>s.resolve(r,t)},d={pathKind:M.Relative,path:s.dirname(u),basePath:r,getDirectoryName:()=>s.basename(s.dirname(u)),getAbsolutePath:()=>s.dirname(u)};a.push({type:ht.Readme,content:e,length:e.length,filePathKind:M.Relative,projectName:n,targetDir:c,isRoot:l,markdownContents:[],dir:d})}catch(e){c.warn(`failed to read readme.md`,{path:u,error:e})}try{let c=o.readdirSync(t,{withFileTypes:!0});for(let o of c)if(o.isDirectory()){let c=l?o.name:s.join(i,o.name),u=s.join(t,o.name);this.collectReadmeFiles(e,u,n,r,c,a)}}catch(e){c.warn(`failed to scan directory`,{path:t,error:e})}}},Tf=class extends X{constructor(){super(`ShadowProjectInputPlugin`)}collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i}=e,{workspaceDir:a,shadowProjectDir:o}=this.resolveBasePaths(t),s=t.shadowProjectsDir,c=this.resolvePath(s,a,o),l=i.basename(o),u=[];if(r.existsSync(c)&&r.statSync(c).isDirectory())try{let e=r.readdirSync(c,{withFileTypes:!0});for(let t of e)if(t.isDirectory()){let e=t.name===l;u.push({name:t.name,...e&&{isPromptSourceProject:!0},dirFromWorkspacePath:{pathKind:M.Relative,path:t.name,basePath:a,getDirectoryName:()=>t.name,getAbsolutePath:()=>i.resolve(a,t.name)}})}}catch(e){n.error(`failed to scan shadow projects`,{path:c,error:e})}return{workspace:{directory:{pathKind:M.Absolute,path:a,getDirectoryName:()=>i.basename(a)},projects:u}}}},Ef=class extends X{constructor(){super(`SkillInputPlugin`)}readMcpConfig(e,t,n){let r=i.join(e,`mcp.json`);if(t.existsSync(r)){if(!t.statSync(r).isFile()){n.warn(`mcp.json is not a file`,{skillDir:e});return}try{let i=t.readFileSync(r,`utf-8`),a=JSON.parse(i);if(a.mcpServers==null||typeof a.mcpServers!=`object`){n.warn(`mcp.json missing mcpServers field`,{skillDir:e});return}return{type:ht.SkillMcpConfig,mcpServers:a.mcpServers,rawContent:i}}catch(t){n.warn(`failed to parse mcp.json`,{skillDir:e,error:t});return}}}isBinaryResourceExtension(e){return Ct.includes(e.toLowerCase())}getResourceCategory(e){let t=e.toLowerCase();return[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.ico`,`.bmp`,`.tiff`,`.svg`].includes(t)?`image`:`.kt,.java,.py,.pyi,.pyx,.ts,.tsx,.js,.jsx,.mjs,.cjs,.go,.rs,.c,.cpp,.cc,.h,.hpp,.hxx,.cs,.fs,.fsx,.vb,.rb,.php,.swift,.scala,.groovy,.lua,.r,.jl,.ex,.exs,.erl,.clj,.cljs,.hs,.ml,.mli,.nim,.zig,.v,.dart,.vue,.svelte,.d.ts,.d.mts,.d.cts`.split(`,`).includes(t)?`code`:[`.sql`,`.json`,`.jsonc`,`.json5`,`.xml`,`.xsd`,`.xsl`,`.xslt`,`.yaml`,`.yml`,`.toml`,`.csv`,`.tsv`,`.graphql`,`.gql`,`.proto`].includes(t)?`data`:[`.txt`,`.text`,`.rtf`,`.log`,`.docx`,`.doc`,`.xlsx`,`.xls`,`.pptx`,`.ppt`,`.pdf`,`.odt`,`.ods`,`.odp`].includes(t)?`document`:[`.ini`,`.conf`,`.cfg`,`.config`,`.properties`,`.env`,`.envrc`,`.editorconfig`,`.gitignore`,`.gitattributes`,`.npmrc`,`.nvmrc`,`.npmignore`,`.eslintrc`,`.prettierrc`,`.stylelintrc`,`.babelrc`,`.browserslistrc`].includes(t)?`config`:[`.sh`,`.bash`,`.zsh`,`.fish`,`.ps1`,`.psm1`,`.psd1`,`.bat`,`.cmd`].includes(t)?`script`:`.exe,.dll,.so,.dylib,.bin,.wasm,.class,.jar,.war,.pyd,.pyc,.pyo,.zip,.tar,.gz,.bz2,.7z,.rar,.ttf,.otf,.woff,.woff2,.eot,.db,.sqlite,.sqlite3`.split(`,`).includes(t)?`binary`:`other`}getMimeType(e){return{".ts":`text/typescript`,".tsx":`text/typescript`,".js":`text/javascript`,".jsx":`text/javascript`,".json":`application/json`,".py":`text/x-python`,".java":`text/x-java`,".kt":`text/x-kotlin`,".go":`text/x-go`,".rs":`text/x-rust`,".c":`text/x-c`,".cpp":`text/x-c++`,".cs":`text/x-csharp`,".rb":`text/x-ruby`,".php":`text/x-php`,".swift":`text/x-swift`,".scala":`text/x-scala`,".sql":`application/sql`,".xml":`application/xml`,".yaml":`text/yaml`,".yml":`text/yaml`,".toml":`text/toml`,".csv":`text/csv`,".graphql":`application/graphql`,".txt":`text/plain`,".pdf":`application/pdf`,".docx":`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,".xlsx":`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,".html":`text/html`,".css":`text/css`,".svg":`image/svg+xml`,".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".ico":`image/x-icon`,".bmp":`image/bmp`}[e.toLowerCase()]}scanSkillDirectory(e,t,n,r=``){let a=[],o=[],s=r?i.join(e,r):e;try{let c=t.readdirSync(s,{withFileTypes:!0});for(let l of c){let c=r?`${r}/${l.name}`:l.name;if(l.isDirectory()){let r=this.scanSkillDirectory(e,t,n,c);a.push(...r.childDocs),o.push(...r.resources)}else if(l.isFile()){let d=i.join(s,l.name);if(l.name.endsWith(`.md`)){if(r===``&&l.name===`skill.md`)continue;try{let n=Cd(t.readFileSync(d,`utf-8`)),r=n.contentWithoutFrontMatter;a.push({type:ht.SkillChildDoc,content:r,length:r.length,filePathKind:M.Relative,markdownAst:n.markdownAst,markdownContents:n.markdownContents,...n.rawFrontMatter!=null&&{rawFrontMatter:n.rawFrontMatter},relativePath:c,dir:{pathKind:M.Relative,path:c,basePath:e,getDirectoryName:()=>i.dirname(c),getAbsolutePath:()=>d}})}catch(e){n.warn(`failed to read child doc`,{path:c,error:e})}}else{if(r===``&&l.name===`mcp.json`)continue;let e=i.extname(l.name),a,s,f;try{if(this.isBinaryResourceExtension(e)){let e=t.readFileSync(d);a=e.toString(`base64`),s=`base64`,f=e.length}else a=t.readFileSync(d,`utf-8`),s=`text`,f=u.byteLength(a,`utf-8`);let n=this.getMimeType(e),r={type:ht.SkillResource,extension:e,fileName:l.name,relativePath:c,content:a,encoding:s,category:this.getResourceCategory(e),length:f};n==null?o.push(r):o.push({...r,mimeType:n})}catch(e){n.warn(`failed to read resource file`,{path:c,error:e})}}}}}catch(e){n.warn(`failed to scan directory`,{path:s,error:e})}return{childDocs:a,resources:o}}collect(e){let{userConfigOptions:t,logger:n}=e,{workspaceDir:r,shadowProjectDir:a}=this.resolveBasePaths(t),o=t.shadowSkillSourceDir,s=this.resolvePath(o,r,a),c=[];if(e.fs.existsSync(s)&&e.fs.statSync(s).isDirectory())try{let t=e.fs.readdirSync(s,{withFileTypes:!0});for(let r of t)if(r.isDirectory()){let t=e.path.join(s,r.name,`skill.md`);if(e.fs.existsSync(t)&&e.fs.statSync(t).isFile()){let a=Cd(e.fs.readFileSync(t,`utf-8`)),o=a.contentWithoutFrontMatter,l=e.path.join(s,r.name),u=this.readMcpConfig(l,e.fs,n),{childDocs:d,resources:f}=this.scanSkillDirectory(l,e.fs,n);c.push({type:ht.Skill,content:o,length:o.length,filePathKind:M.Relative,yamlFrontMatter:a.yamlFrontMatter??{name:r.name,description:``},...a.rawFrontMatter!=null&&{rawFrontMatter:a.rawFrontMatter},markdownAst:a.markdownAst,markdownContents:a.markdownContents,...u!=null&&{mcpConfig:u},...d.length>0&&{childDocs:d},...f.length>0&&{resources:f},dir:{pathKind:M.Relative,path:r.name,basePath:s,getDirectoryName:()=>r.name,getAbsolutePath:()=>i.join(s,r.name)}})}}}catch(e){n.error(`failed to scan skills`,{path:s,error:e})}return{skills:c}}},Df=class extends X{constructor(){super(`SkillNonSrcFileSyncEffectInputPlugin`),this.registerEffect(`skill-non-src-file-sync`,this.syncNonSrcFiles.bind(this),10)}async syncNonSrcFiles(e){let{fs:t,path:n,shadowProjectDir:r,dryRun:i,logger:a}=e,o=n.join(r,`src`,`skills`),s=n.join(r,`dist`,`skills`),c=[],l=[],u=[],d=[];if(!t.existsSync(o))return a.debug({action:`skill-sync`,message:`src/skills/ directory does not exist, skipping`,srcSkillsDir:o}),{success:!0,description:`src/skills/ directory does not exist, nothing to sync`,copiedFiles:c,skippedFiles:l,createdDirs:u};this.syncDirectoryRecursive(e,o,s,``,c,l,u,d,i??!1);let f=d.length>0;return f&&a.warn({action:`skill-sync`,errors:d.map(e=>({path:e.path,error:e.error.message}))}),{success:!f,description:i?`Would copy ${c.length} files, skip ${l.length} files`:`Copied ${c.length} files, skipped ${l.length} files`,copiedFiles:c,skippedFiles:l,createdDirs:u,...f&&{error:Error(`${d.length} errors occurred during sync`)},modifiedFiles:c}}syncDirectoryRecursive(e,t,n,r,i,a,o,s,c){let{fs:l,path:u,logger:d}=e,f=r?u.join(t,r):t;if(!l.existsSync(f))return;let p;try{p=l.readdirSync(f,{withFileTypes:!0})}catch(e){s.push({path:f,error:e}),d.warn({action:`skill-sync`,message:`Failed to read directory`,path:f,error:e.message});return}for(let f of p){let p=r?u.join(r,f.name):f.name,m=u.join(t,p),h=u.join(n,p);if(f.isDirectory())this.syncDirectoryRecursive(e,t,n,p,i,a,o,s,c);else if(f.isFile()){if(f.name.endsWith(`.cn.mdx`))continue;let e=u.dirname(h);if(!l.existsSync(e))if(c)d.debug({action:`skill-sync`,dryRun:!0,wouldCreateDir:e}),o.push(e);else try{l.mkdirSync(e,{recursive:!0}),o.push(e),d.debug({action:`skill-sync`,createdDir:e})}catch(t){s.push({path:e,error:t}),d.warn({action:`skill-sync`,message:`Failed to create directory`,path:e,error:t.message});continue}if(l.existsSync(h))try{let e=l.readFileSync(m),t=l.readFileSync(h);if(this.computeHash(e)===this.computeHash(t)){a.push(h),d.debug({action:`skill-sync`,skipped:h,reason:`identical content`});continue}}catch(e){d.debug({action:`skill-sync`,message:`Could not compare files, will copy`,path:h,error:e.message})}if(c)d.debug({action:`skill-sync`,dryRun:!0,wouldCopy:{from:m,to:h}}),i.push(h);else try{l.copyFileSync(m,h),i.push(h),d.debug({action:`skill-sync`,copied:{from:m,to:h}})}catch(e){s.push({path:h,error:e}),d.warn({action:`skill-sync`,message:`Failed to copy file`,from:m,to:h,error:e.message})}}}}computeHash(e){return d(`sha256`).update(e).digest(`hex`)}collect(e){return{}}},Of=class extends X{constructor(){super(`SubAgentInputPlugin`)}collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i}=e,{workspaceDir:a,shadowProjectDir:o}=this.resolveBasePaths(t),s=t.shadowSubAgentDir,c=this.resolvePath(s,a,o),l=[];if(r.existsSync(c)&&r.statSync(c).isDirectory())try{let e=r.readdirSync(c,{withFileTypes:!0});for(let t of e)if(t.isFile()&&t.name.endsWith(`.md`)){let e=i.join(c,t.name),n=Cd(r.readFileSync(e,`utf-8`)),a=n.contentWithoutFrontMatter;l.push({type:ht.SubAgent,content:a,length:a.length,filePathKind:M.Relative,...n.yamlFrontMatter!=null&&{yamlFrontMatter:n.yamlFrontMatter},...n.rawFrontMatter!=null&&{rawFrontMatter:n.rawFrontMatter},markdownAst:n.markdownAst,markdownContents:n.markdownContents,dir:{pathKind:M.Relative,path:t.name,basePath:c,getDirectoryName:()=>t.name.replace(/\.md$/,``),getAbsolutePath:()=>e}})}}catch(e){n.error(`Failed to scan sub agents at ${c}`,{error:e})}return{subAgents:l}}};const kf=`WARP.md`;var Af=class extends Td{constructor(){super(`WarpIDEOutputPlugin`,{outputFileName:kf})}isAgentsPluginRegistered(e){return`registeredPluginNames`in e&&e.registeredPluginNames!=null?e.registeredPluginNames.includes(`AgentsOutputPlugin`):!1}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,r=this.isAgentsPluginRegistered(e);for(let e of n)if(e.dirFromWorkspacePath!=null){if(r)t.push(this.createFileRelativePath(e.dirFromWorkspacePath,kf));else if(e.rootMemoryPrompt!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,kf)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,kf))}return t}async canWrite(e){let t=this.isAgentsPluginRegistered(e),{workspace:n,globalMemory:r}=e.collectedInputContext;return t?r==null?(this.log.debug(`skipped`,{reason:`AgentsOutputPlugin registered but no global memory`}),!1):!0:n.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0)?!0:(this.log.debug(`skipped`,{reason:`no outputs to write`}),!1)}async writeProjectOutputs(e){let t=this.isAgentsPluginRegistered(e),{workspace:n,globalMemory:r}=e.collectedInputContext,{projects:i}=n,a=[],o=[];if(t){if(r==null)return{files:[],dirs:[]};for(let t of i){let n=t.dirFromWorkspacePath;if(n==null)continue;let i=t.name??`unknown`,o=await this.writePromptFile(e,n,r.content,`project:${i}/global-warp`);a.push(o)}return{files:a,dirs:o}}let s=this.extractGlobalMemoryContent(e);for(let t of i){let n=t.name??`unknown`,r=t.dirFromWorkspacePath;if(r!=null){if(t.rootMemoryPrompt!=null){let i=this.combineGlobalWithContent(s,t.rootMemoryPrompt.content),o=await this.writePromptFile(e,r,i,`project:${n}/root`);a.push(o)}if(t.childMemoryPrompts!=null)for(let r of t.childMemoryPrompts){let t=await this.writePromptFile(e,r.dir,r.content,`project:${n}/child:${r.workingChildDirectoryPath?.path??`unknown`}`);a.push(t)}}}return{files:a,dirs:o}}},jf=class extends X{constructor(){super(`WorkspaceInputPlugin`)}collect(e){let{userConfigOptions:t}=e,{workspaceDir:n,shadowProjectDir:r}=this.resolveBasePaths(t),a=t.externalProjects.map(e=>{let t=this.resolvePath(e,n,r);return{name:i.basename(t),dirFromWorkspacePath:{pathKind:M.Relative,path:t,basePath:n,getDirectoryName:()=>i.basename(t)}}});return{workspace:{directory:{pathKind:M.Absolute,path:n,getDirectoryName:()=>i.basename(n)},projects:[]},shadowSourceProjectDir:r,...a.length>0&&{externalProjects:a}}}};const Mf=`.vscode`,Nf=[`.vscode/settings.json`,`.vscode/extensions.json`];var Pf=class extends Td{constructor(){super(`VisualStudioCodeIDEConfigOutputPlugin`)}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{ideConfigFiles:r}=e.collectedInputContext;if(!r.some(e=>e.type===N.VSCode))return t;for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null&&e.isPromptSourceProject!==!0)for(let e of Nf){let r=this.joinPath(n.path,e);t.push({pathKind:M.Relative,path:r,basePath:n.basePath,getDirectoryName:()=>this.dirname(e),getAbsolutePath:()=>this.resolvePath(n.basePath,r)})}}return t}async canWrite(e){let{ideConfigFiles:t}=e.collectedInputContext;return t.some(e=>e.type===N.VSCode)?!0:(this.log.debug(`skipped`,{reason:`no VS Code config files found`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{ideConfigFiles:n}=e.collectedInputContext,r=[],i=[],a=n.filter(e=>e.type===N.VSCode);for(let n of t){let t=n.dirFromWorkspacePath;if(t==null)continue;let i=n.name??`unknown`;for(let n of a){let a=await this.writeConfigFile(e,t,n,`project:${i}`);r.push(a)}}return{files:r,dirs:i}}async writeConfigFile(e,t,n,r){let i=this.getTargetRelativePath(n),a=this.resolvePath(t.basePath,t.path,i),o={pathKind:M.Relative,path:this.joinPath(t.path,i),basePath:t.basePath,getDirectoryName:()=>this.dirname(i),getAbsolutePath:()=>a};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`config`,path:a,label:r}),{path:o,success:!0,skipped:!1};try{let e=this.dirname(a);return this.ensureDirectory(e),this.writeFileSync(a,n.content),this.log.trace({action:`write`,type:`config`,path:a,label:r}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`config`,path:a,label:r,error:t}),{path:o,success:!1,error:e}}}getTargetRelativePath(e){let t=e.dir.path;if(e.type===N.VSCode){let e=t.indexOf(Mf);return e===-1?this.joinPath(Mf,this.basename(t)):t.substring(e)}return this.basename(t)}},Ff=rr({plugins:[new Dd,new jd,new Ld,new Ud,new Yd,new $d,new rf,new _f,new Af,new lf,new Pf,new Cf,new Df,new yf,new vf,new jf,new Tf,new kd,new of,new Ef,new Xd,new Of,new af,new xf,new wf]}),If=Ff;async function Lf(){let e=await Ff;await new Yn(...n.argv).run(e)}Lf().catch(e=>{console.error(e)});export{bt as CircularDependencyError,gt as ClaudeCodeCLISubAgentColors,_t as CodingAgentTools,Tn as ConfigLoader,bn as DEFAULT_CONFIG_FILE_NAME,xn as DEFAULT_GLOBAL_CONFIG_DIR,wt as DEFAULT_SHADOW_SOURCE_PROJECT_STRUCTURE,Nt as DEFAULT_USER_CONFIG,M as FilePathKind,yt as GlobalConfigDirectoryType,N as IDEKind,xt as MissingDependencyError,vt as NamingCaseKind,Mt as PathPlaceholders,mt as PluginKind,ht as PromptKind,P as SHADOW_SOURCE_DIR_NAMES,F as SHADOW_SOURCE_FILE_NAMES,I as SHADOW_SOURCE_RELATIVE_PATHS,Ct as SKILL_RESOURCE_BINARY_EXTENSIONS,St as SKILL_RESOURCE_TEXT_EXTENSIONS,at as checkCanClean,st as checkCanWrite,Pt as checkVersionControl,it as collectAllPluginOutputs,yn as createLogger,If as default,rr as defineConfig,ot as executeOnCleanComplete,ct as executeWriteOutputs,Bt as generateShadowSourceProject,Dn as getConfigLoader,Cn as getDefaultUserConfig,Sn as getGlobalConfigPath,dn as getGlobalLogLevel,On as loadUserConfig,Qn as mergeConfig,un as setGlobalLogLevel,kn as validateAndEnsureGlobalConfig,Ft as validateShadowSourceProject};
285
+ `}collect(e){return{}}},cp=class extends X{constructor(){super(`OrphanFileCleanupEffectInputPlugin`),this.registerEffect(`orphan-file-cleanup`,this.cleanupOrphanFiles.bind(this),20)}async cleanupOrphanFiles(e){let{fs:t,path:n,shadowProjectDir:r,dryRun:i,logger:a}=e,o=n.join(r,`dist`),s=[],c=[],l=[];if(!t.existsSync(o))return a.debug({action:`orphan-cleanup`,message:`dist/ directory does not exist, skipping`,distDir:o}),{success:!0,description:`dist/ directory does not exist, nothing to clean`,deletedFiles:s,deletedDirs:c};for(let r of[`skills`,`commands`,`agents`,`app`]){let a=n.join(o,r);t.existsSync(a)&&this.cleanupDirectory(e,a,r,s,c,l,i??!1)}let u=l.length>0;return u&&a.warn({action:`orphan-cleanup`,errors:l.map(e=>({path:e.path,error:e.error.message}))}),{success:!u,description:i?`Would delete ${s.length} files and ${c.length} directories`:`Deleted ${s.length} files and ${c.length} directories`,deletedFiles:s,deletedDirs:c,...u&&{error:Error(`${l.length} errors occurred during cleanup`)}}}cleanupDirectory(e,t,n,r,i,a,o){let{fs:s,path:c,shadowProjectDir:l,logger:u}=e,d;try{d=s.readdirSync(t,{withFileTypes:!0})}catch(e){a.push({path:t,error:e}),u.warn({action:`orphan-cleanup`,message:`Failed to read directory`,path:t,error:e.message});return}for(let f of d){let d=c.join(t,f.name);if(f.isDirectory())this.cleanupDirectory(e,d,n,r,i,a,o),this.removeEmptyDirectory(e,d,i,a,o);else if(f.isFile()&&this.isOrphanFile(e,d,n,l))if(o)u.debug({action:`orphan-cleanup`,dryRun:!0,wouldDelete:d}),r.push(d);else try{s.unlinkSync(d),r.push(d),u.debug({action:`orphan-cleanup`,deleted:d})}catch(e){a.push({path:d,error:e}),u.warn({action:`orphan-cleanup`,message:`Failed to delete file`,path:d,error:e.message})}}}isOrphanFile(e,t,n,r){let{fs:i,path:a}=e,o=a.basename(t),s=o.endsWith(`.mdx`),c=a.join(r,`dist`,n),l=a.relative(c,t),u=a.dirname(l),d=o.replace(/\.mdx$/,``);if(s)return!this.getPossibleSourcePaths(a,r,n,d,u).some(e=>i.existsSync(e));{let e=[];return n===`app`?e.push(a.join(r,`app`,l)):e.push(a.join(r,`src`,n,l)),!e.some(e=>i.existsSync(e))}}getPossibleSourcePaths(e,t,n,r,i){switch(n){case`skills`:return i===`.`?[e.join(t,`src`,`skills`,r,`SKILL.cn.mdx`),e.join(t,`src`,`skills`,`${r}.cn.mdx`)]:[e.join(t,`src`,`skills`,i,`${r}.cn.mdx`)];case`commands`:return i===`.`?[e.join(t,`src`,`commands`,`${r}.cn.mdx`)]:[e.join(t,`src`,`commands`,i,`${r}.cn.mdx`)];case`agents`:return i===`.`?[e.join(t,`src`,`agents`,`${r}.cn.mdx`)]:[e.join(t,`src`,`agents`,i,`${r}.cn.mdx`)];case`app`:return i===`.`?[e.join(t,`app`,`${r}.cn.mdx`)]:[e.join(t,`app`,i,`${r}.cn.mdx`)];default:return[]}}removeEmptyDirectory(e,t,n,r,i){let{fs:a,logger:o}=e;try{a.readdirSync(t).length===0&&(i?(o.debug({action:`orphan-cleanup`,dryRun:!0,wouldDeleteDir:t}),n.push(t)):(a.rmdirSync(t),n.push(t),o.debug({action:`orphan-cleanup`,deletedDir:t})))}catch(e){r.push({path:t,error:e}),o.warn({action:`orphan-cleanup`,message:`Failed to check/remove directory`,path:t,error:e.message})}}collect(e){return{}}};const lp=`agt.mdx`;var up=class extends X{constructor(){super(`ProjectPromptInputPlugin`,[`ShadowProjectInputPlugin`])}async collect(e){let{dependencyContext:t,fs:n,userConfigOptions:r,path:i,globalScope:a}=e,{workspaceDir:o,shadowProjectDir:s}=this.resolveBasePaths(r),c=r.shadowProjectsDir,l=this.resolvePath(c,o,s),u=t.workspace;if(u==null)return this.log.warn(`No workspace found in dependency context, skipping project prompt enhancement`),{};let d=u.projects??[],f=await Promise.all(d.map(async t=>{let r=t.name;if(r==null)return t;let o=i.join(l,r);if(!n.existsSync(o)||!n.statSync(o).isDirectory())return t;let s=t.dirFromWorkspacePath?.getAbsolutePath(),c=await this.readRootMemoryPrompt(e,o,a),u=s==null?[]:await this.scanChildMemoryPrompts(e,o,s,a);return{...t,...c!=null&&{rootMemoryPrompt:c},...u.length>0&&{childMemoryPrompts:u}}}));return{workspace:{directory:u.directory,projects:f}}}async readRootMemoryPrompt(e,t,n){let{fs:r,path:i,logger:a}=e,o=i.join(t,lp);if(!(!r.existsSync(o)||!r.statSync(o).isFile()))try{let e=r.readFileSync(o,`utf-8`),i=Kd(e),s;try{s=await xf(e,{globalScope:n,basePath:t})}catch(e){throw e instanceof d&&(a.error(`MDX compilation failed in ${o}: ${e.message}`),a.error(`Please check your configuration file (~/.aindex/.tnmsc.json) and ensure all required variables are defined.`),m.exit(1)),e}return{type:Ot.ProjectRootMemory,content:s,length:s.length,filePathKind:N.Relative,...i.yamlFrontMatter!=null&&{yamlFrontMatter:i.yamlFrontMatter},...i.rawFrontMatter!=null&&{rawFrontMatter:i.rawFrontMatter},markdownAst:i.markdownAst,markdownContents:i.markdownContents,dir:{pathKind:N.Root,path:``,getDirectoryName:()=>``}}}catch(e){a.error(`Failed to read root memory prompt at ${o}`,{error:e});return}}async scanChildMemoryPrompts(e,t,n,r){let{logger:i}=e,a=[];try{await this.scanDirectoryRecursive(e,t,t,n,a,r)}catch(e){i.error(`Failed to scan child memory prompts at ${t}`,{error:e})}return a}async scanDirectoryRecursive(e,t,n,r,i,a){let{fs:o,path:s}=e,c=o.readdirSync(n,{withFileTypes:!0});for(let l of c){if(!l.isDirectory()||l.name.startsWith(`.`)||l.name===`node_modules`)continue;let c=s.join(n,l.name),u=s.join(c,lp);if(o.existsSync(u)&&o.statSync(u).isFile()){let n=await this.readChildMemoryPrompt(e,t,c,r,a);n!=null&&i.push(n)}await this.scanDirectoryRecursive(e,t,c,r,i,a)}}async readChildMemoryPrompt(e,t,n,r,i){let{fs:a,path:o,logger:s}=e,c=o.join(n,lp);try{let e=a.readFileSync(c,`utf-8`),l=Kd(e),u;try{u=await xf(e,{globalScope:i,basePath:n})}catch(e){throw e instanceof d&&(s.error(`MDX compilation failed in ${c}: ${e.message}`),s.error(`Please check your configuration file (~/.aindex/.tnmsc.json) and ensure all required variables are defined.`),m.exit(1)),e}let f=o.relative(t,n),p=o.join(r,f),h=o.basename(n);return{type:Ot.ProjectChildrenMemory,content:u,length:u.length,filePathKind:N.Relative,...l.yamlFrontMatter!=null&&{yamlFrontMatter:l.yamlFrontMatter},...l.rawFrontMatter!=null&&{rawFrontMatter:l.rawFrontMatter},markdownAst:l.markdownAst,markdownContents:l.markdownContents,dir:{pathKind:N.Relative,path:f,basePath:r,getDirectoryName:()=>h,getAbsolutePath:()=>p},workingChildDirectoryPath:{pathKind:N.Relative,path:f,basePath:r,getDirectoryName:()=>h,getAbsolutePath:()=>p}}}catch(e){s.error(`Failed to read child memory prompt at ${c}`,{error:e});return}}};const dp=`README.md`;var fp=class extends Jd{constructor(){super(`ReadmeMdConfigFileOutputPlugin`,{outputFileName:dp})}async registerProjectOutputFiles(e){let t=[],{readmePrompts:n}=e.collectedInputContext;if(n==null||n.length===0)return t;for(let e of n){let n=e.targetDir,r=g.join(n.path,dp);t.push({pathKind:N.Relative,path:r,basePath:n.basePath,getDirectoryName:()=>n.getDirectoryName(),getAbsolutePath:()=>g.join(n.basePath,r)})}return t}async canWrite(e){let{readmePrompts:t}=e.collectedInputContext;return t==null||t.length===0?(this.log.debug(`skipped`,{reason:`no README prompts to write`}),!1):!0}async writeProjectOutputs(e){let t=[],n=[],{readmePrompts:r}=e.collectedInputContext;if(r==null||r.length===0)return{files:t,dirs:n};for(let n of r){let r=await this.writeReadmeFile(e,n);t.push(r)}return{files:t,dirs:n}}async writeReadmeFile(e,t){let n=t.targetDir,r=g.join(n.path,dp),i=g.join(n.basePath,r),a=t.content,o={pathKind:N.Relative,path:r,basePath:n.basePath,getDirectoryName:()=>n.getDirectoryName(),getAbsolutePath:()=>i},s=t.isRoot?`project:${t.projectName}/README.md`:`project:${t.projectName}/${n.path}/README.md`;if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`readme`,path:i,label:s}),{path:o,success:!0,skipped:!1};try{let e=g.dirname(i);return h.existsSync(e)||h.mkdirSync(e,{recursive:!0}),h.writeFileSync(i,a,`utf-8`),this.log.trace({action:`write`,type:`readme`,path:i,label:s}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`readme`,path:i,label:s,error:t}),{path:o,success:!1,error:e}}}},pp=class extends X{constructor(){super(`ReadmeMdInputPlugin`,[`ShadowProjectInputPlugin`])}async collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i,globalScope:a}=e,{workspaceDir:o,shadowProjectDir:s}=this.resolveBasePaths(t),c=t.shadowProjectsDir,l=this.resolvePath(c,o,s),u=[];if(!r.existsSync(l)||!r.statSync(l).isDirectory())return n.debug(`shadow projects directory does not exist`,{path:l}),{readmePrompts:u};try{let t=r.readdirSync(l,{withFileTypes:!0});for(let n of t){if(!n.isDirectory())continue;let t=n.name,r=i.join(l,t);await this.collectReadmeFiles(e,r,t,o,``,u,a)}}catch(e){n.error(`failed to scan shadow projects`,{path:l,error:e})}return{readmePrompts:u}}async collectReadmeFiles(e,t,n,r,i,a,o){let{fs:s,path:c,logger:l}=e,u=i===``,f=c.join(t,`readme.mdx`);if(s.existsSync(f)&&s.statSync(f).isFile())try{let e=s.readFileSync(f,`utf-8`),p;if(o!=null)try{p=await xf(e,{globalScope:o,basePath:t})}catch(e){throw e instanceof d&&(l.error(`MDX compilation failed in ${f}: ${e.message}`),l.error(`Please check your configuration file (~/.aindex/.tnmsc.json) and ensure all required variables are defined.`),m.exit(1)),e}else p=e;let h=u?n:c.join(n,i),g={pathKind:N.Relative,path:h,basePath:r,getDirectoryName:()=>u?n:c.basename(i),getAbsolutePath:()=>c.resolve(r,h)},_={pathKind:N.Relative,path:c.dirname(f),basePath:r,getDirectoryName:()=>c.basename(c.dirname(f)),getAbsolutePath:()=>c.dirname(f)};a.push({type:Ot.Readme,content:p,length:p.length,filePathKind:N.Relative,projectName:n,targetDir:g,isRoot:u,markdownContents:[],dir:_})}catch(e){l.warn(`failed to read readme`,{path:f,error:e})}try{let l=s.readdirSync(t,{withFileTypes:!0});for(let s of l)if(s.isDirectory()){let l=u?s.name:c.join(i,s.name),d=c.join(t,s.name);await this.collectReadmeFiles(e,d,n,r,l,a,o)}}catch(e){l.warn(`failed to scan directory`,{path:t,error:e})}}},mp=class extends X{constructor(){super(`ShadowProjectInputPlugin`)}collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i}=e,{workspaceDir:a,shadowProjectDir:o}=this.resolveBasePaths(t),s=t.shadowProjectsDir,c=this.resolvePath(s,a,o),l=i.basename(o),u=[];if(r.existsSync(c)&&r.statSync(c).isDirectory())try{let e=r.readdirSync(c,{withFileTypes:!0});for(let t of e)if(t.isDirectory()){let e=t.name===l;u.push({name:t.name,...e&&{isPromptSourceProject:!0},dirFromWorkspacePath:{pathKind:N.Relative,path:t.name,basePath:a,getDirectoryName:()=>t.name,getAbsolutePath:()=>i.resolve(a,t.name)}})}}catch(e){n.error(`failed to scan shadow projects`,{path:c,error:e})}if(u.length===0&&r.existsSync(a)&&r.statSync(a).isDirectory()){n.debug(`no projects in dist/app/, falling back to workspace scan`,{workspaceDir:a});try{let e=r.readdirSync(a,{withFileTypes:!0});for(let t of e)if(t.isDirectory()&&!t.name.startsWith(`.`)){let e=t.name===l;u.push({name:t.name,...e&&{isPromptSourceProject:!0},dirFromWorkspacePath:{pathKind:N.Relative,path:t.name,basePath:a,getDirectoryName:()=>t.name,getAbsolutePath:()=>i.resolve(a,t.name)}})}}catch(e){n.error(`failed to scan workspace directory`,{path:a,error:e})}}return{workspace:{directory:{pathKind:N.Absolute,path:a,getDirectoryName:()=>i.basename(a)},projects:u}}}},hp=class extends X{constructor(){super(`SkillInputPlugin`)}readMcpConfig(e,t,n){let r=g.join(e,`mcp.json`);if(t.existsSync(r)){if(!t.statSync(r).isFile()){n.warn(`mcp.json is not a file`,{skillDir:e});return}try{let i=t.readFileSync(r,`utf-8`),a=JSON.parse(i);if(a.mcpServers==null||typeof a.mcpServers!=`object`){n.warn(`mcp.json missing mcpServers field`,{skillDir:e});return}return{type:Ot.SkillMcpConfig,mcpServers:a.mcpServers,rawContent:i}}catch(t){n.warn(`failed to parse mcp.json`,{skillDir:e,error:t});return}}}isBinaryResourceExtension(e){return zt.includes(e.toLowerCase())}getResourceCategory(e){let t=e.toLowerCase();return[`.png`,`.jpg`,`.jpeg`,`.gif`,`.webp`,`.ico`,`.bmp`,`.tiff`,`.svg`].includes(t)?`image`:`.kt,.java,.py,.pyi,.pyx,.ts,.tsx,.js,.jsx,.mjs,.cjs,.go,.rs,.c,.cpp,.cc,.h,.hpp,.hxx,.cs,.fs,.fsx,.vb,.rb,.php,.swift,.scala,.groovy,.lua,.r,.jl,.ex,.exs,.erl,.clj,.cljs,.hs,.ml,.mli,.nim,.zig,.v,.dart,.vue,.svelte,.d.ts,.d.mts,.d.cts`.split(`,`).includes(t)?`code`:[`.sql`,`.json`,`.jsonc`,`.json5`,`.xml`,`.xsd`,`.xsl`,`.xslt`,`.yaml`,`.yml`,`.toml`,`.csv`,`.tsv`,`.graphql`,`.gql`,`.proto`].includes(t)?`data`:[`.txt`,`.text`,`.rtf`,`.log`,`.docx`,`.doc`,`.xlsx`,`.xls`,`.pptx`,`.ppt`,`.pdf`,`.odt`,`.ods`,`.odp`].includes(t)?`document`:[`.ini`,`.conf`,`.cfg`,`.config`,`.properties`,`.env`,`.envrc`,`.editorconfig`,`.gitignore`,`.gitattributes`,`.npmrc`,`.nvmrc`,`.npmignore`,`.eslintrc`,`.prettierrc`,`.stylelintrc`,`.babelrc`,`.browserslistrc`].includes(t)?`config`:[`.sh`,`.bash`,`.zsh`,`.fish`,`.ps1`,`.psm1`,`.psd1`,`.bat`,`.cmd`].includes(t)?`script`:`.exe,.dll,.so,.dylib,.bin,.wasm,.class,.jar,.war,.pyd,.pyc,.pyo,.zip,.tar,.gz,.bz2,.7z,.rar,.ttf,.otf,.woff,.woff2,.eot,.db,.sqlite,.sqlite3`.split(`,`).includes(t)?`binary`:`other`}getMimeType(e){return{".ts":`text/typescript`,".tsx":`text/typescript`,".js":`text/javascript`,".jsx":`text/javascript`,".json":`application/json`,".py":`text/x-python`,".java":`text/x-java`,".kt":`text/x-kotlin`,".go":`text/x-go`,".rs":`text/x-rust`,".c":`text/x-c`,".cpp":`text/x-c++`,".cs":`text/x-csharp`,".rb":`text/x-ruby`,".php":`text/x-php`,".swift":`text/x-swift`,".scala":`text/x-scala`,".sql":`application/sql`,".xml":`application/xml`,".yaml":`text/yaml`,".yml":`text/yaml`,".toml":`text/toml`,".csv":`text/csv`,".graphql":`application/graphql`,".txt":`text/plain`,".pdf":`application/pdf`,".docx":`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,".xlsx":`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,".html":`text/html`,".css":`text/css`,".svg":`image/svg+xml`,".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`,".ico":`image/x-icon`,".bmp":`image/bmp`}[e.toLowerCase()]}scanSkillDirectory(e,t,n,r=``){let i=[],a=[],o=r?g.join(e,r):e;try{let s=t.readdirSync(o,{withFileTypes:!0});for(let c of s){let s=r?`${r}/${c.name}`:c.name;if(c.isDirectory()){let r=this.scanSkillDirectory(e,t,n,s);i.push(...r.childDocs),a.push(...r.resources)}else if(c.isFile()){let l=g.join(o,c.name);if(c.name.endsWith(`.mdx`)){if(r===``&&c.name===`skill.mdx`)continue;try{let n=Kd(t.readFileSync(l,`utf-8`)),r=n.contentWithoutFrontMatter;i.push({type:Ot.SkillChildDoc,content:r,length:r.length,filePathKind:N.Relative,markdownAst:n.markdownAst,markdownContents:n.markdownContents,...n.rawFrontMatter!=null&&{rawFrontMatter:n.rawFrontMatter},relativePath:s,dir:{pathKind:N.Relative,path:s,basePath:e,getDirectoryName:()=>g.dirname(s),getAbsolutePath:()=>l}})}catch(e){n.warn(`failed to read child doc`,{path:s,error:e})}}else{if(r===``&&c.name===`mcp.json`)continue;let e=g.extname(c.name),i,o,u;try{if(this.isBinaryResourceExtension(e)){let e=t.readFileSync(l);i=e.toString(`base64`),o=`base64`,u=e.length}else i=t.readFileSync(l,`utf-8`),o=`text`,u=w.byteLength(i,`utf-8`);let n=this.getMimeType(e),r={type:Ot.SkillResource,extension:e,fileName:c.name,relativePath:s,content:i,encoding:o,category:this.getResourceCategory(e),length:u};n==null?a.push(r):a.push({...r,mimeType:n})}catch(e){n.warn(`failed to read resource file`,{path:s,error:e})}}}}}catch(e){n.warn(`failed to scan directory`,{path:o,error:e})}return{childDocs:i,resources:a}}async collect(e){let{userConfigOptions:n,logger:r,globalScope:i}=e,{workspaceDir:a,shadowProjectDir:o}=this.resolveBasePaths(n),s=n.shadowSkillSourceDir,c=this.resolvePath(s,a,o),l=[];if(e.fs.existsSync(c)&&e.fs.statSync(c).isDirectory()){let n=e.fs.readdirSync(c,{withFileTypes:!0});for(let a of n)if(a.isDirectory()){let n=e.path.join(c,a.name,`skill.mdx`);if(e.fs.existsSync(n)&&e.fs.statSync(n).isFile())try{let o=e.fs.readFileSync(n,`utf-8`),s=Kd(o),u=await xf(o,{globalScope:i,extractMetadata:!0,basePath:e.path.join(c,a.name)}),d={...s.yamlFrontMatter,...u.metadata.fields},f=Pt(d,n);for(let e of f.warnings)r.debug(e);if(!f.valid)throw new t(f.errors,n);let p=u.content,m=e.path.join(c,a.name),h=this.readMcpConfig(m,e.fs,r),{childDocs:_,resources:v}=this.scanSkillDirectory(m,e.fs,r);r.debug(`skill metadata extracted`,{skill:a.name,source:u.metadata.source,hasYaml:s.yamlFrontMatter!=null,hasExport:Object.keys(u.metadata.fields).length>0}),l.push({type:Ot.Skill,content:p,length:p.length,filePathKind:N.Relative,yamlFrontMatter:d.name==null?{name:a.name,description:``}:d,...s.rawFrontMatter!=null&&{rawFrontMatter:s.rawFrontMatter},markdownAst:s.markdownAst,markdownContents:s.markdownContents,...h!=null&&{mcpConfig:h},..._.length>0&&{childDocs:_},...v.length>0&&{resources:v},dir:{pathKind:N.Relative,path:a.name,basePath:c,getDirectoryName:()=>a.name,getAbsolutePath:()=>g.join(c,a.name)}})}catch(e){r.error(`failed to parse skill`,{file:n,error:e})}}}return{skills:l}}},gp=class extends X{constructor(){super(`SkillNonSrcFileSyncEffectInputPlugin`),this.registerEffect(`skill-non-src-file-sync`,this.syncNonSrcFiles.bind(this),10)}async syncNonSrcFiles(e){let{fs:t,path:n,shadowProjectDir:r,dryRun:i,logger:a}=e,o=n.join(r,`src`,`skills`),s=n.join(r,`dist`,`skills`),c=[],l=[],u=[],d=[];if(!t.existsSync(o))return a.debug({action:`skill-sync`,message:`src/skills/ directory does not exist, skipping`,srcSkillsDir:o}),{success:!0,description:`src/skills/ directory does not exist, nothing to sync`,copiedFiles:c,skippedFiles:l,createdDirs:u};this.syncDirectoryRecursive(e,o,s,``,c,l,u,d,i??!1);let f=d.length>0;return f&&a.warn({action:`skill-sync`,errors:d.map(e=>({path:e.path,error:e.error.message}))}),{success:!f,description:i?`Would copy ${c.length} files, skip ${l.length} files`:`Copied ${c.length} files, skipped ${l.length} files`,copiedFiles:c,skippedFiles:l,createdDirs:u,...f&&{error:Error(`${d.length} errors occurred during sync`)},modifiedFiles:c}}syncDirectoryRecursive(e,t,n,r,i,a,o,s,c){let{fs:l,path:u,logger:d}=e,f=r?u.join(t,r):t;if(!l.existsSync(f))return;let p;try{p=l.readdirSync(f,{withFileTypes:!0})}catch(e){s.push({path:f,error:e}),d.warn({action:`skill-sync`,message:`Failed to read directory`,path:f,error:e.message});return}for(let f of p){let p=r?u.join(r,f.name):f.name,m=u.join(t,p),h=u.join(n,p);if(f.isDirectory())this.syncDirectoryRecursive(e,t,n,p,i,a,o,s,c);else if(f.isFile()){if(f.name.endsWith(`.cn.mdx`))continue;let e=u.dirname(h);if(!l.existsSync(e))if(c)d.debug({action:`skill-sync`,dryRun:!0,wouldCreateDir:e}),o.push(e);else try{l.mkdirSync(e,{recursive:!0}),o.push(e),d.debug({action:`skill-sync`,createdDir:e})}catch(t){s.push({path:e,error:t}),d.warn({action:`skill-sync`,message:`Failed to create directory`,path:e,error:t.message});continue}if(l.existsSync(h))try{let e=l.readFileSync(m),t=l.readFileSync(h);if(this.computeHash(e)===this.computeHash(t)){a.push(h),d.debug({action:`skill-sync`,skipped:h,reason:`identical content`});continue}}catch(e){d.debug({action:`skill-sync`,message:`Could not compare files, will copy`,path:h,error:e.message})}if(c)d.debug({action:`skill-sync`,dryRun:!0,wouldCopy:{from:m,to:h}}),i.push(h);else try{l.copyFileSync(m,h),i.push(h),d.debug({action:`skill-sync`,copied:{from:m,to:h}})}catch(e){s.push({path:h,error:e}),d.warn({action:`skill-sync`,message:`Failed to copy file`,from:m,to:h,error:e.message})}}}}computeHash(e){return T(`sha256`).update(e).digest(`hex`)}collect(e){return{}}},_p=class extends X{constructor(){super(`SubAgentInputPlugin`)}async collect(e){let{userConfigOptions:n,logger:r,fs:i,path:a,globalScope:o}=e,{workspaceDir:s,shadowProjectDir:c}=this.resolveBasePaths(n),l=n.shadowSubAgentDir,u=this.resolvePath(l,s,c),d=[];if(i.existsSync(u)&&i.statSync(u).isDirectory())try{let e=i.readdirSync(u,{withFileTypes:!0});for(let n of e)if(n.isFile()&&n.name.endsWith(`.mdx`)){let e=a.join(u,n.name),s=i.readFileSync(e,`utf-8`),c=Kd(s),l=await xf(s,{globalScope:o,extractMetadata:!0,basePath:u}),f=c.yamlFrontMatter!=null||Object.keys(l.metadata.fields).length>0?{...c.yamlFrontMatter,...l.metadata.fields}:void 0;if(f!=null){let n=It(f,e);for(let e of n.warnings)r.debug(e);if(!n.valid)throw new t(n.errors,e)}let p=l.content;r.debug(`sub agent metadata extracted`,{agent:n.name,source:l.metadata.source,hasYaml:c.yamlFrontMatter!=null,hasExport:Object.keys(l.metadata.fields).length>0}),d.push({type:Ot.SubAgent,content:p,length:p.length,filePathKind:N.Relative,...f!=null&&{yamlFrontMatter:f},...c.rawFrontMatter!=null&&{rawFrontMatter:c.rawFrontMatter},markdownAst:c.markdownAst,markdownContents:c.markdownContents,dir:{pathKind:N.Relative,path:n.name,basePath:u,getDirectoryName:()=>n.name.replace(/\.mdx$/,``),getAbsolutePath:()=>e}})}}catch(e){r.error(`Failed to scan sub agents at ${u}`,{error:e})}return{subAgents:d}}};const vp=`WARP.md`;var yp=class extends Jd{constructor(){super(`WarpIDEOutputPlugin`,{outputFileName:vp})}isAgentsPluginRegistered(e){return`registeredPluginNames`in e&&e.registeredPluginNames!=null?e.registeredPluginNames.includes(`AgentsOutputPlugin`):!1}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,r=this.isAgentsPluginRegistered(e);for(let e of n)if(e.dirFromWorkspacePath!=null){if(r)t.push(this.createFileRelativePath(e.dirFromWorkspacePath,vp));else if(e.rootMemoryPrompt!=null&&t.push(this.createFileRelativePath(e.dirFromWorkspacePath,vp)),e.childMemoryPrompts!=null)for(let n of e.childMemoryPrompts)n.dir!=null&&this.isRelativePath(n.dir)&&t.push(this.createFileRelativePath(n.dir,vp))}return t}async canWrite(e){let t=this.isAgentsPluginRegistered(e),{workspace:n,globalMemory:r}=e.collectedInputContext;return t?r==null?(this.log.debug(`skipped`,{reason:`AgentsOutputPlugin registered but no global memory`}),!1):!0:n.projects.some(e=>e.rootMemoryPrompt!=null||(e.childMemoryPrompts?.length??0)>0)?!0:(this.log.debug(`skipped`,{reason:`no outputs to write`}),!1)}async writeProjectOutputs(e){let t=this.isAgentsPluginRegistered(e),{workspace:n,globalMemory:r}=e.collectedInputContext,{projects:i}=n,a=[],o=[];if(t){if(r==null)return{files:[],dirs:[]};for(let t of i){let n=t.dirFromWorkspacePath;if(n==null)continue;let i=t.name??`unknown`,o=await this.writePromptFile(e,n,r.content,`project:${i}/global-warp`);a.push(o)}return{files:a,dirs:o}}let s=this.extractGlobalMemoryContent(e);for(let t of i){let n=t.name??`unknown`,r=t.dirFromWorkspacePath;if(r!=null){if(t.rootMemoryPrompt!=null){let i=this.combineGlobalWithContent(s,t.rootMemoryPrompt.content),o=await this.writePromptFile(e,r,i,`project:${n}/root`);a.push(o)}if(t.childMemoryPrompts!=null)for(let r of t.childMemoryPrompts){let t=await this.writePromptFile(e,r.dir,r.content,`project:${n}/child:${r.workingChildDirectoryPath?.path??`unknown`}`);a.push(t)}}}return{files:a,dirs:o}}},bp=class extends X{constructor(){super(`WorkspaceInputPlugin`)}collect(e){let{userConfigOptions:t}=e,{workspaceDir:n,shadowProjectDir:r}=this.resolveBasePaths(t),i=t.externalProjects.map(e=>{let t=this.resolvePath(e,n,r);return{name:g.basename(t),dirFromWorkspacePath:{pathKind:N.Relative,path:t,basePath:n,getDirectoryName:()=>g.basename(t)}}});return{workspace:{directory:{pathKind:N.Absolute,path:n,getDirectoryName:()=>g.basename(n)},projects:[]},shadowSourceProjectDir:r,...i.length>0&&{externalProjects:i}}}};const xp=`.vscode`,Sp=[`.vscode/settings.json`,`.vscode/extensions.json`];var Cp=class extends Jd{constructor(){super(`VisualStudioCodeIDEConfigOutputPlugin`)}async registerProjectOutputFiles(e){let t=[],{projects:n}=e.collectedInputContext.workspace,{ideConfigFiles:r}=e.collectedInputContext;if(!r.some(e=>e.type===P.VSCode))return t;for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null&&e.isPromptSourceProject!==!0)for(let e of Sp){let r=this.joinPath(n.path,e);t.push({pathKind:N.Relative,path:r,basePath:n.basePath,getDirectoryName:()=>this.dirname(e),getAbsolutePath:()=>this.resolvePath(n.basePath,r)})}}return t}async canWrite(e){let{ideConfigFiles:t}=e.collectedInputContext;return t.some(e=>e.type===P.VSCode)?!0:(this.log.debug(`skipped`,{reason:`no VS Code config files found`}),!1)}async writeProjectOutputs(e){let{projects:t}=e.collectedInputContext.workspace,{ideConfigFiles:n}=e.collectedInputContext,r=[],i=[],a=n.filter(e=>e.type===P.VSCode);for(let n of t){let t=n.dirFromWorkspacePath;if(t==null)continue;let i=n.name??`unknown`;for(let n of a){let a=await this.writeConfigFile(e,t,n,`project:${i}`);r.push(a)}}return{files:r,dirs:i}}async writeConfigFile(e,t,n,r){let i=this.getTargetRelativePath(n),a=this.resolvePath(t.basePath,t.path,i),o={pathKind:N.Relative,path:this.joinPath(t.path,i),basePath:t.basePath,getDirectoryName:()=>this.dirname(i),getAbsolutePath:()=>a};if(e.dryRun===!0)return this.log.trace({action:`dryRun`,type:`config`,path:a,label:r}),{path:o,success:!0,skipped:!1};try{let e=this.dirname(a);return this.ensureDirectory(e),this.writeFileSync(a,n.content),this.log.trace({action:`write`,type:`config`,path:a,label:r}),{path:o,success:!0}}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error({action:`write`,type:`config`,path:a,label:r,error:t}),{path:o,success:!1,error:e}}}getTargetRelativePath(e){let t=e.dir.path;if(e.type===P.VSCode){let e=t.indexOf(xp);return e===-1?this.joinPath(xp,this.basename(t)):t.substring(e)}return this.basename(t)}},wp=Tr({plugins:[new Xd,new ef,new Df,new Nf,new zf,new Uf,new qf,new op,new yp,new Qf,new Cp,new fp,new gp,new cp,new sp,new bp,new mp,new Qd,new Yf,new hp,new Bf,new _p,new Jf,new up,new pp]}),Tp=wp;async function Ep(){let e=await wp;await new _r(...m.argv).run(e)}Ep().catch(e=>{console.error(e)});export{e as CircularDependencyError,kt as ClaudeCodeCLISubAgentColors,At as CodingAgentTools,Vn as ConfigLoader,s as ConfigValidationError,In as DEFAULT_CONFIG_FILE_NAME,Ln as DEFAULT_GLOBAL_CONFIG_DIR,Bt as DEFAULT_SHADOW_SOURCE_PROJECT_STRUCTURE,Yt as DEFAULT_USER_CONFIG,l as ExportParseError,N as FilePathKind,Mt as GlobalConfigDirectoryType,P as IDEKind,t as MetadataValidationError,a as MissingDependencyError,jt as NamingCaseKind,Jt as PathPlaceholders,Dt as PluginKind,Ot as PromptKind,F as SHADOW_SOURCE_DIR_NAMES,I as SHADOW_SOURCE_FILE_NAMES,L as SHADOW_SOURCE_RELATIVE_PATHS,zt as SKILL_RESOURCE_BINARY_EXTENSIONS,Rt as SKILL_RESOURCE_TEXT_EXTENSIONS,d as ScopeError,n as UndefinedNamespaceError,r as UndefinedVariableError,Lt as applyMetadataDefaults,vt as checkCanClean,bt as checkCanWrite,Xt as checkVersionControl,_t as collectAllPluginOutputs,Fn as createLogger,Tp as default,Tr as defineConfig,yt as executeOnCleanComplete,xt as executeWriteOutputs,nn as generateShadowSourceProject,Un as getConfigLoader,zn as getDefaultUserConfig,Rn as getGlobalConfigPath,Dn as getGlobalLogLevel,Wn as loadUserConfig,br as mergeConfig,En as setGlobalLogLevel,Gn as validateAndEnsureGlobalConfig,Nt as validateExportMetadata,Ft as validateFastCommandMetadata,Zt as validateShadowSourceProject,Pt as validateSkillMetadata,It as validateSubAgentMetadata};