@truenine/memory-sync-cli 2026.10402.116 → 2026.10403.117

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
@@ -193,43 +193,42 @@ var n=dm(),r={"{":`}`,"(":`)`,"[":`]`},i=function(e){if(e[0]===`!`)return!0;for(
193
193
  /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
194
194
  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))})),Um=C(((e,t)=>{
195
195
  /*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
196
- t.exports=r;let n=Hm();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}})),Wm=C((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})),Gm=C((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})),Km=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fs=void 0,e.fs=Gm()})),qm=C((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})),Jm=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=Vm(),n=Um(),r=Wm(),i=Km(),a=qm();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)}})),Ym=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=Vm(),n=Wm(),r=Km(),i=qm();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})),Xm=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;let t=E(`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})),Zm=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`path`),n=Vm(),r=Xm();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}}})),Qm=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;let t=Jm(),n=Ym(),r=Zm();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)}})),$m=C(((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})),eh=C(((e,t)=>{var n=$m();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})),th=C((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})),nh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=th();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}})),rh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`events`),n=Qm(),r=eh(),i=th(),a=nh();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)}}})),ih=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=rh();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)}})),ah=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`stream`),n=rh();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}}})),oh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Qm(),n=th(),r=nh();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)}}})),sh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=oh();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()}}})),ch=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`path`),n=Qm();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}}})),lh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;let t=ih(),n=ah(),r=sh(),i=ch();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)}})),uh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`path`),n=Vm(),r=Fm();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}}})),dh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`stream`),n=Vm(),r=lh(),i=uh();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))})}}})),fh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=lh(),n=uh(),r=dh();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))})}}})),ph=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm();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))}}})),mh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=ph();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}}})),hh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm(),n=mh();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)}}})),gh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm();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}}})),_h=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}})),vh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm();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}}})),yh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`path`),n=hh(),r=gh(),i=_h(),a=vh();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}}}})),bh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=fh(),n=yh();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)}}})),xh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`stream`),n=dh(),r=yh();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)}}})),Sh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Vm(),n=lh(),r=uh();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)}}})),Ch=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Sh(),n=yh();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)}}})),wh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;let t=E(`fs`),n=E(`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)}}})),Th=T(C(((e,t)=>{let n=Im(),r=bh(),i=xh(),a=Ch(),o=wh(),s=Fm();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);const Eh={"win32-x64":{local:`napi-script-runtime.win32-x64-msvc`,suffix:`win32-x64-msvc`},"linux-x64":{local:`napi-script-runtime.linux-x64-gnu`,suffix:`linux-x64-gnu`},"linux-arm64":{local:`napi-script-runtime.linux-arm64-gnu`,suffix:`linux-arm64-gnu`},"darwin-arm64":{local:`napi-script-runtime.darwin-arm64`,suffix:`darwin-arm64`},"darwin-x64":{local:`napi-script-runtime.darwin-x64`,suffix:`darwin-x64`}};let Dh,Oh,kh;function Ah(){let e=Eh[`${a.platform}-${a.arch}`];if(e!=null)return e;throw Error(`Unsupported platform for @truenine/script-runtime native binding: ${a.platform}-${a.arch}`)}function jh(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.validate_public_path==`function`||typeof t.validatePublicPath==`function`||typeof t.resolve_public_path==`function`||typeof t.resolvePublicPath==`function`}function Mh(e,t,n){let r=e instanceof Error?e.message:String(e),i=t instanceof Error?t.message:String(t);return Error([`Failed to load @truenine/script-runtime native binding.`,`Tried local binary "./${Eh[`${a.platform}-${a.arch}`]?.local??`unknown`}.node" and package "@truenine/memory-sync-cli-${n}".`,`Local error: ${r}`,`Package error: ${i}`,"Run `pnpm -F @truenine/script-runtime run build` to build the native module."].join(`
197
- `))}function Nh(e,n){let r=`@truenine/memory-sync-cli-${n}`;try{let t=e(r).scriptRuntime;if(jh(t))return t}catch{}let i=l(e.resolve(`${r}/package.json`)),a=t.readdirSync(i).filter(e=>e.startsWith(`napi-script-runtime.`)&&e.endsWith(`.node`)).sort();for(let t of a){let n=e(u(i,t));if(jh(n))return n}throw Error(`Package "${r}" does not export a scriptRuntime binding or contain a compatible native module`)}function Ph(){let t=e(import.meta.url),{local:n,suffix:r}=Ah();try{return t(`./${n}.node`)}catch(e){try{return Nh(t,r)}catch(t){throw Mh(e,t,r)}}}function Fh(){if(Dh!=null)return Dh;if(Oh!=null)throw Oh;try{return Dh=Ph(),Dh}catch(e){throw Oh=e instanceof Error?e:Error(String(e)),Oh}}function Ih(e,t,n){let r=Fh(),i=r.resolve_public_path??r.resolvePublicPath;if(i==null)throw Error(`resolve_public_path native binding is unavailable`);return i(e,t,n)}function Lh(){if(kh!=null)return kh;let e=[o(new URL(`./resolve-proxy-worker.mjs`,import.meta.url)),o(new URL(`./script-runtime-worker.mjs`,import.meta.url))];for(let n of e)if(t.existsSync(n))return kh=n,n;return kh=e[0],kh}function Rh(e,t,n,r=5e3){return Ih(e,JSON.stringify({...t,workerPath:Lh(),timeoutMs:r}),n)}const zh=`aindex`,Bh=[`app`,`ext`,`arch`,`softwares`],Vh=[`skills`,`commands`,`subAgents`,`rules`,...Bh],Hh=[`globalPrompt`,`workspacePrompt`],Uh=[`skills`,`commands`,`subAgents`,`rules`,`globalPrompt`,`workspacePrompt`,...Bh],Wh=[`skills`,`commands`,`subAgents`,...Bh],Gh={skills:{src:`skills`,dist:`dist/skills`},commands:{src:`commands`,dist:`dist/commands`},subAgents:{src:`subagents`,dist:`dist/subagents`},rules:{src:`rules`,dist:`dist/rules`},globalPrompt:{src:`global.src.mdx`,dist:`dist/global.mdx`},workspacePrompt:{src:`workspace.src.mdx`,dist:`dist/workspace.mdx`},app:{src:`app`,dist:`dist/app`},ext:{src:`ext`,dist:`dist/ext`},arch:{src:`arch`,dist:`dist/arch`},softwares:{src:`softwares`,dist:`dist/softwares`}};function Kh(){let e=[];for(let t of Uh)e.push(`aindex.${t}.src`,`aindex.${t}.dist`);return e}function qh(){return Object.fromEntries(Uh.map(e=>[e,{...Gh[e]}]))}const Jh=Kh();function Yh(){return{dir:zh,...qh()}}function Xh(e,t){if(t==null)return e;let n=Object.fromEntries(Uh.map(n=>[n,{...e[n],...t[n]}]));return{...e,...t,dir:t.dir??e.dir,...n}}const Zh={SRC:`src`,DIST:`dist`,SKILLS:`skills`,COMMANDS:`commands`,AGENTS:`agents`,RULES:`rules`,APP:`app`,EXT:`ext`,ARCH:`arch`,SOFTWARES:`softwares`,IDEA:`.idea`,IDEA_CODE_STYLES:`.idea/codeStyles`,VSCODE:`.vscode`,ZED:`.zed`},Qh={GLOBAL_MEMORY:`global.mdx`,GLOBAL_MEMORY_SRC:`global.src.mdx`,WORKSPACE_MEMORY:`workspace.mdx`,WORKSPACE_MEMORY_SRC:`workspace.src.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`,ZED_SETTINGS:`.zed/settings.json`,QODER_IGNORE:`.qoderignore`,CURSOR_IGNORE:`.cursorignore`,WARP_INDEX_IGNORE:`.warpindexignore`,AI_IGNORE:`.aiignore`,WINDSURF_IGNORE:`.codeignore`,CODEIUM_IGNORE:`.codeiumignore`},$h={SRC_SKILLS:`src/skills`,SRC_COMMANDS:`src/commands`,SRC_AGENTS:`src/agents`,SRC_RULES:`src/rules`,SRC_GLOBAL_MEMORY:`global.src.mdx`,SRC_WORKSPACE_MEMORY:`workspace.src.mdx`,DIST_SKILLS:`dist/skills`,DIST_COMMANDS:`dist/commands`,DIST_AGENTS:`dist/agents`,DIST_RULES:`dist/rules`,DIST_APP:`dist/app`,DIST_EXT:`dist/ext`,DIST_ARCH:`dist/arch`,DIST_SOFTWARES:`dist/softwares`,DIST_GLOBAL_MEMORY:`dist/global.mdx`,DIST_WORKSPACE_MEMORY:`dist/workspace.mdx`,APP:`app`,EXT:`ext`,ARCH:`arch`,SOFTWARES:`softwares`},eg={src:{skills:{name:Zh.SKILLS,required:!1,description:`Skill source files (.src.mdx)`},commands:{name:Zh.COMMANDS,required:!1,description:`Fast command source files (.src.mdx)`},agents:{name:Zh.AGENTS,required:!1,description:`Sub-agent source files (.src.mdx)`},rules:{name:Zh.RULES,required:!1,description:`Rule source files (.src.mdx)`},globalMemoryFile:{name:Qh.GLOBAL_MEMORY_SRC,required:!1,description:`Global memory source file`},workspaceMemoryFile:{name:Qh.WORKSPACE_MEMORY_SRC,required:!1,description:`Workspace memory source file`}},dist:{skills:{name:Zh.SKILLS,required:!1,description:`Compiled skill files (.mdx)`},commands:{name:Zh.COMMANDS,required:!1,description:`Compiled fast command files (.mdx)`},agents:{name:Zh.AGENTS,required:!1,description:`Compiled sub-agent files (.mdx)`},rules:{name:Zh.RULES,required:!1,description:`Compiled rule files (.mdx)`},globalMemoryFile:{name:Qh.GLOBAL_MEMORY,required:!1,description:`Compiled global memory file`},workspaceMemoryFile:{name:Qh.WORKSPACE_MEMORY,required:!1,description:`Compiled workspace memory file`},app:{name:Zh.APP,required:!1,description:`Compiled project-specific prompts`},ext:{name:Zh.EXT,required:!1,description:`Compiled extension-specific prompts`},arch:{name:Zh.ARCH,required:!1,description:`Compiled architecture-specific prompts`},softwares:{name:Zh.SOFTWARES,required:!1,description:`Compiled software-repository prompts`}},app:{name:Zh.APP,required:!1,description:`Project-specific prompts (standalone directory)`},ext:{name:Zh.EXT,required:!1,description:`Extension-specific prompts (standalone directory)`},arch:{name:Zh.ARCH,required:!1,description:`Architecture-specific prompts (standalone directory)`},softwares:{name:Zh.SOFTWARES,required:!1,description:`Software-repository prompts (standalone directory)`},ide:{idea:{name:Zh.IDEA,required:!1,description:`JetBrains IDE configuration directory`},ideaCodeStyles:{name:Zh.IDEA_CODE_STYLES,required:!1,description:`JetBrains IDE code styles directory`},vscode:{name:Zh.VSCODE,required:!1,description:`VS Code configuration directory`},zed:{name:Zh.ZED,required:!1,description:`Zed configuration directory`}},ideFiles:[{name:Qh.EDITOR_CONFIG,required:!1,description:`EditorConfig file`},{name:Qh.IDEA_GITIGNORE,required:!1,description:`JetBrains IDE .gitignore`},{name:Qh.IDEA_PROJECT_XML,required:!1,description:`JetBrains IDE Project.xml`},{name:Qh.IDEA_CODE_STYLE_CONFIG_XML,required:!1,description:`JetBrains IDE codeStyleConfig.xml`},{name:Qh.VSCODE_SETTINGS,required:!1,description:`VS Code settings.json`},{name:Qh.VSCODE_EXTENSIONS,required:!1,description:`VS Code extensions.json`},{name:Qh.ZED_SETTINGS,required:!1,description:`Zed settings.json`}],ignoreFiles:[{name:Qh.QODER_IGNORE,required:!1,description:`Qoder ignore file`},{name:Qh.CURSOR_IGNORE,required:!1,description:`Cursor ignore file`},{name:Qh.WARP_INDEX_IGNORE,required:!1,description:`Warp index ignore file`},{name:Qh.AI_IGNORE,required:!1,description:`AI ignore file`},{name:Qh.WINDSURF_IGNORE,required:!1,description:`Windsurf ignore file`},{name:Qh.CODEIUM_IGNORE,required:!1,description:`Windsurf legacy ignore file`}]};let tg=function(e){return e.Output=`output`,e}({}),ng=function(e){return e.GlobalMemory=`globalMemory`,e.ProjectRootMemory=`projectRootMemory`,e.ProjectChildrenMemory=`projectChildrenMemory`,e.Command=`command`,e.SubAgent=`subAgent`,e.Skill=`skill`,e.SkillChildDoc=`skillChildDoc`,e.SkillResource=`skillResource`,e.SkillMcpConfig=`skillMcpConfig`,e.Readme=`readme`,e.Rule=`rule`,e}({}),rg=function(e){return e.Relative=`relative`,e.Absolute=`absolute`,e.Root=`root`,e}({}),ig=function(e){return e.VSCode=`vscode`,e.Zed=`zed`,e.IntellijIDEA=`intellijIdea`,e.Git=`git`,e.EditorConfig=`editorconfig`,e.Original=`original`,e}({}),ag=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}({}),og=function(e){return e.UserHome=`userHome`,e.External=`external`,e}({});const sg=`proxy.ts`,cg=`.gitignore`,lg=`.git/info/exclude`,ug=[Qh.QODER_IGNORE,Qh.CURSOR_IGNORE,Qh.WARP_INDEX_IGNORE,Qh.AI_IGNORE,Qh.WINDSURF_IGNORE,Qh.CODEIUM_IGNORE,`.kiroignore`,`.traeignore`],dg=[cg,lg,Qh.EDITOR_CONFIG,Qh.VSCODE_SETTINGS,Qh.VSCODE_EXTENSIONS,Qh.ZED_SETTINGS,Qh.IDEA_PROJECT_XML,Qh.IDEA_CODE_STYLE_CONFIG_XML,Qh.IDEA_GITIGNORE,...ug],fg=new Map;function pg(e){let t=e.split(/[\\/]+/).filter(e=>e.length>0).join(`/`);if(t.length===0)throw Error(`public target relative path cannot be empty`);return t}function mg(e){return s.join(e,`public`)}function hg(e){return s.join(mg(e),sg)}function gg(e){return e?.command??`execute`}function _g(e,t){return s.resolve(t?.workspaceDir??s.dirname(e))}function vg(e,t,n){return{cwd:t,workspaceDir:t,aindexDir:s.resolve(e),command:n,platform:a.platform}}function yg(e,t,n){return Rh(e,t,n)}function bg(e,n,r){let i=pg(n);if(i===`proxy.ts`)return sg;let a=hg(e);if(!(t.existsSync(a)&&t.statSync(a).isFile()))return i;let o=gg(r),s=_g(e,r),c=[a,s,o,i].join(`::`),l=fg.get(c);if(l!=null)return l;let u=yg(a,vg(e,s,o),i);return fg.set(c,u),u}function xg(e,t,n){let r=bg(e,t,n);return s.join(mg(e),...r.split(/[\\/]+/))}function Sg(e,t){let n=new Set([xg(e,sg)]);for(let r of dg)n.add(xg(e,r,t));return[...n]}function Cg(e,t,n,r,i){let a=xg(n,t,i);if(!(r.existsSync(a)&&r.statSync(a).isFile()))return;let o=r.readFileSync(a,`utf8`);return{type:e,content:o,length:o.length,filePathKind:rg.Absolute,dir:{pathKind:rg.Absolute,path:a,getDirectoryName:()=>s.basename(a)}}}const wg=`.aindex`,Tg=`.tnmsc.json`,Eg=/^[A-Za-z]:[\\/]/u,Dg=/%([^%]+)%/gu,Og=/\$\{([A-Za-z_]\w*)\}/gu,kg=/\$([A-Za-z_]\w*)/gu;function Ag(e){return e!=null&&`effectiveHomeDir`in e&&`expandedEnv`in e}function jg(e){return e?.fs??t}function Mg(e){return e?.platform??a.platform}function Ng(e){return e?.release??p.release()}function Pg(e){return e?.homedir??p.homedir()}function Fg(e){return e?.env??a.env}function Ig(e){return e?.windowsUsersRoot??`/mnt/c/Users`}function Lg(e){return s.posix.normalize(e.replaceAll(`\\`,`/`))}function Rg(e,t){let n=Lg(e),r=Lg(t);return n===r?!0:n.startsWith(`${r}/`)}function zg(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n.length===0)return;let r=[Yg(n),Lg(n)];for(let e of r)if(e!=null&&Rg(e,t))return Lg(e)}function Bg(e){let t=Fg(e),n=Lg(Ig(e)),r=t.HOMEDRIVE,i=t.HOMEPATH,a=[zg(t.USERPROFILE,n),typeof r==`string`&&r.length>0&&typeof i==`string`&&i.length>0?zg(`${r}${i}`,n):void 0,zg(t.HOME,n)];return[...new Set(a.filter(e=>e!=null))]}function Vg(e){let t=Lg(e);return s.posix.dirname(s.posix.dirname(t))}function Hg(e,t){let n=Bg(t);if(n.length<=0)return e.length===1?e[0]:void 0;for(let t of n){let n=e.find(e=>Vg(e)===t);if(n!=null)return n}}function Ug(e,t){try{return e.statSync(t).isDirectory()}catch{return!1}}function Wg(e,t){try{return e.statSync(t).isFile()}catch{return!1}}function Gg(e){return e===`win32`?s.win32:s.posix}function Kg(e,t,n){let r={};for(let[t,n]of Object.entries(e))typeof n==`string`&&(r[t]=n);if(n===t)return r;r.HOME=n,r.USERPROFILE=n;let i=/^\/mnt\/([a-zA-Z])\/(.+)$/u.exec(n);if(i==null)return r;let a=i[1],o=i[2];return a==null||o==null?r:(r.HOMEDRIVE=`${a.toUpperCase()}:`,r.HOMEPATH=`\\${o.replaceAll(`/`,`\\`)}`,r)}function qg(e,t){let n=(e,n)=>t[n]??e;return e.replaceAll(Dg,n).replaceAll(Og,n).replaceAll(kg,n)}function Jg(e,t,n){if(e===`~`)return t;if(!(e.startsWith(`~/`)||e.startsWith(`~\\`)))return e;let r=Gg(n),i=n===`win32`?e.slice(2).replaceAll(`/`,`\\`):e.slice(2).replaceAll(`\\`,`/`);return r.resolve(t,i)}function Yg(e){if(!Eg.test(e))return;let t=e.slice(0,1).toLowerCase(),n=e.slice(2).replaceAll(`\\`,`/`).replace(/^\/+/u,``),r=`/mnt/${t}`;return n.length===0?r:s.posix.join(r,n)}function Xg(e,t){return t===`win32`?s.win32.normalize(e.replaceAll(`/`,`\\`)):s.posix.normalize(e)}function Zg(e){if(Mg(e)!==`linux`)return!1;let t=Fg(e);return typeof t.WSL_DISTRO_NAME==`string`&&t.WSL_DISTRO_NAME.length>0||typeof t.WSL_INTEROP==`string`&&t.WSL_INTEROP.length>0?!0:Ng(e).toLowerCase().includes(`microsoft`)}function Qg(e){let t=jg(e),n=Ig(e);if(!Ug(t,n))return[];try{let e=t.readdirSync(n,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>s.join(n,e.name,wg,Tg)).filter(e=>t.existsSync(e)&&Wg(t,e));return e.sort((e,t)=>e.localeCompare(t)),e}catch{return[]}}function $g(e){let t=Mg(e),n=Pg(e),r=Zg(e),i=r?Qg(e):[],a=r?Hg(i,e):void 0,o=a==null?n:Vg(a);return{platform:t,isWsl:r,nativeHomeDir:n,effectiveHomeDir:o,globalConfigCandidates:i,...a!=null&&{selectedGlobalConfigPath:a},...a!=null&&{wslHostHomeDir:o},windowsUsersRoot:Ig(e),expandedEnv:Kg(Fg(e),n,o)}}function e_(e){return $g(e).effectiveHomeDir}function t_(e){let t=$g(e);return t.selectedGlobalConfigPath==null?s.join(t.effectiveHomeDir,wg,Tg):t.selectedGlobalConfigPath}function n_(e){let t=$g(e);if(!t.isWsl||t.selectedGlobalConfigPath!=null)return t_(e);let n=`"${t.windowsUsersRoot}/*/${wg}/${Tg}"`;throw t.globalConfigCandidates.length===0?Error(`WSL host config file not found under ${n}.`):Bg(e).length>0?Error(`WSL host config file for the current Windows user was not found under ${n}.`):Error(`WSL host config file could not be matched to the current Windows user under ${n}.`)}function r_(e,t){let n=Ag(t)?t:$g(t),r=qg(e,n.expandedEnv);if(r=Jg(r,n.effectiveHomeDir,n.platform),!n.isWsl)return Xg(r,n.platform);let i=Yg(r);return i==null?(r.startsWith(n.effectiveHomeDir)||r.startsWith(`/mnt/`)||r.startsWith(`/`))&&(r=r.replaceAll(`\\`,`/`)):r=i,Xg(r,n.platform)}var i_=class extends Error{operation;violations;constructor(e,t){super(I_(e,t)),this.name=`ProtectedDeletionGuardError`,this.operation=e,this.violations=t}};const a_=[`globalPrompt`,`workspacePrompt`];function o_(e){let t=a.env.XDG_CONFIG_HOME;return typeof t==`string`&&t.trim().length>0?t:s.join(e,`.config`)}function s_(e){let t=a.env.XDG_DATA_HOME;return typeof t==`string`&&t.trim().length>0?t:s.join(e,`.local`,`share`)}function c_(e){let t=a.env.XDG_STATE_HOME;return typeof t==`string`&&t.trim().length>0?t:s.join(e,`.local`,`state`)}function l_(e){let t=a.env.XDG_CACHE_HOME;return typeof t==`string`&&t.trim().length>0?t:s.join(e,`.cache`)}function u_(e){if(e!=null){if(typeof e.getAbsolutePath==`function`)try{let t=e.getAbsolutePath();if(t.length>0)return s.resolve(t)}catch{}if(e.pathKind===`absolute`)return s.resolve(e.path);if(typeof e.basePath==`string`&&e.basePath.length>0)return s.resolve(e.basePath,e.path)}}function d_(e){return e===`~`||e.startsWith(`~/`)||e.startsWith(`~\\`)?r_(e):e}function f_(e){return s.resolve(d_(e))}function p_(e){let t=s.normalize(f_(e));return a.platform===`win32`?t.toLowerCase():t}function m_(e){let{root:t}=s.parse(e);return e===t?e:e.endsWith(s.sep)?e.slice(0,-1):e}function h_(e,t){let n=m_(e),r=m_(t);return n===r?!0:n.startsWith(`${r}${s.sep}`)}function g_(e){let n=f_(e),r=new Set([p_(n)]);try{if(t.existsSync(n)){let e=t.realpathSync.native(n);r.add(p_(e))}}catch{}return[...r]}function __(e,t,n,r,i=`path`){return{path:f_(e),protectionMode:t,reason:n,source:r,matcher:i}}function v_(e){let t=p_(e.path);return{...e,path:f_(e.path),comparisonKeys:g_(e.path),normalizedPath:t,specificity:m_(t).length}}function y_(e){let t=new Map;for(let n of e){let e=v_(n);t.set(`${e.protectionMode}:${e.normalizedPath}`,e)}return[...t.values()].sort((e,t)=>{let n=t.specificity-e.specificity;return n===0?e.protectionMode===t.protectionMode?e.path.localeCompare(t.path):e.protectionMode===`recursive`?-1:1:n})}function b_(e){return f_(e).replaceAll(`\\`,`/`)}function x_(e){let t=[];for(let n of e){if(n.matcher!==`glob`){t.push(__(n.path,n.protectionMode,n.reason,n.source));continue}let e=Th.default.sync(b_(n.path),{onlyFiles:!1,dot:!0,absolute:!0,followSymbolicLinks:!1});for(let r of e)t.push(__(r,n.protectionMode,n.reason,n.source))}return t}function S_(e,t,n){return n===`direct`?h_(t,e):h_(e,t)||h_(t,e)}function C_(e,n){let r=f_(e);try{if(t.existsSync(r)&&t.lstatSync(r).isDirectory())return`recursive`}catch{}return n}function w_(){let e=e_();return[__(s.parse(e).root,`direct`,`built-in dangerous root path`,`built-in-dangerous-root`),__(e,`direct`,`built-in dangerous home directory`,`built-in-dangerous-root`),__(o_(e),`direct`,`built-in dangerous config directory`,`built-in-dangerous-root`),__(s_(e),`direct`,`built-in dangerous data directory`,`built-in-dangerous-root`),__(c_(e),`direct`,`built-in dangerous state directory`,`built-in-dangerous-root`),__(l_(e),`direct`,`built-in dangerous cache directory`,`built-in-dangerous-root`),__(s.join(e,`.aindex`),`direct`,`built-in global aindex directory`,`built-in-dangerous-root`),__(s.join(e,`.aindex`,`.tnmsc.json`),`direct`,`built-in global config file`,`built-in-config`)]}function T_(e,t,n){let r=[__(e,`direct`,`workspace root`,`workspace-reserved`),__(s.join(e,`aindex`),`direct`,`reserved workspace aindex root`,`workspace-reserved`),__(s.join(e,`knowladge`),`direct`,`reserved workspace knowladge root`,`workspace-reserved`)];for(let e of t)r.push(__(e,`direct`,`workspace project root`,`workspace-project-root`));if(!n)return r;r.push(__(s.join(e,`aindex`,`dist`,`**`,`*.mdx`),`direct`,`reserved workspace aindex dist mdx files`,`workspace-reserved`,`glob`));for(let t of Bh)r.push(__(s.join(e,`aindex`,t,`**`,`*.mdx`),`direct`,`reserved workspace aindex ${t} mdx files`,`workspace-reserved`,`glob`));return r}function E_(e){return[__(e,`direct`,`resolved aindex root`,`aindex-root`)]}function D_(e,t){return Sg(e,t)}function O_(e,t,n){let r=[];for(let n of Vh){let i=e.aindex[n];i!=null&&r.push(__(s.join(t,i.src),`recursive`,`configured aindex ${n} source directory`,`configured-aindex-source`))}for(let n of a_){let i=e.aindex[n];i!=null&&r.push(__(s.join(t,i.src),`direct`,`configured aindex ${n} source file`,`configured-aindex-source`))}for(let e of D_(t,n))r.push(__(e,`direct`,`known aindex input config file`,`known-aindex-config`));return r}function k_(e){let t=[],n=new Set,r=(e,r,i,a)=>{if(e==null||e.length===0)return;let o=__(e,r,i,a),s=`${o.protectionMode}:${p_(o.path)}`;n.has(s)||(n.add(s),t.push(o))},i=(e,t,n,i)=>{let a=u_(e);a!=null&&r(a,t,n,i)};i(e.globalMemory?.dir,`recursive`,`global memory source directory`,`collected-input-source`);for(let t of e.commands??[])i(t.dir,`recursive`,`command source directory`,`collected-input-source`);for(let t of e.subAgents??[])i(t.dir,`recursive`,`sub-agent source directory`,`collected-input-source`);for(let t of e.rules??[])i(t.dir,`recursive`,`rule source directory`,`collected-input-source`);for(let t of e.skills??[]){i(t.dir,`recursive`,`skill source directory`,`collected-input-source`);for(let e of t.childDocs??[])i(e.dir,`recursive`,`skill child document directory`,`collected-input-source`);for(let e of t.resources??[])e.sourcePath==null||e.sourcePath.length===0||r(e.sourcePath,C_(e.sourcePath,`direct`),`skill resource source path`,`collected-input-source`)}for(let t of e.vscodeConfigFiles??[])i(t.dir,`direct`,`vscode input config file`,`collected-input-config`);for(let t of e.zedConfigFiles??[])i(t.dir,`direct`,`zed input config file`,`collected-input-config`);for(let t of e.jetbrainsConfigFiles??[])i(t.dir,`direct`,`jetbrains input config file`,`collected-input-config`);for(let t of e.editorConfigFiles??[])i(t.dir,`direct`,`editorconfig input file`,`collected-input-config`);for(let t of e.aiAgentIgnoreConfigFiles??[])r(t.sourcePath,`direct`,`AI agent ignore config file`,`collected-input-config`);if(e.aindexDir!=null)for(let t of D_(e.aindexDir,{workspaceDir:e.workspace.directory.path}))r(t,`direct`,`known aindex input config file`,`known-aindex-config`);return t}function A_(e){let t=[];for(let n of e.exactProtectedPaths??[])t.push(__(n,`direct`,`legacy direct protected path`,`legacy-direct`));for(let n of e.subtreeProtectedPaths??[])t.push(__(n,`recursive`,`legacy recursive protected path`,`legacy-recursive`));return t}function j_(e={}){let t=e.includeReservedWorkspaceContentRoots??!0,n=y_(x_([...w_(),...A_(e),...e.workspaceDir==null?[]:T_(e.workspaceDir,e.projectRoots??[],t),...e.aindexDir==null?[]:E_(e.aindexDir),...e.rules??[]]));return{rules:n.map(e=>({path:e.path,protectionMode:e.protectionMode,reason:e.reason,source:e.source,...e.matcher==null?{}:{matcher:e.matcher}})),exactProtectedPaths:n.filter(e=>e.protectionMode===`direct`).map(e=>e.path),subtreeProtectedPaths:n.filter(e=>e.protectionMode===`recursive`).map(e=>e.path),compiledRules:n}}function M_(e){let t=new Set;for(let n of e.workspace.projects){if(n.isWorkspaceRootProject===!0)continue;let e=n.dirFromWorkspacePath?.getAbsolutePath?.();e!=null&&e.length>0&&t.add(f_(e))}return[...t]}function N_(e,t){return t==null?e:e.specificity===t.specificity?e.protectionMode===t.protectionMode?e.path.localeCompare(t.path)<0?e:t:e.protectionMode===`recursive`?e:t:e.specificity>t.specificity?e:t}function P_(e,t){let n=f_(e),r=g_(n),i;for(let e of t.compiledRules){let t=!1;for(let n of r){for(let r of e.comparisonKeys)if(S_(n,r,e.protectionMode)){i=N_(e,i),t=!0;break}if(t)break}}if(i!=null)return{targetPath:n,protectedPath:i.path,protectionMode:i.protectionMode,reason:i.reason,source:i.source}}function F_(e,t){let n=[],r=new Map;for(let i of e){let e=f_(i),a=P_(e,t);if(a==null){n.push(e);continue}r.has(a.targetPath)||r.set(a.targetPath,a)}return{safePaths:n,violations:[...r.values()].sort((e,t)=>e.targetPath.localeCompare(t.targetPath))}}function I_(e,t){let n=t.map(e=>e.targetPath).join(`, `);return`Protected deletion guard blocked ${e} for ${t.length} path(s): ${n}`}function L_(e,t,n){e.error(xp(t,n))}var R_=class{inputEffects=[];registeredScopes=[];name;dependsOn;_log;get log(){return this._log??=om(this.name),this._log}constructor(e,t){this.name=e,t!=null&&(this.dependsOn=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,aindexDir:i}=this.resolveBasePaths(e.userConfigOptions),a={logger:this.log,fs:e.fs,path:e.path,glob:e.glob,spawn:d,userConfigOptions:e.userConfigOptions,workspaceDir:r,aindexDir: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,modifiedFileCount:t.modifiedFiles.length}),t.deletedFiles!=null&&t.deletedFiles.length>0&&this.log.debug({action:`inputEffect`,name:e.name,deletedFileCount:t.deletedFiles.length});else throw t.error??Error(`Input effect failed: ${e.name}`);n.push(t)}catch(t){let r=t instanceof Error?t:Error(String(t));throw this.logInputEffectFailure(e.name,r),n.push({success:!1,error:r,description:`Input effect failed: ${e.name}`}),r}}return n}logInputEffectFailure(e,t){if(t instanceof i_){L_(this.log,t.operation,t.violations);return}this.log.error(dp({code:`INPUT_EFFECT_FAILED`,title:`Input effect failed: ${e}`,rootCause:q(`The input effect "${e}" failed before tnmsc could finish preprocessing.`,`Underlying error: ${t.message}`),exactFix:q(`Inspect the effect inputs and fix the failing file, path, or environment condition before retrying tnmsc.`),possibleFixes:[q(`Re-run the command after fixing the referenced path or generated artifact.`),q(`Add a focused regression test if this effect should handle the failure more gracefully.`)],details:{effectName:e,errorMessage:t.message}}))}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.aindex?.dir??`aindex`;return{workspaceDir:n,aindexDir:s.join(n,r)}}resolvePath(e,t){let n=e;return n.includes(SF.WORKSPACE)&&(n=n.replace(SF.WORKSPACE,t)),n.startsWith(SF.USER_HOME)?r_(n):s.normalize(r_(n))}resolveAindexPath(e,t){return s.join(t,e)}readAndParseMarkdown(e,t){return $f(t.readFileSync(e,`utf8`))}},z_=Object.create,B_=Object.defineProperty,V_=Object.getOwnPropertyDescriptor,H_=Object.getOwnPropertyNames,U_=Object.getPrototypeOf,W_=Object.prototype.hasOwnProperty,J=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),G_=(e,t)=>{let n={};for(var r in e)B_(n,r,{get:e[r],enumerable:!0});return t||B_(n,Symbol.toStringTag,{value:`Module`}),n},K_=(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],!W_.call(e,s)&&s!==n&&B_(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=V_(t,s))||r.enumerable});return e},q_=(e,t,n)=>(n=e==null?{}:z_(U_(e)),K_(t||!e||!e.__esModule?B_(n,`default`,{value:e,enumerable:!0}):n,e)),J_=e(import.meta.url);const Y_=ov(/[A-Za-z]/),X_=ov(/[\dA-Za-z]/),Z_=ov(/[#-'*+\--9=?A-Z^-~]/);function Q_(e){return e!==null&&(e<32||e===127)}const $_=ov(/\d/),ev=ov(/[\dA-Fa-f]/),tv=ov(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function nv(e){return e!==null&&(e<0||e===32)}function rv(e){return e===-2||e===-1||e===32}const iv=ov(/\p{P}|\p{S}/u),av=ov(/\s/);function ov(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var sv=q_(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 cv=Object.assign(lv(Error),{eval:lv(EvalError),range:lv(RangeError),reference:lv(ReferenceError),syntax:lv(SyntaxError),type:lv(TypeError),uri:lv(URIError)});function lv(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,sv.default)(t,...n))}}const uv={}.hasOwnProperty,dv={yaml:`-`,toml:`+`};function fv(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=pv(r[n]);return t}function pv(e){let t=e;if(typeof t==`string`){if(!uv.call(dv,t))throw cv("Missing matter definition for `%s`",t);t={type:t,marker:dv[t]}}else if(typeof t!=`object`)throw cv("Expected matter to be an object, not `%j`",t);if(!uv.call(t,`type`))throw cv("Missing `type` in matter `%j`",t);if(!uv.call(t,`fence`)&&!uv.call(t,`marker`))throw cv("Missing `marker` or `fence` in matter `%j`",t);return t}function mv(e){let t=fv(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=gv(e,`open`).charCodeAt(0),a=hv(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function hv(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=gv(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),rv(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return rv(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return Y(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=gv(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||Y(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||Y(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),rv(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return rv(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||Y(i)?(e.exit(r),t(i)):n(i)}}}function gv(e,t){return e.marker?_v(e.marker,t).repeat(3):_v(e.fence,t)}function _v(e,t){return typeof e==`string`?e:e[t]}function vv(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function yv(e){let t=fv(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=bv(e),r[e.type]=xv,r[e.type+`Value`]=Sv}return{enter:n,exit:r}}function bv(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function xv(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 Sv(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Cv(e){let t=[],n={},r=fv(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=wv(e);let a=Tv(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:vv(a.charAt(1))})}return{unsafe:t,handlers:n}}function wv(e){let t=Tv(e,`open`),n=Tv(e,`close`);return r;function r(e){return t+(e.value?`
196
+ t.exports=r;let n=Hm();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}})),Wm=C((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})),Gm=C((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})),Km=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.fs=void 0,e.fs=Gm()})),qm=C((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})),Jm=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=Vm(),n=Um(),r=Wm(),i=Km(),a=qm();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)}})),Ym=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.readdir=e.readdirWithFileTypes=e.read=void 0;let t=Vm(),n=Wm(),r=Km(),i=qm();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})),Xm=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.createFileSystemAdapter=e.FILE_SYSTEM_ADAPTER=void 0;let t=E(`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})),Zm=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`path`),n=Vm(),r=Xm();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}}})),Qm=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.scandirSync=e.scandir=void 0;let t=Jm(),n=Ym(),r=Zm();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)}})),$m=C(((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})),eh=C(((e,t)=>{var n=$m();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})),th=C((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})),nh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=th();e.default=class{constructor(e,n){this._root=e,this._settings=n,this._root=t.replacePathSegmentSeparator(e,n.pathSegmentSeparator)}}})),rh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`events`),n=Qm(),r=eh(),i=th(),a=nh();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)}}})),ih=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=rh();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)}})),ah=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`stream`),n=rh();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}}})),oh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Qm(),n=th(),r=nh();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)}}})),sh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=oh();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()}}})),ch=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`path`),n=Qm();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}}})),lh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Settings=e.walkStream=e.walkSync=e.walk=void 0;let t=ih(),n=ah(),r=sh(),i=ch();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)}})),uh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`path`),n=Vm(),r=Fm();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}}})),dh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`stream`),n=Vm(),r=lh(),i=uh();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))})}}})),fh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=lh(),n=uh(),r=dh();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))})}}})),ph=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm();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))}}})),mh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=ph();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}}})),hh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm(),n=mh();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)}}})),gh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm();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}}})),_h=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm();e.default=class{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return t.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}})),vh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Fm();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}}})),yh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`path`),n=hh(),r=gh(),i=_h(),a=vh();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}}}})),bh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=fh(),n=yh();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)}}})),xh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=E(`stream`),n=dh(),r=yh();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)}}})),Sh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Vm(),n=lh(),r=uh();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)}}})),Ch=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0});let t=Sh(),n=yh();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)}}})),wh=C((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;let t=E(`fs`),n=E(`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)}}})),Th=T(C(((e,t)=>{let n=Im(),r=bh(),i=xh(),a=Ch(),o=wh(),s=Fm();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);const Eh=`.aindex`,Dh=`.tnmsc.json`,Oh=/^[A-Za-z]:[\\/]/u,kh=/%([^%]+)%/gu,Ah=/\$\{([A-Za-z_]\w*)\}/gu,jh=/\$([A-Za-z_]\w*)/gu;function Mh(e){return e!=null&&`effectiveHomeDir`in e&&`expandedEnv`in e}function Nh(e){return e?.fs??t}function Ph(e){return e?.platform??a.platform}function Fh(e){return e?.release??p.release()}function Ih(e){return e?.homedir??p.homedir()}function Lh(e){return e?.env??a.env}function Rh(e){return e?.windowsUsersRoot??`/mnt/c/Users`}function zh(e){return s.posix.normalize(e.replaceAll(`\\`,`/`))}function Bh(e,t){let n=zh(e),r=zh(t);return n===r?!0:n.startsWith(`${r}/`)}function Vh(e,t){if(typeof e!=`string`)return;let n=e.trim();if(n.length===0)return;let r=[Zh(n),zh(n)];for(let e of r)if(e!=null&&Bh(e,t))return zh(e)}function Hh(e){let t=Lh(e),n=zh(Rh(e)),r=t.HOMEDRIVE,i=t.HOMEPATH,a=[Vh(t.USERPROFILE,n),typeof r==`string`&&r.length>0&&typeof i==`string`&&i.length>0?Vh(`${r}${i}`,n):void 0,Vh(t.HOME,n)];return[...new Set(a.filter(e=>e!=null))]}function Uh(e){let t=zh(e);return s.posix.dirname(s.posix.dirname(t))}function Wh(e,t){let n=Hh(t);if(n.length<=0)return e.length===1?e[0]:void 0;for(let t of n){let n=e.find(e=>Uh(e)===t);if(n!=null)return n}}function Gh(e,t){try{return e.statSync(t).isDirectory()}catch{return!1}}function Kh(e,t){try{return e.statSync(t).isFile()}catch{return!1}}function qh(e){return e===`win32`?s.win32:s.posix}function Jh(e,t,n){let r={};for(let[t,n]of Object.entries(e))typeof n==`string`&&(r[t]=n);if(n===t)return r;r.HOME=n,r.USERPROFILE=n;let i=/^\/mnt\/([a-zA-Z])\/(.+)$/u.exec(n);if(i==null)return r;let a=i[1],o=i[2];return a==null||o==null?r:(r.HOMEDRIVE=`${a.toUpperCase()}:`,r.HOMEPATH=`\\${o.replaceAll(`/`,`\\`)}`,r)}function Yh(e,t){let n=(e,n)=>t[n]??e;return e.replaceAll(kh,n).replaceAll(Ah,n).replaceAll(jh,n)}function Xh(e,t,n){if(e===`~`)return t;if(!(e.startsWith(`~/`)||e.startsWith(`~\\`)))return e;let r=qh(n),i=n===`win32`?e.slice(2).replaceAll(`/`,`\\`):e.slice(2).replaceAll(`\\`,`/`);return r.resolve(t,i)}function Zh(e){if(!Oh.test(e))return;let t=e.slice(0,1).toLowerCase(),n=e.slice(2).replaceAll(`\\`,`/`).replace(/^\/+/u,``),r=`/mnt/${t}`;return n.length===0?r:s.posix.join(r,n)}function Qh(e,t){return t===`win32`?s.win32.normalize(e.replaceAll(`/`,`\\`)):s.posix.normalize(e)}function $h(e){if(Ph(e)!==`linux`)return!1;let t=Lh(e);return typeof t.WSL_DISTRO_NAME==`string`&&t.WSL_DISTRO_NAME.length>0||typeof t.WSL_INTEROP==`string`&&t.WSL_INTEROP.length>0?!0:Fh(e).toLowerCase().includes(`microsoft`)}function eg(e){let t=Nh(e),n=Rh(e);if(!Gh(t,n))return[];try{let e=t.readdirSync(n,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>s.join(n,e.name,Eh,Dh)).filter(e=>t.existsSync(e)&&Kh(t,e));return e.sort((e,t)=>e.localeCompare(t)),e}catch{return[]}}function tg(e){let t=Ph(e),n=Ih(e),r=$h(e),i=r?eg(e):[],a=r?Wh(i,e):void 0,o=a==null?n:Uh(a);return{platform:t,isWsl:r,nativeHomeDir:n,effectiveHomeDir:o,globalConfigCandidates:i,...a!=null&&{selectedGlobalConfigPath:a},...a!=null&&{wslHostHomeDir:o},windowsUsersRoot:Rh(e),expandedEnv:Jh(Lh(e),n,o)}}function ng(e){return tg(e).effectiveHomeDir}function rg(e){let t=tg(e);return t.selectedGlobalConfigPath==null?s.join(t.effectiveHomeDir,Eh,Dh):t.selectedGlobalConfigPath}function ig(e){let t=tg(e);if(!t.isWsl||t.selectedGlobalConfigPath!=null)return rg(e);let n=`"${t.windowsUsersRoot}/*/${Eh}/${Dh}"`;throw t.globalConfigCandidates.length===0?Error(`WSL host config file not found under ${n}.`):Hh(e).length>0?Error(`WSL host config file for the current Windows user was not found under ${n}.`):Error(`WSL host config file could not be matched to the current Windows user under ${n}.`)}function ag(e,t){let n=Mh(t)?t:tg(t),r=Yh(e,n.expandedEnv);if(r=Xh(r,n.effectiveHomeDir,n.platform),!n.isWsl)return Qh(r,n.platform);let i=Zh(r);return i==null?(r.startsWith(n.effectiveHomeDir)||r.startsWith(`/mnt/`)||r.startsWith(`/`))&&(r=r.replaceAll(`\\`,`/`)):r=i,Qh(r,n.platform)}var og=class extends Error{operation;violations;constructor(e,t){super(Fg(e,t)),this.name=`ProtectedDeletionGuardError`,this.operation=e,this.violations=t}};function sg(e){let t=a.env.XDG_CONFIG_HOME;return typeof t==`string`&&t.trim().length>0?t:s.join(e,`.config`)}function cg(e){let t=a.env.XDG_DATA_HOME;return typeof t==`string`&&t.trim().length>0?t:s.join(e,`.local`,`share`)}function lg(e){let t=a.env.XDG_STATE_HOME;return typeof t==`string`&&t.trim().length>0?t:s.join(e,`.local`,`state`)}function ug(e){let t=a.env.XDG_CACHE_HOME;return typeof t==`string`&&t.trim().length>0?t:s.join(e,`.cache`)}function dg(e){if(e!=null){if(typeof e.getAbsolutePath==`function`)try{let t=e.getAbsolutePath();if(t.length>0)return s.resolve(t)}catch{}if(e.pathKind===`absolute`)return s.resolve(e.path);if(typeof e.basePath==`string`&&e.basePath.length>0)return s.resolve(e.basePath,e.path)}}function fg(e){return e===`~`||e.startsWith(`~/`)||e.startsWith(`~\\`)?ag(e):e}function pg(e){return s.resolve(fg(e))}function mg(e){let t=s.normalize(pg(e));return a.platform===`win32`?t.toLowerCase():t}function hg(e){let{root:t}=s.parse(e);return e===t?e:e.endsWith(s.sep)?e.slice(0,-1):e}function gg(e,t){let n=hg(e),r=hg(t);return n===r?!0:n.startsWith(`${r}${s.sep}`)}function _g(e){let n=pg(e),r=new Set([mg(n)]);try{if(t.existsSync(n)){let e=t.realpathSync.native(n);r.add(mg(e))}}catch{}return[...r]}function vg(e,t,n,r,i=`path`){return{path:pg(e),protectionMode:t,reason:n,source:r,matcher:i}}function yg(e){let t=mg(e.path);return{...e,path:pg(e.path),comparisonKeys:_g(e.path),normalizedPath:t,specificity:hg(t).length}}function bg(e){let t=new Map;for(let n of e){let e=yg(n);t.set(`${e.protectionMode}:${e.normalizedPath}`,e)}return[...t.values()].sort((e,t)=>{let n=t.specificity-e.specificity;return n===0?e.protectionMode===t.protectionMode?e.path.localeCompare(t.path):e.protectionMode===`recursive`?-1:1:n})}function xg(e){return pg(e).replaceAll(`\\`,`/`)}function Sg(e){let t=[];for(let n of e){if(n.matcher!==`glob`){t.push(vg(n.path,n.protectionMode,n.reason,n.source));continue}let e=Th.default.sync(xg(n.path),{onlyFiles:!1,dot:!0,absolute:!0,followSymbolicLinks:!1});for(let r of e)t.push(vg(r,n.protectionMode,n.reason,n.source))}return t}function Cg(e,t,n){return n===`direct`?gg(t,e):gg(e,t)||gg(t,e)}function wg(e,n){let r=pg(e);try{if(t.existsSync(r)&&t.lstatSync(r).isDirectory())return`recursive`}catch{}return n}function Tg(){let e=ng();return[vg(s.parse(e).root,`direct`,`built-in dangerous root path`,`built-in-dangerous-root`),vg(e,`direct`,`built-in dangerous home directory`,`built-in-dangerous-root`),vg(sg(e),`direct`,`built-in dangerous config directory`,`built-in-dangerous-root`),vg(cg(e),`direct`,`built-in dangerous data directory`,`built-in-dangerous-root`),vg(lg(e),`direct`,`built-in dangerous state directory`,`built-in-dangerous-root`),vg(ug(e),`direct`,`built-in dangerous cache directory`,`built-in-dangerous-root`),vg(s.join(e,`.aindex`),`direct`,`built-in global aindex directory`,`built-in-dangerous-root`),vg(s.join(e,`.aindex`,`.tnmsc.json`),`direct`,`built-in global config file`,`built-in-config`)]}function Eg(e,t,n){let r=[vg(e,`direct`,`workspace root`,`workspace-reserved`),vg(s.join(e,`aindex`),`direct`,`reserved workspace aindex root`,`workspace-reserved`),vg(s.join(e,`knowladge`),`direct`,`reserved workspace knowladge root`,`workspace-reserved`)];for(let e of t)r.push(vg(e,`direct`,`workspace project root`,`workspace-project-root`));return r}function Dg(e){return[vg(e,`direct`,`resolved aindex root`,`aindex-root`)]}function Og(e){let t=[],n=new Set,r=(e,r,i,a)=>{if(e==null||e.length===0)return;let o=vg(e,r,i,a),s=`${o.protectionMode}:${mg(o.path)}`;n.has(s)||(n.add(s),t.push(o))},i=(e,t,n,i)=>{let a=dg(e);a!=null&&r(a,t,n,i)};i(e.globalMemory?.dir,`recursive`,`global memory source directory`,`collected-input-source`);for(let t of e.commands??[])i(t.dir,`recursive`,`command source directory`,`collected-input-source`);for(let t of e.subAgents??[])i(t.dir,`recursive`,`sub-agent source directory`,`collected-input-source`);for(let t of e.rules??[])i(t.dir,`recursive`,`rule source directory`,`collected-input-source`);for(let t of e.skills??[]){i(t.dir,`recursive`,`skill source directory`,`collected-input-source`);for(let e of t.childDocs??[])i(e.dir,`recursive`,`skill child document directory`,`collected-input-source`);for(let e of t.resources??[])e.sourcePath==null||e.sourcePath.length===0||r(e.sourcePath,wg(e.sourcePath,`direct`),`skill resource source path`,`collected-input-source`)}for(let t of e.vscodeConfigFiles??[])i(t.dir,`direct`,`vscode input config file`,`collected-input-config`);for(let t of e.zedConfigFiles??[])i(t.dir,`direct`,`zed input config file`,`collected-input-config`);for(let t of e.jetbrainsConfigFiles??[])i(t.dir,`direct`,`jetbrains input config file`,`collected-input-config`);for(let t of e.editorConfigFiles??[])i(t.dir,`direct`,`editorconfig input file`,`collected-input-config`);for(let t of e.aiAgentIgnoreConfigFiles??[])r(t.sourcePath,`direct`,`AI agent ignore config file`,`collected-input-config`);return t}function kg(e){let t=[];for(let n of e.exactProtectedPaths??[])t.push(vg(n,`direct`,`legacy direct protected path`,`legacy-direct`));for(let n of e.subtreeProtectedPaths??[])t.push(vg(n,`recursive`,`legacy recursive protected path`,`legacy-recursive`));return t}function Ag(e={}){let t=e.includeReservedWorkspaceContentRoots??!0,n=bg(Sg([...Tg(),...kg(e),...e.workspaceDir==null?[]:Eg(e.workspaceDir,e.projectRoots??[],t),...e.aindexDir==null?[]:Dg(e.aindexDir),...e.rules??[]]));return{rules:n.map(e=>({path:e.path,protectionMode:e.protectionMode,reason:e.reason,source:e.source,...e.matcher==null?{}:{matcher:e.matcher}})),exactProtectedPaths:n.filter(e=>e.protectionMode===`direct`).map(e=>e.path),subtreeProtectedPaths:n.filter(e=>e.protectionMode===`recursive`).map(e=>e.path),compiledRules:n}}function jg(e){let t=new Set;for(let n of e.workspace.projects){if(n.isWorkspaceRootProject===!0)continue;let e=n.dirFromWorkspacePath?.getAbsolutePath?.();e!=null&&e.length>0&&t.add(pg(e))}return[...t]}function Mg(e,t){return t==null?e:e.specificity===t.specificity?e.protectionMode===t.protectionMode?e.path.localeCompare(t.path)<0?e:t:e.protectionMode===`recursive`?e:t:e.specificity>t.specificity?e:t}function Ng(e,t){let n=pg(e),r=_g(n),i;for(let e of t.compiledRules){let t=!1;for(let n of r){for(let r of e.comparisonKeys)if(Cg(n,r,e.protectionMode)){i=Mg(e,i),t=!0;break}if(t)break}}if(i!=null)return{targetPath:n,protectedPath:i.path,protectionMode:i.protectionMode,reason:i.reason,source:i.source}}function Pg(e,t){let n=[],r=new Map;for(let i of e){let e=pg(i),a=Ng(e,t);if(a==null){n.push(e);continue}r.has(a.targetPath)||r.set(a.targetPath,a)}return{safePaths:n,violations:[...r.values()].sort((e,t)=>e.targetPath.localeCompare(t.targetPath))}}function Fg(e,t){let n=t.map(e=>e.targetPath).join(`, `);return`Protected deletion guard blocked ${e} for ${t.length} path(s): ${n}`}function Ig(e,t,n){e.error(xp(t,n))}var Lg=class{inputEffects=[];registeredScopes=[];name;dependsOn;_log;get log(){return this._log??=om(this.name),this._log}constructor(e,t){this.name=e,t!=null&&(this.dependsOn=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,aindexDir:i}=this.resolveBasePaths(e.userConfigOptions),a={logger:this.log,fs:e.fs,path:e.path,glob:e.glob,spawn:d,userConfigOptions:e.userConfigOptions,workspaceDir:r,aindexDir: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,modifiedFileCount:t.modifiedFiles.length}),t.deletedFiles!=null&&t.deletedFiles.length>0&&this.log.debug({action:`inputEffect`,name:e.name,deletedFileCount:t.deletedFiles.length});else throw t.error??Error(`Input effect failed: ${e.name}`);n.push(t)}catch(t){let r=t instanceof Error?t:Error(String(t));throw this.logInputEffectFailure(e.name,r),n.push({success:!1,error:r,description:`Input effect failed: ${e.name}`}),r}}return n}logInputEffectFailure(e,t){if(t instanceof og){Ig(this.log,t.operation,t.violations);return}this.log.error(dp({code:`INPUT_EFFECT_FAILED`,title:`Input effect failed: ${e}`,rootCause:q(`The input effect "${e}" failed before tnmsc could finish preprocessing.`,`Underlying error: ${t.message}`),exactFix:q(`Inspect the effect inputs and fix the failing file, path, or environment condition before retrying tnmsc.`),possibleFixes:[q(`Re-run the command after fixing the referenced path or generated artifact.`),q(`Add a focused regression test if this effect should handle the failure more gracefully.`)],details:{effectName:e,errorMessage:t.message}}))}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.aindex?.dir??`aindex`;return{workspaceDir:n,aindexDir:s.join(n,r)}}resolvePath(e,t){let n=e;return n.includes(rF.WORKSPACE)&&(n=n.replace(rF.WORKSPACE,t)),n.startsWith(rF.USER_HOME)?ag(n):s.normalize(ag(n))}resolveAindexPath(e,t){return s.join(t,e)}readAndParseMarkdown(e,t){return $f(t.readFileSync(e,`utf8`))}},Rg=Object.create,zg=Object.defineProperty,Bg=Object.getOwnPropertyDescriptor,Vg=Object.getOwnPropertyNames,Hg=Object.getPrototypeOf,Ug=Object.prototype.hasOwnProperty,J=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Wg=(e,t)=>{let n={};for(var r in e)zg(n,r,{get:e[r],enumerable:!0});return t||zg(n,Symbol.toStringTag,{value:`Module`}),n},Gg=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Vg(t),a=0,o=i.length,s;a<o;a++)s=i[a],!Ug.call(e,s)&&s!==n&&zg(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=Bg(t,s))||r.enumerable});return e},Kg=(e,t,n)=>(n=e==null?{}:Rg(Hg(e)),Gg(t||!e||!e.__esModule?zg(n,`default`,{value:e,enumerable:!0}):n,e)),qg=e(import.meta.url);const Jg=a_(/[A-Za-z]/),Yg=a_(/[\dA-Za-z]/),Xg=a_(/[#-'*+\--9=?A-Z^-~]/);function Zg(e){return e!==null&&(e<32||e===127)}const Qg=a_(/\d/),$g=a_(/[\dA-Fa-f]/),e_=a_(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function t_(e){return e!==null&&(e<0||e===32)}function n_(e){return e===-2||e===-1||e===32}const r_=a_(/\p{P}|\p{S}/u),i_=a_(/\s/);function a_(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}var o_=Kg(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 s_=Object.assign(c_(Error),{eval:c_(EvalError),range:c_(RangeError),reference:c_(ReferenceError),syntax:c_(SyntaxError),type:c_(TypeError),uri:c_(URIError)});function c_(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,o_.default)(t,...n))}}const l_={}.hasOwnProperty,u_={yaml:`-`,toml:`+`};function d_(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=f_(r[n]);return t}function f_(e){let t=e;if(typeof t==`string`){if(!l_.call(u_,t))throw s_("Missing matter definition for `%s`",t);t={type:t,marker:u_[t]}}else if(typeof t!=`object`)throw s_("Expected matter to be an object, not `%j`",t);if(!l_.call(t,`type`))throw s_("Missing `type` in matter `%j`",t);if(!l_.call(t,`fence`)&&!l_.call(t,`marker`))throw s_("Missing `marker` or `fence` in matter `%j`",t);return t}function p_(e){let t=d_(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=h_(e,`open`).charCodeAt(0),a=m_(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function m_(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=h_(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),n_(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return n_(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return Y(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=h_(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||Y(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||Y(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),n_(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return n_(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||Y(i)?(e.exit(r),t(i)):n(i)}}}function h_(e,t){return e.marker?g_(e.marker,t).repeat(3):g_(e.fence,t)}function g_(e,t){return typeof e==`string`?e:e[t]}function __(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function v_(e){let t=d_(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=y_(e),r[e.type]=b_,r[e.type+`Value`]=x_}return{enter:n,exit:r}}function y_(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function b_(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 x_(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function S_(e){let t=[],n={},r=d_(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=C_(e);let a=w_(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:__(a.charAt(1))})}return{unsafe:t,handlers:n}}function C_(e){let t=w_(e,`open`),n=w_(e,`close`);return r;function r(e){return t+(e.value?`
198
197
  `+e.value:``)+`
199
- `+n}}function Tv(e,t){return e.marker?Ev(e.marker,t).repeat(3):Ev(e.fence,t)}function Ev(e,t){return typeof e==`string`?e:e[t]}function Dv(e){let t=this,n=e||`yaml`,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(mv(n)),a.push(yv(n)),o.push(Cv(n))}function Ov(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 kv=(function(e){if(e==null)return Pv;if(typeof e==`function`)return Nv(e);if(typeof e==`object`)return Array.isArray(e)?Av(e):jv(e);if(typeof e==`string`)return Mv(e);throw Error(`Expected function, string, or object as test`)});function Av(e){let t=[],n=-1;for(;++n<e.length;)t[n]=kv(e[n]);return Nv(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function jv(e){let t=e;return Nv(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Mv(e){return Nv(t);function t(t){return t&&t.type===e}}function Nv(e){return t;function t(t,n,r){return!!(Fv(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Pv(){return!0}function Fv(e){return typeof e==`object`&&!!e&&`type`in e}function Iv(e){return`\x1B[33m`+e+`\x1B[39m`}const Lv=[];function Rv(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=kv(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 (`+Iv(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Lv,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=zv(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 zv(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Lv:[e]}function Bv(e,t,n){let r=kv((n||{}).ignore||[]),i=Vv(t),a=-1;for(;++a<i.length;)Rv(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 Vv(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([Hv(e[0]),Uv(e[1])])}return t}function Hv(e){return typeof e==`string`?new RegExp(vv(e),`g`):e}function Uv(e){return typeof e==`function`?e:function(){return e}}const Wv=`phrasing`,Gv=[`autolink`,`link`,`image`,`label`];function Kv(){return{transforms:[ey],enter:{literalAutolink:Jv,literalAutolinkEmail:Yv,literalAutolinkHttp:Yv,literalAutolinkWww:Yv},exit:{literalAutolink:$v,literalAutolinkEmail:Qv,literalAutolinkHttp:Xv,literalAutolinkWww:Zv}}}function qv(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Wv,notInConstruct:Gv},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Wv,notInConstruct:Gv},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Wv,notInConstruct:Gv}]}}function Jv(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Yv(e){this.config.enter.autolinkProtocol.call(this,e)}function Xv(e){this.config.exit.autolinkProtocol.call(this,e)}function Zv(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 Qv(e){this.config.exit.autolinkEmail.call(this,e)}function $v(e){this.exit(e)}function ey(e){Bv(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ty],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ny]],{ignore:[`link`,`linkReference`]})}function ty(e,t,n,r,i){let a=``;if(!ay(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!ry(n)))return!1;let o=iy(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 ny(e,t,n,r){return!ay(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function ry(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 iy(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=Ov(e,`(`),a=Ov(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 ay(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||av(n)||iv(n))&&(!t||n!==47)}function oy(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}gy.peek=hy;function sy(){this.buffer()}function cy(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ly(){this.buffer()}function uy(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function dy(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=oy(this.sliceSerialize(e)).toLowerCase(),n.label=t}function fy(e){this.exit(e)}function py(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=oy(this.sliceSerialize(e)).toLowerCase(),n.label=t}function my(e){this.exit(e)}function hy(){return`[`}function gy(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 _y(){return{enter:{gfmFootnoteCallString:sy,gfmFootnoteCall:cy,gfmFootnoteDefinitionLabelString:ly,gfmFootnoteDefinition:uy},exit:{gfmFootnoteCallString:dy,gfmFootnoteCall:fy,gfmFootnoteDefinitionLabelString:py,gfmFootnoteDefinition:my}}}function vy(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:gy},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?`
200
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?by:yy))),s(),o}}function yy(e,t,n){return t===0?e:by(e,t,n)}function by(e,t,n){return(n?``:` `)+e}const xy=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Ey.peek=Dy;function Sy(){return{canContainEols:[`delete`],enter:{strikethrough:wy},exit:{strikethrough:Ty}}}function Cy(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:xy}],handlers:{delete:Ey}}}function wy(e){this.enter({type:`delete`,children:[]},e)}function Ty(e){this.exit(e)}function Ey(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 Dy(){return`~`}function Oy(e){return e.length}function ky(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Oy,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=Ay(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]=jy(r[d]);else{let e=jy(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(`
201
- `)}function Ay(e){return e==null?``:String(e)}function jy(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 My(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()),Ny);return i(),o}function Ny(e,t,n){return`>`+(n?``:` `)+e}function Py(e,t){return Fy(e,t.inConstruct,!0)&&!Fy(e,t.notInConstruct,!1)}function Fy(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 Iy(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
202
- `&&Py(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
203
- `}function Ly(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 Ry(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 zy(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function By(e,t,n,r){let i=zy(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Ry(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Vy);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Ly(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:`
198
+ `+n}}function w_(e,t){return e.marker?T_(e.marker,t).repeat(3):T_(e.fence,t)}function T_(e,t){return typeof e==`string`?e:e[t]}function E_(e){let t=this,n=e||`yaml`,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(p_(n)),a.push(v_(n)),o.push(S_(n))}function D_(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 O_=(function(e){if(e==null)return N_;if(typeof e==`function`)return M_(e);if(typeof e==`object`)return Array.isArray(e)?k_(e):A_(e);if(typeof e==`string`)return j_(e);throw Error(`Expected function, string, or object as test`)});function k_(e){let t=[],n=-1;for(;++n<e.length;)t[n]=O_(e[n]);return M_(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function A_(e){let t=e;return M_(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function j_(e){return M_(t);function t(t){return t&&t.type===e}}function M_(e){return t;function t(t,n,r){return!!(P_(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function N_(){return!0}function P_(e){return typeof e==`object`&&!!e&&`type`in e}function F_(e){return`\x1B[33m`+e+`\x1B[39m`}const I_=[];function L_(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=O_(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 (`+F_(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=I_,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=R_(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 R_(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?I_:[e]}function z_(e,t,n){let r=O_((n||{}).ignore||[]),i=B_(t),a=-1;for(;++a<i.length;)L_(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 B_(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([V_(e[0]),H_(e[1])])}return t}function V_(e){return typeof e==`string`?new RegExp(__(e),`g`):e}function H_(e){return typeof e==`function`?e:function(){return e}}const U_=`phrasing`,W_=[`autolink`,`link`,`image`,`label`];function G_(){return{transforms:[$_],enter:{literalAutolink:q_,literalAutolinkEmail:J_,literalAutolinkHttp:J_,literalAutolinkWww:J_},exit:{literalAutolink:Q_,literalAutolinkEmail:Z_,literalAutolinkHttp:Y_,literalAutolinkWww:X_}}}function K_(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:U_,notInConstruct:W_},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:U_,notInConstruct:W_},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:U_,notInConstruct:W_}]}}function q_(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function J_(e){this.config.enter.autolinkProtocol.call(this,e)}function Y_(e){this.config.exit.autolinkProtocol.call(this,e)}function X_(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 Z_(e){this.config.exit.autolinkEmail.call(this,e)}function Q_(e){this.exit(e)}function $_(e){z_(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,ev],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,tv]],{ignore:[`link`,`linkReference`]})}function ev(e,t,n,r,i){let a=``;if(!iv(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!nv(n)))return!1;let o=rv(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 tv(e,t,n,r){return!iv(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function nv(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 rv(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=D_(e,`(`),a=D_(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 iv(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||i_(n)||r_(n))&&(!t||n!==47)}function av(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}hv.peek=mv;function ov(){this.buffer()}function sv(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function cv(){this.buffer()}function lv(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function uv(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=av(this.sliceSerialize(e)).toLowerCase(),n.label=t}function dv(e){this.exit(e)}function fv(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=av(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pv(e){this.exit(e)}function mv(){return`[`}function hv(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 gv(){return{enter:{gfmFootnoteCallString:ov,gfmFootnoteCall:sv,gfmFootnoteDefinitionLabelString:cv,gfmFootnoteDefinition:lv},exit:{gfmFootnoteCallString:uv,gfmFootnoteCall:dv,gfmFootnoteDefinitionLabelString:fv,gfmFootnoteDefinition:pv}}}function _v(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:hv},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?`
199
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?yv:vv))),s(),o}}function vv(e,t,n){return t===0?e:yv(e,t,n)}function yv(e,t,n){return(n?``:` `)+e}const bv=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Tv.peek=Ev;function xv(){return{canContainEols:[`delete`],enter:{strikethrough:Cv},exit:{strikethrough:wv}}}function Sv(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:bv}],handlers:{delete:Tv}}}function Cv(e){this.enter({type:`delete`,children:[]},e)}function wv(e){this.exit(e)}function Tv(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 Ev(){return`~`}function Dv(e){return e.length}function Ov(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Dv,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=kv(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]=Av(r[d]);else{let e=Av(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(`
200
+ `)}function kv(e){return e==null?``:String(e)}function Av(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 jv(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()),Mv);return i(),o}function Mv(e,t,n){return`>`+(n?``:` `)+e}function Nv(e,t){return Pv(e,t.inConstruct,!0)&&!Pv(e,t.notInConstruct,!1)}function Pv(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 Fv(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
201
+ `&&Nv(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
202
+ `}function Iv(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 Lv(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 Rv(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function zv(e,t,n,r){let i=Rv(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Lv(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Bv);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Iv(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:`
204
203
  `,encode:["`"],...s.current()})),t()}return u+=s.move(`
205
204
  `),a&&(u+=s.move(a+`
206
- `)),u+=s.move(c),l(),u}function Vy(e,t,n){return(n?``:` `)+e}function Hy(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Uy(e,t,n,r){let i=Hy(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?` `:`
207
- `,...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 Wy(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Gy(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Ky(e){if(e===null||nv(e)||av(e))return 1;if(iv(e))return 2}function qy(e,t,n){let r=Ky(e),i=Ky(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}}Jy.peek=Yy;function Jy(e,t,n,r){let i=Wy(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=qy(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Gy(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=qy(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Gy(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Yy(e,t,n){return n.options.emphasis||`*`}function Xy(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),Rv(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 Zy={};function Qy(e,t){let n=t||Zy;return $y(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function $y(e,t,n){if(tb(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 eb(e.children,t,n)}return Array.isArray(e)?eb(e,t,n):``}function eb(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=$y(e[i],t,n);return r.join(``)}function tb(e){return!!(e&&typeof e==`object`)}function nb(e,t){let n=!1;return Xy(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)&&Qy(e)&&(t.options.setext||n))}function rb(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(nb(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
205
+ `)),u+=s.move(c),l(),u}function Bv(e,t,n){return(n?``:` `)+e}function Vv(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Hv(e,t,n,r){let i=Vv(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?` `:`
206
+ `,...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 Uv(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Wv(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Gv(e){if(e===null||t_(e)||i_(e))return 1;if(r_(e))return 2}function Kv(e,t,n){let r=Gv(e),i=Gv(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}}qv.peek=Jv;function qv(e,t,n,r){let i=Uv(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=Kv(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Wv(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Kv(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Wv(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Jv(e,t,n){return n.options.emphasis||`*`}function Yv(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),L_(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 Xv={};function Zv(e,t){let n=t||Xv;return Qv(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function Qv(e,t,n){if(ey(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 $v(e.children,t,n)}return Array.isArray(e)?$v(e,t,n):``}function $v(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=Qv(e[i],t,n);return r.join(``)}function ey(e){return!!(e&&typeof e==`object`)}function ty(e,t){let n=!1;return Yv(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)&&Zv(e)&&(t.options.setext||n))}function ny(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(ty(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
208
207
  `,after:`
209
208
  `});return r(),t(),o+`
210
209
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
211
210
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
212
- `,...a.current()});return/^[\t ]/.test(l)&&(l=Gy(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ib.peek=ab;function ib(e){return e.value||``}function ab(){return`<`}ob.peek=sb;function ob(e,t,n,r){let i=Hy(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 sb(){return`!`}cb.peek=lb;function cb(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 lb(){return`!`}ub.peek=db;function ub(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 db(){return"`"}function fb(e,t){let n=Qy(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))}pb.peek=mb;function pb(e,t,n,r){let i=Hy(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(fb(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 mb(e,t,n){return fb(e,n)?`<`:`[`}hb.peek=gb;function hb(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 gb(){return`[`}function _b(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 vb(e){let t=_b(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 yb(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function bb(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 xb(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?yb(n):_b(n),s=e.ordered?o===`.`?`)`:`.`:vb(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),bb(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 Sb(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 Cb(e,t,n,r){let i=Sb(n),a=n.bulletCurrent||_b(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 wb(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const Tb=kv([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Eb(e,t,n,r){return(e.children.some(function(e){return Tb(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Db(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Ob.peek=kb;function Ob(e,t,n,r){let i=Db(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=qy(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Gy(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=qy(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Gy(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function kb(e,t,n){return n.options.strong||`*`}function Ab(e,t,n,r){return n.safe(e.value,r)}function jb(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 Mb(e,t,n){let r=(bb(n)+(n.options.ruleSpaces?` `:``)).repeat(jb(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Nb={blockquote:My,break:Iy,code:By,definition:Uy,emphasis:Jy,hardBreak:Iy,heading:rb,html:ib,image:ob,imageReference:cb,inlineCode:ub,link:pb,linkReference:hb,list:xb,listItem:Cb,paragraph:wb,root:Eb,strong:Ob,text:Ab,thematicBreak:Mb},Pb={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:`
213
- `,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:`‌`},Fb={}.hasOwnProperty;function Ib(e){return Fb.call(Pb,e)?Pb[e]:!1}function Lb(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 Rb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zb(e){return e.replace(Rb,Bb)}function Bb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Lb(n.slice(t?2:1),t?16:10)}return Ib(n)||e}function Vb(){return{enter:{table:Hb,tableData:Kb,tableHeader:Kb,tableRow:Wb},exit:{codeText:qb,table:Ub,tableData:Gb,tableHeader:Gb,tableRow:Gb}}}function Hb(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 Ub(e){this.exit(e),this.data.inTable=void 0}function Wb(e){this.enter({type:`tableRow`,children:[]},e)}function Gb(e){this.exit(e)}function Kb(e){this.enter({type:`tableCell`,children:[]},e)}function qb(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Jb));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Jb(e,t){return t===`|`?t:e}function Yb(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
211
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=Wv(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ry.peek=iy;function ry(e){return e.value||``}function iy(){return`<`}ay.peek=oy;function ay(e,t,n,r){let i=Vv(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 oy(){return`!`}sy.peek=cy;function sy(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 cy(){return`!`}ly.peek=uy;function ly(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 uy(){return"`"}function dy(e,t){let n=Zv(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))}fy.peek=py;function fy(e,t,n,r){let i=Vv(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(dy(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 py(e,t,n){return dy(e,n)?`<`:`[`}my.peek=hy;function my(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 hy(){return`[`}function gy(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 _y(e){let t=gy(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 vy(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function yy(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 by(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?vy(n):gy(n),s=e.ordered?o===`.`?`)`:`.`:_y(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),yy(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 xy(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 Sy(e,t,n,r){let i=xy(n),a=n.bulletCurrent||gy(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 Cy(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}const wy=O_([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Ty(e,t,n,r){return(e.children.some(function(e){return wy(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Ey(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Dy.peek=Oy;function Dy(e,t,n,r){let i=Ey(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=Kv(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Wv(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Kv(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Wv(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function Oy(e,t,n){return n.options.strong||`*`}function ky(e,t,n,r){return n.safe(e.value,r)}function Ay(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 jy(e,t,n){let r=(yy(n)+(n.options.ruleSpaces?` `:``)).repeat(Ay(n));return n.options.ruleSpaces?r.slice(0,-1):r}const My={blockquote:jv,break:Fv,code:zv,definition:Hv,emphasis:qv,hardBreak:Fv,heading:ny,html:ry,image:ay,imageReference:sy,inlineCode:ly,link:fy,linkReference:my,list:by,listItem:Sy,paragraph:Cy,root:Ty,strong:Dy,text:ky,thematicBreak:jy},Ny={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:`
212
+ `,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:`‌`},Py={}.hasOwnProperty;function Fy(e){return Py.call(Ny,e)?Ny[e]:!1}function Iy(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 Ly=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ry(e){return e.replace(Ly,zy)}function zy(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Iy(n.slice(t?2:1),t?16:10)}return Fy(n)||e}function By(){return{enter:{table:Vy,tableData:Gy,tableHeader:Gy,tableRow:Uy},exit:{codeText:Ky,table:Hy,tableData:Wy,tableHeader:Wy,tableRow:Wy}}}function Vy(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 Hy(e){this.exit(e),this.data.inTable=void 0}function Uy(e){this.enter({type:`tableRow`,children:[]},e)}function Wy(e){this.exit(e)}function Gy(e){this.enter({type:`tableCell`,children:[]},e)}function Ky(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,qy));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function qy(e,t){return t===`|`?t:e}function Jy(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
214
213
  `,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(`
215
- `))}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 ky(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=Nb.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Xb(){return{exit:{taskListCheckValueChecked:Qb,taskListCheckValueUnchecked:Qb,paragraph:$b}}}function Zb(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:ex}}}function Qb(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function $b(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 ex(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=Nb.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 tx(){return[Kv(),_y(),Sy(),Vb(),Xb()]}function nx(e){return{extensions:[qv(),vy(e),Cy(),Yb(e),Zb()]}}function rx(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 ix(e,t){return e.length>0?(rx(e,e.length,0,t),e):t}const ax={}.hasOwnProperty;function ox(e){let t={},n=-1;for(;++n<e.length;)sx(t,e[n]);return t}function sx(e,t){let n;for(n in t){let r=(ax.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ax.call(r,a)||(r[a]=[]);let e=i[a];cx(r[a],Array.isArray(e)?e:e?[e]:[])}}}function cx(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);rx(e,0,0,r)}const lx={tokenize:Cx,partial:!0},ux={tokenize:wx,partial:!0},dx={tokenize:Tx,partial:!0},fx={tokenize:Ex,partial:!0},px={tokenize:Dx,partial:!0},mx={name:`wwwAutolink`,tokenize:xx,previous:Ox},hx={name:`protocolAutolink`,tokenize:Sx,previous:kx},gx={name:`emailAutolink`,tokenize:bx,previous:Ax},_x={};function vx(){return{text:_x}}let yx=48;for(;yx<123;)_x[yx]=gx,yx++,yx===58?yx=65:yx===91&&(yx=97);_x[43]=gx,_x[45]=gx,_x[46]=gx,_x[95]=gx,_x[72]=[gx,hx],_x[104]=[gx,hx],_x[87]=[gx,mx],_x[119]=[gx,mx];function bx(e,t,n){let r=this,i,a;return o;function o(t){return!jx(t)||!Ax.call(r,r.previous)||Mx(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return jx(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(px,u,l)(t):t===45||t===95||X_(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&&Y_(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function xx(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Ox.call(r,r.previous)||Mx(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(lx,e.attempt(ux,e.attempt(dx,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Sx(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&kx.call(r,r.previous)&&!Mx(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Y_(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||Q_(t)||nv(t)||av(t)||iv(t)?n(t):e.attempt(ux,e.attempt(dx,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Cx(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 wx(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(fx,c,s)(t):t===null||nv(t)||av(t)||t!==45&&iv(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 Tx(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(fx,t,a)(o):o===null||nv(o)||av(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ex(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||nv(o)||av(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||nv(e)||av(e)?t(e):r(e)}function a(e){return Y_(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Y_(t)?(e.consume(t),o):n(t)}}function Dx(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return X_(e)?n(e):t(e)}}function Ox(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||nv(e)}function kx(e){return!Y_(e)}function Ax(e){return!(e===47||jx(e))}function jx(e){return e===43||e===45||e===46||e===95||X_(e)}function Mx(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 Nx(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 Px={name:`attention`,resolveAll:Fx,tokenize:Ix};function Fx(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};Lx(d,-c),Lx(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=ix(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=ix(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=ix(l,Nx(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=ix(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=ix(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,rx(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 Ix(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ky(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=Ky(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 Lx(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Rx={name:`autolink`,tokenize:zx};function zx(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 Y_(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||X_(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||X_(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||Q_(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Z_(t)?(e.consume(t),l):n(t)}function u(e){return X_(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||X_(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function Bx(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return rv(r)?(e.enter(n),s(r)):t(r)}function s(r){return rv(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const Vx={partial:!0,tokenize:Hx};function Hx(e,t,n){return r;function r(t){return rv(t)?Bx(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}const Ux={continuation:{tokenize:Gx},exit:Kx,name:`blockQuote`,tokenize:Wx};function Wx(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 rv(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Gx(e,t,n){let r=this;return i;function i(t){return rv(t)?Bx(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Ux,t,n)(r)}}function Kx(e){e.exit(`blockQuote`)}const qx={name:`characterEscape`,tokenize:Jx};function Jx(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 tv(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Yx={name:`characterReference`,tokenize:Xx};function Xx(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=X_,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=ev,u):(e.enter(`characterReferenceValue`),a=7,o=$_,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===X_&&!Ib(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 Zx={partial:!0,tokenize:eS},Qx={concrete:!0,name:`codeFenced`,tokenize:$x};function $x(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`),rv(t)?Bx(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Zx,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):rv(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Bx(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(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&&rv(t)?Bx(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(Zx,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(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`),rv(t)?Bx(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`),rv(t)?Bx(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(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 tS={name:`codeIndented`,tokenize:rS},nS={partial:!0,tokenize:iS};function rS(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Bx(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):Y(t)?e.attempt(nS,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function iS(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Bx(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):Y(e)?i(e):n(e)}}const aS={name:`codeText`,previous:sS,resolve:oS,tokenize:cS};function oS(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 sS(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function cS(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)):Y(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||Y(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 lS=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&&uS(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),uS(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),uS(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);uS(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);uS(this.left,t.reverse())}}};function uS(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 dS(e){let t={},n=-1,r,i,a,o,s,c,l,u=new lS(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,fS(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 rx(e,0,1/0,u.slice(0)),!l}function fS(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 pS={resolve:hS,tokenize:gS},mS={partial:!0,tokenize:_S};function hS(e){return dS(e),e}function gS(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):Y(t)?e.check(mS,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 _S(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Bx(e,a,`linePrefix`)}function a(i){if(i===null||Y(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 vS(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||Q_(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||Y(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||nv(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||Q_(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 yS(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):Y(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||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!rv(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function bS(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):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Bx(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(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 xS(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):rv(i)?Bx(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const SS={name:`definition`,tokenize:wS},CS={partial:!0,tokenize:TS};function wS(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return yS.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=oy(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 nv(t)?xS(e,l)(t):l(t)}function l(t){return vS(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(CS,d,d)(t)}function d(t){return rv(t)?Bx(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function TS(e,t,n){return r;function r(t){return nv(t)?xS(e,i)(t):n(t)}function i(t){return bS(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return rv(t)?Bx(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}const ES={name:`hardBreakEscape`,tokenize:DS};function DS(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const OS={name:`headingAtx`,resolve:kS,tokenize:AS};function kS(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`},rx(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function AS(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||nv(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):rv(n)?Bx(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||nv(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const jS=`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(`.`),MS=[`pre`,`script`,`style`,`textarea`],NS={concrete:!0,name:`htmlFlow`,resolveTo:IS,tokenize:LS},PS={partial:!0,tokenize:zS},FS={partial:!0,tokenize:RS};function IS(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 LS(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:oe):Y_(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):Y_(a)?(e.consume(a),i=4,r.interrupt?t:oe):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:oe):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return Y_(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||nv(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&MS.includes(l)?(i=1,r.interrupt?t(s):D(s)):jS.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||X_(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return rv(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Y_(t)?(e.consume(t),b):rv(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||X_(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):rv(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):rv(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(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||nv(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||rv(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Y(t)?D(t):rv(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),re):t===60&&i===1?(e.consume(t),k):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),oe):t===93&&i===5?(e.consume(t),ae):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(PS,A,te)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(FS,O,A)(t)}function O(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||Y(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function re(t){return t===45?(e.consume(t),oe):D(t)}function k(t){return t===47?(e.consume(t),o=``,ie):D(t)}function ie(t){if(t===62){let n=o.toLowerCase();return MS.includes(n)?(e.consume(t),se):D(t)}return Y_(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):D(t)}function ae(t){return t===93?(e.consume(t),oe):D(t)}function oe(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),oe):D(t)}function se(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),A(t)):(e.consume(t),se)}function A(n){return e.exit(`htmlFlow`),t(n)}}function RS(e,t,n){let r=this;return i;function i(t){return Y(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 zS(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Vx,t,n)}}const BS={name:`htmlText`,tokenize:VS};function VS(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):Y_(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):Y_(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):Y(t)?(o=d,k(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?re(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):Y(t)?(o=h,k(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?re(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?re(t):Y(t)?(o=v,k(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,k(t)):(e.consume(t),y)}function b(e){return e===62?re(e):y(e)}function x(t){return Y_(t)?(e.consume(t),S):n(t)}function S(t){return t===45||X_(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,k(t)):rv(t)?(e.consume(t),C):re(t)}function w(t){return t===45||X_(t)?(e.consume(t),w):t===47||t===62||nv(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),re):t===58||t===95||Y_(t)?(e.consume(t),E):Y(t)?(o=T,k(t)):rv(t)?(e.consume(t),T):re(t)}function E(t){return t===45||t===46||t===58||t===95||X_(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):Y(t)?(o=ee,k(t)):rv(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):Y(t)?(o=D,k(t)):rv(t)?(e.consume(t),D):(e.consume(t),O)}function te(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):Y(t)?(o=te,k(t)):(e.consume(t),te)}function O(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||nv(t)?T(t):(e.consume(t),O)}function ne(e){return e===47||e===62||nv(e)?T(e):n(e)}function re(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function k(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return rv(t)?Bx(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}const HS={name:`labelEnd`,resolveAll:KS,resolveTo:qS,tokenize:JS},US={tokenize:YS},WS={tokenize:XS},GS={tokenize:ZS};function KS(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&&rx(e,0,e.length,n),e}function qS(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=ix(s,e.slice(a+1,a+r+3)),s=ix(s,[[`enter`,u,t]]),s=ix(s,Nx(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=ix(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=ix(s,e.slice(o+1)),s=ix(s,[[`exit`,c,t]]),rx(e,a,e.length,s),e}function JS(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(oy(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(US,u,o?u:d)(t):t===91?e.attempt(WS,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(GS,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function YS(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 nv(t)?xS(e,a)(t):a(t)}function a(t){return t===41?u(t):vS(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return nv(t)?xS(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?bS(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return nv(t)?xS(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 XS(e,t,n){let r=this;return i;function i(t){return yS.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(oy(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ZS(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 QS={name:`labelStartImage`,resolveAll:HS.resolveAll,tokenize:$S};function $S(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:HS.resolveAll,tokenize:tC};function tC(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 nC={name:`lineEnding`,tokenize:rC};function rC(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Bx(e,t,`linePrefix`)}}const iC={name:`thematicBreak`,tokenize:aC};function aC(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||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),rv(t)?Bx(e,s,`whitespace`)(t):s(t))}}const oC={continuation:{tokenize:uC},exit:fC,name:`list`,tokenize:lC},sC={partial:!0,tokenize:pC},cC={partial:!0,tokenize:dC};function lC(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:$_(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(iC,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 $_(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(Vx,r.interrupt?n:u,e.attempt(sC,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return rv(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 uC(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Vx,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Bx(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!rv(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(cC,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Bx(e,e.attempt(oC,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function dC(e,t,n){let r=this;return Bx(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 fC(e){e.exit(this.containerState.type)}function pC(e,t,n){let r=this;return Bx(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!rv(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const mC={name:`setextUnderline`,resolveTo:hC,tokenize:gC};function hC(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 gC(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`),rv(t)?Bx(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const _C={tokenize:TC,partial:!0};function vC(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:SC,continuation:{tokenize:CC},exit:wC}},text:{91:{name:`gfmFootnoteCall`,tokenize:xC},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:yC,resolveTo:bC}}}}function yC(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=oy(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 bC(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 xC(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||nv(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(oy(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return nv(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 SC(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||nv(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=oy(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return nv(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),Bx(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function CC(e,t,n){return e.check(Vx,t,e.attempt(_C,t,n))}function wC(e){e.exit(`gfmFootnoteDefinition`)}function TC(e,t,n){let r=this;return Bx(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 EC(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&&rx(o,o.length,0,Nx(s,e.slice(r+1,n),t)),rx(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),rx(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=Ky(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=Ky(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var DC=class{constructor(){this.map=[]}add(e,t,n){OC(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 OC(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 kC(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 AC(){return{flow:{null:{name:`table`,tokenize:jC,resolveAll:MC}}}}function jC(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):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):rv(t)?Bx(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||nv(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,rv(t)?Bx(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 rv(t)?Bx(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||Y(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 rv(t)?Bx(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(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||Y(n)?(e.exit(`tableRow`),t(n)):rv(n)?Bx(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||nv(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 MC(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 DC;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(PC(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=NC(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=NC(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=NC(f,t,o,i,n,d)):(o[0]=o[1],d=NC(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&PC(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=kC(t.events,n))}return e}function NC(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},FC(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=FC(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=FC(t.events,n[2]),a=FC(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({},FC(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function PC(e,t,n,r,i){let a=[],o=FC(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 FC(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const IC={name:`tasklistCheck`,tokenize:RC};function LC(){return{text:{91:IC}}}function RC(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 nv(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 Y(r)?t(r):rv(r)?e.check({tokenize:zC},t,n)(r):n(r)}}function zC(e,t,n){return Bx(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function BC(e){return ox([vx(),vC(),EC(e),AC(),LC()])}const VC={};function HC(e){let t=this,n=e||VC,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(BC(n)),a.push(tx()),o.push(nx(n))}function UC(){return{enter:{mdxFlowExpression:GC,mdxTextExpression:KC},exit:{mdxFlowExpression:qC,mdxFlowExpressionChunk:JC,mdxTextExpression:qC,mdxTextExpressionChunk:JC}}}function WC(){return{handlers:{mdxFlowExpression:YC,mdxTextExpression:YC},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function GC(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function KC(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function qC(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function JC(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function YC(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}const XC=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),ZC={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function QC(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function $C(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function ew(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function tw(e){return ew(e)||QC(e)}const nw=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function rw(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?tw:u===`decimal`?QC:$C;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&XC.includes(y)&&(_=y,v=Ib(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?Ib(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):tw(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(iw(e))h(7,S),C=`�`;else if(e in ZC)h(6,S),C=ZC[e];else{let t=``;aw(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,nw[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function iw(e){return e>=55296&&e<=57343||e>1114111}function aw(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const ow=/["&'<>`]/g,sw=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,cw=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,lw=/[|\\{}()[\]^$+*?.]/g,uw=new WeakMap;function dw(e,t){if(e=e.replace(t.subset?fw(t.subset):ow,r),t.subset||t.escapeOnly)return e;return e.replace(sw,n).replace(cw,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function fw(e){let t=uw.get(e);return t||(t=pw(e),uw.set(e,t)),t}function pw(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(lw,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function mw(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function hw(e,t){return dw(e,Object.assign({format:mw},t))}function gw(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?vw(e.position):`start`in e||`end`in e?vw(e):`line`in e||`column`in e?_w(e):``}function _w(e){return yw(e&&e.line)+`:`+yw(e&&e.column)}function vw(e){return _w(e&&e.start)+`-`+_w(e&&e.end)}function yw(e){return e&&typeof e==`number`?e:1}var bw=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=gw(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}};bw.prototype.file=``,bw.prototype.name=``,bw.prototype.reason=``,bw.prototype.message=``,bw.prototype.stack=``,bw.prototype.column=void 0,bw.prototype.line=void 0,bw.prototype.ancestors=void 0,bw.prototype.cause=void 0,bw.prototype.fatal=void 0,bw.prototype.place=void 0,bw.prototype.ruleId=void 0,bw.prototype.source=void 0;function xw(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new bw("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new bw(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new bw("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=rw(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new bw("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+gw(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new bw("Expected a closing tag for `"+S(r)+"` ("+gw({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new bw("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+gw(t.end)+") or another opening tag after the start of `"+t.type+"` ("+gw(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function Sw(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=Ew,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=Tw(ww(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&Ov(e,n)>Ov(e,o)?o:n;s=t+hw(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+` `+m[e];b+=y.move(`
214
+ `))}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 Ov(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=My.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function Yy(){return{exit:{taskListCheckValueChecked:Zy,taskListCheckValueUnchecked:Zy,paragraph:Qy}}}function Xy(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:$y}}}function Zy(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Qy(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 $y(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=My.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 eb(){return[G_(),gv(),xv(),By(),Yy()]}function tb(e){return{extensions:[K_(),_v(e),Sv(),Jy(e),Xy()]}}function nb(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 rb(e,t){return e.length>0?(nb(e,e.length,0,t),e):t}const ib={}.hasOwnProperty;function ab(e){let t={},n=-1;for(;++n<e.length;)ob(t,e[n]);return t}function ob(e,t){let n;for(n in t){let r=(ib.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){ib.call(r,a)||(r[a]=[]);let e=i[a];sb(r[a],Array.isArray(e)?e:e?[e]:[])}}}function sb(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);nb(e,0,0,r)}const cb={tokenize:Sb,partial:!0},lb={tokenize:Cb,partial:!0},ub={tokenize:wb,partial:!0},db={tokenize:Tb,partial:!0},fb={tokenize:Eb,partial:!0},pb={name:`wwwAutolink`,tokenize:bb,previous:Db},mb={name:`protocolAutolink`,tokenize:xb,previous:Ob},hb={name:`emailAutolink`,tokenize:yb,previous:kb},gb={};function _b(){return{text:gb}}let vb=48;for(;vb<123;)gb[vb]=hb,vb++,vb===58?vb=65:vb===91&&(vb=97);gb[43]=hb,gb[45]=hb,gb[46]=hb,gb[95]=hb,gb[72]=[hb,mb],gb[104]=[hb,mb],gb[87]=[hb,pb],gb[119]=[hb,pb];function yb(e,t,n){let r=this,i,a;return o;function o(t){return!Ab(t)||!kb.call(r,r.previous)||jb(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Ab(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(fb,u,l)(t):t===45||t===95||Yg(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&&Jg(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function bb(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Db.call(r,r.previous)||jb(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(cb,e.attempt(lb,e.attempt(ub,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function xb(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Ob.call(r,r.previous)&&!jb(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Jg(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||Zg(t)||t_(t)||i_(t)||r_(t)?n(t):e.attempt(lb,e.attempt(ub,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Sb(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 Cb(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(db,c,s)(t):t===null||t_(t)||i_(t)||t!==45&&r_(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 wb(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(db,t,a)(o):o===null||t_(o)||i_(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Tb(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||t_(o)||i_(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||t_(e)||i_(e)?t(e):r(e)}function a(e){return Jg(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Jg(t)?(e.consume(t),o):n(t)}}function Eb(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Yg(e)?n(e):t(e)}}function Db(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||t_(e)}function Ob(e){return!Jg(e)}function kb(e){return!(e===47||Ab(e))}function Ab(e){return e===43||e===45||e===46||e===95||Yg(e)}function jb(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 Mb(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 Nb={name:`attention`,resolveAll:Pb,tokenize:Fb};function Pb(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};Ib(d,-c),Ib(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=rb(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=rb(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=rb(l,Mb(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=rb(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=rb(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,nb(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 Fb(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Gv(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=Gv(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 Ib(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Lb={name:`autolink`,tokenize:Rb};function Rb(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 Jg(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Yg(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||Yg(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||Zg(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Xg(t)?(e.consume(t),l):n(t)}function u(e){return Yg(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||Yg(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function zb(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return n_(r)?(e.enter(n),s(r)):t(r)}function s(r){return n_(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const Bb={partial:!0,tokenize:Vb};function Vb(e,t,n){return r;function r(t){return n_(t)?zb(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}const Hb={continuation:{tokenize:Wb},exit:Gb,name:`blockQuote`,tokenize:Ub};function Ub(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 n_(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Wb(e,t,n){let r=this;return i;function i(t){return n_(t)?zb(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Hb,t,n)(r)}}function Gb(e){e.exit(`blockQuote`)}const Kb={name:`characterEscape`,tokenize:qb};function qb(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 e_(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const Jb={name:`characterReference`,tokenize:Yb};function Yb(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=Yg,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=$g,u):(e.enter(`characterReferenceValue`),a=7,o=Qg,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Yg&&!Fy(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 Xb={partial:!0,tokenize:$b},Zb={concrete:!0,name:`codeFenced`,tokenize:Qb};function Qb(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`),n_(t)?zb(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Xb,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):n_(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),zb(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(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&&n_(t)?zb(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(Xb,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(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`),n_(t)?zb(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`),n_(t)?zb(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function $b(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 ex={name:`codeIndented`,tokenize:nx},tx={partial:!0,tokenize:rx};function nx(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),zb(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):Y(t)?e.attempt(tx,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function rx(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):zb(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):Y(e)?i(e):n(e)}}const ix={name:`codeText`,previous:ox,resolve:ax,tokenize:sx};function ax(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 ox(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function sx(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)):Y(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||Y(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 cx=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&&lx(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),lx(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),lx(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);lx(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);lx(this.left,t.reverse())}}};function lx(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 ux(e){let t={},n=-1,r,i,a,o,s,c,l,u=new cx(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,dx(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 nb(e,0,1/0,u.slice(0)),!l}function dx(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 fx={resolve:mx,tokenize:hx},px={partial:!0,tokenize:gx};function mx(e){return ux(e),e}function hx(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):Y(t)?e.check(px,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 gx(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),zb(e,a,`linePrefix`)}function a(i){if(i===null||Y(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 _x(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||Zg(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||Y(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||t_(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||Zg(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 vx(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):Y(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||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!n_(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function yx(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):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),zb(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(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 bx(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):n_(i)?zb(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const xx={name:`definition`,tokenize:Cx},Sx={partial:!0,tokenize:wx};function Cx(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return vx.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=av(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 t_(t)?bx(e,l)(t):l(t)}function l(t){return _x(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Sx,d,d)(t)}function d(t){return n_(t)?zb(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function wx(e,t,n){return r;function r(t){return t_(t)?bx(e,i)(t):n(t)}function i(t){return yx(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return n_(t)?zb(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}const Tx={name:`hardBreakEscape`,tokenize:Ex};function Ex(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const Dx={name:`headingAtx`,resolve:Ox,tokenize:kx};function Ox(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`},nb(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function kx(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||t_(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):n_(n)?zb(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||t_(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const Ax=`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(`.`),jx=[`pre`,`script`,`style`,`textarea`],Mx={concrete:!0,name:`htmlFlow`,resolveTo:Fx,tokenize:Ix},Nx={partial:!0,tokenize:Rx},Px={partial:!0,tokenize:Lx};function Fx(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 Ix(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:oe):Jg(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):Jg(a)?(e.consume(a),i=4,r.interrupt?t:oe):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:oe):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return Jg(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||t_(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&jx.includes(l)?(i=1,r.interrupt?t(s):D(s)):Ax.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Yg(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return n_(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Jg(t)?(e.consume(t),b):n_(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Yg(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):n_(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):n_(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(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||t_(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||n_(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Y(t)?D(t):n_(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),re):t===60&&i===1?(e.consume(t),k):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),oe):t===93&&i===5?(e.consume(t),ae):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Nx,A,te)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(Px,O,A)(t)}function O(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||Y(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function re(t){return t===45?(e.consume(t),oe):D(t)}function k(t){return t===47?(e.consume(t),o=``,ie):D(t)}function ie(t){if(t===62){let n=o.toLowerCase();return jx.includes(n)?(e.consume(t),se):D(t)}return Jg(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):D(t)}function ae(t){return t===93?(e.consume(t),oe):D(t)}function oe(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),oe):D(t)}function se(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),A(t)):(e.consume(t),se)}function A(n){return e.exit(`htmlFlow`),t(n)}}function Lx(e,t,n){let r=this;return i;function i(t){return Y(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 Rx(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Bb,t,n)}}const zx={name:`htmlText`,tokenize:Bx};function Bx(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):Jg(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):Jg(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):Y(t)?(o=d,k(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?re(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):Y(t)?(o=h,k(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?re(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?re(t):Y(t)?(o=v,k(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,k(t)):(e.consume(t),y)}function b(e){return e===62?re(e):y(e)}function x(t){return Jg(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Yg(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,k(t)):n_(t)?(e.consume(t),C):re(t)}function w(t){return t===45||Yg(t)?(e.consume(t),w):t===47||t===62||t_(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),re):t===58||t===95||Jg(t)?(e.consume(t),E):Y(t)?(o=T,k(t)):n_(t)?(e.consume(t),T):re(t)}function E(t){return t===45||t===46||t===58||t===95||Yg(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):Y(t)?(o=ee,k(t)):n_(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):Y(t)?(o=D,k(t)):n_(t)?(e.consume(t),D):(e.consume(t),O)}function te(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):Y(t)?(o=te,k(t)):(e.consume(t),te)}function O(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||t_(t)?T(t):(e.consume(t),O)}function ne(e){return e===47||e===62||t_(e)?T(e):n(e)}function re(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function k(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return n_(t)?zb(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}const Vx={name:`labelEnd`,resolveAll:Gx,resolveTo:Kx,tokenize:qx},Hx={tokenize:Jx},Ux={tokenize:Yx},Wx={tokenize:Xx};function Gx(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&&nb(e,0,e.length,n),e}function Kx(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=rb(s,e.slice(a+1,a+r+3)),s=rb(s,[[`enter`,u,t]]),s=rb(s,Mb(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=rb(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=rb(s,e.slice(o+1)),s=rb(s,[[`exit`,c,t]]),nb(e,a,e.length,s),e}function qx(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(av(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(Hx,u,o?u:d)(t):t===91?e.attempt(Ux,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Wx,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function Jx(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 t_(t)?bx(e,a)(t):a(t)}function a(t){return t===41?u(t):_x(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return t_(t)?bx(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?yx(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return t_(t)?bx(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 Yx(e,t,n){let r=this;return i;function i(t){return vx.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(av(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Xx(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 Zx={name:`labelStartImage`,resolveAll:Vx.resolveAll,tokenize:Qx};function Qx(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 $x={name:`labelStartLink`,resolveAll:Vx.resolveAll,tokenize:eS};function eS(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 tS={name:`lineEnding`,tokenize:nS};function nS(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),zb(e,t,`linePrefix`)}}const rS={name:`thematicBreak`,tokenize:iS};function iS(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||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),n_(t)?zb(e,s,`whitespace`)(t):s(t))}}const aS={continuation:{tokenize:lS},exit:dS,name:`list`,tokenize:cS},oS={partial:!0,tokenize:fS},sS={partial:!0,tokenize:uS};function cS(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:Qg(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(rS,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 Qg(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(Bb,r.interrupt?n:u,e.attempt(oS,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return n_(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 lS(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Bb,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zb(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!n_(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(sS,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,zb(e,e.attempt(aS,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function uS(e,t,n){let r=this;return zb(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 dS(e){e.exit(this.containerState.type)}function fS(e,t,n){let r=this;return zb(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!n_(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const pS={name:`setextUnderline`,resolveTo:mS,tokenize:hS};function mS(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 hS(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`),n_(t)?zb(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const gS={tokenize:wS,partial:!0};function _S(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:xS,continuation:{tokenize:SS},exit:CS}},text:{91:{name:`gfmFootnoteCall`,tokenize:bS},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:vS,resolveTo:yS}}}}function vS(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=av(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 yS(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 bS(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||t_(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(av(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return t_(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 xS(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||t_(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=av(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return t_(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),zb(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function SS(e,t,n){return e.check(Bb,t,e.attempt(gS,t,n))}function CS(e){e.exit(`gfmFootnoteDefinition`)}function wS(e,t,n){let r=this;return zb(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 TS(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&&nb(o,o.length,0,Mb(s,e.slice(r+1,n),t)),nb(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),nb(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=Gv(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=Gv(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var ES=class{constructor(){this.map=[]}add(e,t,n){DS(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 DS(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 OS(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 kS(){return{flow:{null:{name:`table`,tokenize:AS,resolveAll:jS}}}}function AS(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):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):n_(t)?zb(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||t_(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,n_(t)?zb(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 n_(t)?zb(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||Y(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 n_(t)?zb(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(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||Y(n)?(e.exit(`tableRow`),t(n)):n_(n)?zb(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||t_(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 jS(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 ES;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(NS(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=MS(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=MS(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=MS(f,t,o,i,n,d)):(o[0]=o[1],d=MS(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&NS(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=OS(t.events,n))}return e}function MS(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},PS(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=PS(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=PS(t.events,n[2]),a=PS(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({},PS(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function NS(e,t,n,r,i){let a=[],o=PS(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 PS(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const FS={name:`tasklistCheck`,tokenize:LS};function IS(){return{text:{91:FS}}}function LS(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 t_(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 Y(r)?t(r):n_(r)?e.check({tokenize:RS},t,n)(r):n(r)}}function RS(e,t,n){return zb(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function zS(e){return ab([_b(),_S(),TS(e),kS(),IS()])}const BS={};function VS(e){let t=this,n=e||BS,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(zS(n)),a.push(eb()),o.push(tb(n))}function HS(){return{enter:{mdxFlowExpression:WS,mdxTextExpression:GS},exit:{mdxFlowExpression:KS,mdxFlowExpressionChunk:qS,mdxTextExpression:KS,mdxTextExpressionChunk:qS}}}function US(){return{handlers:{mdxFlowExpression:JS,mdxTextExpression:JS},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function WS(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function GS(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function KS(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function qS(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function JS(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}const YS=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),XS={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function ZS(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function QS(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function $S(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function eC(e){return $S(e)||ZS(e)}const tC=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function nC(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?eC:u===`decimal`?ZS:QS;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&YS.includes(y)&&(_=y,v=Fy(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?Fy(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):eC(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(rC(e))h(7,S),C=`�`;else if(e in XS)h(6,S),C=XS[e];else{let t=``;iC(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,tC[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function rC(e){return e>=55296&&e<=57343||e>1114111}function iC(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}const aC=/["&'<>`]/g,oC=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,sC=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,cC=/[|\\{}()[\]^$+*?.]/g,lC=new WeakMap;function uC(e,t){if(e=e.replace(t.subset?dC(t.subset):aC,r),t.subset||t.escapeOnly)return e;return e.replace(oC,n).replace(sC,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function dC(e){let t=lC.get(e);return t||(t=fC(e),lC.set(e,t)),t}function fC(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(cC,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}function pC(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function mC(e,t){return uC(e,Object.assign({format:pC},t))}function hC(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?_C(e.position):`start`in e||`end`in e?_C(e):`line`in e||`column`in e?gC(e):``}function gC(e){return vC(e&&e.line)+`:`+vC(e&&e.column)}function _C(e){return gC(e&&e.start)+`-`+gC(e&&e.end)}function vC(e){return e&&typeof e==`number`?e:1}var yC=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=hC(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}};yC.prototype.file=``,yC.prototype.name=``,yC.prototype.reason=``,yC.prototype.message=``,yC.prototype.stack=``,yC.prototype.column=void 0,yC.prototype.line=void 0,yC.prototype.ancestors=void 0,yC.prototype.cause=void 0,yC.prototype.fatal=void 0,yC.prototype.place=void 0,yC.prototype.ruleId=void 0,yC.prototype.source=void 0;function bC(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new yC("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new yC(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new yC("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=nC(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new yC("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+hC(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new yC("Expected a closing tag for `"+S(r)+"` ("+hC({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new yC("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+hC(t.end)+") or another opening tag after the start of `"+t.type+"` ("+hC(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function xC(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=TC,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=wC(CC(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&D_(e,n)>D_(e,o)?o:n;s=t+mC(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+` `+m[e];b+=y.move(`
216
215
  `+m.join(`
217
216
  `)+`
218
217
  `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
219
- `),b+=y.move(Cw(e,s,y.current())),b+=y.move(`
220
- `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function Cw(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=Tw(ww(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
218
+ `),b+=y.move(SC(e,s,y.current())),b+=y.move(`
219
+ `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function SC(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=wC(CC(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
221
220
  `,after:`
222
221
  `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
223
222
 
224
- `))}return r.pop(),s.join(``)}function ww(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function Tw(e){return` `.repeat(e)}function Ew(){return`<`}function Dw(){return{enter:{mdxjsEsm:kw},exit:{mdxjsEsm:Aw,mdxjsEsmData:jw}}}function Ow(){return{handlers:{mdxjsEsm:Mw}}}function kw(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function Aw(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function jw(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Mw(e){return e.value||``}function Nw(){return[UC(),xw(),Dw()]}function Pw(e){return{extensions:[WC(),Sw(e),Ow()]}}var Fw=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Iw=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Lw=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,Rw=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,zw={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},Bw=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,Vw={5:Bw,"5module":Bw+` export import`,6:Bw+` const class extends export import super`},Hw=/^in(stanceof)?$/,Uw=RegExp(`[`+Rw+`]`),Ww=RegExp(`[`+Rw+Lw+`]`);function Gw(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function Kw(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Uw.test(String.fromCharCode(e)):t===!1?!1:Gw(e,Iw)}function qw(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Ww.test(String.fromCharCode(e)):t===!1?!1:Gw(e,Iw)||Gw(e,Fw)}var Jw=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function Yw(e,t){return new Jw(e,{beforeExpr:!0,binop:t})}var Xw={beforeExpr:!0},Zw={startsExpr:!0},Qw={};function $w(e,t){return t===void 0&&(t={}),t.keyword=e,Qw[e]=new Jw(e,t)}var X={num:new Jw(`num`,Zw),regexp:new Jw(`regexp`,Zw),string:new Jw(`string`,Zw),name:new Jw(`name`,Zw),privateId:new Jw(`privateId`,Zw),eof:new Jw(`eof`),bracketL:new Jw(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new Jw(`]`),braceL:new Jw(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new Jw(`}`),parenL:new Jw(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new Jw(`)`),comma:new Jw(`,`,Xw),semi:new Jw(`;`,Xw),colon:new Jw(`:`,Xw),dot:new Jw(`.`),question:new Jw(`?`,Xw),questionDot:new Jw(`?.`),arrow:new Jw(`=>`,Xw),template:new Jw(`template`),invalidTemplate:new Jw(`invalidTemplate`),ellipsis:new Jw(`...`,Xw),backQuote:new Jw("`",Zw),dollarBraceL:new Jw("${",{beforeExpr:!0,startsExpr:!0}),eq:new Jw(`=`,{beforeExpr:!0,isAssign:!0}),assign:new Jw(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new Jw(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new Jw(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:Yw(`||`,1),logicalAND:Yw(`&&`,2),bitwiseOR:Yw(`|`,3),bitwiseXOR:Yw(`^`,4),bitwiseAND:Yw(`&`,5),equality:Yw(`==/!=/===/!==`,6),relational:Yw(`</>/<=/>=`,7),bitShift:Yw(`<</>>/>>>`,8),plusMin:new Jw(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:Yw(`%`,10),star:Yw(`*`,10),slash:Yw(`/`,10),starstar:new Jw(`**`,{beforeExpr:!0}),coalesce:Yw(`??`,1),_break:$w(`break`),_case:$w(`case`,Xw),_catch:$w(`catch`),_continue:$w(`continue`),_debugger:$w(`debugger`),_default:$w(`default`,Xw),_do:$w(`do`,{isLoop:!0,beforeExpr:!0}),_else:$w(`else`,Xw),_finally:$w(`finally`),_for:$w(`for`,{isLoop:!0}),_function:$w(`function`,Zw),_if:$w(`if`),_return:$w(`return`,Xw),_switch:$w(`switch`),_throw:$w(`throw`,Xw),_try:$w(`try`),_var:$w(`var`),_const:$w(`const`),_while:$w(`while`,{isLoop:!0}),_with:$w(`with`),_new:$w(`new`,{beforeExpr:!0,startsExpr:!0}),_this:$w(`this`,Zw),_super:$w(`super`,Zw),_class:$w(`class`,Zw),_extends:$w(`extends`,Xw),_export:$w(`export`),_import:$w(`import`,Zw),_null:$w(`null`,Zw),_true:$w(`true`,Zw),_false:$w(`false`,Zw),_in:$w(`in`,{beforeExpr:!0,binop:7}),_instanceof:$w(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:$w(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:$w(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:$w(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},eT=/\r\n?|\n|\u2028|\u2029/,tT=new RegExp(eT.source,`g`);function nT(e){return e===10||e===13||e===8232||e===8233}function rT(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(nT(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var iT=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,aT=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,oT=Object.prototype,sT=oT.hasOwnProperty,cT=oT.toString,lT=Object.hasOwn||(function(e,t){return sT.call(e,t)}),uT=Array.isArray||(function(e){return cT.call(e)===`[object Array]`}),dT=Object.create(null);function fT(e){return dT[e]||(dT[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function pT(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var mT=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,hT=function(e,t){this.line=e,this.column=t};hT.prototype.offset=function(e){return new hT(this.line,this.column+e)};var gT=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function _T(e,t){for(var n=1,r=0;;){var i=rT(e,r,t);if(i<0)return new hT(n,t-r);++n,r=i}}var vT={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},yT=!1;function bT(e){var t={};for(var n in vT)t[n]=e&&lT(e,n)?e[n]:vT[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!yT&&typeof console==`object`&&console.warn&&(yT=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
225
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),uT(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(uT(t.onComment)&&(t.onComment=xT(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function xT(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new gT(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var ST=1,CT=2,wT=4,TT=8,ET=16,DT=32,OT=64,kT=128,AT=256,jT=512,MT=1024,NT=ST|CT|AT;function PT(e,t){return CT|(e?wT:0)|(t?TT:0)}var FT=0,IT=1,LT=2,RT=3,zT=4,BT=5,VT=function(e,t,n){this.options=e=bT(e),this.sourceFile=e.sourceFile,this.keywords=fT(Vw[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=zw[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=fT(r);var i=(r?r+` `:``)+zw.strict;this.reservedWordsStrict=fT(i),this.reservedWordsStrictBind=fT(i+` `+zw.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
226
- `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(eT).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?CT:ST),this.regexpState=null,this.privateNameStack=[]},HT={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};VT.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},HT.inFunction.get=function(){return(this.currentVarScope().flags&CT)>0},HT.inGenerator.get=function(){return(this.currentVarScope().flags&TT)>0},HT.inAsync.get=function(){return(this.currentVarScope().flags&wT)>0},HT.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(AT|jT))return!1;if(t&CT)return(t&wT)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},HT.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&ST)},HT.allowSuper.get=function(){return(this.currentThisScope().flags&OT)>0||this.options.allowSuperOutsideMethod},HT.allowDirectSuper.get=function(){return(this.currentThisScope().flags&kT)>0},HT.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},HT.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(AT|jT)||t&CT&&!(t&ET))return!0}return!1},HT.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&MT||!this.inModule&&e&ST)},HT.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&AT)>0},VT.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},VT.parse=function(e,t){return new this(t,e).parse()},VT.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},VT.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(VT.prototype,HT);var UT=VT.prototype,WT=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;UT.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){aT.lastIndex=e,e+=aT.exec(this.input)[0].length;var t=WT.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){aT.lastIndex=e+t[0].length;var n=aT.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||eT.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,aT.lastIndex=e,e+=aT.exec(this.input)[0].length,this.input[e]===`;`&&e++}},UT.eat=function(e){return this.type===e?(this.next(),!0):!1},UT.isContextual=function(e){return this.type===X.name&&this.value===e&&!this.containsEsc},UT.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},UT.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},UT.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||eT.test(this.input.slice(this.lastTokEnd,this.start))},UT.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},UT.semicolon=function(){!this.eat(X.semi)&&!this.insertSemicolon()&&this.unexpected()},UT.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},UT.expect=function(e){this.eat(e)||this.unexpected()},UT.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var GT=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};UT.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},UT.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},UT.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},UT.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var Z=VT.prototype;Z.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==X.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var KT={kind:`loop`},qT={kind:`switch`};Z.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;aT.lastIndex=this.pos;var t=aT.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(Kw(r)){var i=n;do n+=r<=65535?1:2;while(qw(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!Hw.test(a))return!0}return!1},Z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;aT.lastIndex=this.pos;var e=aT.exec(this.input),t=this.pos+e[0].length,n;return!eT.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(qw(n=this.fullCharCodeAt(t+8))||n===92))},Z.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;aT.lastIndex=this.pos;var n=aT.exec(this.input),r=this.pos+n[0].length;if(eT.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||qw(a=this.fullCharCodeAt(i))||a===92)return!1;aT.lastIndex=i;var o=aT.exec(this.input);if(r=i+o[0].length,o&&eT.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!Kw(s)&&s!==92)return!1;var c=r;do r+=s<=65535?1:2;while(qw(s=this.fullCharCodeAt(r)));if(s===92)return!0;var l=this.input.slice(c,r);return!(Hw.test(l)||t&&l===`of`)},Z.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},Z.isUsing=function(e){return this.isUsingKeyword(!1,e)},Z.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=X._var,a=`let`),r){case X._break:case X._continue:return this.parseBreakContinueStatement(i,r.keyword);case X._debugger:return this.parseDebuggerStatement(i);case X._do:return this.parseDoStatement(i);case X._for:return this.parseForStatement(i);case X._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case X._class:return e&&this.unexpected(),this.parseClass(i,!0);case X._if:return this.parseIfStatement(i);case X._return:return this.parseReturnStatement(i);case X._switch:return this.parseSwitchStatement(i);case X._throw:return this.parseThrowStatement(i);case X._try:return this.parseTryStatement(i);case X._const:case X._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case X._while:return this.parseWhileStatement(i);case X._with:return this.parseWithStatement(i);case X.braceL:return this.parseBlock(!0,i);case X.semi:return this.parseEmptyStatement(i);case X._export:case X._import:if(this.options.ecmaVersion>10&&r===X._import){aT.lastIndex=this.pos;var o=aT.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===X._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===X.name&&d.type===`Identifier`&&this.eat(X.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},Z.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(X.semi)||this.insertSemicolon()?e.label=null:this.type===X.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},Z.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},Z.parseDoStatement=function(e){return this.next(),this.labels.push(KT),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(X._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(X.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},Z.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(KT),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===X._var||this.type===X._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new GT,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===X._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===X._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},Z.parseForAfterInit=function(e,t,n){return(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},Z.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,YT|(n?0:XT),!1,t)},Z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(X._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},Z.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(X.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},Z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(X.braceL),this.labels.push(qT),this.enterScope(MT);for(var t,n=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var r=this.type===X._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(X.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},Z.parseThrowStatement=function(e){return this.next(),eT.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var JT=[];Z.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?DT:0),this.checkLValPattern(e,t?zT:LT),this.expect(X.parenR),e},Z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===X._catch){var t=this.startNode();this.next(),this.eat(X.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(X._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},Z.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},Z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(KT),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},Z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},Z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},Z.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===X._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},Z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},Z.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(X.braceL),e&&this.enterScope(0);this.type!==X.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},Z.parseFor=function(e,t){return e.init=t,this.expect(X.semi),e.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),e.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},Z.parseForIn=function(e,t){var n=this.type===X._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},Z.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(X.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==X._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&!(t&&(this.type===X._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(X.comma))break}return e},Z.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?IT:LT,!1)};var YT=1,XT=2,ZT=4;Z.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===X.star&&t&XT&&this.unexpected(),e.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&YT&&(e.id=t&ZT&&this.type!==X.name?null:this.parseIdent(),e.id&&!(t&XT)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?IT:LT:RT));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(PT(e.async,e.generator)),t&YT||(e.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&YT?`FunctionDeclaration`:`FunctionExpression`)},Z.parseFunctionParams=function(e){this.expect(X.parenL),e.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Z.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(X.braceL);this.type!==X.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&QT(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},Z.parseClassElement=function(e){if(this.eat(X.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===X.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(X.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===X.parenL||o!==`method`||i||a){var l=!n.static&&$T(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},Z.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword},Z.parseClassElementName=function(e){this.type===X.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},Z.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&$T(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},Z.parseClassField=function(e){return $T(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&$T(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(X.eq)?(this.enterScope(jT|OT),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},Z.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(AT|OT);this.type!==X.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},Z.parseClassId=function(e,t){this.type===X.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,LT,!1)):(t===!0&&this.unexpected(),e.id=null)},Z.parseClassSuper=function(e){e.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null},Z.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},Z.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];lT(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function QT(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function $T(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}Z.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},Z.parseExport=function(e,t){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(e,t);if(this.eat(X._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},Z.parseExportDeclaration=function(e){return this.parseStatement(null)},Z.parseExportDefaultDeclaration=function(){var e;if(this.type===X._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,YT|ZT,!1,e)}else if(this.type===X._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},Z.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),lT(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},Z.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},Z.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},Z.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},Z.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},Z.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(X.braceL);!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;t.push(this.parseExportSpecifier(e))}return t},Z.parseImport=function(e){return this.next(),this.type===X.string?(e.specifiers=JT,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===X.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},Z.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,LT),this.finishNode(e,`ImportSpecifier`)},Z.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,LT),this.finishNode(e,`ImportDefaultSpecifier`)},Z.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,LT),this.finishNode(e,`ImportNamespaceSpecifier`)},Z.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===X.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(X.comma)))return e;if(this.type===X.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(X.braceL);!this.eat(X.braceR);){if(t)t=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;e.push(this.parseImportSpecifier())}return e},Z.parseWithClause=function(){var e=[];if(!this.eat(X._with))return e;this.expect(X.braceL);for(var t={},n=!0;!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;lT(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},Z.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(X.colon),this.type!==X.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},Z.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===X.string){var e=this.parseLiteral(this.value);return mT.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},Z.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},Z.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var eE=VT.prototype;eE.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},eE.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},eE.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},eE.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==X.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},eE.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case X.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(X.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case X.braceL:return this.parseObj(!0)}return this.parseIdent()},eE.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(X.comma),t&&this.type===X.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===X.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},eE.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},eE.parseBindingListItem=function(e){return e},eE.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(X.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},eE.checkLValSimple=function(e,t,n){t===void 0&&(t=FT);var r=t!==FT;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===LT&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(lT(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==BT&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},eE.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=FT),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},eE.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=FT),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var tE=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},nE={b_stat:new tE(`{`,!1),b_expr:new tE(`{`,!0),b_tmpl:new tE("${",!1),p_stat:new tE(`(`,!1),p_expr:new tE(`(`,!0),q_tmpl:new tE("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new tE(`function`,!1),f_expr:new tE(`function`,!0),f_expr_gen:new tE(`function`,!0,!1,null,!0),f_gen:new tE(`function`,!1,!1,null,!0)},rE=VT.prototype;rE.initialContext=function(){return[nE.b_stat]},rE.curContext=function(){return this.context[this.context.length-1]},rE.braceIsBlock=function(e){var t=this.curContext();return t===nE.f_expr||t===nE.f_stat?!0:e===X.colon&&(t===nE.b_stat||t===nE.b_expr)?!t.isExpr:e===X._return||e===X.name&&this.exprAllowed?eT.test(this.input.slice(this.lastTokEnd,this.start)):e===X._else||e===X.semi||e===X.eof||e===X.parenR||e===X.arrow?!0:e===X.braceL?t===nE.b_stat:e===X._var||e===X._const||e===X.name?!1:!this.exprAllowed},rE.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},rE.updateContext=function(e){var t,n=this.type;n.keyword&&e===X.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},rE.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},X.parenR.updateContext=X.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===nE.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},X.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?nE.b_stat:nE.b_expr),this.exprAllowed=!0},X.dollarBraceL.updateContext=function(){this.context.push(nE.b_tmpl),this.exprAllowed=!0},X.parenL.updateContext=function(e){var t=e===X._if||e===X._for||e===X._with||e===X._while;this.context.push(t?nE.p_stat:nE.p_expr),this.exprAllowed=!0},X.incDec.updateContext=function(){},X._function.updateContext=X._class.updateContext=function(e){e.beforeExpr&&e!==X._else&&!(e===X.semi&&this.curContext()!==nE.p_stat)&&!(e===X._return&&eT.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===X.colon||e===X.braceL)&&this.curContext()===nE.b_stat)?this.context.push(nE.f_expr):this.context.push(nE.f_stat),this.exprAllowed=!1},X.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},X.backQuote.updateContext=function(){this.curContext()===nE.q_tmpl?this.context.pop():this.context.push(nE.q_tmpl),this.exprAllowed=!1},X.star.updateContext=function(e){if(e===X._function){var t=this.context.length-1;this.context[t]===nE.f_expr?this.context[t]=nE.f_expr_gen:this.context[t]=nE.f_gen}this.exprAllowed=!0},X.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==X.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var iE=VT.prototype;iE.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},iE.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===X.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(X.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},iE.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new GT,r=!0);var s=this.start,c=this.startLoc;(this.type===X.parenL||this.type===X.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===X.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===X.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},iE.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(X.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(X.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},iE.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},iE.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==X._in)&&a>r){var o=this.type===X.logicalOR||this.type===X.logicalAND,s=this.type===X.coalesce;s&&(a=X.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===X.coalesce||s&&(this.type===X.logicalOR||this.type===X.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},iE.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},iE.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===X.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&aE(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&oE(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===X.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==X._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(X.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1);else return o};function aE(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&aE(e.expression)}function oE(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&oE(e.expression)||e.type===`ParenthesizedExpression`&&oE(e.expression)}iE.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},iE.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},iE.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(X.arrow)},iE.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},iE.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(X.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(X.bracketL);if(l||c&&this.type!==X.parenL&&this.type!==X.backQuote||this.eat(X.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(X.bracketR)):this.type===X.privateId&&e.type!==`Super`?u.property=this.parsePrivateIdent():u.property=this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(X.parenL)){var d=new GT,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===X.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},iE.parseExprAtom=function(e,t,n){this.type===X.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case X._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===X.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==X.dot&&this.type!==X.bracketL&&this.type!==X.parenL&&this.unexpected(),this.finishNode(r,`Super`);case X._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case X.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(nE.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===X.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(X.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case X.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return r=this.startNode(),r.value=this.type===X._null?null:this.type===X._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case X.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case X.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(X.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case X.braceL:return this.overrideContext(nE.b_expr),this.parseObj(!1,e);case X._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},iE.parseExprAtomDefault=function(){this.unexpected()},iE.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===X.parenL&&!e)return this.parseDynamicImport(t);if(this.type===X.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}else this.unexpected()},iE.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(X.parenR)?e.options=null:(this.expect(X.comma),this.afterTrailingComma(X.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(X.parenR)||(this.expect(X.comma),this.afterTrailingComma(X.parenR)||this.unexpected())));else if(!this.eat(X.parenR)){var t=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},iE.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},iE.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},iE.parseParenExpression=function(){this.expect(X.parenL);var e=this.parseExpression();return this.expect(X.parenR),e},iE.shouldParseArrow=function(e){return!this.canInsertSemicolon()},iE.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new GT,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;)if(l?l=!1:this.expect(X.comma),a&&this.afterTrailingComma(X.parenR,!0)){u=!0;break}else if(this.type===X.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}else c.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(X.parenR),e&&this.shouldParseArrow(c)&&this.eat(X.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}else return i},iE.parseParenItem=function(e){return e},iE.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var sE=[];iE.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(X.parenL)?e.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):e.arguments=sE,this.finishNode(e,`NewExpression`)},iE.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===X.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
223
+ `))}return r.pop(),s.join(``)}function CC(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function wC(e){return` `.repeat(e)}function TC(){return`<`}function EC(){return{enter:{mdxjsEsm:OC},exit:{mdxjsEsm:kC,mdxjsEsmData:AC}}}function DC(){return{handlers:{mdxjsEsm:jC}}}function OC(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function kC(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function AC(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function jC(e){return e.value||``}function MC(){return[HS(),bC(),EC()]}function NC(e){return{extensions:[US(),xC(e),DC()]}}var PC=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],FC=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],IC=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,LC=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,RC={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},zC=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,BC={5:zC,"5module":zC+` export import`,6:zC+` const class extends export import super`},VC=/^in(stanceof)?$/,HC=RegExp(`[`+LC+`]`),UC=RegExp(`[`+LC+IC+`]`);function WC(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function GC(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&HC.test(String.fromCharCode(e)):t===!1?!1:WC(e,FC)}function KC(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&UC.test(String.fromCharCode(e)):t===!1?!1:WC(e,FC)||WC(e,PC)}var qC=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function JC(e,t){return new qC(e,{beforeExpr:!0,binop:t})}var YC={beforeExpr:!0},XC={startsExpr:!0},ZC={};function QC(e,t){return t===void 0&&(t={}),t.keyword=e,ZC[e]=new qC(e,t)}var X={num:new qC(`num`,XC),regexp:new qC(`regexp`,XC),string:new qC(`string`,XC),name:new qC(`name`,XC),privateId:new qC(`privateId`,XC),eof:new qC(`eof`),bracketL:new qC(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new qC(`]`),braceL:new qC(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new qC(`}`),parenL:new qC(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new qC(`)`),comma:new qC(`,`,YC),semi:new qC(`;`,YC),colon:new qC(`:`,YC),dot:new qC(`.`),question:new qC(`?`,YC),questionDot:new qC(`?.`),arrow:new qC(`=>`,YC),template:new qC(`template`),invalidTemplate:new qC(`invalidTemplate`),ellipsis:new qC(`...`,YC),backQuote:new qC("`",XC),dollarBraceL:new qC("${",{beforeExpr:!0,startsExpr:!0}),eq:new qC(`=`,{beforeExpr:!0,isAssign:!0}),assign:new qC(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new qC(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new qC(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:JC(`||`,1),logicalAND:JC(`&&`,2),bitwiseOR:JC(`|`,3),bitwiseXOR:JC(`^`,4),bitwiseAND:JC(`&`,5),equality:JC(`==/!=/===/!==`,6),relational:JC(`</>/<=/>=`,7),bitShift:JC(`<</>>/>>>`,8),plusMin:new qC(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:JC(`%`,10),star:JC(`*`,10),slash:JC(`/`,10),starstar:new qC(`**`,{beforeExpr:!0}),coalesce:JC(`??`,1),_break:QC(`break`),_case:QC(`case`,YC),_catch:QC(`catch`),_continue:QC(`continue`),_debugger:QC(`debugger`),_default:QC(`default`,YC),_do:QC(`do`,{isLoop:!0,beforeExpr:!0}),_else:QC(`else`,YC),_finally:QC(`finally`),_for:QC(`for`,{isLoop:!0}),_function:QC(`function`,XC),_if:QC(`if`),_return:QC(`return`,YC),_switch:QC(`switch`),_throw:QC(`throw`,YC),_try:QC(`try`),_var:QC(`var`),_const:QC(`const`),_while:QC(`while`,{isLoop:!0}),_with:QC(`with`),_new:QC(`new`,{beforeExpr:!0,startsExpr:!0}),_this:QC(`this`,XC),_super:QC(`super`,XC),_class:QC(`class`,XC),_extends:QC(`extends`,YC),_export:QC(`export`),_import:QC(`import`,XC),_null:QC(`null`,XC),_true:QC(`true`,XC),_false:QC(`false`,XC),_in:QC(`in`,{beforeExpr:!0,binop:7}),_instanceof:QC(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:QC(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:QC(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:QC(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},$C=/\r\n?|\n|\u2028|\u2029/,ew=new RegExp($C.source,`g`);function tw(e){return e===10||e===13||e===8232||e===8233}function nw(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(tw(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var rw=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,iw=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,aw=Object.prototype,ow=aw.hasOwnProperty,sw=aw.toString,cw=Object.hasOwn||(function(e,t){return ow.call(e,t)}),lw=Array.isArray||(function(e){return sw.call(e)===`[object Array]`}),uw=Object.create(null);function dw(e){return uw[e]||(uw[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function fw(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var pw=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,mw=function(e,t){this.line=e,this.column=t};mw.prototype.offset=function(e){return new mw(this.line,this.column+e)};var hw=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function gw(e,t){for(var n=1,r=0;;){var i=nw(e,r,t);if(i<0)return new mw(n,t-r);++n,r=i}}var _w={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},vw=!1;function yw(e){var t={};for(var n in _w)t[n]=e&&cw(e,n)?e[n]:_w[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!vw&&typeof console==`object`&&console.warn&&(vw=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
224
+ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),lw(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(lw(t.onComment)&&(t.onComment=bw(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function bw(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new hw(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var xw=1,Sw=2,Cw=4,ww=8,Tw=16,Ew=32,Dw=64,Ow=128,kw=256,Aw=512,jw=1024,Mw=xw|Sw|kw;function Nw(e,t){return Sw|(e?Cw:0)|(t?ww:0)}var Pw=0,Fw=1,Iw=2,Lw=3,Rw=4,zw=5,Bw=function(e,t,n){this.options=e=yw(e),this.sourceFile=e.sourceFile,this.keywords=dw(BC[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=RC[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=dw(r);var i=(r?r+` `:``)+RC.strict;this.reservedWordsStrict=dw(i),this.reservedWordsStrictBind=dw(i+` `+RC.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
225
+ `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split($C).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=X.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?Sw:xw),this.regexpState=null,this.privateNameStack=[]},Vw={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};Bw.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Vw.inFunction.get=function(){return(this.currentVarScope().flags&Sw)>0},Vw.inGenerator.get=function(){return(this.currentVarScope().flags&ww)>0},Vw.inAsync.get=function(){return(this.currentVarScope().flags&Cw)>0},Vw.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(kw|Aw))return!1;if(t&Sw)return(t&Cw)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Vw.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&xw)},Vw.allowSuper.get=function(){return(this.currentThisScope().flags&Dw)>0||this.options.allowSuperOutsideMethod},Vw.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Ow)>0},Vw.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Vw.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(kw|Aw)||t&Sw&&!(t&Tw))return!0}return!1},Vw.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&jw||!this.inModule&&e&xw)},Vw.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&kw)>0},Bw.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},Bw.parse=function(e,t){return new this(t,e).parse()},Bw.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},Bw.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(Bw.prototype,Vw);var Hw=Bw.prototype,Uw=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Hw.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){iw.lastIndex=e,e+=iw.exec(this.input)[0].length;var t=Uw.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){iw.lastIndex=e+t[0].length;var n=iw.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||$C.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,iw.lastIndex=e,e+=iw.exec(this.input)[0].length,this.input[e]===`;`&&e++}},Hw.eat=function(e){return this.type===e?(this.next(),!0):!1},Hw.isContextual=function(e){return this.type===X.name&&this.value===e&&!this.containsEsc},Hw.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},Hw.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},Hw.canInsertSemicolon=function(){return this.type===X.eof||this.type===X.braceR||$C.test(this.input.slice(this.lastTokEnd,this.start))},Hw.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Hw.semicolon=function(){!this.eat(X.semi)&&!this.insertSemicolon()&&this.unexpected()},Hw.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},Hw.expect=function(e){this.eat(e)||this.unexpected()},Hw.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var Ww=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Hw.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},Hw.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},Hw.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},Hw.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var Z=Bw.prototype;Z.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==X.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var Gw={kind:`loop`},Kw={kind:`switch`};Z.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;iw.lastIndex=this.pos;var t=iw.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(GC(r)){var i=n;do n+=r<=65535?1:2;while(KC(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!VC.test(a))return!0}return!1},Z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;iw.lastIndex=this.pos;var e=iw.exec(this.input),t=this.pos+e[0].length,n;return!$C.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(KC(n=this.fullCharCodeAt(t+8))||n===92))},Z.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;iw.lastIndex=this.pos;var n=iw.exec(this.input),r=this.pos+n[0].length;if($C.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||KC(a=this.fullCharCodeAt(i))||a===92)return!1;iw.lastIndex=i;var o=iw.exec(this.input);if(r=i+o[0].length,o&&$C.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!GC(s)&&s!==92)return!1;var c=r;do r+=s<=65535?1:2;while(KC(s=this.fullCharCodeAt(r)));if(s===92)return!0;var l=this.input.slice(c,r);return!(VC.test(l)||t&&l===`of`)},Z.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},Z.isUsing=function(e){return this.isUsingKeyword(!1,e)},Z.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=X._var,a=`let`),r){case X._break:case X._continue:return this.parseBreakContinueStatement(i,r.keyword);case X._debugger:return this.parseDebuggerStatement(i);case X._do:return this.parseDoStatement(i);case X._for:return this.parseForStatement(i);case X._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case X._class:return e&&this.unexpected(),this.parseClass(i,!0);case X._if:return this.parseIfStatement(i);case X._return:return this.parseReturnStatement(i);case X._switch:return this.parseSwitchStatement(i);case X._throw:return this.parseThrowStatement(i);case X._try:return this.parseTryStatement(i);case X._const:case X._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case X._while:return this.parseWhileStatement(i);case X._with:return this.parseWithStatement(i);case X.braceL:return this.parseBlock(!0,i);case X.semi:return this.parseEmptyStatement(i);case X._export:case X._import:if(this.options.ecmaVersion>10&&r===X._import){iw.lastIndex=this.pos;var o=iw.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===X._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===X.name&&d.type===`Identifier`&&this.eat(X.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},Z.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(X.semi)||this.insertSemicolon()?e.label=null:this.type===X.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},Z.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},Z.parseDoStatement=function(e){return this.next(),this.labels.push(Gw),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(X._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(X.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},Z.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Gw),this.enterScope(0),this.expect(X.parenL),this.type===X.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===X._var||this.type===X._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new Ww,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===X._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===X._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},Z.parseForAfterInit=function(e,t,n){return(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===X._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},Z.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,Jw|(n?0:Yw),!1,t)},Z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(X._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},Z.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(X.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},Z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(X.braceL),this.labels.push(Kw),this.enterScope(jw);for(var t,n=!1;this.type!==X.braceR;)if(this.type===X._case||this.type===X._default){var r=this.type===X._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(X.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},Z.parseThrowStatement=function(e){return this.next(),$C.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var qw=[];Z.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?Ew:0),this.checkLValPattern(e,t?Rw:Iw),this.expect(X.parenR),e},Z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===X._catch){var t=this.startNode();this.next(),this.eat(X.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(X._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},Z.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},Z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Gw),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},Z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},Z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},Z.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===X._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},Z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},Z.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(X.braceL),e&&this.enterScope(0);this.type!==X.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},Z.parseFor=function(e,t){return e.init=t,this.expect(X.semi),e.test=this.type===X.semi?null:this.parseExpression(),this.expect(X.semi),e.update=this.type===X.parenR?null:this.parseExpression(),this.expect(X.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},Z.parseForIn=function(e,t){var n=this.type===X._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(X.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},Z.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(X.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===X._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==X._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&!(t&&(this.type===X._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(X.comma))break}return e},Z.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?Fw:Iw,!1)};var Jw=1,Yw=2,Xw=4;Z.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===X.star&&t&Yw&&this.unexpected(),e.generator=this.eat(X.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Jw&&(e.id=t&Xw&&this.type!==X.name?null:this.parseIdent(),e.id&&!(t&Yw)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Fw:Iw:Lw));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Nw(e.async,e.generator)),t&Jw||(e.id=this.type===X.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&Jw?`FunctionDeclaration`:`FunctionExpression`)},Z.parseFunctionParams=function(e){this.expect(X.parenL),e.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},Z.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(X.braceL);this.type!==X.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Zw(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},Z.parseClassElement=function(e){if(this.eat(X.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(X.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===X.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===X.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(X.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===X.parenL||o!==`method`||i||a){var l=!n.static&&Qw(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},Z.isClassElementNameStart=function(){return this.type===X.name||this.type===X.privateId||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword},Z.parseClassElementName=function(e){this.type===X.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},Z.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Qw(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},Z.parseClassField=function(e){return Qw(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Qw(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(X.eq)?(this.enterScope(Aw|Dw),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},Z.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(kw|Dw);this.type!==X.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},Z.parseClassId=function(e,t){this.type===X.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Iw,!1)):(t===!0&&this.unexpected(),e.id=null)},Z.parseClassSuper=function(e){e.superClass=this.eat(X._extends)?this.parseExprSubscripts(null,!1):null},Z.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},Z.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];cw(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Zw(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Qw(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}Z.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},Z.parseExport=function(e,t){if(this.next(),this.eat(X.star))return this.parseExportAllDeclaration(e,t);if(this.eat(X._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==X.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},Z.parseExportDeclaration=function(e){return this.parseStatement(null)},Z.parseExportDefaultDeclaration=function(){var e;if(this.type===X._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Jw|Xw,!1,e)}else if(this.type===X._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},Z.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),cw(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},Z.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},Z.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},Z.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},Z.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},Z.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(X.braceL);!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;t.push(this.parseExportSpecifier(e))}return t},Z.parseImport=function(e){return this.next(),this.type===X.string?(e.specifiers=qw,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===X.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},Z.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Iw),this.finishNode(e,`ImportSpecifier`)},Z.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Iw),this.finishNode(e,`ImportDefaultSpecifier`)},Z.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,Iw),this.finishNode(e,`ImportNamespaceSpecifier`)},Z.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===X.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(X.comma)))return e;if(this.type===X.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(X.braceL);!this.eat(X.braceR);){if(t)t=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;e.push(this.parseImportSpecifier())}return e},Z.parseWithClause=function(){var e=[];if(!this.eat(X._with))return e;this.expect(X.braceL);for(var t={},n=!0;!this.eat(X.braceR);){if(n)n=!1;else if(this.expect(X.comma),this.afterTrailingComma(X.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;cw(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},Z.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(X.colon),this.type!==X.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},Z.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===X.string){var e=this.parseLiteral(this.value);return pw.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},Z.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},Z.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var $w=Bw.prototype;$w.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},$w.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},$w.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},$w.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==X.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},$w.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case X.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(X.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case X.braceL:return this.parseObj(!0)}return this.parseIdent()},$w.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(X.comma),t&&this.type===X.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===X.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},$w.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},$w.parseBindingListItem=function(e){return e},$w.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(X.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},$w.checkLValSimple=function(e,t,n){t===void 0&&(t=Pw);var r=t!==Pw;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===Iw&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(cw(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==zw&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},$w.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=Pw),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},$w.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=Pw),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var eT=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},tT={b_stat:new eT(`{`,!1),b_expr:new eT(`{`,!0),b_tmpl:new eT("${",!1),p_stat:new eT(`(`,!1),p_expr:new eT(`(`,!0),q_tmpl:new eT("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new eT(`function`,!1),f_expr:new eT(`function`,!0),f_expr_gen:new eT(`function`,!0,!1,null,!0),f_gen:new eT(`function`,!1,!1,null,!0)},nT=Bw.prototype;nT.initialContext=function(){return[tT.b_stat]},nT.curContext=function(){return this.context[this.context.length-1]},nT.braceIsBlock=function(e){var t=this.curContext();return t===tT.f_expr||t===tT.f_stat?!0:e===X.colon&&(t===tT.b_stat||t===tT.b_expr)?!t.isExpr:e===X._return||e===X.name&&this.exprAllowed?$C.test(this.input.slice(this.lastTokEnd,this.start)):e===X._else||e===X.semi||e===X.eof||e===X.parenR||e===X.arrow?!0:e===X.braceL?t===tT.b_stat:e===X._var||e===X._const||e===X.name?!1:!this.exprAllowed},nT.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},nT.updateContext=function(e){var t,n=this.type;n.keyword&&e===X.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},nT.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},X.parenR.updateContext=X.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===tT.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},X.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?tT.b_stat:tT.b_expr),this.exprAllowed=!0},X.dollarBraceL.updateContext=function(){this.context.push(tT.b_tmpl),this.exprAllowed=!0},X.parenL.updateContext=function(e){var t=e===X._if||e===X._for||e===X._with||e===X._while;this.context.push(t?tT.p_stat:tT.p_expr),this.exprAllowed=!0},X.incDec.updateContext=function(){},X._function.updateContext=X._class.updateContext=function(e){e.beforeExpr&&e!==X._else&&!(e===X.semi&&this.curContext()!==tT.p_stat)&&!(e===X._return&&$C.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===X.colon||e===X.braceL)&&this.curContext()===tT.b_stat)?this.context.push(tT.f_expr):this.context.push(tT.f_stat),this.exprAllowed=!1},X.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},X.backQuote.updateContext=function(){this.curContext()===tT.q_tmpl?this.context.pop():this.context.push(tT.q_tmpl),this.exprAllowed=!1},X.star.updateContext=function(e){if(e===X._function){var t=this.context.length-1;this.context[t]===tT.f_expr?this.context[t]=tT.f_expr_gen:this.context[t]=tT.f_gen}this.exprAllowed=!0},X.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==X.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var rT=Bw.prototype;rT.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},rT.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===X.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(X.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},rT.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Ww,r=!0);var s=this.start,c=this.startLoc;(this.type===X.parenL||this.type===X.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===X.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===X.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},rT.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(X.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(X.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},rT.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},rT.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==X._in)&&a>r){var o=this.type===X.logicalOR||this.type===X.logicalAND,s=this.type===X.coalesce;s&&(a=X.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===X.coalesce||s&&(this.type===X.logicalOR||this.type===X.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},rT.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},rT.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===X.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&iT(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&aT(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===X.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==X._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(X.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1);else return o};function iT(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&iT(e.expression)}function aT(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&aT(e.expression)||e.type===`ParenthesizedExpression`&&aT(e.expression)}rT.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},rT.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},rT.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(X.arrow)},rT.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},rT.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(X.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(X.bracketL);if(l||c&&this.type!==X.parenL&&this.type!==X.backQuote||this.eat(X.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(X.bracketR)):this.type===X.privateId&&e.type!==`Super`?u.property=this.parsePrivateIdent():u.property=this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(X.parenL)){var d=new Ww,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===X.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},rT.parseExprAtom=function(e,t,n){this.type===X.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case X._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===X.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==X.dot&&this.type!==X.bracketL&&this.type!==X.parenL&&this.unexpected(),this.finishNode(r,`Super`);case X._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case X.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(X._function))return this.overrideContext(tT.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(X.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===X.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(X.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case X.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case X.num:case X.string:return this.parseLiteral(this.value);case X._null:case X._true:case X._false:return r=this.startNode(),r.value=this.type===X._null?null:this.type===X._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case X.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case X.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(X.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case X.braceL:return this.overrideContext(tT.b_expr),this.parseObj(!1,e);case X._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case X._class:return this.parseClass(this.startNode(),!1);case X._new:return this.parseNew();case X.backQuote:return this.parseTemplate();case X._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},rT.parseExprAtomDefault=function(){this.unexpected()},rT.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===X.parenL&&!e)return this.parseDynamicImport(t);if(this.type===X.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}else this.unexpected()},rT.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(X.parenR)?e.options=null:(this.expect(X.comma),this.afterTrailingComma(X.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(X.parenR)||(this.expect(X.comma),this.afterTrailingComma(X.parenR)||this.unexpected())));else if(!this.eat(X.parenR)){var t=this.start;this.eat(X.comma)&&this.eat(X.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},rT.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},rT.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},rT.parseParenExpression=function(){this.expect(X.parenL);var e=this.parseExpression();return this.expect(X.parenR),e},rT.shouldParseArrow=function(e){return!this.canInsertSemicolon()},rT.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new Ww,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==X.parenR;)if(l?l=!1:this.expect(X.comma),a&&this.afterTrailingComma(X.parenR,!0)){u=!0;break}else if(this.type===X.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}else c.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(X.parenR),e&&this.shouldParseArrow(c)&&this.eat(X.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}else return i},rT.parseParenItem=function(e){return e},rT.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var oT=[];rT.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===X.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(X.parenL)?e.arguments=this.parseExprList(X.parenR,this.options.ecmaVersion>=8,!1):e.arguments=oT,this.finishNode(e,`NewExpression`)},rT.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===X.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
227
226
  `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
228
- `),cooked:this.value},this.next(),n.tail=this.type===X.backQuote,this.finishNode(n,`TemplateElement`)},iE.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===X.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(X.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(X.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},iE.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!eT.test(this.input.slice(this.lastTokEnd,this.start))},iE.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(X.braceR);){if(r)r=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},iE.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===X.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(X.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},iE.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},iE.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===X.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==X.comma&&this.type!==X.braceR&&this.type!==X.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===X.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},iE.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(X.bracketR),e.key;e.computed=!1}return e.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},iE.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},iE.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(PT(t,r.generator)|OT|(n?kT:0)),this.expect(X.parenL),r.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},iE.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(PT(n,!1)|ET),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},iE.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==X.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,BT),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},iE.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},iE.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,IT,t?null:n)}},iE.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(X.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===X.comma?o=null:this.type===X.ellipsis?(o=this.parseSpread(r),r&&this.type===X.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},iE.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&NT)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},iE.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},iE.parseIdentNode=function(){var e=this.startNode();return this.type===X.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name===`class`||e.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=X.name):this.unexpected(),e},iE.parsePrivateIdent=function(){var e=this.startNode();return this.type===X.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},iE.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===X.semi||this.canInsertSemicolon()||this.type!==X.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(X.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},iE.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var cE=VT.prototype;cE.raise=function(e,t){var n=_T(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},cE.raiseRecoverable=cE.raise,cE.curPosition=function(){if(this.options.locations)return new hT(this.curLine,this.pos-this.lineStart)};var lE=VT.prototype,uE=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};lE.enterScope=function(e){this.scopeStack.push(new uE(e))},lE.exitScope=function(){this.scopeStack.pop()},lE.treatFunctionsAsVarInScope=function(e){return e.flags&CT||!this.inModule&&e.flags&ST},lE.declareName=function(e,t,n){var r=!1;if(t===LT){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&ST&&delete this.undefinedExports[e]}else if(t===zT)this.currentScope().lexical.push(e);else if(t===RT){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&DT&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&ST&&delete this.undefinedExports[e],s.flags&NT)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},lE.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},lE.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},lE.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(NT|jT|AT))return t}},lE.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(NT|jT|AT)&&!(t.flags&ET))return t}};var dE=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new gT(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},fE=VT.prototype;fE.startNode=function(){return new dE(this,this.start,this.startLoc)},fE.startNodeAt=function(e,t){return new dE(this,e,t)};function pE(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}fE.finishNode=function(e,t){return pE.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},fE.finishNodeAt=function(e,t,n,r){return pE.call(this,e,t,n,r)},fE.copyNode=function(e){var t=new dE(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var mE=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,hE=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,gE=hE+` Extended_Pictographic`,_E=gE,vE=_E+` EBase EComp EMod EPres ExtPict`,yE=vE,bE=yE,xE={9:hE,10:gE,11:_E,12:vE,13:yE,14:bE},SE=`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`,CE={9:``,10:``,11:``,12:``,13:``,14:SE},wE=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,TE=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,EE=TE+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,DE=EE+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,OE=DE+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,kE=OE+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,AE=kE+` `+mE,jE={9:TE,10:EE,11:DE,12:OE,13:kE,14:AE},ME={};function NE(e){var t=ME[e]={binary:fT(xE[e]+` `+wE),binaryOfStrings:fT(CE[e]),nonBinary:{General_Category:fT(wE),Script:fT(jE[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var PE=0,FE=[9,10,11,12,13,14];PE<FE.length;PE+=1){var IE=FE[PE];NE(IE)}var Q=VT.prototype,LE=function(e,t){this.parent=e,this.base=t||this};LE.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},LE.prototype.sibling=function(){return new LE(this.parent,this.base)};var RE=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=ME[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};RE.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},RE.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},RE.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},RE.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},RE.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},RE.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},RE.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},RE.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1},RE.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},Q.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function zE(e){for(var t in e)return!0;return!1}Q.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&zE(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Q.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},Q.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new LE(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Q.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Q.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Q.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Q.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Q.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Q.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Q.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Q.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Q.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},Q.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Q.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&BE(n);)t+=pT(n),e.advance();return t};function BE(e){return e===105||e===109||e===115}Q.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Q.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Q.regexp_eatSyntaxCharacter=function(e){var t=e.current();return VE(t)?(e.lastIntValue=t,e.advance(),!0):!1};function VE(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Q.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!VE(n);)e.advance();return e.pos!==t},Q.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},Q.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`);t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Q.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Q.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=pT(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=pT(e.lastIntValue);return!0}return!1},Q.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),HE(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function HE(e){return Kw(e,!0)||e===36||e===95}Q.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),UE(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function UE(e){return qw(e,!0)||e===36||e===95||e===8204||e===8205}Q.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Q.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Q.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Q.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Q.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Q.regexp_eatZero=function(e){return e.current()===48&&!tD(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},Q.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},Q.regexp_eatControlLetter=function(e){var t=e.current();return WE(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function WE(e){return e>=65&&e<=90||e>=97&&e<=122}Q.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&GE(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function GE(e){return e>=0&&e<=1114111}Q.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},Q.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var KE=0,qE=1,JE=2;Q.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(YE(t))return e.lastIntValue=-1,e.advance(),qE;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===JE&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return KE};function YE(e){return e===100||e===68||e===115||e===83||e===119||e===87}Q.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),qE}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return KE},Q.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){lT(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Q.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return qE;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return JE;e.raise(`Invalid property name`)},Q.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;XE(t=e.current());)e.lastStringValue+=pT(t),e.advance();return e.lastStringValue!==``};function XE(e){return WE(e)||e===95}Q.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;ZE(t=e.current());)e.lastStringValue+=pT(t),e.advance();return e.lastStringValue!==``};function ZE(e){return XE(e)||tD(e)}Q.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Q.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===JE&&e.raise(`Negated character class may contain strings`),!0}return!1},Q.regexp_classContents=function(e){return e.current()===93?qE:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),qE)},Q.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Q.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||iD(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},Q.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Q.regexp_classSetExpression=function(e){var t=qE,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===JE&&(t=JE);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==JE&&(t=qE);continue}e.raise(`Invalid character in character class`)}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`);for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===JE&&(t=JE)}},Q.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},Q.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?qE:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Q.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===JE&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},Q.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},Q.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===JE&&(t=JE);return t},Q.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?qE:JE},Q.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&QE(n)||$E(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function QE(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function $E(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}Q.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return eD(t)?(e.lastIntValue=t,e.advance(),!0):!1};function eD(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}Q.regexp_eatClassControlLetter=function(e){var t=e.current();return tD(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Q.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Q.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;tD(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function tD(e){return e>=48&&e<=57}Q.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;nD(n=e.current());)e.lastIntValue=16*e.lastIntValue+rD(n),e.advance();return e.pos!==t};function nD(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function rD(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Q.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},Q.regexp_eatOctalDigit=function(e){var t=e.current();return iD(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function iD(e){return e>=48&&e<=55}Q.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!nD(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+rD(i),e.advance()}return!0};var aD=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new gT(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},oD=VT.prototype;oD.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new aD(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},oD.getToken=function(){return this.next(),new aD(this)},typeof Symbol<`u`&&(oD[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===X.eof,value:t}}}}),oD.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(X.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},oD.readToken=function(e){return Kw(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},oD.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},oD.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},oD.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=rT(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},oD.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!nT(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},oD.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&iT.test(String.fromCharCode(e)))++this.pos;else break loop}}},oD.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},oD.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))},oD.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)},oD.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=X.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(X.assign,n+1):this.finishOp(r,n)},oD.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(X.assign,3):this.finishOp(e===124?X.logicalOR:X.logicalAND,2):t===61?this.finishOp(X.assign,2):this.finishOp(e===124?X.bitwiseOR:X.bitwiseAND,1)},oD.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)},oD.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||eT.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(X.incDec,2):t===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)},oD.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(X.assign,n+1):this.finishOp(X.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(X.relational,n))},oD.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(e===61?X.eq:X.prefix,1)},oD.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(X.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(X.assign,3):this.finishOp(X.coalesce,2)}return this.finishOp(X.question,1)},oD.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Kw(t,!0)||t===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+pT(t)+`'`)},oD.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+pT(e)+`'`)},oD.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},oD.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if(eT.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new RE(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(X.regexp,{pattern:i,flags:o,value:c})},oD.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function sD(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function cD(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}oD.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=cD(this.input.slice(t,this.pos)),++this.pos):Kw(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(X.num,n)},oD.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=cD(this.input.slice(t,this.pos));return++this.pos,Kw(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(X.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),Kw(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=sD(this.input.slice(t,this.pos),n);return this.finishToken(X.num,a)},oD.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},oD.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(nT(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(X.string,t)};var lD={};oD.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===lD)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},oD.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw lD;this.raise(e,t)},oD.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===X.template||this.type===X.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(X.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(nT(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
229
- `;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},oD.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(X.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
227
+ `),cooked:this.value},this.next(),n.tail=this.type===X.backQuote,this.finishNode(n,`TemplateElement`)},rT.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var n=this.startNode();this.next(),n.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(n.quasis=[r];!r.tail;)this.type===X.eof&&this.raise(this.pos,`Unterminated template literal`),this.expect(X.dollarBraceL),n.expressions.push(this.parseExpression()),this.expect(X.braceR),n.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(n,`TemplateLiteral`)},rT.isAsyncProp=function(e){return!e.computed&&e.key.type===`Identifier`&&e.key.name===`async`&&(this.type===X.name||this.type===X.num||this.type===X.string||this.type===X.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===X.star)&&!$C.test(this.input.slice(this.lastTokEnd,this.start))},rT.parseObj=function(e,t){var n=this.startNode(),r=!0,i={};for(n.properties=[],this.next();!this.eat(X.braceR);){if(r)r=!1;else if(this.expect(X.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(X.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,i,t),n.properties.push(a)}return this.finishNode(n,e?`ObjectPattern`:`ObjectExpression`)},rT.parseProperty=function(e,t){var n=this.startNode(),r,i,a,o;if(this.options.ecmaVersion>=9&&this.eat(X.ellipsis))return e?(n.argument=this.parseIdent(!1),this.type===X.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.finishNode(n,`RestElement`)):(n.argument=this.parseMaybeAssign(!1,t),this.type===X.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(n,`SpreadElement`));this.options.ecmaVersion>=6&&(n.method=!1,n.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(X.star)));var s=this.containsEsc;return this.parsePropertyName(n),!e&&!s&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(n)?(i=!0,r=this.options.ecmaVersion>=9&&this.eat(X.star),this.parsePropertyName(n)):i=!1,this.parsePropertyValue(n,e,r,i,a,o,t,s),this.finishNode(n,`Property`)},rT.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var n=e.kind===`get`?0:1;if(e.value.params.length!==n){var r=e.value.start;e.kind===`get`?this.raiseRecoverable(r,`getter should have no params`):this.raiseRecoverable(r,`setter should have exactly one param`)}else e.kind===`set`&&e.value.params[0].type===`RestElement`&&this.raiseRecoverable(e.value.params[0].start,`Setter cannot use rest params`)},rT.parsePropertyValue=function(e,t,n,r,i,a,o,s){(n||r)&&this.type===X.colon&&this.unexpected(),this.eat(X.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind=`init`):this.options.ecmaVersion>=6&&this.type===X.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(n,r),e.kind=`init`):!t&&!s&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type===`Identifier`&&(e.key.name===`get`||e.key.name===`set`)&&this.type!==X.comma&&this.type!==X.braceR&&this.type!==X.eq?((n||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type===`Identifier`?((n||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=i),t?e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key)):this.type===X.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(i,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind=`init`,e.shorthand=!0):this.unexpected()},rT.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(X.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(X.bracketR),e.key;e.computed=!1}return e.key=this.type===X.num||this.type===X.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`)},rT.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)},rT.parseMethod=function(e,t,n){var r=this.startNode(),i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Nw(t,r.generator)|Dw|(n?Ow:0)),this.expect(X.parenL),r.params=this.parseBindingList(X.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,`FunctionExpression`)},rT.parseArrowExpression=function(e,t,n,r){var i=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(Nw(n,!1)|Tw),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!n),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=i,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,`ArrowFunctionExpression`)},rT.parseFunctionBody=function(e,t,n,r){var i=t&&this.type!==X.braceL,a=this.strict,o=!1;if(i)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var s=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||s)&&(o=this.strictDirective(this.end),o&&s&&this.raiseRecoverable(e.start,`Illegal 'use strict' directive in function with non-simple parameter list`));var c=this.labels;this.labels=[],o&&(this.strict=!0),this.checkParams(e,!a&&!o&&!t&&!n&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,zw),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()},rT.isSimpleParamList=function(e){for(var t=0,n=e;t<n.length;t+=1)if(n[t].type!==`Identifier`)return!1;return!0},rT.checkParams=function(e,t){for(var n=Object.create(null),r=0,i=e.params;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,Fw,t?null:n)}},rT.parseExprList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);){if(a)a=!1;else if(this.expect(X.comma),t&&this.afterTrailingComma(e))break;var o=void 0;n&&this.type===X.comma?o=null:this.type===X.ellipsis?(o=this.parseSpread(r),r&&this.type===X.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(!1,r),i.push(o)}return i},rT.checkUnreserved=function(e){var t=e.start,n=e.end,r=e.name;this.inGenerator&&r===`yield`&&this.raiseRecoverable(t,`Cannot use 'yield' as identifier inside a generator`),this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use 'await' as identifier inside an async function`),!(this.currentThisScope().flags&Mw)&&r===`arguments`&&this.raiseRecoverable(t,`Cannot use 'arguments' in class field initializer`),this.inClassStaticBlock&&(r===`arguments`||r===`await`)&&this.raise(t,`Cannot use `+r+` in class static initialization block`),this.keywords.test(r)&&this.raise(t,`Unexpected keyword '`+r+`'`),!(this.options.ecmaVersion<6&&this.input.slice(t,n).indexOf(`\\`)!==-1)&&(this.strict?this.reservedWordsStrict:this.reservedWords).test(r)&&(!this.inAsync&&r===`await`&&this.raiseRecoverable(t,`Cannot use keyword 'await' outside an async function`),this.raiseRecoverable(t,`The keyword '`+r+`' is reserved`))},rT.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,`Identifier`),e||(this.checkUnreserved(t),t.name===`await`&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t},rT.parseIdentNode=function(){var e=this.startNode();return this.type===X.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name===`class`||e.name===`function`)&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=X.name):this.unexpected(),e},rT.parsePrivateIdent=function(){var e=this.startNode();return this.type===X.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,`PrivateIdentifier`),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,`Private field '#`+e.name+`' must be declared in an enclosing class`):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e},rT.parseYield=function(e){this.yieldPos||=this.start;var t=this.startNode();return this.next(),this.type===X.semi||this.canInsertSemicolon()||this.type!==X.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(X.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,`YieldExpression`)},rT.parseAwait=function(e){this.awaitPos||=this.start;var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,`AwaitExpression`)};var sT=Bw.prototype;sT.raise=function(e,t){var n=gw(this.input,e);t+=` (`+n.line+`:`+n.column+`)`,this.sourceFile&&(t+=` in `+this.sourceFile);var r=SyntaxError(t);throw r.pos=e,r.loc=n,r.raisedAt=this.pos,r},sT.raiseRecoverable=sT.raise,sT.curPosition=function(){if(this.options.locations)return new mw(this.curLine,this.pos-this.lineStart)};var cT=Bw.prototype,lT=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};cT.enterScope=function(e){this.scopeStack.push(new lT(e))},cT.exitScope=function(){this.scopeStack.pop()},cT.treatFunctionsAsVarInScope=function(e){return e.flags&Sw||!this.inModule&&e.flags&xw},cT.declareName=function(e,t,n){var r=!1;if(t===Iw){var i=this.currentScope();r=i.lexical.indexOf(e)>-1||i.functions.indexOf(e)>-1||i.var.indexOf(e)>-1,i.lexical.push(e),this.inModule&&i.flags&xw&&delete this.undefinedExports[e]}else if(t===Rw)this.currentScope().lexical.push(e);else if(t===Lw){var a=this.currentScope();r=this.treatFunctionsAsVar?a.lexical.indexOf(e)>-1:a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var s=this.scopeStack[o];if(s.lexical.indexOf(e)>-1&&!(s.flags&Ew&&s.lexical[0]===e)||!this.treatFunctionsAsVarInScope(s)&&s.functions.indexOf(e)>-1){r=!0;break}if(s.var.push(e),this.inModule&&s.flags&xw&&delete this.undefinedExports[e],s.flags&Mw)break}r&&this.raiseRecoverable(n,`Identifier '`+e+`' has already been declared`)},cT.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)},cT.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},cT.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Mw|Aw|kw))return t}},cT.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Mw|Aw|kw)&&!(t.flags&Tw))return t}};var uT=function(e,t,n){this.type=``,this.start=t,this.end=0,e.options.locations&&(this.loc=new hw(e,n)),e.options.directSourceFile&&(this.sourceFile=e.options.directSourceFile),e.options.ranges&&(this.range=[t,0])},dT=Bw.prototype;dT.startNode=function(){return new uT(this,this.start,this.startLoc)},dT.startNodeAt=function(e,t){return new uT(this,e,t)};function fT(e,t,n,r){return e.type=t,e.end=n,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=n),e}dT.finishNode=function(e,t){return fT.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)},dT.finishNodeAt=function(e,t,n,r){return fT.call(this,e,t,n,r)},dT.copyNode=function(e){var t=new uT(this,e.start,this.startLoc);for(var n in e)t[n]=e[n];return t};var pT=`Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz`,mT=`ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS`,hT=mT+` Extended_Pictographic`,gT=hT,_T=gT+` EBase EComp EMod EPres ExtPict`,vT=_T,yT=vT,bT={9:mT,10:hT,11:gT,12:_T,13:vT,14:yT},xT=`Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji`,ST={9:``,10:``,11:``,12:``,13:``,14:xT},CT=`Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu`,wT=`Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb`,TT=wT+` Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd`,ET=TT+` Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho`,DT=ET+` Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi`,OT=DT+` Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith`,kT=OT+` `+pT,AT={9:wT,10:TT,11:ET,12:DT,13:OT,14:kT},jT={};function MT(e){var t=jT[e]={binary:dw(bT[e]+` `+CT),binaryOfStrings:dw(ST[e]),nonBinary:{General_Category:dw(CT),Script:dw(AT[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(var NT=0,PT=[9,10,11,12,13,14];NT<PT.length;NT+=1){var FT=PT[NT];MT(FT)}var Q=Bw.prototype,IT=function(e,t){this.parent=e,this.base=t||this};IT.prototype.separatedFrom=function(e){for(var t=this;t;t=t.parent)for(var n=e;n;n=n.parent)if(t.base===n.base&&t!==n)return!0;return!1},IT.prototype.sibling=function(){return new IT(this.parent,this.base)};var LT=function(e){this.parser=e,this.validFlags=`gim`+(e.options.ecmaVersion>=6?`uy`:``)+(e.options.ecmaVersion>=9?`s`:``)+(e.options.ecmaVersion>=13?`d`:``)+(e.options.ecmaVersion>=15?`v`:``),this.unicodeProperties=jT[e.options.ecmaVersion>=14?14:e.options.ecmaVersion],this.source=``,this.flags=``,this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue=``,this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};LT.prototype.reset=function(e,t,n){var r=n.indexOf(`v`)!==-1,i=n.indexOf(`u`)!==-1;this.start=e|0,this.source=t+``,this.flags=n,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=i&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=i&&this.parser.options.ecmaVersion>=9)},LT.prototype.raise=function(e){this.parser.raiseRecoverable(this.start,`Invalid regular expression: /`+this.source+`/: `+e)},LT.prototype.at=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return-1;var i=n.charCodeAt(e);if(!(t||this.switchU)||i<=55295||i>=57344||e+1>=r)return i;var a=n.charCodeAt(e+1);return a>=56320&&a<=57343?(i<<10)+a-56613888:i},LT.prototype.nextIndex=function(e,t){t===void 0&&(t=!1);var n=this.source,r=n.length;if(e>=r)return r;var i=n.charCodeAt(e),a;return!(t||this.switchU)||i<=55295||i>=57344||e+1>=r||(a=n.charCodeAt(e+1))<56320||a>57343?e+1:e+2},LT.prototype.current=function(e){return e===void 0&&(e=!1),this.at(this.pos,e)},LT.prototype.lookahead=function(e){return e===void 0&&(e=!1),this.at(this.nextIndex(this.pos,e),e)},LT.prototype.advance=function(e){e===void 0&&(e=!1),this.pos=this.nextIndex(this.pos,e)},LT.prototype.eat=function(e,t){return t===void 0&&(t=!1),this.current(t)===e?(this.advance(t),!0):!1},LT.prototype.eatChars=function(e,t){t===void 0&&(t=!1);for(var n=this.pos,r=0,i=e;r<i.length;r+=1){var a=i[r],o=this.at(n,t);if(o===-1||o!==a)return!1;n=this.nextIndex(n,t)}return this.pos=n,!0},Q.validateRegExpFlags=function(e){for(var t=e.validFlags,n=e.flags,r=!1,i=!1,a=0;a<n.length;a++){var o=n.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,`Invalid regular expression flag`),n.indexOf(o,a+1)>-1&&this.raise(e.start,`Duplicate regular expression flag`),o===`u`&&(r=!0),o===`v`&&(i=!0)}this.options.ecmaVersion>=15&&r&&i&&this.raise(e.start,`Invalid regular expression flag`)};function RT(e){for(var t in e)return!0;return!1}Q.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&RT(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))},Q.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue=``,e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise(`Unmatched ')'`),(e.eat(93)||e.eat(125))&&e.raise(`Lone quantifier brackets`)),e.maxBackReference>e.numCapturingParens&&e.raise(`Invalid escape`);for(var t=0,n=e.backReferenceNames;t<n.length;t+=1){var r=n[t];e.groupNames[r]||e.raise(`Invalid named capture referenced`)}},Q.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new IT(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise(`Nothing to repeat`),e.eat(123)&&e.raise(`Lone quantifier brackets`)},Q.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););},Q.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise(`Invalid quantifier`),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1},Q.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var n=!1;if(this.options.ecmaVersion>=9&&(n=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise(`Unterminated group`),e.lastAssertionIsQuantifiable=!n,!0}return e.pos=t,!1},Q.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1},Q.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)},Q.regexp_eatBracedQuantifier=function(e,t){var n=e.pos;if(e.eat(123)){var r=0,i=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(i=e.lastIntValue),e.eat(125)))return i!==-1&&i<r&&!t&&e.raise(`numbers out of order in {} quantifier`),!0;e.switchU&&!t&&e.raise(`Incomplete quantifier`),e.pos=n}return!1},Q.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)},Q.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1},Q.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var n=this.regexp_eatModifiers(e),r=e.eat(45);if(n||r){for(var i=0;i<n.length;i++){var a=n.charAt(i);n.indexOf(a,i+1)>-1&&e.raise(`Duplicate regular expression modifiers`)}if(r){var o=this.regexp_eatModifiers(e);!n&&!o&&e.current()===58&&e.raise(`Invalid regular expression modifiers`);for(var s=0;s<o.length;s++){var c=o.charAt(s);(o.indexOf(c,s+1)>-1||n.indexOf(c)>-1)&&e.raise(`Duplicate regular expression modifiers`)}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise(`Unterminated group`)}}e.pos=t}return!1},Q.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise(`Invalid group`),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise(`Unterminated group`)}return!1},Q.regexp_eatModifiers=function(e){for(var t=``,n=0;(n=e.current())!==-1&&zT(n);)t+=fw(n),e.advance();return t};function zT(e){return e===105||e===109||e===115}Q.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)},Q.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise(`Nothing to repeat`),!1},Q.regexp_eatSyntaxCharacter=function(e){var t=e.current();return BT(t)?(e.lastIntValue=t,e.advance(),!0):!1};function BT(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}Q.regexp_eatPatternCharacters=function(e){for(var t=e.pos,n=0;(n=e.current())!==-1&&!BT(n);)e.advance();return e.pos!==t},Q.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1},Q.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise(`Invalid group`);var t=this.options.ecmaVersion>=16,n=e.groupNames[e.lastStringValue];if(n)if(t)for(var r=0,i=n;r<i.length;r+=1)i[r].separatedFrom(e.branchID)||e.raise(`Duplicate capture group name`);else e.raise(`Duplicate capture group name`);t?(n||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}},Q.regexp_eatGroupName=function(e){if(e.lastStringValue=``,e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise(`Invalid capture group name`)}return!1},Q.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue=``,this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=fw(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=fw(e.lastIntValue);return!0}return!1},Q.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),VT(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function VT(e){return GC(e,!0)||e===36||e===95}Q.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,n=this.options.ecmaVersion>=11,r=e.current(n);return e.advance(n),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,n)&&(r=e.lastIntValue),HT(r)?(e.lastIntValue=r,!0):(e.pos=t,!1)};function HT(e){return KC(e,!0)||e===36||e===95||e===8204||e===8205}Q.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise(`Invalid unicode escape`),e.raise(`Invalid escape`)),!1)},Q.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var n=e.lastIntValue;if(e.switchU)return n>e.maxBackReference&&(e.maxBackReference=n),!0;if(n<=e.numCapturingParens)return!0;e.pos=t}return!1},Q.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise(`Invalid named reference`)}return!1},Q.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)},Q.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1},Q.regexp_eatZero=function(e){return e.current()===48&&!eE(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1},Q.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1},Q.regexp_eatControlLetter=function(e){var t=e.current();return UT(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function UT(e){return e>=65&&e<=90||e>=97&&e<=122}Q.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var n=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var i=e.lastIntValue;if(r&&i>=55296&&i<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(i-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=i}return!0}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&WT(e.lastIntValue))return!0;r&&e.raise(`Invalid unicode escape`),e.pos=n}return!1};function WT(e){return e>=0&&e<=1114111}Q.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1},Q.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var GT=0,KT=1,qT=2;Q.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(JT(t))return e.lastIntValue=-1,e.advance(),KT;var n=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((n=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return n&&r===qT&&e.raise(`Invalid property name`),r;e.raise(`Invalid property name`)}return GT};function JT(e){return e===100||e===68||e===115||e===83||e===119||e===87}Q.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var n=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,n,r),KT}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var i=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,i)}return GT},Q.regexp_validateUnicodePropertyNameAndValue=function(e,t,n){cw(e.unicodeProperties.nonBinary,t)||e.raise(`Invalid property name`),e.unicodeProperties.nonBinary[t].test(n)||e.raise(`Invalid property value`)},Q.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return KT;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return qT;e.raise(`Invalid property name`)},Q.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue=``;YT(t=e.current());)e.lastStringValue+=fw(t),e.advance();return e.lastStringValue!==``};function YT(e){return UT(e)||e===95}Q.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue=``;XT(t=e.current());)e.lastStringValue+=fw(t),e.advance();return e.lastStringValue!==``};function XT(e){return YT(e)||eE(e)}Q.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)},Q.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),n=this.regexp_classContents(e);return e.eat(93)||e.raise(`Unterminated character class`),t&&n===qT&&e.raise(`Negated character class may contain strings`),!0}return!1},Q.regexp_classContents=function(e){return e.current()===93?KT:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),KT)},Q.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var n=e.lastIntValue;e.switchU&&(t===-1||n===-1)&&e.raise(`Invalid character class`),t!==-1&&n!==-1&&t>n&&e.raise(`Range out of order in character class`)}}},Q.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var n=e.current();(n===99||rE(n))&&e.raise(`Invalid class escape`),e.raise(`Invalid escape`)}e.pos=t}var r=e.current();return r===93?!1:(e.lastIntValue=r,e.advance(),!0)},Q.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)},Q.regexp_classSetExpression=function(e){var t=KT,n;if(!this.regexp_eatClassSetRange(e))if(n=this.regexp_eatClassSetOperand(e)){n===qT&&(t=qT);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(n=this.regexp_eatClassSetOperand(e))){n!==qT&&(t=KT);continue}e.raise(`Invalid character in character class`)}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise(`Invalid character in character class`);if(r!==e.pos)return t}else e.raise(`Invalid character in character class`);for(;;)if(!this.regexp_eatClassSetRange(e)){if(n=this.regexp_eatClassSetOperand(e),!n)return t;n===qT&&(t=qT)}},Q.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var n=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return n!==-1&&r!==-1&&n>r&&e.raise(`Range out of order in character class`),!0}e.pos=t}return!1},Q.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?KT:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)},Q.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var n=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return n&&r===qT&&e.raise(`Negated character class may contain strings`),r;e.pos=t}if(e.eat(92)){var i=this.regexp_eatCharacterClassEscape(e);if(i)return i;e.pos=t}return null},Q.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var n=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return n}else e.raise(`Invalid escape`);e.pos=t}return null},Q.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===qT&&(t=qT);return t},Q.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?KT:qT},Q.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var n=e.current();return n<0||n===e.lookahead()&&ZT(n)||QT(n)?!1:(e.advance(),e.lastIntValue=n,!0)};function ZT(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function QT(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}Q.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return $T(t)?(e.lastIntValue=t,e.advance(),!0):!1};function $T(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}Q.regexp_eatClassControlLetter=function(e){var t=e.current();return eE(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1},Q.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise(`Invalid escape`),e.pos=t}return!1},Q.regexp_eatDecimalDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;eE(n=e.current());)e.lastIntValue=10*e.lastIntValue+(n-48),e.advance();return e.pos!==t};function eE(e){return e>=48&&e<=57}Q.regexp_eatHexDigits=function(e){var t=e.pos,n=0;for(e.lastIntValue=0;tE(n=e.current());)e.lastIntValue=16*e.lastIntValue+nE(n),e.advance();return e.pos!==t};function tE(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function nE(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}Q.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var n=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+n*8+e.lastIntValue:e.lastIntValue=t*8+n}else e.lastIntValue=t;return!0}return!1},Q.regexp_eatOctalDigit=function(e){var t=e.current();return rE(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function rE(e){return e>=48&&e<=55}Q.regexp_eatFixedHexDigits=function(e,t){var n=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var i=e.current();if(!tE(i))return e.pos=n,!1;e.lastIntValue=16*e.lastIntValue+nE(i),e.advance()}return!0};var iE=function(e){this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations&&(this.loc=new hw(e,e.startLoc,e.endLoc)),e.options.ranges&&(this.range=[e.start,e.end])},aE=Bw.prototype;aE.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword `+this.type.keyword),this.options.onToken&&this.options.onToken(new iE(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},aE.getToken=function(){return this.next(),new iE(this)},typeof Symbol<`u`&&(aE[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===X.eof,value:t}}}}),aE.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(X.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())},aE.readToken=function(e){return GC(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)},aE.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var n=this.input.charCodeAt(e+1);return n<=56319||n>=57344?t:(t<<10)+n-56613888},aE.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)},aE.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,n=this.input.indexOf(`*/`,this.pos+=2);if(n===-1&&this.raise(this.pos-2,`Unterminated comment`),this.pos=n+2,this.options.locations)for(var r=void 0,i=t;(r=nw(this.input,i,this.pos))>-1;)++this.curLine,i=this.lineStart=r;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,n),t,this.pos,e,this.curPosition())},aE.skipLineComment=function(e){for(var t=this.pos,n=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!tw(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,n,this.curPosition())},aE.skipSpace=function(){loop:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break loop}break;default:if(e>8&&e<14||e>=5760&&rw.test(String.fromCharCode(e)))++this.pos;else break loop}}},aE.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var n=this.type;this.type=e,this.value=t,this.updateContext(n)},aE.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(X.ellipsis)):(++this.pos,this.finishToken(X.dot))},aE.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(X.assign,2):this.finishOp(X.slash,1)},aE.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),n=1,r=e===42?X.star:X.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++n,r=X.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(X.assign,n+1):this.finishOp(r,n)},aE.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?this.options.ecmaVersion>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(X.assign,3):this.finishOp(e===124?X.logicalOR:X.logicalAND,2):t===61?this.finishOp(X.assign,2):this.finishOp(e===124?X.bitwiseOR:X.bitwiseAND,1)},aE.readToken_caret=function(){return this.input.charCodeAt(this.pos+1)===61?this.finishOp(X.assign,2):this.finishOp(X.bitwiseXOR,1)},aE.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||$C.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(X.incDec,2):t===61?this.finishOp(X.assign,2):this.finishOp(X.plusMin,1)},aE.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),n=1;return t===e?(n=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+n)===61?this.finishOp(X.assign,n+1):this.finishOp(X.bitShift,n)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(n=2),this.finishOp(X.relational,n))},aE.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(X.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(X.arrow)):this.finishOp(e===61?X.eq:X.prefix,1)},aE.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var n=this.input.charCodeAt(this.pos+2);if(n<48||n>57)return this.finishOp(X.questionDot,2)}if(t===63)return e>=12&&this.input.charCodeAt(this.pos+2)===61?this.finishOp(X.assign,3):this.finishOp(X.coalesce,2)}return this.finishOp(X.question,1)},aE.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),GC(t,!0)||t===92))return this.finishToken(X.privateId,this.readWord1());this.raise(this.pos,`Unexpected character '`+fw(t)+`'`)},aE.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(X.parenL);case 41:return++this.pos,this.finishToken(X.parenR);case 59:return++this.pos,this.finishToken(X.semi);case 44:return++this.pos,this.finishToken(X.comma);case 91:return++this.pos,this.finishToken(X.bracketL);case 93:return++this.pos,this.finishToken(X.bracketR);case 123:return++this.pos,this.finishToken(X.braceL);case 125:return++this.pos,this.finishToken(X.braceR);case 58:return++this.pos,this.finishToken(X.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(X.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(X.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,`Unexpected character '`+fw(e)+`'`)},aE.finishOp=function(e,t){var n=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,n)},aE.readRegexp=function(){for(var e,t,n=this.pos;;){this.pos>=this.input.length&&this.raise(n,`Unterminated regular expression`);var r=this.input.charAt(this.pos);if($C.test(r)&&this.raise(n,`Unterminated regular expression`),e)e=!1;else{if(r===`[`)t=!0;else if(r===`]`&&t)t=!1;else if(r===`/`&&!t)break;e=r===`\\`}++this.pos}var i=this.input.slice(n,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var s=this.regexpState||=new LT(this);s.reset(n,i,o),this.validateRegExpFlags(s),this.validateRegExpPattern(s);var c=null;try{c=new RegExp(i,o)}catch{}return this.finishToken(X.regexp,{pattern:i,flags:o,value:c})},aE.readInt=function(e,t,n){for(var r=this.options.ecmaVersion>=12&&t===void 0,i=n&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,s=0,c=0,l=t??1/0;c<l;++c,++this.pos){var u=this.input.charCodeAt(this.pos),d=void 0;if(r&&u===95){i&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed in legacy octal numeric literals`),s===95&&this.raiseRecoverable(this.pos,`Numeric separator must be exactly one underscore`),c===0&&this.raiseRecoverable(this.pos,`Numeric separator is not allowed at the first of digits`),s=u;continue}if(d=u>=97?u-97+10:u>=65?u-65+10:u>=48&&u<=57?u-48:1/0,d>=e)break;s=u,o=o*e+d}return r&&s===95&&this.raiseRecoverable(this.pos-1,`Numeric separator is not allowed at the last of digits`),this.pos===a||t!=null&&this.pos-a!==t?null:o};function oE(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,``))}function sE(e){return typeof BigInt==`function`?BigInt(e.replace(/_/g,``)):null}aE.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var n=this.readInt(e);return n??this.raise(this.start+2,`Expected number in radix `+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(n=sE(this.input.slice(t,this.pos)),++this.pos):GC(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(X.num,n)},aE.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,`Invalid number`);var n=this.pos-t>=2&&this.input.charCodeAt(t)===48;n&&this.strict&&this.raise(t,`Invalid number`);var r=this.input.charCodeAt(this.pos);if(!n&&!e&&this.options.ecmaVersion>=11&&r===110){var i=sE(this.input.slice(t,this.pos));return++this.pos,GC(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`),this.finishToken(X.num,i)}n&&/[89]/.test(this.input.slice(t,this.pos))&&(n=!1),r===46&&!n&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!n&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,`Invalid number`)),GC(this.fullCharCodeAtPos())&&this.raise(this.pos,`Identifier directly after number`);var a=oE(this.input.slice(t,this.pos),n);return this.finishToken(X.num,a)},aE.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var n=++this.pos;t=this.readHexChar(this.input.indexOf(`}`,this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(n,`Code point out of bounds`)}else t=this.readHexChar(4);return t},aE.readString=function(e){for(var t=``,n=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(n,this.pos),t+=this.readEscapedChar(!1),n=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,`Unterminated string constant`),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(tw(r)&&this.raise(this.start,`Unterminated string constant`),++this.pos)}return t+=this.input.slice(n,this.pos++),this.finishToken(X.string,t)};var cE={};aE.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===cE)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1},aE.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw cE;this.raise(e,t)},aE.readTmplToken=function(){for(var e=``,t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated template`);var n=this.input.charCodeAt(this.pos);if(n===96||n===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===X.template||this.type===X.invalidTemplate)?n===36?(this.pos+=2,this.finishToken(X.dollarBraceL)):(++this.pos,this.finishToken(X.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(X.template,e));if(n===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(tw(n)){switch(e+=this.input.slice(t,this.pos),++this.pos,n){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
228
+ `;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},aE.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(X.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
230
229
  `&&++this.pos;case`
231
- `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},oD.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
232
- `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return pT(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return nT(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},oD.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},oD.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(qw(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?Kw:qw)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=pT(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},oD.readWord=function(){var e=this.readWord1(),t=X.name;return this.keywords.test(e)&&(t=Qw[e]),this.finishToken(t,e)},VT.acorn={Parser:VT,version:`8.16.0`,defaultOptions:vT,Position:hT,SourceLocation:gT,getLineInfo:_T,Node:dE,TokenType:Jw,tokTypes:X,keywordTypes:Qw,TokContext:tE,tokContexts:nE,isIdentifierChar:qw,isIdentifierStart:Kw,Token:aD,isNewLine:nT,lineBreak:eT,lineBreakG:tT,nonASCIIwhitespace:iT};var uD=J(((e,t)=>{t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}})),dD=J(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(e,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],r=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t===!1?!1:d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function w(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ee=Object.prototype,D=ee.hasOwnProperty,te=ee.toString,O=Object.hasOwn||(function(e,t){return D.call(e,t)}),ne=Array.isArray||(function(e){return te.call(e)===`[object Array]`}),re=Object.create(null);function k(e){return re[e]||(re[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function ie(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ae=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,oe=function(e,t){this.line=e,this.column=t};oe.prototype.offset=function(e){return new oe(this.line,this.column+e)};var se=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function A(e,t){for(var n=1,r=0;;){var i=w(e,r,t);if(i<0)return new oe(n,t-r);++n,r=i}}var j={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ce=!1;function le(e){var t={};for(var n in j)t[n]=e&&O(e,n)?e[n]:j[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ce&&typeof console==`object`&&console.warn&&(ce=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
230
+ `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},aE.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
231
+ `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return fw(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return tw(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},aE.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},aE.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(KC(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?GC:KC)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=fw(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},aE.readWord=function(){var e=this.readWord1(),t=X.name;return this.keywords.test(e)&&(t=ZC[e]),this.finishToken(t,e)},Bw.acorn={Parser:Bw,version:`8.16.0`,defaultOptions:_w,Position:mw,SourceLocation:hw,getLineInfo:gw,Node:uT,TokenType:qC,tokTypes:X,keywordTypes:ZC,TokContext:eT,tokContexts:tT,isIdentifierChar:KC,isIdentifierStart:GC,Token:iE,isNewLine:tw,lineBreak:$C,lineBreakG:ew,nonASCIIwhitespace:rw};var lE=J(((e,t)=>{t.exports={quot:`"`,amp:`&`,apos:`'`,lt:`<`,gt:`>`,nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,fnof:`ƒ`,circ:`ˆ`,tilde:`˜`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,bull:`•`,hellip:`…`,permil:`‰`,prime:`′`,Prime:`″`,lsaquo:`‹`,rsaquo:`›`,oline:`‾`,frasl:`⁄`,euro:`€`,image:`ℑ`,weierp:`℘`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`}})),uE=J(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.acorn={}))})(e,(function(e){var t=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],n=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],r=`‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-᫝᫠-᫫ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・`,i=`ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-࢏ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚ౜ౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ೜-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ƛ꟱-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ`,a={3:`abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile`,5:`class enum extends super const export import`,6:`enum`,strict:`implements interface let package private protected public static yield`,strictBind:`eval arguments`},o=`break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this`,s={5:o,"5module":o+` export import`,6:o+` const class extends export import super`},c=/^in(stanceof)?$/,l=RegExp(`[`+i+`]`),u=RegExp(`[`+i+r+`]`);function d(e,t){for(var n=65536,r=0;r<t.length;r+=2){if(n+=t[r],n>e)return!1;if(n+=t[r+1],n>=e)return!0}return!1}function f(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&l.test(String.fromCharCode(e)):t===!1?!1:d(e,n)}function p(e,r){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&u.test(String.fromCharCode(e)):r===!1?!1:d(e,n)||d(e,t)}var m=function(e,t){t===void 0&&(t={}),this.label=e,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop||null,this.updateContext=null};function h(e,t){return new m(e,{beforeExpr:!0,binop:t})}var g={beforeExpr:!0},_={startsExpr:!0},v={};function y(e,t){return t===void 0&&(t={}),t.keyword=e,v[e]=new m(e,t)}var b={num:new m(`num`,_),regexp:new m(`regexp`,_),string:new m(`string`,_),name:new m(`name`,_),privateId:new m(`privateId`,_),eof:new m(`eof`),bracketL:new m(`[`,{beforeExpr:!0,startsExpr:!0}),bracketR:new m(`]`),braceL:new m(`{`,{beforeExpr:!0,startsExpr:!0}),braceR:new m(`}`),parenL:new m(`(`,{beforeExpr:!0,startsExpr:!0}),parenR:new m(`)`),comma:new m(`,`,g),semi:new m(`;`,g),colon:new m(`:`,g),dot:new m(`.`),question:new m(`?`,g),questionDot:new m(`?.`),arrow:new m(`=>`,g),template:new m(`template`),invalidTemplate:new m(`invalidTemplate`),ellipsis:new m(`...`,g),backQuote:new m("`",_),dollarBraceL:new m("${",{beforeExpr:!0,startsExpr:!0}),eq:new m(`=`,{beforeExpr:!0,isAssign:!0}),assign:new m(`_=`,{beforeExpr:!0,isAssign:!0}),incDec:new m(`++/--`,{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new m(`!/~`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:h(`||`,1),logicalAND:h(`&&`,2),bitwiseOR:h(`|`,3),bitwiseXOR:h(`^`,4),bitwiseAND:h(`&`,5),equality:h(`==/!=/===/!==`,6),relational:h(`</>/<=/>=`,7),bitShift:h(`<</>>/>>>`,8),plusMin:new m(`+/-`,{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:h(`%`,10),star:h(`*`,10),slash:h(`/`,10),starstar:new m(`**`,{beforeExpr:!0}),coalesce:h(`??`,1),_break:y(`break`),_case:y(`case`,g),_catch:y(`catch`),_continue:y(`continue`),_debugger:y(`debugger`),_default:y(`default`,g),_do:y(`do`,{isLoop:!0,beforeExpr:!0}),_else:y(`else`,g),_finally:y(`finally`),_for:y(`for`,{isLoop:!0}),_function:y(`function`,_),_if:y(`if`),_return:y(`return`,g),_switch:y(`switch`),_throw:y(`throw`,g),_try:y(`try`),_var:y(`var`),_const:y(`const`),_while:y(`while`,{isLoop:!0}),_with:y(`with`),_new:y(`new`,{beforeExpr:!0,startsExpr:!0}),_this:y(`this`,_),_super:y(`super`,_),_class:y(`class`,_),_extends:y(`extends`,g),_export:y(`export`),_import:y(`import`,_),_null:y(`null`,_),_true:y(`true`,_),_false:y(`false`,_),_in:y(`in`,{beforeExpr:!0,binop:7}),_instanceof:y(`instanceof`,{beforeExpr:!0,binop:7}),_typeof:y(`typeof`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y(`void`,{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y(`delete`,{beforeExpr:!0,prefix:!0,startsExpr:!0})},x=/\r\n?|\n|\u2028|\u2029/,S=new RegExp(x.source,`g`);function C(e){return e===10||e===13||e===8232||e===8233}function w(e,t,n){n===void 0&&(n=e.length);for(var r=t;r<n;r++){var i=e.charCodeAt(r);if(C(i))return r<n-1&&i===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var T=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ee=Object.prototype,D=ee.hasOwnProperty,te=ee.toString,O=Object.hasOwn||(function(e,t){return D.call(e,t)}),ne=Array.isArray||(function(e){return te.call(e)===`[object Array]`}),re=Object.create(null);function k(e){return re[e]||(re[e]=RegExp(`^(?:`+e.replace(/ /g,`|`)+`)$`))}function ie(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ae=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,oe=function(e,t){this.line=e,this.column=t};oe.prototype.offset=function(e){return new oe(this.line,this.column+e)};var se=function(e,t,n){this.start=t,this.end=n,e.sourceFile!==null&&(this.source=e.sourceFile)};function A(e,t){for(var n=1,r=0;;){var i=w(e,r,t);if(i<0)return new oe(n,t-r);++n,r=i}}var j={ecmaVersion:null,sourceType:`script`,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},ce=!1;function le(e){var t={};for(var n in j)t[n]=e&&O(e,n)?e[n]:j[n];if(t.ecmaVersion===`latest`?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ce&&typeof console==`object`&&console.warn&&(ce=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
233
232
  Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved??=t.ecmaVersion<5,(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),ne(t.onToken)){var r=t.onToken;t.onToken=function(e){return r.push(e)}}if(ne(t.onComment)&&(t.onComment=M(t,t.onComment)),t.sourceType===`commonjs`&&t.allowAwaitOutsideFunction)throw Error(`Cannot use allowAwaitOutsideFunction with sourceType: commonjs`);return t}function M(e,t){return function(n,r,i,a,o,s){var c={type:n?`Block`:`Line`,value:r,start:i,end:a};e.locations&&(c.loc=new se(this,o,s)),e.ranges&&(c.range=[i,a]),t.push(c)}}var N=1,ue=2,P=4,F=8,I=16,de=32,fe=64,pe=128,me=256,he=512,L=1024,ge=N|ue|me;function _e(e,t){return ue|(e?P:0)|(t?F:0)}var ve=0,ye=1,be=2,xe=3,Se=4,Ce=5,we=function(e,t,n){this.options=e=le(e),this.sourceFile=e.sourceFile,this.keywords=k(s[e.ecmaVersion>=6?6:e.sourceType===`module`?`5module`:5]);var r=``;e.allowReserved!==!0&&(r=a[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType===`module`&&(r+=` await`)),this.reservedWords=k(r);var i=(r?r+` `:``)+a.strict;this.reservedWordsStrict=k(i),this.reservedWordsStrictBind=k(i+` `+a.strictBind),this.input=String(t),this.containsEsc=!1,n?(this.pos=n,this.lineStart=this.input.lastIndexOf(`
234
233
  `,n-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(x).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=b.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=e.sourceType===`module`,this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&e.allowHashBang&&this.input.slice(0,2)===`#!`&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType===`commonjs`?ue:N),this.regexpState=null,this.privateNameStack=[]},Te={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};we.prototype.parse=function(){var e=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(e)},Te.inFunction.get=function(){return(this.currentVarScope().flags&ue)>0},Te.inGenerator.get=function(){return(this.currentVarScope().flags&F)>0},Te.inAsync.get=function(){return(this.currentVarScope().flags&P)>0},Te.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(me|he))return!1;if(t&ue)return(t&P)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Te.allowReturn.get=function(){return!!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&N)},Te.allowSuper.get=function(){return(this.currentThisScope().flags&fe)>0||this.options.allowSuperOutsideMethod},Te.allowDirectSuper.get=function(){return(this.currentThisScope().flags&pe)>0},Te.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Te.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e].flags;if(t&(me|he)||t&ue&&!(t&I))return!0}return!1},Te.allowUsing.get=function(){var e=this.currentScope().flags;return!(e&L||!this.inModule&&e&N)},Te.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&me)>0},we.extend=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++)n=e[r](n);return n},we.parse=function(e,t){return new this(t,e).parse()},we.parseExpressionAt=function(e,t,n){var r=new this(n,e,t);return r.nextToken(),r.parseExpression()},we.tokenizer=function(e,t){return new this(t,e)},Object.defineProperties(we.prototype,Te);var R=we.prototype,Ee=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;R.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){E.lastIndex=e,e+=E.exec(this.input)[0].length;var t=Ee.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])===`use strict`){E.lastIndex=e+t[0].length;var n=E.exec(this.input),r=n.index+n[0].length,i=this.input.charAt(r);return i===`;`||i===`}`||x.test(n[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(i)||i===`!`&&this.input.charAt(r+1)===`=`)}e+=t[0].length,E.lastIndex=e,e+=E.exec(this.input)[0].length,this.input[e]===`;`&&e++}},R.eat=function(e){return this.type===e?(this.next(),!0):!1},R.isContextual=function(e){return this.type===b.name&&this.value===e&&!this.containsEsc},R.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1},R.expectContextual=function(e){this.eatContextual(e)||this.unexpected()},R.canInsertSemicolon=function(){return this.type===b.eof||this.type===b.braceR||x.test(this.input.slice(this.lastTokEnd,this.start))},R.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},R.semicolon=function(){!this.eat(b.semi)&&!this.insertSemicolon()&&this.unexpected()},R.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0},R.expect=function(e){this.eat(e)||this.unexpected()},R.unexpected=function(e){this.raise(e??this.start,`Unexpected token`)};var De=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};R.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,`Comma is not permitted after the rest element`);var n=t?e.parenthesizedAssign:e.parenthesizedBind;n>-1&&this.raiseRecoverable(n,t?`Assigning to rvalue`:`Parenthesized pattern`)}},R.checkExpressionErrors=function(e,t){if(!e)return!1;var n=e.shorthandAssign,r=e.doubleProto;if(!t)return n>=0||r>=0;n>=0&&this.raise(n,`Shorthand property assignments are valid only in destructuring patterns`),r>=0&&this.raiseRecoverable(r,`Redefinition of __proto__ property`)},R.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,`Yield expression cannot be a default value`),this.awaitPos&&this.raise(this.awaitPos,`Await expression cannot be a default value`)},R.isSimpleAssignTarget=function(e){return e.type===`ParenthesizedExpression`?this.isSimpleAssignTarget(e.expression):e.type===`Identifier`||e.type===`MemberExpression`};var z=we.prototype;z.parseTopLevel=function(e){var t=Object.create(null);for(e.body||=[];this.type!==b.eof;){var n=this.parseStatement(null,!0,t);e.body.push(n)}if(this.inModule)for(var r=0,i=Object.keys(this.undefinedExports);r<i.length;r+=1){var a=i[r];this.raiseRecoverable(this.undefinedExports[a].start,`Export '`+a+`' is not defined`)}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType===`commonjs`?`script`:this.options.sourceType,this.finishNode(e,`Program`)};var Oe={kind:`loop`},ke={kind:`switch`};z.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual(`let`))return!1;E.lastIndex=this.pos;var t=E.exec(this.input),n=this.pos+t[0].length,r=this.fullCharCodeAt(n);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(f(r)){var i=n;do n+=r<=65535?1:2;while(p(r=this.fullCharCodeAt(n)));if(r===92)return!0;var a=this.input.slice(i,n);if(!c.test(a))return!0}return!1},z.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual(`async`))return!1;E.lastIndex=this.pos;var e=E.exec(this.input),t=this.pos+e[0].length,n;return!x.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)===`function`&&(t+8===this.input.length||!(p(n=this.fullCharCodeAt(t+8))||n===92))},z.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?`await`:`using`))return!1;E.lastIndex=this.pos;var n=E.exec(this.input),r=this.pos+n[0].length;if(x.test(this.input.slice(this.pos,r)))return!1;if(e){var i=r+5,a;if(this.input.slice(r,i)!==`using`||i===this.input.length||p(a=this.fullCharCodeAt(i))||a===92)return!1;E.lastIndex=i;var o=E.exec(this.input);if(r=i+o[0].length,o&&x.test(this.input.slice(i,r)))return!1}var s=this.fullCharCodeAt(r);if(!f(s)&&s!==92)return!1;var l=r;do r+=s<=65535?1:2;while(p(s=this.fullCharCodeAt(r)));if(s===92)return!0;var u=this.input.slice(l,r);return!(c.test(u)||t&&u===`of`)},z.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)},z.isUsing=function(e){return this.isUsingKeyword(!1,e)},z.parseStatement=function(e,t,n){var r=this.type,i=this.startNode(),a;switch(this.isLet(e)&&(r=b._var,a=`let`),r){case b._break:case b._continue:return this.parseBreakContinueStatement(i,r.keyword);case b._debugger:return this.parseDebuggerStatement(i);case b._do:return this.parseDoStatement(i);case b._for:return this.parseForStatement(i);case b._function:return e&&(this.strict||e!==`if`&&e!==`label`)&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(i,!1,!e);case b._class:return e&&this.unexpected(),this.parseClass(i,!0);case b._if:return this.parseIfStatement(i);case b._return:return this.parseReturnStatement(i);case b._switch:return this.parseSwitchStatement(i);case b._throw:return this.parseThrowStatement(i);case b._try:return this.parseTryStatement(i);case b._const:case b._var:return a||=this.value,e&&a!==`var`&&this.unexpected(),this.parseVarStatement(i,a);case b._while:return this.parseWhileStatement(i);case b._with:return this.parseWithStatement(i);case b.braceL:return this.parseBlock(!0,i);case b.semi:return this.parseEmptyStatement(i);case b._export:case b._import:if(this.options.ecmaVersion>10&&r===b._import){E.lastIndex=this.pos;var o=E.exec(this.input),s=this.pos+o[0].length,c=this.input.charCodeAt(s);if(c===40||c===46)return this.parseExpressionStatement(i,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,`'import' and 'export' may only appear at the top level`),this.inModule||this.raise(this.start,`'import' and 'export' may appear only with 'sourceType: module'`)),r===b._import?this.parseImport(i):this.parseExport(i,n);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(i,!0,!e);var l=this.isAwaitUsing(!1)?`await using`:this.isUsing(!1)?`using`:null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.next(),this.parseVar(i,!1,l),this.semicolon(),this.finishNode(i,`VariableDeclaration`);var u=this.value,d=this.parseExpression();return r===b.name&&d.type===`Identifier`&&this.eat(b.colon)?this.parseLabeledStatement(i,u,d,e):this.parseExpressionStatement(i,d)}},z.parseBreakContinueStatement=function(e,t){var n=t===`break`;this.next(),this.eat(b.semi)||this.insertSemicolon()?e.label=null:this.type===b.name?(e.label=this.parseIdent(),this.semicolon()):this.unexpected();for(var r=0;r<this.labels.length;++r){var i=this.labels[r];if((e.label==null||i.name===e.label.name)&&(i.kind!=null&&(n||i.kind===`loop`)||e.label&&n))break}return r===this.labels.length&&this.raise(e.start,`Unsyntactic `+t),this.finishNode(e,n?`BreakStatement`:`ContinueStatement`)},z.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,`DebuggerStatement`)},z.parseDoStatement=function(e){return this.next(),this.labels.push(Oe),e.body=this.parseStatement(`do`),this.labels.pop(),this.expect(b._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(b.semi):this.semicolon(),this.finishNode(e,`DoWhileStatement`)},z.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual(`await`)?this.lastTokStart:-1;if(this.labels.push(Oe),this.enterScope(0),this.expect(b.parenL),this.type===b.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var n=this.isLet();if(this.type===b._var||this.type===b._const||n){var r=this.startNode(),i=n?`let`:this.value;return this.next(),this.parseVar(r,!0,i),this.finishNode(r,`VariableDeclaration`),this.parseForAfterInit(e,r,t)}var a=this.isContextual(`let`),o=!1,s=this.isUsing(!0)?`using`:this.isAwaitUsing(!0)?`await using`:null;if(s){var c=this.startNode();return this.next(),s===`await using`&&(this.canAwait||this.raise(this.start,`Await using cannot appear outside of async function`),this.next()),this.parseVar(c,!0,s),this.finishNode(c,`VariableDeclaration`),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,u=new De,d=this.start,f=t>-1?this.parseExprSubscripts(u,`await`):this.parseExpression(!0,u);return this.type===b._in||(o=this.options.ecmaVersion>=6&&this.isContextual(`of`))?(t>-1?(this.type===b._in&&this.unexpected(t),e.await=!0):o&&this.options.ecmaVersion>=8&&(f.start===d&&!l&&f.type===`Identifier`&&f.name===`async`?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),a&&o&&this.raise(f.start,`The left-hand side of a for-of loop may not start with 'let'.`),this.toAssignable(f,!1,u),this.checkLValPattern(f),this.parseForIn(e,f)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,f))},z.parseForAfterInit=function(e,t,n){return(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===b._in?n>-1&&this.unexpected(n):e.await=n>-1),this.parseForIn(e,t)):(n>-1&&this.unexpected(n),this.parseFor(e,t))},z.parseFunctionStatement=function(e,t,n){return this.next(),this.parseFunction(e,je|(n?0:Me),!1,t)},z.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement(`if`),e.alternate=this.eat(b._else)?this.parseStatement(`if`):null,this.finishNode(e,`IfStatement`)},z.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,`'return' outside of function`),this.next(),this.eat(b.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,`ReturnStatement`)},z.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(b.braceL),this.labels.push(ke),this.enterScope(L);for(var t,n=!1;this.type!==b.braceR;)if(this.type===b._case||this.type===b._default){var r=this.type===b._case;t&&this.finishNode(t,`SwitchCase`),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(n&&this.raiseRecoverable(this.lastTokStart,`Multiple default clauses`),n=!0,t.test=null),this.expect(b.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,`SwitchCase`),this.next(),this.labels.pop(),this.finishNode(e,`SwitchStatement`)},z.parseThrowStatement=function(e){return this.next(),x.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,`Illegal newline after throw`),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,`ThrowStatement`)};var Ae=[];z.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type===`Identifier`;return this.enterScope(t?de:0),this.checkLValPattern(e,t?Se:be),this.expect(b.parenR),e},z.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===b._catch){var t=this.startNode();this.next(),this.eat(b.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,`CatchClause`)}return e.finalizer=this.eat(b._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,`Missing catch or finally clause`),this.finishNode(e,`TryStatement`)},z.parseVarStatement=function(e,t,n){return this.next(),this.parseVar(e,!1,t,n),this.semicolon(),this.finishNode(e,`VariableDeclaration`)},z.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Oe),e.body=this.parseStatement(`while`),this.labels.pop(),this.finishNode(e,`WhileStatement`)},z.parseWithStatement=function(e){return this.strict&&this.raise(this.start,`'with' in strict mode`),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement(`with`),this.finishNode(e,`WithStatement`)},z.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,`EmptyStatement`)},z.parseLabeledStatement=function(e,t,n,r){for(var i=0,a=this.labels;i<a.length;i+=1)a[i].name===t&&this.raise(n.start,`Label '`+t+`' is already declared`);for(var o=this.type.isLoop?`loop`:this.type===b._switch?`switch`:null,s=this.labels.length-1;s>=0;s--){var c=this.labels[s];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf(`label`)===-1?r+`label`:r:`label`),this.labels.pop(),e.label=n,this.finishNode(e,`LabeledStatement`)},z.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,`ExpressionStatement`)},z.parseBlock=function(e,t,n){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(b.braceL),e&&this.enterScope(0);this.type!==b.braceR;){var r=this.parseStatement(null);t.body.push(r)}return n&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,`BlockStatement`)},z.parseFor=function(e,t){return e.init=t,this.expect(b.semi),e.test=this.type===b.semi?null:this.parseExpression(),this.expect(b.semi),e.update=this.type===b.parenR?null:this.parseExpression(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,`ForStatement`)},z.parseForIn=function(e,t){var n=this.type===b._in;return this.next(),t.type===`VariableDeclaration`&&t.declarations[0].init!=null&&(!n||this.options.ecmaVersion<8||this.strict||t.kind!==`var`||t.declarations[0].id.type!==`Identifier`)&&this.raise(t.start,(n?`for-in`:`for-of`)+` loop variable declaration may not have an initializer`),e.left=t,e.right=n?this.parseExpression():this.parseMaybeAssign(),this.expect(b.parenR),e.body=this.parseStatement(`for`),this.exitScope(),this.labels.pop(),this.finishNode(e,n?`ForInStatement`:`ForOfStatement`)},z.parseVar=function(e,t,n,r){for(e.declarations=[],e.kind=n;;){var i=this.startNode();if(this.parseVarId(i,n),this.eat(b.eq)?i.init=this.parseMaybeAssign(t):!r&&n===`const`&&!(this.type===b._in||this.options.ecmaVersion>=6&&this.isContextual(`of`))?this.unexpected():!r&&(n===`using`||n===`await using`)&&this.options.ecmaVersion>=17&&this.type!==b._in&&!this.isContextual(`of`)?this.raise(this.lastTokEnd,`Missing initializer in `+n+` declaration`):!r&&i.id.type!==`Identifier`&&!(t&&(this.type===b._in||this.isContextual(`of`)))?this.raise(this.lastTokEnd,`Complex binding patterns require an initialization value`):i.init=null,e.declarations.push(this.finishNode(i,`VariableDeclarator`)),!this.eat(b.comma))break}return e},z.parseVarId=function(e,t){e.id=t===`using`||t===`await using`?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t===`var`?ye:be,!1)};var je=1,Me=2,Ne=4;z.parseFunction=function(e,t,n,r,i){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===b.star&&t&Me&&this.unexpected(),e.generator=this.eat(b.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&je&&(e.id=t&Ne&&this.type!==b.name?null:this.parseIdent(),e.id&&!(t&Me)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?ye:be:xe));var a=this.yieldPos,o=this.awaitPos,s=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(_e(e.async,e.generator)),t&je||(e.id=this.type===b.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,n,!1,i),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=s,this.finishNode(e,t&je?`FunctionDeclaration`:`FunctionExpression`)},z.parseFunctionParams=function(e){this.expect(b.parenL),e.params=this.parseBindingList(b.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},z.parseClass=function(e,t){this.next();var n=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),i=this.startNode(),a=!1;for(i.body=[],this.expect(b.braceL);this.type!==b.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(i.body.push(o),o.type===`MethodDefinition`&&o.kind===`constructor`?(a&&this.raiseRecoverable(o.start,`Duplicate constructor in the same class`),a=!0):o.key&&o.key.type===`PrivateIdentifier`&&Pe(r,o)&&this.raiseRecoverable(o.key.start,`Identifier '#`+o.key.name+`' has already been declared`))}return this.strict=n,this.next(),e.body=this.finishNode(i,`ClassBody`),this.exitClassBody(),this.finishNode(e,t?`ClassDeclaration`:`ClassExpression`)},z.parseClassElement=function(e){if(this.eat(b.semi))return null;var t=this.options.ecmaVersion,n=this.startNode(),r=``,i=!1,a=!1,o=`method`,s=!1;if(this.eatContextual(`static`)){if(t>=13&&this.eat(b.braceL))return this.parseClassStaticBlock(n),n;this.isClassElementNameStart()||this.type===b.star?s=!0:r=`static`}if(n.static=s,!r&&t>=8&&this.eatContextual(`async`)&&((this.isClassElementNameStart()||this.type===b.star)&&!this.canInsertSemicolon()?a=!0:r=`async`),!r&&(t>=9||!a)&&this.eat(b.star)&&(i=!0),!r&&!a&&!i){var c=this.value;(this.eatContextual(`get`)||this.eatContextual(`set`))&&(this.isClassElementNameStart()?o=c:r=c)}if(r?(n.computed=!1,n.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),n.key.name=r,this.finishNode(n.key,`Identifier`)):this.parseClassElementName(n),t<13||this.type===b.parenL||o!==`method`||i||a){var l=!n.static&&Fe(n,`constructor`),u=l&&e;l&&o!==`method`&&this.raise(n.key.start,`Constructor can't have get/set modifier`),n.kind=l?`constructor`:o,this.parseClassMethod(n,i,a,u)}else this.parseClassField(n);return n},z.isClassElementNameStart=function(){return this.type===b.name||this.type===b.privateId||this.type===b.num||this.type===b.string||this.type===b.bracketL||this.type.keyword},z.parseClassElementName=function(e){this.type===b.privateId?(this.value===`constructor`&&this.raise(this.start,`Classes can't have an element named '#constructor'`),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)},z.parseClassMethod=function(e,t,n,r){var i=e.key;e.kind===`constructor`?(t&&this.raise(i.start,`Constructor can't be a generator`),n&&this.raise(i.start,`Constructor can't be an async method`)):e.static&&Fe(e,`prototype`)&&this.raise(i.start,`Classes may not have a static property named prototype`);var a=e.value=this.parseMethod(t,n,r);return e.kind===`get`&&a.params.length!==0&&this.raiseRecoverable(a.start,`getter should have no params`),e.kind===`set`&&a.params.length!==1&&this.raiseRecoverable(a.start,`setter should have exactly one param`),e.kind===`set`&&a.params[0].type===`RestElement`&&this.raiseRecoverable(a.params[0].start,`Setter cannot use rest params`),this.finishNode(e,`MethodDefinition`)},z.parseClassField=function(e){return Fe(e,`constructor`)?this.raise(e.key.start,`Classes can't have a field named 'constructor'`):e.static&&Fe(e,`prototype`)&&this.raise(e.key.start,`Classes can't have a static field named 'prototype'`),this.eat(b.eq)?(this.enterScope(he|fe),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,`PropertyDefinition`)},z.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(me|fe);this.type!==b.braceR;){var n=this.parseStatement(null);e.body.push(n)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,`StaticBlock`)},z.parseClassId=function(e,t){this.type===b.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,be,!1)):(t===!0&&this.unexpected(),e.id=null)},z.parseClassSuper=function(e){e.superClass=this.eat(b._extends)?this.parseExprSubscripts(null,!1):null},z.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared},z.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,n=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,i=r===0?null:this.privateNameStack[r-1],a=0;a<n.length;++a){var o=n[a];O(t,o.name)||(i?i.used.push(o):this.raiseRecoverable(o.start,`Private field '#`+o.name+`' must be declared in an enclosing class`))}};function Pe(e,t){var n=t.key.name,r=e[n],i=`true`;return t.type===`MethodDefinition`&&(t.kind===`get`||t.kind===`set`)&&(i=(t.static?`s`:`i`)+t.kind),r===`iget`&&i===`iset`||r===`iset`&&i===`iget`||r===`sget`&&i===`sset`||r===`sset`&&i===`sget`?(e[n]=`true`,!1):r?!0:(e[n]=i,!1)}function Fe(e,t){var n=e.computed,r=e.key;return!n&&(r.type===`Identifier`&&r.name===t||r.type===`Literal`&&r.value===t)}z.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual(`as`)?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual(`from`),this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ExportAllDeclaration`)},z.parseExport=function(e,t){if(this.next(),this.eat(b.star))return this.parseExportAllDeclaration(e,t);if(this.eat(b._default))return this.checkExport(t,`default`,this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,`ExportDefaultDeclaration`);if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type===`VariableDeclaration`?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual(`from`))this.type!==b.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var n=0,r=e.specifiers;n<r.length;n+=1){var i=r[n];this.checkUnreserved(i.local),this.checkLocalExport(i.local),i.local.type===`Literal`&&this.raise(i.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,`ExportNamedDeclaration`)},z.parseExportDeclaration=function(e){return this.parseStatement(null)},z.parseExportDefaultDeclaration=function(){var e;if(this.type===b._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,je|Ne,!1,e)}else if(this.type===b._class){var n=this.startNode();return this.parseClass(n,`nullableID`)}else{var r=this.parseMaybeAssign();return this.semicolon(),r}},z.checkExport=function(e,t,n){e&&(typeof t!=`string`&&(t=t.type===`Identifier`?t.name:t.value),O(e,t)&&this.raiseRecoverable(n,`Duplicate export '`+t+`'`),e[t]=!0)},z.checkPatternExport=function(e,t){var n=t.type;if(n===`Identifier`)this.checkExport(e,t,t.start);else if(n===`ObjectPattern`)for(var r=0,i=t.properties;r<i.length;r+=1){var a=i[r];this.checkPatternExport(e,a)}else if(n===`ArrayPattern`)for(var o=0,s=t.elements;o<s.length;o+=1){var c=s[o];c&&this.checkPatternExport(e,c)}else n===`Property`?this.checkPatternExport(e,t.value):n===`AssignmentPattern`?this.checkPatternExport(e,t.left):n===`RestElement`&&this.checkPatternExport(e,t.argument)},z.checkVariableExport=function(e,t){if(e)for(var n=0,r=t;n<r.length;n+=1){var i=r[n];this.checkPatternExport(e,i.id)}},z.shouldParseExportStatement=function(){return this.type.keyword===`var`||this.type.keyword===`const`||this.type.keyword===`class`||this.type.keyword===`function`||this.isLet()||this.isAsyncFunction()},z.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual(`as`)?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,`ExportSpecifier`)},z.parseExportSpecifiers=function(e){var t=[],n=!0;for(this.expect(b.braceL);!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;t.push(this.parseExportSpecifier(e))}return t},z.parseImport=function(e){return this.next(),this.type===b.string?(e.specifiers=Ae,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual(`from`),e.source=this.type===b.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,`ImportDeclaration`)},z.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual(`as`)?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,be),this.finishNode(e,`ImportSpecifier`)},z.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,be),this.finishNode(e,`ImportDefaultSpecifier`)},z.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual(`as`),e.local=this.parseIdent(),this.checkLValSimple(e.local,be),this.finishNode(e,`ImportNamespaceSpecifier`)},z.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===b.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(b.comma)))return e;if(this.type===b.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(b.braceL);!this.eat(b.braceR);){if(t)t=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;e.push(this.parseImportSpecifier())}return e},z.parseWithClause=function(){var e=[];if(!this.eat(b._with))return e;this.expect(b.braceL);for(var t={},n=!0;!this.eat(b.braceR);){if(n)n=!1;else if(this.expect(b.comma),this.afterTrailingComma(b.braceR))break;var r=this.parseImportAttribute(),i=r.key.type===`Identifier`?r.key.name:r.key.value;O(t,i)&&this.raiseRecoverable(r.key.start,`Duplicate attribute key '`+i+`'`),t[i]=!0,e.push(r)}return e},z.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===b.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!==`never`),this.expect(b.colon),this.type!==b.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,`ImportAttribute`)},z.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===b.string){var e=this.parseLiteral(this.value);return ae.test(e.value)&&this.raise(e.start,`An export name cannot include a lone surrogate.`),e}return this.parseIdent(!0)},z.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)},z.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type===`ExpressionStatement`&&e.expression.type===`Literal`&&typeof e.expression.value==`string`&&(this.input[e.start]===`"`||this.input[e.start]===`'`)};var Ie=we.prototype;Ie.toAssignable=function(e,t,n){if(this.options.ecmaVersion>=6&&e)switch(e.type){case`Identifier`:this.inAsync&&e.name===`await`&&this.raise(e.start,`Cannot use 'await' as identifier inside an async function`);break;case`ObjectPattern`:case`ArrayPattern`:case`AssignmentPattern`:case`RestElement`:break;case`ObjectExpression`:e.type=`ObjectPattern`,n&&this.checkPatternErrors(n,!0);for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.toAssignable(a,t),a.type===`RestElement`&&(a.argument.type===`ArrayPattern`||a.argument.type===`ObjectPattern`)&&this.raise(a.argument.start,`Unexpected token`)}break;case`Property`:e.kind!==`init`&&this.raise(e.key.start,`Object pattern can't contain getter or setter`),this.toAssignable(e.value,t);break;case`ArrayExpression`:e.type=`ArrayPattern`,n&&this.checkPatternErrors(n,!0),this.toAssignableList(e.elements,t);break;case`SpreadElement`:e.type=`RestElement`,this.toAssignable(e.argument,t),e.argument.type===`AssignmentPattern`&&this.raise(e.argument.start,`Rest elements cannot have a default value`);break;case`AssignmentExpression`:e.operator!==`=`&&this.raise(e.left.end,`Only '=' operator can be used for specifying default value.`),e.type=`AssignmentPattern`,delete e.operator,this.toAssignable(e.left,t);break;case`ParenthesizedExpression`:this.toAssignable(e.expression,t,n);break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:if(!t)break;default:this.raise(e.start,`Assigning to rvalue`)}else n&&this.checkPatternErrors(n,!0);return e},Ie.toAssignableList=function(e,t){for(var n=e.length,r=0;r<n;r++){var i=e[r];i&&this.toAssignable(i,t)}if(n){var a=e[n-1];this.options.ecmaVersion===6&&t&&a&&a.type===`RestElement`&&a.argument.type!==`Identifier`&&this.unexpected(a.argument.start)}return e},Ie.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,`SpreadElement`)},Ie.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==b.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,`RestElement`)},Ie.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case b.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(b.bracketR,!0,!0),this.finishNode(e,`ArrayPattern`);case b.braceL:return this.parseObj(!0)}return this.parseIdent()},Ie.parseBindingList=function(e,t,n,r){for(var i=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(b.comma),t&&this.type===b.comma)i.push(null);else if(n&&this.afterTrailingComma(e))break;else if(this.type===b.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),i.push(o),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`),this.expect(e);break}else i.push(this.parseAssignableListItem(r));return i},Ie.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t},Ie.parseBindingListItem=function(e){return e},Ie.parseMaybeDefault=function(e,t,n){if(n||=this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(b.eq))return n;var r=this.startNodeAt(e,t);return r.left=n,r.right=this.parseMaybeAssign(),this.finishNode(r,`AssignmentPattern`)},Ie.checkLValSimple=function(e,t,n){t===void 0&&(t=ve);var r=t!==ve;switch(e.type){case`Identifier`:this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?`Binding `:`Assigning to `)+e.name+` in strict mode`),r&&(t===be&&e.name===`let`&&this.raiseRecoverable(e.start,`let is disallowed as a lexically bound name`),n&&(O(n,e.name)&&this.raiseRecoverable(e.start,`Argument name clash`),n[e.name]=!0),t!==Ce&&this.declareName(e.name,t,e.start));break;case`ChainExpression`:this.raiseRecoverable(e.start,`Optional chaining cannot appear in left-hand side`);break;case`MemberExpression`:r&&this.raiseRecoverable(e.start,`Binding member expression`);break;case`ParenthesizedExpression`:return r&&this.raiseRecoverable(e.start,`Binding parenthesized expression`),this.checkLValSimple(e.expression,t,n);default:this.raise(e.start,(r?`Binding`:`Assigning to`)+` rvalue`)}},Ie.checkLValPattern=function(e,t,n){switch(t===void 0&&(t=ve),e.type){case`ObjectPattern`:for(var r=0,i=e.properties;r<i.length;r+=1){var a=i[r];this.checkLValInnerPattern(a,t,n)}break;case`ArrayPattern`:for(var o=0,s=e.elements;o<s.length;o+=1){var c=s[o];c&&this.checkLValInnerPattern(c,t,n)}break;default:this.checkLValSimple(e,t,n)}},Ie.checkLValInnerPattern=function(e,t,n){switch(t===void 0&&(t=ve),e.type){case`Property`:this.checkLValInnerPattern(e.value,t,n);break;case`AssignmentPattern`:this.checkLValPattern(e.left,t,n);break;case`RestElement`:this.checkLValPattern(e.argument,t,n);break;default:this.checkLValPattern(e,t,n)}};var Le=function(e,t,n,r,i){this.token=e,this.isExpr=!!t,this.preserveSpace=!!n,this.override=r,this.generator=!!i},B={b_stat:new Le(`{`,!1),b_expr:new Le(`{`,!0),b_tmpl:new Le("${",!1),p_stat:new Le(`(`,!1),p_expr:new Le(`(`,!0),q_tmpl:new Le("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new Le(`function`,!1),f_expr:new Le(`function`,!0),f_expr_gen:new Le(`function`,!0,!1,null,!0),f_gen:new Le(`function`,!1,!1,null,!0)},Re=we.prototype;Re.initialContext=function(){return[B.b_stat]},Re.curContext=function(){return this.context[this.context.length-1]},Re.braceIsBlock=function(e){var t=this.curContext();return t===B.f_expr||t===B.f_stat?!0:e===b.colon&&(t===B.b_stat||t===B.b_expr)?!t.isExpr:e===b._return||e===b.name&&this.exprAllowed?x.test(this.input.slice(this.lastTokEnd,this.start)):e===b._else||e===b.semi||e===b.eof||e===b.parenR||e===b.arrow?!0:e===b.braceL?t===B.b_stat:e===b._var||e===b._const||e===b.name?!1:!this.exprAllowed},Re.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token===`function`)return t.generator}return!1},Re.updateContext=function(e){var t,n=this.type;n.keyword&&e===b.dot?this.exprAllowed=!1:(t=n.updateContext)?t.call(this,e):this.exprAllowed=n.beforeExpr},Re.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)},b.parenR.updateContext=b.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===B.b_stat&&this.curContext().token===`function`&&(e=this.context.pop()),this.exprAllowed=!e.isExpr},b.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?B.b_stat:B.b_expr),this.exprAllowed=!0},b.dollarBraceL.updateContext=function(){this.context.push(B.b_tmpl),this.exprAllowed=!0},b.parenL.updateContext=function(e){var t=e===b._if||e===b._for||e===b._with||e===b._while;this.context.push(t?B.p_stat:B.p_expr),this.exprAllowed=!0},b.incDec.updateContext=function(){},b._function.updateContext=b._class.updateContext=function(e){e.beforeExpr&&e!==b._else&&!(e===b.semi&&this.curContext()!==B.p_stat)&&!(e===b._return&&x.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===b.colon||e===b.braceL)&&this.curContext()===B.b_stat)?this.context.push(B.f_expr):this.context.push(B.f_stat),this.exprAllowed=!1},b.colon.updateContext=function(){this.curContext().token===`function`&&this.context.pop(),this.exprAllowed=!0},b.backQuote.updateContext=function(){this.curContext()===B.q_tmpl?this.context.pop():this.context.push(B.q_tmpl),this.exprAllowed=!1},b.star.updateContext=function(e){if(e===b._function){var t=this.context.length-1;this.context[t]===B.f_expr?this.context[t]=B.f_expr_gen:this.context[t]=B.f_gen}this.exprAllowed=!0},b.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==b.dot&&(this.value===`of`&&!this.exprAllowed||this.value===`yield`&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var V=we.prototype;V.checkPropClash=function(e,t,n){if(!(this.options.ecmaVersion>=9&&e.type===`SpreadElement`)&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,i;switch(r.type){case`Identifier`:i=r.name;break;case`Literal`:i=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){i===`__proto__`&&a===`init`&&(t.proto&&(n?n.doubleProto<0&&(n.doubleProto=r.start):this.raiseRecoverable(r.start,`Redefinition of __proto__ property`)),t.proto=!0);return}i=`$`+i;var o=t[i];o?(a===`init`?this.strict&&o.init||o.get||o.set:o.init||o[a])&&this.raiseRecoverable(r.start,`Redefinition of property`):o=t[i]={init:!1,get:!1,set:!1},o[a]=!0}},V.parseExpression=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeAssign(e,t);if(this.type===b.comma){var a=this.startNodeAt(n,r);for(a.expressions=[i];this.eat(b.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,`SequenceExpression`)}return i},V.parseMaybeAssign=function(e,t,n){if(this.isContextual(`yield`)){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var r=!1,i=-1,a=-1,o=-1;t?(i=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new De,r=!0);var s=this.start,c=this.startLoc;(this.type===b.parenL||this.type===b.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e===`await`);var l=this.parseMaybeConditional(e,t);if(n&&(l=n.call(this,l,s,c)),this.type.isAssign){var u=this.startNodeAt(s,c);return u.operator=this.value,this.type===b.eq&&(l=this.toAssignable(l,!1,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===b.eq?this.checkLValPattern(l):this.checkLValSimple(l),u.left=l,this.next(),u.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(u,`AssignmentExpression`)}else r&&this.checkExpressionErrors(t,!0);return i>-1&&(t.parenthesizedAssign=i),a>-1&&(t.trailingComma=a),l},V.parseMaybeConditional=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return i;if(this.eat(b.question)){var a=this.startNodeAt(n,r);return a.test=i,a.consequent=this.parseMaybeAssign(),this.expect(b.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,`ConditionalExpression`)}return i},V.parseExprOps=function(e,t){var n=this.start,r=this.startLoc,i=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||i.start===n&&i.type===`ArrowFunctionExpression`?i:this.parseExprOp(i,n,r,-1,e)},V.parseExprOp=function(e,t,n,r,i){var a=this.type.binop;if(a!=null&&(!i||this.type!==b._in)&&a>r){var o=this.type===b.logicalOR||this.type===b.logicalAND,s=this.type===b.coalesce;s&&(a=b.logicalAND.binop);var c=this.value;this.next();var l=this.start,u=this.startLoc,d=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,i),l,u,a,i),f=this.buildBinary(t,n,e,d,c,o||s);return(o&&this.type===b.coalesce||s&&(this.type===b.logicalOR||this.type===b.logicalAND))&&this.raiseRecoverable(this.start,`Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses`),this.parseExprOp(f,t,n,r,i)}return e},V.buildBinary=function(e,t,n,r,i,a){r.type===`PrivateIdentifier`&&this.raise(r.start,`Private identifier can only be left side of binary expression`);var o=this.startNodeAt(e,t);return o.left=n,o.operator=i,o.right=r,this.finishNode(o,a?`LogicalExpression`:`BinaryExpression`)},V.parseMaybeUnary=function(e,t,n,r){var i=this.start,a=this.startLoc,o;if(this.isContextual(`await`)&&this.canAwait)o=this.parseAwait(r),t=!0;else if(this.type.prefix){var s=this.startNode(),c=this.type===b.incDec;s.operator=this.value,s.prefix=!0,this.next(),s.argument=this.parseMaybeUnary(null,!0,c,r),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(s.argument):this.strict&&s.operator===`delete`&&ze(s.argument)?this.raiseRecoverable(s.start,`Deleting local variable in strict mode`):s.operator===`delete`&&Be(s.argument)?this.raiseRecoverable(s.start,`Private fields can not be deleted`):t=!0,o=this.finishNode(s,c?`UpdateExpression`:`UnaryExpression`)}else if(!t&&this.type===b.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==b._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(i,a);l.operator=this.value,l.prefix=!1,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,`UpdateExpression`)}}if(!n&&this.eat(b.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(i,a,o,this.parseMaybeUnary(null,!1,!1,r),`**`,!1);else return o};function ze(e){return e.type===`Identifier`||e.type===`ParenthesizedExpression`&&ze(e.expression)}function Be(e){return e.type===`MemberExpression`&&e.property.type===`PrivateIdentifier`||e.type===`ChainExpression`&&Be(e.expression)||e.type===`ParenthesizedExpression`&&Be(e.expression)}V.parseExprSubscripts=function(e,t){var n=this.start,r=this.startLoc,i=this.parseExprAtom(e,t);if(i.type===`ArrowFunctionExpression`&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==`)`)return i;var a=this.parseSubscripts(i,n,r,!1,t);return e&&a.type===`MemberExpression`&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a},V.parseSubscripts=function(e,t,n,r,i){for(var a=this.options.ecmaVersion>=8&&e.type===`Identifier`&&e.name===`async`&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=!1;;){var s=this.parseSubscript(e,t,n,r,a,o,i);if(s.optional&&(o=!0),s===e||s.type===`ArrowFunctionExpression`){if(o){var c=this.startNodeAt(t,n);c.expression=s,s=this.finishNode(c,`ChainExpression`)}return s}e=s}},V.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(b.arrow)},V.parseSubscriptAsyncArrow=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!0,r)},V.parseSubscript=function(e,t,n,r,i,a,o){var s=this.options.ecmaVersion>=11,c=s&&this.eat(b.questionDot);r&&c&&this.raise(this.lastTokStart,`Optional chaining cannot appear in the callee of new expressions`);var l=this.eat(b.bracketL);if(l||c&&this.type!==b.parenL&&this.type!==b.backQuote||this.eat(b.dot)){var u=this.startNodeAt(t,n);u.object=e,l?(u.property=this.parseExpression(),this.expect(b.bracketR)):this.type===b.privateId&&e.type!==`Super`?u.property=this.parsePrivateIdent():u.property=this.parseIdent(this.options.allowReserved!==`never`),u.computed=!!l,s&&(u.optional=c),e=this.finishNode(u,`MemberExpression`)}else if(!r&&this.eat(b.parenL)){var d=new De,f=this.yieldPos,p=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var h=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1,d);if(i&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,`Cannot use 'await' as identifier inside an async function`),this.yieldPos=f,this.awaitPos=p,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,n,h,o);this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var g=this.startNodeAt(t,n);g.callee=e,g.arguments=h,s&&(g.optional=c),e=this.finishNode(g,`CallExpression`)}else if(this.type===b.backQuote){(c||a)&&this.raise(this.start,`Optional chaining cannot appear in the tag of tagged template expressions`);var _=this.startNodeAt(t,n);_.tag=e,_.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(_,`TaggedTemplateExpression`)}return e},V.parseExprAtom=function(e,t,n){this.type===b.slash&&this.readRegexp();var r,i=this.potentialArrowAt===this.start;switch(this.type){case b._super:return this.allowSuper||this.raise(this.start,`'super' keyword outside a method`),r=this.startNode(),this.next(),this.type===b.parenL&&!this.allowDirectSuper&&this.raise(r.start,`super() call outside constructor of a subclass`),this.type!==b.dot&&this.type!==b.bracketL&&this.type!==b.parenL&&this.unexpected(),this.finishNode(r,`Super`);case b._this:return r=this.startNode(),this.next(),this.finishNode(r,`ThisExpression`);case b.name:var a=this.start,o=this.startLoc,s=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!s&&c.name===`async`&&!this.canInsertSemicolon()&&this.eat(b._function))return this.overrideContext(B.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(i&&!this.canInsertSemicolon()){if(this.eat(b.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,t);if(this.options.ecmaVersion>=8&&c.name===`async`&&this.type===b.name&&!s&&(!this.potentialArrowInForAwait||this.value!==`of`||this.containsEsc))return c=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(b.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case b.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case b.num:case b.string:return this.parseLiteral(this.value);case b._null:case b._true:case b._false:return r=this.startNode(),r.value=this.type===b._null?null:this.type===b._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,`Literal`);case b.parenL:var u=this.start,d=this.parseParenAndDistinguishExpression(i,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(d)&&(e.parenthesizedAssign=u),e.parenthesizedBind<0&&(e.parenthesizedBind=u)),d;case b.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(b.bracketR,!0,!0,e),this.finishNode(r,`ArrayExpression`);case b.braceL:return this.overrideContext(B.b_expr),this.parseObj(!1,e);case b._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case b._class:return this.parseClass(this.startNode(),!1);case b._new:return this.parseNew();case b.backQuote:return this.parseTemplate();case b._import:return this.options.ecmaVersion>=11?this.parseExprImport(n):this.unexpected();default:return this.parseExprAtomDefault()}},V.parseExprAtomDefault=function(){this.unexpected()},V.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword import`),this.next(),this.type===b.parenL&&!e)return this.parseDynamicImport(t);if(this.type===b.dot){var n=this.startNodeAt(t.start,t.loc&&t.loc.start);return n.name=`import`,t.meta=this.finishNode(n,`Identifier`),this.parseImportMeta(t)}else this.unexpected()},V.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(b.parenR)?e.options=null:(this.expect(b.comma),this.afterTrailingComma(b.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(b.parenR)||(this.expect(b.comma),this.afterTrailingComma(b.parenR)||this.unexpected())));else if(!this.eat(b.parenR)){var t=this.start;this.eat(b.comma)&&this.eat(b.parenR)?this.raiseRecoverable(t,`Trailing comma is not allowed in import()`):this.unexpected(t)}return this.finishNode(e,`ImportExpression`)},V.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`meta`&&this.raiseRecoverable(e.property.start,`The only valid meta property for import is 'import.meta'`),t&&this.raiseRecoverable(e.start,`'import.meta' must not contain escaped characters`),this.options.sourceType!==`module`&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,`Cannot use 'import.meta' outside a module`),this.finishNode(e,`MetaProperty`)},V.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value==null?t.raw.slice(0,-1).replace(/_/g,``):t.value.toString()),this.next(),this.finishNode(t,`Literal`)},V.parseParenExpression=function(){this.expect(b.parenL);var e=this.parseExpression();return this.expect(b.parenR),e},V.shouldParseArrow=function(e){return!this.canInsertSemicolon()},V.parseParenAndDistinguishExpression=function(e,t){var n=this.start,r=this.startLoc,i,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,s=this.startLoc,c=[],l=!0,u=!1,d=new De,f=this.yieldPos,p=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==b.parenR;)if(l?l=!1:this.expect(b.comma),a&&this.afterTrailingComma(b.parenR,!0)){u=!0;break}else if(this.type===b.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===b.comma&&this.raiseRecoverable(this.start,`Comma is not permitted after the rest element`);break}else c.push(this.parseMaybeAssign(!1,d,this.parseParenItem));var h=this.lastTokEnd,g=this.lastTokEndLoc;if(this.expect(b.parenR),e&&this.shouldParseArrow(c)&&this.eat(b.arrow))return this.checkPatternErrors(d,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=f,this.awaitPos=p,this.parseParenArrowList(n,r,c,t);(!c.length||u)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(d,!0),this.yieldPos=f||this.yieldPos,this.awaitPos=p||this.awaitPos,c.length>1?(i=this.startNodeAt(o,s),i.expressions=c,this.finishNodeAt(i,`SequenceExpression`,h,g)):i=c[0]}else i=this.parseParenExpression();if(this.options.preserveParens){var _=this.startNodeAt(n,r);return _.expression=i,this.finishNode(_,`ParenthesizedExpression`)}else return i},V.parseParenItem=function(e){return e},V.parseParenArrowList=function(e,t,n,r){return this.parseArrowExpression(this.startNodeAt(e,t),n,!1,r)};var Ve=[];V.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,`Escape sequence in keyword new`);var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===b.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name=`new`,e.meta=this.finishNode(t,`Identifier`),this.next();var n=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!==`target`&&this.raiseRecoverable(e.property.start,`The only valid meta property for new is 'new.target'`),n&&this.raiseRecoverable(e.start,`'new.target' must not contain escaped characters`),this.allowNewDotTarget||this.raiseRecoverable(e.start,`'new.target' can only be used in functions and class static block`),this.finishNode(e,`MetaProperty`)}var r=this.start,i=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,i,!0,!1),this.eat(b.parenL)?e.arguments=this.parseExprList(b.parenR,this.options.ecmaVersion>=8,!1):e.arguments=Ve,this.finishNode(e,`NewExpression`)},V.parseTemplateElement=function(e){var t=e.isTagged,n=this.startNode();return this.type===b.invalidTemplate?(t||this.raiseRecoverable(this.start,`Bad escape sequence in untagged template literal`),n.value={raw:this.value.replace(/\r\n?/g,`
235
234
  `),cooked:null}):n.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
@@ -237,22 +236,22 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
237
236
  `;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else ++this.pos}},U.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case`\\`:++this.pos;break;case`$`:if(this.input[this.pos+1]!==`{`)break;case"`":return this.finishToken(b.invalidTemplate,this.input.slice(this.start,this.pos));case`\r`:this.input[this.pos+1]===`
238
237
  `&&++this.pos;case`
239
238
  `:case`\u2028`:case`\u2029`:++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,`Unterminated template`)},U.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
240
- `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ie(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return C(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},U.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},U.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(p(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?f:p)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=ie(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},U.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=v[e]),this.finishToken(t,e)};var Ut=`8.16.0`;we.acorn={Parser:we,version:Ut,defaultOptions:j,Position:oe,SourceLocation:se,getLineInfo:A,Node:Ge,TokenType:m,tokTypes:b,keywordTypes:v,TokContext:Le,tokContexts:B,isIdentifierChar:p,isIdentifierStart:f,Token:zt,isNewLine:C,lineBreak:x,lineBreakG:S,nonASCIIwhitespace:T};function Wt(e,t){return we.parse(e,t)}function Gt(e,t,n){return we.parseExpressionAt(e,t,n)}function Kt(e,t){return we.tokenizer(e,t)}e.Node=Ge,e.Parser=we,e.Position=oe,e.SourceLocation=se,e.TokContext=Le,e.Token=zt,e.TokenType=m,e.defaultOptions=j,e.getLineInfo=A,e.isIdentifierChar=p,e.isIdentifierStart=f,e.isNewLine=C,e.keywordTypes=v,e.lineBreak=x,e.lineBreakG=S,e.nonASCIIwhitespace=T,e.parse=Wt,e.parseExpressionAt=Gt,e.tokContexts=B,e.tokTypes=b,e.tokenizer=Kt,e.version=Ut}))})),fD=J(((e,t)=>{let n=uD(),r=/^[\da-fA-F]+$/,i=/^\d+$/,a=new WeakMap;function o(e){e=e.Parser.acorn||e;let t=a.get(e);if(!t){let n=e.tokTypes,r=e.TokContext,i=e.TokenType,o=new r(`<tag`,!1),s=new r(`</tag`,!1),c=new r(`<tag>...</tag>`,!0,!0),l={tc_oTag:o,tc_cTag:s,tc_expr:c},u={jsxName:new i(`jsxName`),jsxText:new i(`jsxText`,{beforeExpr:!0}),jsxTagStart:new i(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new i(`jsxTagEnd`)};u.jsxTagStart.updateContext=function(){this.context.push(c),this.context.push(o),this.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===o&&e===n.slash||t===s?(this.context.pop(),this.exprAllowed=this.curContext()===c):this.exprAllowed=!0},t={tokContexts:l,tokTypes:u},a.set(e,t)}return t}function s(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return s(e.object)+`.`+s(e.property)}t.exports=function(e){return e||={},function(t){return c({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(t.exports,`tokTypes`,{get:function(){return o(dD()).tokTypes},configurable:!0,enumerable:!0});function c(e,t){let a=t.acorn||dD(),c=o(a),l=a.tokTypes,u=c.tokTypes,d=a.tokContexts,f=c.tokContexts.tc_oTag,p=c.tokContexts.tc_cTag,m=c.tokContexts.tc_expr,h=a.isNewLine,g=a.isIdentifierStart,_=a.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(u.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`&gt;`:`&rbrace;`)+'` or `{"'+this.input[this.pos]+'"}`?');default:h(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
239
+ `;case 114:return`\r`;case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ie(this.readCodePoint());case 116:return` `;case 98:return`\b`;case 118:return`\v`;case 102:return`\f`;case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),``;case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,`Invalid escape sequence`),e){var n=this.pos-1;this.invalidStringToken(n,`Invalid escape sequence in template string`)}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],i=parseInt(r,8);return i>255&&(r=r.slice(0,-1),i=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!==`0`||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?`Octal literal in template string`:`Octal literal in strict mode`),String.fromCharCode(i)}return C(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),``):String.fromCharCode(t)}},U.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,`Bad character escape sequence`),n},U.readWord1=function(){this.containsEsc=!1;for(var e=``,t=!0,n=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var i=this.fullCharCodeAtPos();if(p(i,r))this.pos+=i<=65535?1:2;else if(i===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,`Expecting Unicode escape sequence \\uXXXX`),++this.pos;var o=this.readCodePoint();(t?f:p)(o,r)||this.invalidStringToken(a,`Invalid Unicode escape`),e+=ie(o),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},U.readWord=function(){var e=this.readWord1(),t=b.name;return this.keywords.test(e)&&(t=v[e]),this.finishToken(t,e)};var Ut=`8.16.0`;we.acorn={Parser:we,version:Ut,defaultOptions:j,Position:oe,SourceLocation:se,getLineInfo:A,Node:Ge,TokenType:m,tokTypes:b,keywordTypes:v,TokContext:Le,tokContexts:B,isIdentifierChar:p,isIdentifierStart:f,Token:zt,isNewLine:C,lineBreak:x,lineBreakG:S,nonASCIIwhitespace:T};function Wt(e,t){return we.parse(e,t)}function Gt(e,t,n){return we.parseExpressionAt(e,t,n)}function Kt(e,t){return we.tokenizer(e,t)}e.Node=Ge,e.Parser=we,e.Position=oe,e.SourceLocation=se,e.TokContext=Le,e.Token=zt,e.TokenType=m,e.defaultOptions=j,e.getLineInfo=A,e.isIdentifierChar=p,e.isIdentifierStart=f,e.isNewLine=C,e.keywordTypes=v,e.lineBreak=x,e.lineBreakG=S,e.nonASCIIwhitespace=T,e.parse=Wt,e.parseExpressionAt=Gt,e.tokContexts=B,e.tokTypes=b,e.tokenizer=Kt,e.version=Ut}))})),dE=J(((e,t)=>{let n=lE(),r=/^[\da-fA-F]+$/,i=/^\d+$/,a=new WeakMap;function o(e){e=e.Parser.acorn||e;let t=a.get(e);if(!t){let n=e.tokTypes,r=e.TokContext,i=e.TokenType,o=new r(`<tag`,!1),s=new r(`</tag`,!1),c=new r(`<tag>...</tag>`,!0,!0),l={tc_oTag:o,tc_cTag:s,tc_expr:c},u={jsxName:new i(`jsxName`),jsxText:new i(`jsxText`,{beforeExpr:!0}),jsxTagStart:new i(`jsxTagStart`,{startsExpr:!0}),jsxTagEnd:new i(`jsxTagEnd`)};u.jsxTagStart.updateContext=function(){this.context.push(c),this.context.push(o),this.exprAllowed=!1},u.jsxTagEnd.updateContext=function(e){let t=this.context.pop();t===o&&e===n.slash||t===s?(this.context.pop(),this.exprAllowed=this.curContext()===c):this.exprAllowed=!0},t={tokContexts:l,tokTypes:u},a.set(e,t)}return t}function s(e){if(!e)return e;if(e.type===`JSXIdentifier`)return e.name;if(e.type===`JSXNamespacedName`)return e.namespace.name+`:`+e.name.name;if(e.type===`JSXMemberExpression`)return s(e.object)+`.`+s(e.property)}t.exports=function(e){return e||={},function(t){return c({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}},Object.defineProperty(t.exports,`tokTypes`,{get:function(){return o(uE()).tokTypes},configurable:!0,enumerable:!0});function c(e,t){let a=t.acorn||uE(),c=o(a),l=a.tokTypes,u=c.tokTypes,d=a.tokContexts,f=c.tokContexts.tc_oTag,p=c.tokContexts.tc_cTag,m=c.tokContexts.tc_expr,h=a.isNewLine,g=a.isIdentifierStart,_=a.isIdentifierChar;return class extends t{static get acornJsx(){return c}jsx_readToken(){let e=``,t=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated JSX contents`);let n=this.input.charCodeAt(this.pos);switch(n){case 60:case 123:return this.pos===this.start?n===60&&this.exprAllowed?(++this.pos,this.finishToken(u.jsxTagStart)):this.getTokenFromCode(n):(e+=this.input.slice(t,this.pos),this.finishToken(u.jsxText,e));case 38:e+=this.input.slice(t,this.pos),e+=this.jsx_readEntity(),t=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(n===62?`&gt;`:`&rbrace;`)+'` or `{"'+this.input[this.pos]+'"}`?');default:h(n)?(e+=this.input.slice(t,this.pos),e+=this.jsx_readNewLine(!0),t=this.pos):++this.pos}}}jsx_readNewLine(e){let t=this.input.charCodeAt(this.pos),n;return++this.pos,t===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,n=e?`
241
240
  `:`\r
242
- `):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):h(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(l.string,t)}jsx_readEntity(){let e=``,t=0,a,o=this.input[this.pos];o!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let s=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(o=this.input[this.pos++],o===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),r.test(e)&&(a=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),i.test(e)&&(a=String.fromCharCode(parseInt(e,10)))):a=n[e];break}e+=o}return a||(this.pos=s,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(_(e)||e===45);return this.finishToken(u.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===u.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let t=this.start,n=this.startLoc,r=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(l.colon))return r;var i=this.startNodeAt(t,n);return i.namespace=r,i.name=this.jsx_parseIdentifier(),this.finishNode(i,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===u.jsxTagEnd)return``;let t=this.start,n=this.startLoc,r=this.jsx_parseNamespacedName();for(this.type===l.dot&&r.type===`JSXNamespacedName`&&!e.allowNamespacedObjects&&this.unexpected();this.eat(l.dot);){let e=this.startNodeAt(t,n);e.object=r,e.property=this.jsx_parseIdentifier(),r=this.finishNode(e,`JSXMemberExpression`)}return r}jsx_parseAttributeValue(){switch(this.type){case l.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case u.jsxTagStart:case l.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===l.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(l.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(l.braceL)?(this.expect(l.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(l.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(l.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==l.slash&&this.type!==u.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(l.slash),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],i=this.jsx_parseOpeningElementAt(e,t),a=null;if(!i.selfClosing){contents:for(;;)switch(this.type){case u.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(l.slash)){a=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case u.jsxText:r.push(this.parseExprAtom());break;case l.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(a.name)!==s(i.name)&&this.raise(a.start,`Expected corresponding JSX closing tag for <`+s(i.name)+`>`)}let o=i.name?`Element`:`Fragment`;return n[`opening`+o]=i,n[`closing`+o]=a,n.children=r,this.type===l.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===u.jsxText?this.jsx_parseText():this.type===u.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===f||t===p){if(g(e))return this.jsx_readWord();if(e==62)return++this.pos,this.finishToken(u.jsxTagEnd);if((e===34||e===39)&&t==f)return this.jsx_readString(e)}return e===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(u.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==l.braceL){var t=this.curContext();t==f?this.context.push(d.b_expr):t==m?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(this.type===l.slash&&e===u.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(e)}}}}));function pD(e){return`\x1B[33m`+e+`\x1B[39m`}const mD={}.hasOwnProperty,hD=Symbol(`continue`),gD=Symbol(`exit`),_D=Symbol(`skip`);function vD(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return bD(e)&&(s.displayName=`node (`+pD(e.type)+`)`),s;function s(){let s=n?yD(n(e,t,a,o)):[];if(s[0]===gD)return s;if(s[0]!==_D){let t;for(t in e)if(mD.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(bD(r)){let e=i(r,t,a,n)();if(e[0]===gD)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(bD(r)){let e=i(r,t,void 0,n)();if(e[0]===gD)return e}}}return r?yD(r(e,t,a,o)):s}}}function yD(e){return Array.isArray(e)?e:typeof e==`number`?[hD,e]:[e]}function bD(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function xD(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=CD(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&SD(m);if(g&&!t.allowEmpty)throw new bw(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(SD(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,vD(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=wD(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function SD(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function CD(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=TD(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function wD(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function TD(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
241
+ `):n=String.fromCharCode(t),this.options.locations&&(++this.curLine,this.lineStart=this.pos),n}jsx_readString(e){let t=``,n=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,`Unterminated string constant`);let r=this.input.charCodeAt(this.pos);if(r===e)break;r===38?(t+=this.input.slice(n,this.pos),t+=this.jsx_readEntity(),n=this.pos):h(r)?(t+=this.input.slice(n,this.pos),t+=this.jsx_readNewLine(!1),n=this.pos):++this.pos}return t+=this.input.slice(n,this.pos++),this.finishToken(l.string,t)}jsx_readEntity(){let e=``,t=0,a,o=this.input[this.pos];o!==`&`&&this.raise(this.pos,`Entity must start with an ampersand`);let s=++this.pos;for(;this.pos<this.input.length&&t++<10;){if(o=this.input[this.pos++],o===`;`){e[0]===`#`?e[1]===`x`?(e=e.substr(2),r.test(e)&&(a=String.fromCharCode(parseInt(e,16)))):(e=e.substr(1),i.test(e)&&(a=String.fromCharCode(parseInt(e,10)))):a=n[e];break}e+=o}return a||(this.pos=s,`&`)}jsx_readWord(){let e,t=this.pos;do e=this.input.charCodeAt(++this.pos);while(_(e)||e===45);return this.finishToken(u.jsxName,this.input.slice(t,this.pos))}jsx_parseIdentifier(){let e=this.startNode();return this.type===u.jsxName?e.name=this.value:this.type.keyword?e.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(e,`JSXIdentifier`)}jsx_parseNamespacedName(){let t=this.start,n=this.startLoc,r=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(l.colon))return r;var i=this.startNodeAt(t,n);return i.namespace=r,i.name=this.jsx_parseIdentifier(),this.finishNode(i,`JSXNamespacedName`)}jsx_parseElementName(){if(this.type===u.jsxTagEnd)return``;let t=this.start,n=this.startLoc,r=this.jsx_parseNamespacedName();for(this.type===l.dot&&r.type===`JSXNamespacedName`&&!e.allowNamespacedObjects&&this.unexpected();this.eat(l.dot);){let e=this.startNodeAt(t,n);e.object=r,e.property=this.jsx_parseIdentifier(),r=this.finishNode(e,`JSXMemberExpression`)}return r}jsx_parseAttributeValue(){switch(this.type){case l.braceL:let e=this.jsx_parseExpressionContainer();return e.expression.type===`JSXEmptyExpression`&&this.raise(e.start,`JSX attributes must only be assigned a non-empty expression`),e;case u.jsxTagStart:case l.string:return this.parseExprAtom();default:this.raise(this.start,`JSX value should be either an expression or a quoted JSX text`)}}jsx_parseEmptyExpression(){let e=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(e,`JSXEmptyExpression`,this.start,this.startLoc)}jsx_parseExpressionContainer(){let e=this.startNode();return this.next(),e.expression=this.type===l.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(l.braceR),this.finishNode(e,`JSXExpressionContainer`)}jsx_parseAttribute(){let e=this.startNode();return this.eat(l.braceL)?(this.expect(l.ellipsis),e.argument=this.parseMaybeAssign(),this.expect(l.braceR),this.finishNode(e,`JSXSpreadAttribute`)):(e.name=this.jsx_parseNamespacedName(),e.value=this.eat(l.eq)?this.jsx_parseAttributeValue():null,this.finishNode(e,`JSXAttribute`))}jsx_parseOpeningElementAt(e,t){let n=this.startNodeAt(e,t);n.attributes=[];let r=this.jsx_parseElementName();for(r&&(n.name=r);this.type!==l.slash&&this.type!==u.jsxTagEnd;)n.attributes.push(this.jsx_parseAttribute());return n.selfClosing=this.eat(l.slash),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXOpeningElement`:`JSXOpeningFragment`)}jsx_parseClosingElementAt(e,t){let n=this.startNodeAt(e,t),r=this.jsx_parseElementName();return r&&(n.name=r),this.expect(u.jsxTagEnd),this.finishNode(n,r?`JSXClosingElement`:`JSXClosingFragment`)}jsx_parseElementAt(e,t){let n=this.startNodeAt(e,t),r=[],i=this.jsx_parseOpeningElementAt(e,t),a=null;if(!i.selfClosing){contents:for(;;)switch(this.type){case u.jsxTagStart:if(e=this.start,t=this.startLoc,this.next(),this.eat(l.slash)){a=this.jsx_parseClosingElementAt(e,t);break contents}r.push(this.jsx_parseElementAt(e,t));break;case u.jsxText:r.push(this.parseExprAtom());break;case l.braceL:r.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}s(a.name)!==s(i.name)&&this.raise(a.start,`Expected corresponding JSX closing tag for <`+s(i.name)+`>`)}let o=i.name?`Element`:`Fragment`;return n[`opening`+o]=i,n[`closing`+o]=a,n.children=r,this.type===l.relational&&this.value===`<`&&this.raise(this.start,`Adjacent JSX elements must be wrapped in an enclosing tag`),this.finishNode(n,`JSX`+o)}jsx_parseText(){let e=this.parseLiteral(this.value);return e.type=`JSXText`,e}jsx_parseElement(){let e=this.start,t=this.startLoc;return this.next(),this.jsx_parseElementAt(e,t)}parseExprAtom(e){return this.type===u.jsxText?this.jsx_parseText():this.type===u.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(e)}readToken(e){let t=this.curContext();if(t===m)return this.jsx_readToken();if(t===f||t===p){if(g(e))return this.jsx_readWord();if(e==62)return++this.pos,this.finishToken(u.jsxTagEnd);if((e===34||e===39)&&t==f)return this.jsx_readString(e)}return e===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(u.jsxTagStart)):super.readToken(e)}updateContext(e){if(this.type==l.braceL){var t=this.curContext();t==f?this.context.push(d.b_expr):t==m?this.context.push(d.b_tmpl):super.updateContext(e),this.exprAllowed=!0}else if(this.type===l.slash&&e===u.jsxTagStart)this.context.length-=2,this.context.push(p),this.exprAllowed=!1;else return super.updateContext(e)}}}}));function fE(e){return`\x1B[33m`+e+`\x1B[39m`}const pE={}.hasOwnProperty,mE=Symbol(`continue`),hE=Symbol(`exit`),gE=Symbol(`skip`);function _E(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return yE(e)&&(s.displayName=`node (`+fE(e.type)+`)`),s;function s(){let s=n?vE(n(e,t,a,o)):[];if(s[0]===hE)return s;if(s[0]!==gE){let t;for(t in e)if(pE.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(yE(r)){let e=i(r,t,a,n)();if(e[0]===hE)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(yE(r)){let e=i(r,t,void 0,n)();if(e[0]===hE)return e}}}return r?vE(r(e,t,a,o)):s}}}function vE(e){return Array.isArray(e)?e:typeof e==`number`?[mE,e]:[e]}function yE(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function bE(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=SE(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&xE(m);if(g&&!t.allowEmpty)throw new yC(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(xE(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,_E(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=CE(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function xE(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function SE(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=wE(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function CE(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function wE(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
243
242
  `;break;case-3:a=`\r
244
- `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function ED(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=DD(n.start,r[0]||t.start),a=DD(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function DD(e,t){if(e&&typeof e==`object`){let n=`line`in e?OD(e.line):void 0,r=`column`in e?OD(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:OD(t)}}}function OD(e){return typeof e==`number`&&e>-1?e:void 0}const kD=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,AD=`#unexpected-type-in-code-expected-an-object-spread-spread`;function jD(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new bw("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=kD+`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,e}if(Y(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?MD.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||Y(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new bw("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=kD+`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,e}return rv(t)?Bx(e,_,`linePrefix`,3)(t):_(t)}}function MD(e,t,n,r,i,a,o){let s=xD(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=ED(e),n=new bw("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=kD+AD,n}if(e.expression.properties[1]){let t=new bw(`Unexpected extra content in spread: only a single spread is supported`,{place:ED(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=kD+`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=ED(e.expression.properties[0]),n=new bw("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=kD+AD,n}}if(s.error){let e=new bw(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=kD+`#could-not-parse-expression-with-acorn`,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function ND(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return jD.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return rv(t)?Bx(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||Y(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return jD.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}const PD=/[$_\p{ID_Start}]/u,FD=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,ID=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,LD={};function RD(e){return e?PD.test(String.fromCodePoint(e)):!1}function zD(e,t){let n=(t||LD).jsx?ID:FD;return e?n.test(String.fromCodePoint(e)):!1}const BD=`https://github.com/micromark/micromark-extension-mdx-jsx`;function VD(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,D,te,O,ne){let re=this,k,ie;return ae;function ae(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),oe}function oe(e){return nv(e)?n(e):(k=se,Se(e))}function se(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),k=A,Se;if(t===62)return xe(t);if(t!==null&&t>=0&&RD(t))return e.enter(d),e.enter(f),e.consume(t),j;Te(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function A(t){if(t===62)return xe(t);if(t!==null&&t>=0&&RD(t))return e.enter(d),e.enter(f),e.consume(t),j;Te(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function j(t){if(t!==null&&t>=0&&zD(t,{jsx:!0}))return e.consume(t),j;if(t===46||t===47||t===58||t===62||t===123||nv(t)||av(t))return e.exit(f),k=ce,Se(t);Te(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ce(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),k=le,Se;if(t===58)return e.enter(h),e.consume(t),e.exit(h),k=ue,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&RD(t))return e.exit(d),I(t);Te(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function le(t){if(t!==null&&t>=0&&RD(t))return e.enter(m),e.consume(t),M;Te(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function M(t){if(t!==null&&t>=0&&zD(t,{jsx:!0}))return e.consume(t),M;if(t===46||t===47||t===62||t===123||nv(t)||av(t))return e.exit(m),k=N,Se(t);Te(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function N(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),k=le,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&RD(t))return e.exit(d),I(t);Te(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ue(t){if(t!==null&&t>=0&&RD(t))return e.enter(g),e.consume(t),P;Te(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function P(t){if(t!==null&&t>=0&&zD(t,{jsx:!0}))return e.consume(t),P;if(t===47||t===62||t===123||nv(t)||av(t))return e.exit(g),k=F,Se(t);Te(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function F(t){if(t===47||t===62||t===123||t!==null&&t>=0&&RD(t))return e.exit(d),I(t);Te(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function I(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),k=be,Se;if(t===62)return xe(t);if(t===123)return jD.call(re,e,de,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&RD(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),fe;Te(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(e){return k=I,Se(e)}function fe(t){if(t!==null&&t>=0&&zD(t,{jsx:!0}))return e.consume(t),fe;if(t===47||t===58||t===61||t===62||t===123||nv(t)||av(t))return e.exit(S),k=pe,Se(t);Te(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function pe(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),k=me,Se;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),k=ge,Se;if(t===47||t===62||t===123||nv(t)||av(t)||t!==null&&t>=0&&RD(t))return e.exit(x),e.exit(b),k=I,Se(t);Te(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function me(t){if(t!==null&&t>=0&&RD(t))return e.enter(w),e.consume(t),he;Te(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function he(t){if(t!==null&&t>=0&&zD(t,{jsx:!0}))return e.consume(t),he;if(t===47||t===61||t===62||t===123||nv(t)||av(t))return e.exit(w),e.exit(x),k=L,Se(t);Te(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function L(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),k=ge,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&RD(t))return e.exit(b),I(t);Te(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ge(t){if(t===34||t===39)return e.enter(E),e.enter(ee),e.consume(t),e.exit(ee),ie=t,ve;if(t===123)return jD.call(re,e,_e,te,O,ne,r,i,a,!1,!1,o)(t);Te(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function _e(t){return e.exit(b),k=I,Se(t)}function ve(t){return t===null&&Te(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ie)+"`"),t===ie?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(E),e.exit(b),ie=void 0,k=I,Se):Y(t)?(k=ve,Se(t)):(e.enter(D),ye(t))}function ye(t){return t===null||t===ie||Y(t)?(e.exit(D),ve(t)):(e.consume(t),ye)}function be(e){if(e===62)return xe(e);Te(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function xe(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Se(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),we):rv(t)||av(t)?(e.enter(`esWhitespace`),Ce(t)):k(t)}function Ce(t){return Y(t)?(e.exit(`esWhitespace`),Se(t)):rv(t)||av(t)?(e.consume(t),Ce):(e.exit(`esWhitespace`),k(t))}function we(e){if(!o&&re.parser.lazy[re.now().line]){let e=new bw("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",re.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=BD+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Se(e)}function Te(e,t,n){let r=new bw(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+HD(e)+`)`)+` `+t+`, expected `+n,re.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=BD+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function HD(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function UD(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return VD.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function WD(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return VD.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return rv(e)?Bx(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||Y(e)?r(e):i(e)}}}function GD(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:WD(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:UD(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function KD(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}const qD={tokenize:ZD,partial:!0},JD=`https://github.com/micromark/micromark-extension-mdxjs-esm`,YD=new Set([`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ImportDeclaration`]);function XD(e){let t={tokenize:i,concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw Error("Expected an `acorn` instance passed in as `options.acorn`");let n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:`module`},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}};function i(t,i,a){let o=this,s=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),c=this.events.length+1,l=``;return o.interrupt?a:u;function u(e){return o.now().column>1?a(e):(t.enter(`mdxjsEsm`),t.enter(`mdxjsEsmData`),t.consume(e),l+=String.fromCharCode(e),d)}function d(e){return Y_(e)?(t.consume(e),l+=String.fromCharCode(e),d):(l===`import`||l===`export`)&&e===32?(t.consume(e),f):a(e)}function f(e){return e===null||Y(e)?(t.exit(`mdxjsEsmData`),p(e)):(t.consume(e),f)}function p(e){return e===null?h(e):Y(e)?t.check(qD,h,m)(e):(t.enter(`mdxjsEsmData`),f(e))}function m(e){return t.enter(`lineEnding`),t.consume(e),t.exit(`lineEnding`),p}function h(a){let l=xD(o.events.slice(c),{acorn:n,acornOptions:r,tokenTypes:[`mdxjsEsmData`],prefix:s.length>0?`var `+s.join(`,`)+`
245
- `:``});if(l.error){if(a!==null&&l.swallow)return m(a);let e=new bw(`Could not parse import/exports with acorn`,{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:`acorn`,source:`micromark-extension-mdxjs-esm`});throw e.url=JD+`#could-not-parse-importexports-with-acorn`,e}s.length>0&&l.estree.body.shift();let u=-1;for(;++u<l.estree.body.length;){let e=l.estree.body[u];if(!YD.has(e.type)){let t=new bw("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:ED(e),ruleId:`non-esm`,source:`micromark-extension-mdxjs-esm`});throw t.url=JD+`#unexpected-type-in-code-only-importexports-are-supported`,t}if(e.type===`ImportDeclaration`&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){let n=e.specifiers[t];s.push(n.local.name)}}}return Object.assign(t.exit(`mdxjsEsm`),e.addResult?{estree:l.estree}:void 0),i(a)}}}function ZD(e,t,n){return r;function r(r){return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),e.attempt(Vx,t,n)}}var QD=q_(fD(),1);function $D(e){let t=Object.assign({acorn:VT.extend((0,QD.default)()),acornOptions:{ecmaVersion:2024,sourceType:`module`},addResult:!0},e);return ox([XD(t),ND(t),GD(t),KD()])}const eO={};function tO(e){let t=this,n=e||eO,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push($D(n)),a.push(Nw()),o.push(Pw(n))}const nO={tokenize:rO};function rO(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`),Bx(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 Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const iO={tokenize:oO},aO={tokenize:sO};function oO(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 rx(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(aO,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(aO,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 Y(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++;rx(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 sO(e,t,n){return Bx(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const cO={tokenize:lO};function lO(e){let t=this,n=e.attempt(Vx,r,e.attempt(this.parser.constructs.flowInitial,i,Bx(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pS,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 uO={resolveAll:mO()},dO=pO(`string`),fO=pO(`text`);function pO(e){return{resolveAll:mO(e===`text`?hO: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 mO(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 hO(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 gO=G_({attentionMarkers:()=>wO,contentInitial:()=>vO,disable:()=>TO,document:()=>_O,flow:()=>bO,flowInitial:()=>yO,insideSpan:()=>CO,string:()=>xO,text:()=>SO});const _O={42:oC,43:oC,45:oC,48:oC,49:oC,50:oC,51:oC,52:oC,53:oC,54:oC,55:oC,56:oC,57:oC,62:Ux},vO={91:SS},yO={[-2]:tS,[-1]:tS,32:tS},bO={35:OS,42:iC,45:[mC,iC],60:NS,61:mC,95:iC,96:Qx,126:Qx},xO={38:Yx,92:qx},SO={[-5]:nC,[-4]:nC,[-3]:nC,33:QS,38:Yx,42:Px,60:[Rx,BS],91:eC,92:[ES,qx],93:HS,95:Px,96:aS},CO={null:[Px,uO]},wO={null:[42,95]},TO={null:[]};function EO(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=ix(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Nx(a,l.events,l),l.events):[]}function f(e,t){return OO(p(e),t)}function p(e){return DO(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){Y(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&&rx(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 DO(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 OO(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=`
243
+ `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function TE(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=EE(n.start,r[0]||t.start),a=EE(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function EE(e,t){if(e&&typeof e==`object`){let n=`line`in e?DE(e.line):void 0,r=`column`in e?DE(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:DE(t)}}}function DE(e){return typeof e==`number`&&e>-1?e:void 0}const OE=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,kE=`#unexpected-type-in-code-expected-an-object-spread-spread`;function AE(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new yC("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=OE+`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,e}if(Y(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?jE.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||Y(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new yC("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=OE+`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,e}return n_(t)?zb(e,_,`linePrefix`,3)(t):_(t)}}function jE(e,t,n,r,i,a,o){let s=bE(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=TE(e),n=new yC("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=OE+kE,n}if(e.expression.properties[1]){let t=new yC(`Unexpected extra content in spread: only a single spread is supported`,{place:TE(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=OE+`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=TE(e.expression.properties[0]),n=new yC("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=OE+kE,n}}if(s.error){let e=new yC(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=OE+`#could-not-parse-expression-with-acorn`,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function ME(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return AE.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return n_(t)?zb(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||Y(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return AE.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}const NE=/[$_\p{ID_Start}]/u,PE=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,FE=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,IE={};function LE(e){return e?NE.test(String.fromCodePoint(e)):!1}function RE(e,t){let n=(t||IE).jsx?FE:PE;return e?n.test(String.fromCodePoint(e)):!1}const zE=`https://github.com/micromark/micromark-extension-mdx-jsx`;function BE(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,D,te,O,ne){let re=this,k,ie;return ae;function ae(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),oe}function oe(e){return t_(e)?n(e):(k=se,Se(e))}function se(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),k=A,Se;if(t===62)return xe(t);if(t!==null&&t>=0&&LE(t))return e.enter(d),e.enter(f),e.consume(t),j;Te(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function A(t){if(t===62)return xe(t);if(t!==null&&t>=0&&LE(t))return e.enter(d),e.enter(f),e.consume(t),j;Te(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function j(t){if(t!==null&&t>=0&&RE(t,{jsx:!0}))return e.consume(t),j;if(t===46||t===47||t===58||t===62||t===123||t_(t)||i_(t))return e.exit(f),k=ce,Se(t);Te(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function ce(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),k=le,Se;if(t===58)return e.enter(h),e.consume(t),e.exit(h),k=ue,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&LE(t))return e.exit(d),I(t);Te(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function le(t){if(t!==null&&t>=0&&LE(t))return e.enter(m),e.consume(t),M;Te(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function M(t){if(t!==null&&t>=0&&RE(t,{jsx:!0}))return e.consume(t),M;if(t===46||t===47||t===62||t===123||t_(t)||i_(t))return e.exit(m),k=N,Se(t);Te(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function N(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),k=le,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&LE(t))return e.exit(d),I(t);Te(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ue(t){if(t!==null&&t>=0&&LE(t))return e.enter(g),e.consume(t),P;Te(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function P(t){if(t!==null&&t>=0&&RE(t,{jsx:!0}))return e.consume(t),P;if(t===47||t===62||t===123||t_(t)||i_(t))return e.exit(g),k=F,Se(t);Te(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function F(t){if(t===47||t===62||t===123||t!==null&&t>=0&&LE(t))return e.exit(d),I(t);Te(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function I(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),k=be,Se;if(t===62)return xe(t);if(t===123)return AE.call(re,e,de,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&LE(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),fe;Te(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function de(e){return k=I,Se(e)}function fe(t){if(t!==null&&t>=0&&RE(t,{jsx:!0}))return e.consume(t),fe;if(t===47||t===58||t===61||t===62||t===123||t_(t)||i_(t))return e.exit(S),k=pe,Se(t);Te(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function pe(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),k=me,Se;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),k=ge,Se;if(t===47||t===62||t===123||t_(t)||i_(t)||t!==null&&t>=0&&LE(t))return e.exit(x),e.exit(b),k=I,Se(t);Te(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function me(t){if(t!==null&&t>=0&&LE(t))return e.enter(w),e.consume(t),he;Te(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function he(t){if(t!==null&&t>=0&&RE(t,{jsx:!0}))return e.consume(t),he;if(t===47||t===61||t===62||t===123||t_(t)||i_(t))return e.exit(w),e.exit(x),k=L,Se(t);Te(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function L(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),k=ge,Se;if(t===47||t===62||t===123||t!==null&&t>=0&&LE(t))return e.exit(b),I(t);Te(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function ge(t){if(t===34||t===39)return e.enter(E),e.enter(ee),e.consume(t),e.exit(ee),ie=t,ve;if(t===123)return AE.call(re,e,_e,te,O,ne,r,i,a,!1,!1,o)(t);Te(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function _e(t){return e.exit(b),k=I,Se(t)}function ve(t){return t===null&&Te(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ie)+"`"),t===ie?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(E),e.exit(b),ie=void 0,k=I,Se):Y(t)?(k=ve,Se(t)):(e.enter(D),ye(t))}function ye(t){return t===null||t===ie||Y(t)?(e.exit(D),ve(t)):(e.consume(t),ye)}function be(e){if(e===62)return xe(e);Te(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function xe(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function Se(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),we):n_(t)||i_(t)?(e.enter(`esWhitespace`),Ce(t)):k(t)}function Ce(t){return Y(t)?(e.exit(`esWhitespace`),Se(t)):n_(t)||i_(t)?(e.consume(t),Ce):(e.exit(`esWhitespace`),k(t))}function we(e){if(!o&&re.parser.lazy[re.now().line]){let e=new yC("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",re.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=zE+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return Se(e)}function Te(e,t,n){let r=new yC(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+VE(e)+`)`)+` `+t+`, expected `+n,re.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=zE+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function VE(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function HE(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return BE.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function UE(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return BE.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return n_(e)?zb(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||Y(e)?r(e):i(e)}}}function WE(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:UE(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:HE(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function GE(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}const KE={tokenize:XE,partial:!0},qE=`https://github.com/micromark/micromark-extension-mdxjs-esm`,JE=new Set([`ExportAllDeclaration`,`ExportDefaultDeclaration`,`ExportNamedDeclaration`,`ImportDeclaration`]);function YE(e){let t={tokenize:i,concrete:!0};if(!e||!e.acorn||!e.acorn.parse)throw Error("Expected an `acorn` instance passed in as `options.acorn`");let n=e.acorn,r=Object.assign({ecmaVersion:2024,sourceType:`module`},e.acornOptions,{locations:!0});return{flow:{101:t,105:t}};function i(t,i,a){let o=this,s=o.parser.definedModuleSpecifiers||(o.parser.definedModuleSpecifiers=[]),c=this.events.length+1,l=``;return o.interrupt?a:u;function u(e){return o.now().column>1?a(e):(t.enter(`mdxjsEsm`),t.enter(`mdxjsEsmData`),t.consume(e),l+=String.fromCharCode(e),d)}function d(e){return Jg(e)?(t.consume(e),l+=String.fromCharCode(e),d):(l===`import`||l===`export`)&&e===32?(t.consume(e),f):a(e)}function f(e){return e===null||Y(e)?(t.exit(`mdxjsEsmData`),p(e)):(t.consume(e),f)}function p(e){return e===null?h(e):Y(e)?t.check(KE,h,m)(e):(t.enter(`mdxjsEsmData`),f(e))}function m(e){return t.enter(`lineEnding`),t.consume(e),t.exit(`lineEnding`),p}function h(a){let l=bE(o.events.slice(c),{acorn:n,acornOptions:r,tokenTypes:[`mdxjsEsmData`],prefix:s.length>0?`var `+s.join(`,`)+`
244
+ `:``});if(l.error){if(a!==null&&l.swallow)return m(a);let e=new yC(`Could not parse import/exports with acorn`,{cause:l.error,place:{line:l.error.loc.line,column:l.error.loc.column+1,offset:l.error.pos},ruleId:`acorn`,source:`micromark-extension-mdxjs-esm`});throw e.url=qE+`#could-not-parse-importexports-with-acorn`,e}s.length>0&&l.estree.body.shift();let u=-1;for(;++u<l.estree.body.length;){let e=l.estree.body[u];if(!JE.has(e.type)){let t=new yC("Unexpected `"+e.type+"` in code: only import/exports are supported",{place:TE(e),ruleId:`non-esm`,source:`micromark-extension-mdxjs-esm`});throw t.url=qE+`#unexpected-type-in-code-only-importexports-are-supported`,t}if(e.type===`ImportDeclaration`&&!o.interrupt){let t=-1;for(;++t<e.specifiers.length;){let n=e.specifiers[t];s.push(n.local.name)}}}return Object.assign(t.exit(`mdxjsEsm`),e.addResult?{estree:l.estree}:void 0),i(a)}}}function XE(e,t,n){return r;function r(r){return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),e.attempt(Bb,t,n)}}var ZE=Kg(dE(),1);function QE(e){let t=Object.assign({acorn:Bw.extend((0,ZE.default)()),acornOptions:{ecmaVersion:2024,sourceType:`module`},addResult:!0},e);return ab([YE(t),ME(t),WE(t),GE()])}const $E={};function eD(e){let t=this,n=e||$E,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(QE(n)),a.push(MC()),o.push(NC(n))}const tD={tokenize:nD};function nD(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`),zb(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 Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}const rD={tokenize:aD},iD={tokenize:oD};function aD(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 nb(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(iD,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(iD,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 Y(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++;nb(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 oD(e,t,n){return zb(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}const sD={tokenize:cD};function cD(e){let t=this,n=e.attempt(Bb,r,e.attempt(this.parser.constructs.flowInitial,i,zb(e,e.attempt(this.parser.constructs.flow,i,e.attempt(fx,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 lD={resolveAll:pD()},uD=fD(`string`),dD=fD(`text`);function fD(e){return{resolveAll:pD(e===`text`?mD: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 pD(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 mD(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 hD=Wg({attentionMarkers:()=>CD,contentInitial:()=>_D,disable:()=>wD,document:()=>gD,flow:()=>yD,flowInitial:()=>vD,insideSpan:()=>SD,string:()=>bD,text:()=>xD});const gD={42:aS,43:aS,45:aS,48:aS,49:aS,50:aS,51:aS,52:aS,53:aS,54:aS,55:aS,56:aS,57:aS,62:Hb},_D={91:xx},vD={[-2]:ex,[-1]:ex,32:ex},yD={35:Dx,42:rS,45:[pS,rS],60:Mx,61:pS,95:rS,96:Zb,126:Zb},bD={38:Jb,92:Kb},xD={[-5]:tS,[-4]:tS,[-3]:tS,33:Zx,38:Jb,42:Nb,60:[Lb,zx],91:$x,92:[Tx,Kb],93:Vx,95:Nb,96:ix},SD={null:[Nb,lD]},CD={null:[42,95]},wD={null:[]};function TD(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=rb(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Mb(a,l.events,l),l.events):[]}function f(e,t){return DD(p(e),t)}function p(e){return ED(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){Y(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&&nb(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 ED(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 DD(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=`
246
245
  `;break;case-3:o=`\r
247
- `;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 kO(e){let t={constructs:ox([gO,...(e||{}).extensions||[]]),content:n(nO),defined:[],document:n(iO),flow:n(cO),lazy:{},string:n(dO),text:n(fO)};return t;function n(e){return n;function n(n){return EO(t,e,n)}}}function AO(e){for(;!dS(e););return e}const jO=/[\0\t\n\r]/g;function MO(){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(jO.lastIndex=u,c=jO.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}}const NO={}.hasOwnProperty;function PO(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),FO(n)(AO(kO(n).document().write(MO()(e,t,!0))))}function FO(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(F),characterEscape:T,characterReference:T,codeFenced:a(I),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(I,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(L,o),htmlFlowData:T,htmlText:a(L,o),htmlTextData:T,image:a(ge),label:o,link:a(_e),listItem:a(ye),listItemValue:f,listOrdered:a(ve,d),listUnordered:a(ve),paragraph:a(be),reference:j,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(xe),thematicBreak:a(Ce)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:P,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:M,characterReference:N,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(O),htmlTextData:E,image:c(k),label:ae,labelText:ie,lineEnding:ee,link:c(re),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:oe,resourceTitleString:se,resource:A,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};LO(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]];NO.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]||zO).call(a,void 0,e[0])}for(r.position={start:IO(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:IO(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:IO(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]||zO).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+gw({start:e.start,end:e.end})+`): it’s not open`);n.position.end=IO(e.end)}function u(){return Qy(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=oy(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=Se(),n.position={start:IO(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=IO(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=IO(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 D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){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 k(){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 ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=zb(t),n.identifier=oy(t).toLowerCase()}function ae(){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 oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function A(){this.data.inReference=void 0}function j(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=oy(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function M(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Lb(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Ib(t);let i=this.stack[this.stack.length-1];i.value+=r}function N(e){let t=this.stack.pop();t.position.end=IO(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function P(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function F(){return{type:`blockquote`,children:[]}}function I(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function L(){return{type:`html`,value:``}}function ge(){return{type:`image`,title:null,url:``,alt:null}}function _e(){return{type:`link`,title:null,url:``,children:[]}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function Se(){return{type:`text`,value:``}}function Ce(){return{type:`thematicBreak`}}}function IO(e){return{line:e.line,column:e.column,offset:e.offset}}function LO(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?LO(e,r):RO(e,r)}}function RO(e,t){let n;for(n in t)if(NO.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 zO(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+gw({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+gw({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+gw({start:t.start,end:t.end})+`) is still open`)}function BO(e){let t=this;t.parser=n;function n(n){return PO(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function VO(e){if(e)throw e}var HO=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))return;if(a)return a(e,t).value}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 UO(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 WO(){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?GO(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 GO(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)}}function KO(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const qO=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var JO=class{constructor(e){let t;t=e?KO(e)?{path:e}:typeof e==`string`||QO(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:a.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<qO.length;){let e=qO[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)qO.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?c.basename(this.path):void 0}set basename(e){XO(e,`basename`),YO(e,`basename`),this.path=c.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?c.dirname(this.path):void 0}set dirname(e){ZO(this.basename,`dirname`),this.path=c.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?c.extname(this.path):void 0}set extname(e){if(YO(e,`extname`),ZO(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=c.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){KO(e)&&(e=o(e)),XO(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?c.basename(this.path,this.extname):void 0}set stem(e){XO(e,`stem`),YO(e,`stem`),this.path=c.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 bw(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 YO(e,t){if(e&&e.includes(c.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+c.sep+"`")}function XO(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function ZO(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function QO(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const $O=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var ek=q_(HO(),1);const tk={}.hasOwnProperty,nk=new class e extends $O{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=WO()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ek.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(ak(`data`,this.frozen),this.namespace[e]=t,this):tk.call(this.namespace,e)&&this.namespace[e]||void 0:e?(ak(`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=ck(e),n=this.parser||this.Parser;return rk(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),rk(`process`,this.parser||this.Parser),ik(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ck(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);uk(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(),rk(`processSync`,this.parser||this.Parser),ik(`processSync`,this.compiler||this.Compiler),this.process(e,r),sk(`processSync`,`process`,t),n;function r(e,r){t=!0,VO(e),n=r}}run(e,t,n){ok(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=ck(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),sk(`runSync`,`run`,n),r;function i(e,t){VO(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ck(t),r=this.compiler||this.Compiler;return ik(`stringify`,r),ok(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(ak(`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,ek.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];UO(o)&&UO(r)&&(r=(0,ek.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function rk(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function ik(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function ak(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 ok(e){if(!UO(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function sk(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ck(e){return lk(e)?e:new JO(e)}function lk(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function uk(e){return typeof e==`string`||dk(e)}function dk(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function fk(e){return nk().use(BO).use(HC).use(Dv,[`yaml`]).use(tO).parse(e)}var pk=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})),mk=J((e=>{var t=pk();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})),hk=J((e=>{var t=pk(),n=mk();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(`
248
- `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),gk=J((e=>{var t=pk(),n=mk();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})),_k=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})),vk=J((e=>{var t=pk();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})),yk=J((e=>{var t=_k(),n=pk(),r=vk();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}}})),bk=J((e=>{var t=gk(),n=mk(),r=pk(),i=yk(),a=vk(),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})),xk=J((e=>{var t=pk(),n=yk(),r=vk();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})),Sk=J((e=>{var t=bk(),n=pk(),r=xk();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})),Ck=J((e=>{var t=Sk(),n=pk(),r=yk();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})),wk=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(`
246
+ `;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 OD(e){let t={constructs:ab([hD,...(e||{}).extensions||[]]),content:n(tD),defined:[],document:n(rD),flow:n(sD),lazy:{},string:n(uD),text:n(dD)};return t;function n(e){return n;function n(n){return TD(t,e,n)}}}function kD(e){for(;!ux(e););return e}const AD=/[\0\t\n\r]/g;function jD(){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(AD.lastIndex=u,c=AD.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}}const MD={}.hasOwnProperty;function ND(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),PD(n)(kD(OD(n).document().write(jD()(e,t,!0))))}function PD(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(_e),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(F),characterEscape:T,characterReference:T,codeFenced:a(I),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(I,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(L,o),htmlFlowData:T,htmlText:a(L,o),htmlTextData:T,image:a(ge),label:o,link:a(_e),listItem:a(ye),listItemValue:f,listOrdered:a(ve,d),listUnordered:a(ve),paragraph:a(be),reference:j,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(xe),thematicBreak:a(Ce)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:P,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:M,characterReference:N,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(O),htmlTextData:E,image:c(k),label:ae,labelText:ie,lineEnding:ee,link:c(re),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ce,resourceDestinationString:oe,resourceTitleString:se,resource:A,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};ID(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]];MD.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]||RD).call(a,void 0,e[0])}for(r.position={start:FD(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:FD(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:FD(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]||RD).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+hC({start:e.start,end:e.end})+`): it’s not open`);n.position.end=FD(e.end)}function u(){return Zv(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=av(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=Se(),n.position={start:FD(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=FD(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=FD(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 D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){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 k(){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 ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Ry(t),n.identifier=av(t).toLowerCase()}function ae(){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 oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function A(){this.data.inReference=void 0}function j(){this.data.referenceType=`collapsed`}function ce(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=av(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function le(e){this.data.characterReferenceType=e.type}function M(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Iy(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Fy(t);let i=this.stack[this.stack.length-1];i.value+=r}function N(e){let t=this.stack.pop();t.position.end=FD(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function P(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function F(){return{type:`blockquote`,children:[]}}function I(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function L(){return{type:`html`,value:``}}function ge(){return{type:`image`,title:null,url:``,alt:null}}function _e(){return{type:`link`,title:null,url:``,children:[]}}function ve(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ye(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function be(){return{type:`paragraph`,children:[]}}function xe(){return{type:`strong`,children:[]}}function Se(){return{type:`text`,value:``}}function Ce(){return{type:`thematicBreak`}}}function FD(e){return{line:e.line,column:e.column,offset:e.offset}}function ID(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ID(e,r):LD(e,r)}}function LD(e,t){let n;for(n in t)if(MD.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 RD(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+hC({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hC({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+hC({start:t.start,end:t.end})+`) is still open`)}function zD(e){let t=this;t.parser=n;function n(n){return ND(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function BD(e){if(e)throw e}var VD=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))return;if(a)return a(e,t).value}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 HD(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 UD(){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?WD(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 WD(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)}}function GD(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}const KD=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`];var qD=class{constructor(e){let t;t=e?GD(e)?{path:e}:typeof e==`string`||ZD(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:a.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<KD.length;){let e=KD[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)KD.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?c.basename(this.path):void 0}set basename(e){YD(e,`basename`),JD(e,`basename`),this.path=c.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?c.dirname(this.path):void 0}set dirname(e){XD(this.basename,`dirname`),this.path=c.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?c.extname(this.path):void 0}set extname(e){if(JD(e,`extname`),XD(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=c.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){GD(e)&&(e=o(e)),YD(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?c.basename(this.path,this.extname):void 0}set stem(e){YD(e,`stem`),JD(e,`stem`),this.path=c.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 yC(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 JD(e,t){if(e&&e.includes(c.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+c.sep+"`")}function YD(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function XD(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ZD(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}const QD=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var $D=Kg(VD(),1);const eO={}.hasOwnProperty,tO=new class e extends QD{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=UD()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,$D.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(iO(`data`,this.frozen),this.namespace[e]=t,this):eO.call(this.namespace,e)&&this.namespace[e]||void 0:e?(iO(`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=sO(e),n=this.parser||this.Parser;return nO(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),nO(`process`,this.parser||this.Parser),rO(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=sO(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);lO(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(),nO(`processSync`,this.parser||this.Parser),rO(`processSync`,this.compiler||this.Compiler),this.process(e,r),oO(`processSync`,`process`,t),n;function r(e,r){t=!0,BD(e),n=r}}run(e,t,n){aO(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=sO(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),oO(`runSync`,`run`,n),r;function i(e,t){BD(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=sO(t),r=this.compiler||this.Compiler;return rO(`stringify`,r),aO(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(iO(`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,$D.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];HD(o)&&HD(r)&&(r=(0,$D.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function nO(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function rO(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function iO(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 aO(e){if(!HD(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function oO(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function sO(e){return cO(e)?e:new qD(e)}function cO(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function lO(e){return typeof e==`string`||uO(e)}function uO(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function dO(e){return tO().use(zD).use(VS).use(E_,[`yaml`]).use(eD).parse(e)}var fO=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})),pO=J((e=>{var t=fO();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})),mO=J((e=>{var t=fO(),n=pO();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(`
247
+ `)}};a.defaultYaml={explicit:!1,version:`1.2`},a.defaultTags={"!!":`tag:yaml.org,2002:`},e.Directives=a})),hO=J((e=>{var t=fO(),n=pO();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})),gO=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})),_O=J((e=>{var t=fO();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})),vO=J((e=>{var t=gO(),n=fO(),r=_O();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}}})),yO=J((e=>{var t=hO(),n=pO(),r=fO(),i=vO(),a=_O(),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})),bO=J((e=>{var t=fO(),n=vO(),r=_O();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})),xO=J((e=>{var t=yO(),n=fO(),r=bO();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})),SO=J((e=>{var t=xO(),n=fO(),r=vO();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})),CO=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(`
249
248
  `)?n(r,t):r.includes(`
250
249
  `)?`
251
- `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),Tk=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===`
250
+ `+n(r,t):(e.endsWith(` `)?``:` `)+r,e.stringifyComment=t})),wO=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===`
252
251
  `)a===t&&(v=i(e,v,r.length)),m=v+r.length+d,h=void 0;else{if(o===` `&&g&&g!==` `&&g!==`
253
252
  `&&g!==` `){let t=e[v+1];t&&t!==` `&&t!==`
254
253
  `&&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!==`
255
- `);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})),Ek=J((e=>{var t=xk(),n=Tk();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]===`
254
+ `);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})),TO=J((e=>{var t=bO(),n=wO();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]===`
256
255
  `){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)+`
257
256
 
258
257
  `;a[e+2]===`\\`&&a[e+3]===`n`&&a[e+4]!==`"`;)l+=`
@@ -270,29 +269,29 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
270
269
  $&`).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(`
271
270
  `)||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(`
272
271
  `)?c(d,a):u(e,a,o,s);if(!p&&!g&&l!==t.Scalar.PLAIN&&d.includes(`
273
- `))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})),Dk=J((e=>{var t=gk(),n=pk(),r=wk(),i=Ek();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,trailingComma:!1,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})),Ok=J((e=>{var t=pk(),n=xk(),r=Dk(),i=wk();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?`
272
+ `))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})),EO=J((e=>{var t=hO(),n=fO(),r=CO(),i=TO();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,trailingComma:!1,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})),DO=J((e=>{var t=fO(),n=bO(),r=EO(),i=CO();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?`
274
273
  `:``,S){let e=p(S);E+=`\n${i.indentComment(e,o.indent)}`}T===``&&!o.inFlow?E===`
275
274
  `&&C&&(E=`
276
275
 
277
276
  `):E+=`\n${o.indent}`}else if(!_&&t.isCollection(a)){let e=T[0],t=T.indexOf(`
278
277
  `),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]===`
279
- `)&&(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})),kk=J((e=>{var t=J_(`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})),Ak=J((e=>{var t=pk(),n=xk();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})),jk=J((e=>{var t=kk(),n=Ak(),r=Dk(),i=pk(),a=vk();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})),Mk=J((e=>{var t=Sk(),n=Ok(),r=jk(),i=pk();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})),Nk=J((e=>{var t=pk(),n=Dk(),r=wk();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}`:`
278
+ `)&&(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})),OO=J((e=>{var t=qg(`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})),kO=J((e=>{var t=fO(),n=bO();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})),AO=J((e=>{var t=OO(),n=kO(),r=EO(),i=fO(),a=_O();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})),jO=J((e=>{var t=xO(),n=DO(),r=AO(),i=fO();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})),MO=J((e=>{var t=fO(),n=EO(),r=CO();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}`:`
280
279
  `}}return e?(_+=`
281
280
  `+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);p||=h.length>m||u.includes(`
282
281
  `),a<e.length-1?u+=`,`:i.options.trailingComma&&(i.options.lineWidth>0&&(p||=h.reduce((e,t)=>e+t.length+2,2)+(u.length+2)>i.options.lineWidth),p&&(u+=`,`)),l&&(u+=r.lineComment(u,o,d(l))),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}`:`
283
- `;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})),Pk=J((e=>{var t=Nk(),n=jk(),r=Ck(),i=pk(),a=Mk(),o=xk();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})),Fk=J((e=>{var t=pk(),n=Pk();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)}})),Ik=J((e=>{var t=Sk(),n=Nk(),r=Ck(),i=pk(),a=xk(),o=vk(),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})),Lk=J((e=>{var t=pk(),n=Ik();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)}})),Rk=J((e=>{var t=Ek();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)}}})),zk=J((e=>{var t=xk();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})),Bk=J((e=>{var t=xk();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})),Vk=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})),Hk=J((e=>{var t=xk(),n=Vk();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})),Uk=J((e=>{var t=Vk();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`)}})),Wk=J((e=>{var t=Fk(),n=zk(),r=Lk(),i=Rk(),a=Bk(),o=Hk(),s=Uk();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),Gk=J((e=>{var t=xk(),n=Fk(),r=Lk();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}})})),Kk=J((e=>{var t=J_(`buffer`),n=xk(),r=Ek();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?`
284
- `:` `)}return r.stringifyString({comment:e,type:i,value:u},o,s,c)}}})),qk=J((e=>{var t=pk(),n=Mk(),r=xk(),i=Ik();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})),Jk=J((e=>{var t=pk(),n=vk(),r=Pk(),i=Ik(),a=qk(),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})),Yk=J((e=>{var t=xk();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})),Xk=J((e=>{var t=xk(),n=Vk();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})),Zk=J((e=>{var t=Vk();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})),Qk=J((e=>{var t=pk(),n=Mk(),r=Pk(),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})),$k=J((e=>{var t=Vk();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})),eA=J((e=>{var t=Fk(),n=zk(),r=Lk(),i=Rk(),a=Kk(),o=Yk(),s=Xk(),c=Zk(),l=Ak(),u=Jk(),d=qk(),f=Qk(),p=$k();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]})),tA=J((e=>{var t=Fk(),n=zk(),r=Lk(),i=Rk(),a=Bk(),o=Hk(),s=Uk(),c=Wk(),l=Gk(),u=Kk(),d=Ak(),f=Jk(),p=qk(),m=eA(),h=Qk(),g=$k();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})),nA=J((e=>{var t=pk(),n=Fk(),r=Lk(),i=Rk(),a=tA();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}}})),rA=J((e=>{var t=pk(),n=Dk(),r=wk();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(`
282
+ `;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})),NO=J((e=>{var t=MO(),n=AO(),r=SO(),i=fO(),a=jO(),o=bO();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})),PO=J((e=>{var t=fO(),n=NO();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)}})),FO=J((e=>{var t=xO(),n=MO(),r=SO(),i=fO(),a=bO(),o=_O(),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})),IO=J((e=>{var t=fO(),n=FO();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)}})),LO=J((e=>{var t=TO();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)}}})),RO=J((e=>{var t=bO();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})),zO=J((e=>{var t=bO();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})),BO=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})),VO=J((e=>{var t=bO(),n=BO();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})),HO=J((e=>{var t=BO();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`)}})),UO=J((e=>{var t=PO(),n=RO(),r=IO(),i=LO(),a=zO(),o=VO(),s=HO();e.schema=[t.map,r.seq,i.string,n.nullTag,a.boolTag,s.intOct,s.int,s.intHex,o.floatNaN,o.floatExp,o.float]})),WO=J((e=>{var t=bO(),n=PO(),r=IO();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}})})),GO=J((e=>{var t=qg(`buffer`),n=bO(),r=TO();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?`
283
+ `:` `)}return r.stringifyString({comment:e,type:i,value:u},o,s,c)}}})),KO=J((e=>{var t=fO(),n=jO(),r=bO(),i=FO();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})),qO=J((e=>{var t=fO(),n=_O(),r=NO(),i=FO(),a=KO(),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})),JO=J((e=>{var t=bO();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})),YO=J((e=>{var t=bO(),n=BO();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})),XO=J((e=>{var t=BO();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})),ZO=J((e=>{var t=fO(),n=jO(),r=NO(),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})),QO=J((e=>{var t=BO();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})),$O=J((e=>{var t=PO(),n=RO(),r=IO(),i=LO(),a=GO(),o=JO(),s=YO(),c=XO(),l=kO(),u=qO(),d=KO(),f=ZO(),p=QO();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]})),ek=J((e=>{var t=PO(),n=RO(),r=IO(),i=LO(),a=zO(),o=VO(),s=HO(),c=UO(),l=WO(),u=GO(),d=kO(),f=qO(),p=KO(),m=$O(),h=ZO(),g=QO();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})),tk=J((e=>{var t=fO(),n=PO(),r=IO(),i=LO(),a=ek();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}}})),nk=J((e=>{var t=fO(),n=EO(),r=CO();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(`
285
284
  `)?(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(`
286
285
  `)+`
287
- `}e.stringifyDocument=i})),iA=J((e=>{var t=bk(),n=Ck(),r=pk(),i=Mk(),a=vk(),o=nA(),s=rA(),c=gk(),l=_k(),u=Sk(),d=hk(),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})),aA=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)+`…
288
- `),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`}}})),oA=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})),sA=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(`
289
- `))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})),cA=J((e=>{var t=sA();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})),lA=J((e=>{var t=pk();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})),uA=J((e=>{var t=Mk(),n=Pk(),r=oA(),i=sA(),a=cA(),o=lA();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+=`
286
+ `}e.stringifyDocument=i})),rk=J((e=>{var t=yO(),n=SO(),r=fO(),i=jO(),a=_O(),o=tk(),s=nk(),c=hO(),l=gO(),u=xO(),d=mO(),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})),ik=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)+`…
287
+ `),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`}}})),ak=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})),ok=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(`
288
+ `))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})),sk=J((e=>{var t=ok();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})),ck=J((e=>{var t=fO();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})),lk=J((e=>{var t=jO(),n=NO(),r=ak(),i=ok(),a=sk(),o=ck();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+=`
290
289
  `+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+=`
291
- `+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})),dA=J((e=>{var t=Ik(),n=oA(),r=cA();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})),fA=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})),pA=J((e=>{var t=pk(),n=Mk(),r=Pk(),i=Ik(),a=fA(),o=oA(),s=sA(),c=lA();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+=`
290
+ `+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})),uk=J((e=>{var t=FO(),n=ak(),r=sk();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})),dk=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})),fk=J((e=>{var t=fO(),n=jO(),r=NO(),i=FO(),a=dk(),o=ak(),s=ok(),c=ck();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+=`
292
291
  `+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+=`
293
292
  `+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+=`
294
293
  `+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+=`
295
- `+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})),mA=J((e=>{var t=pk(),n=xk(),r=Pk(),i=Ik(),a=uA(),o=dA(),s=pA();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})),hA=J((e=>{var t=xk();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?`
294
+ `+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})),pk=J((e=>{var t=fO(),n=bO(),r=NO(),i=FO(),a=lk(),o=uk(),s=fk();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})),mk=J((e=>{var t=bO();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?`
296
295
  `.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)+`
297
296
  `;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=`
298
297
  `):n.length>d||r[0]===` `?(h===` `?h=`
@@ -307,7 +306,7 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
307
306
  `+l[e][0].slice(d);m[m.length-1]!==`
308
307
  `&&(m+=`
309
308
  `);break;default:m+=`
310
- `}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})),gA=J((e=>{var t=xk(),n=fA();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?
309
+ `}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})),hk=J((e=>{var t=bO(),n=dk();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?
311
310
  `,`sy`),n=RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
312
311
  `,`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===`
313
312
  `?i+=a:a=`
@@ -322,10 +321,10 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
322
321
  `);)r===`
323
322
  `&&(n+=`
324
323
  `),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:`
325
- `,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})),_A=J((e=>{var t=pk(),n=xk(),r=hA(),i=gA();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})),vA=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})),yA=J((e=>{var t=bk(),n=pk(),r=mA(),i=_A(),a=fA(),o=vA();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`:try{h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1))}catch(e){o(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),g=!1}return h??=l(e,t.offset,void 0,null,a,o),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})),bA=J((e=>{var t=iA(),n=yA(),r=fA(),i=oA();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})),xA=J((e=>{var t=J_(`process`),n=hk(),r=iA(),i=aA(),a=pk(),o=bA(),s=fA();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?`
324
+ `,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})),gk=J((e=>{var t=fO(),n=bO(),r=mk(),i=hk();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})),_k=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})),vk=J((e=>{var t=yO(),n=fO(),r=pk(),i=gk(),a=dk(),o=_k();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`:try{h=r.composeCollection(s,e,t,a,o),p&&(h.anchor=p.source.substring(1))}catch(e){o(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:o(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),g=!1}return h??=l(e,t.offset,void 0,null,a,o),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})),yk=J((e=>{var t=rk(),n=vk(),r=dk(),i=ak();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})),bk=J((e=>{var t=qg(`process`),n=mO(),r=rk(),i=ik(),a=fO(),o=yk(),s=dk();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?`
326
325
 
327
326
  `:`
328
- `)+(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}}}})),SA=J((e=>{var t=hA(),n=gA(),r=aA(),i=Ek();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:`
327
+ `)+(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}}}})),xk=J((e=>{var t=mk(),n=hk(),r=ik(),i=TO();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:`
329
328
  `}];switch(c[0]){case`|`:case`>`:{let e=c.indexOf(`
330
329
  `),t=c.substring(0,e),n=c.substring(e+1)+`
331
330
  `,i=[{type:`block-scalar-header`,offset:o,indent:r,source:t}];return l(i,u)||i.push({type:`newline`,offset:-1,indent:r,source:`
@@ -333,9 +332,9 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
333
332
  `),r=t.substring(0,n),i=t.substring(n+1)+`
334
333
  `;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:`
335
334
  `});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:`
336
- `};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})),CA=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})),wA=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})),TA=J((e=>{var t=SA(),n=CA(),r=wA();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`
335
+ `};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})),Sk=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})),Ck=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})),wk=J((e=>{var t=xk(),n=Sk(),r=Ck();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`
337
336
  `:case`\r
338
- `: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})),EA=J((e=>{var t=TA();function n(e){switch(e){case void 0:case` `:case`
337
+ `: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})),Tk=J((e=>{var t=wk();function n(e){switch(e){case void 0:case` `:case`
339
338
  `:case`\r`:case` `:return!0;default:return!1}}let r=new Set(`0123456789ABCDEFabcdef`),i=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),a=new Set(`,[]{}`),o=new Set(` ,[]{}
340
339
  \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===`
341
340
  `?!0:t===`\r`?this.buffer[e+1]===`
@@ -354,95 +353,94 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
354
353
  `,t=this.buffer[i+1]):r=i),t===`#`||e&&a.has(t))break;if(o===`
355
354
  `){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===`
356
355
  `?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
357
- `?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)}}})),DA=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}}}}})),OA=J((e=>{var t=J_(`process`),n=TA(),r=EA();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){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(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}}*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(`
356
+ `?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)}}})),Ek=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}}}}})),Dk=J((e=>{var t=qg(`process`),n=wk(),r=Tk();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){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(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}}*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(`
358
357
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
359
358
  `,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(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 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 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(`
360
359
  `)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
361
- `,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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),kA=J((e=>{var t=xA(),n=iA(),r=aA(),i=kk(),a=pk(),o=DA(),s=OA();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})),AA=J((e=>{var t=xA(),n=iA(),r=nA(),i=aA(),a=bk(),o=pk(),s=Mk(),c=xk(),l=Pk(),u=Ik();TA();var d=EA(),f=DA(),p=OA(),m=kA(),h=mk();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}));function jA(){return a.env.TNMSC_FORCE_NATIVE_BINDING===`1`?!1:a.env.TNMSC_DISABLE_NATIVE_BINDING===`1`?!0:a.env.NODE_ENV===`test`||a.env.VITEST!=null||a.env.VITEST_WORKER_ID!=null}const MA=/\r?\n/u;function NA(e={}){let{filePath:t,position:n,sourceText:r,expression:i,exportName:a,nodeType:o,phase:s,hint:c,cause:l}=e,u=n?.start.line,d=n?.start.column,f=n?.end?.line,p=n?.end?.column,m=n?.start.offset,h=n?.end?.offset,g=u!=null&&r!=null?PA(r,u):void 0,_=FA(r,m,h,g),v=u!=null&&d!=null&&g!=null?IA(u,d,p,g):void 0,y={};return t!=null&&t.length>0&&Object.assign(y,{filePath:t}),u!=null&&Object.assign(y,{line:u}),d!=null&&Object.assign(y,{column:d}),f!=null&&Object.assign(y,{endLine:f}),p!=null&&Object.assign(y,{endColumn:p}),m!=null&&Object.assign(y,{offset:m}),h!=null&&Object.assign(y,{endOffset:h}),_!=null&&_.length>0&&Object.assign(y,{snippet:_}),g!=null&&g.length>0&&Object.assign(y,{sourceLine:g}),v!=null&&v.length>0&&Object.assign(y,{codeFrame:v}),i!=null&&i.length>0&&Object.assign(y,{expression:i}),a!=null&&a.length>0&&Object.assign(y,{exportName:a}),o!=null&&o.length>0&&Object.assign(y,{nodeType:o}),s!=null&&s.length>0&&Object.assign(y,{phase:s}),c!=null&&c.length>0&&Object.assign(y,{hint:c}),l!=null&&l.length>0&&Object.assign(y,{cause:l}),y}function PA(e,t){return e.split(MA)[t-1]}function FA(e,t,n,r){if(e!=null&&t!=null){let r=n!=null&&n>=t?n:t+1,i=e.slice(t,r).trim();if(i.length>0)return i.length>240?`${i.slice(0,240)}...`:i}let i=r?.trim();if(i!=null&&i.length>0)return i}function IA(e,t,n,r){let i=`${e} | `,a=` `.repeat(i.length+Math.max(0,t-1)),o=Math.max(1,(n??t+1)-t);return`${i}${r}\n${a}${`^`.repeat(o)}`}function LA(e){if(!(e.line==null||e.column==null))return e.endLine!=null&&e.endColumn!=null?`${e.line}:${e.column}-${e.endLine}:${e.endColumn}`:`${e.line}:${e.column}`}function RA(e,t){let n=[e];t.phase!=null&&n.push(`phase: ${t.phase}`),t.nodeType!=null&&n.push(`node: ${t.nodeType}`),t.filePath!=null&&n.push(`file: ${t.filePath}`);let r=LA(t);return r!=null&&n.push(`location: ${r}`),t.expression!=null&&n.push(`expression: ${t.expression}`),t.exportName!=null&&n.push(`export: ${t.exportName}`),t.sourceLine!=null&&n.push(`source line: ${t.sourceLine.trimEnd()}`),t.codeFrame!=null&&(n.push(`code frame:`),n.push(t.codeFrame)),t.hint!=null&&n.push(`hint: ${t.hint}`),t.cause!=null&&n.push(`cause: ${t.cause}`),n.join(`
362
- `)}var zA=class extends Error{diagnostic;filePath;line;column;endLine;endColumn;snippet;sourceLine;codeFrame;phase;nodeType;constructor(e,t,n){super(RA(t,n)),this.name=e,this.diagnostic=n,n.filePath!=null&&(this.filePath=n.filePath),n.line!=null&&(this.line=n.line),n.column!=null&&(this.column=n.column),n.endLine!=null&&(this.endLine=n.endLine),n.endColumn!=null&&(this.endColumn=n.endColumn),n.snippet!=null&&(this.snippet=n.snippet),n.sourceLine!=null&&(this.sourceLine=n.sourceLine),n.codeFrame!=null&&(this.codeFrame=n.codeFrame),n.phase!=null&&(this.phase=n.phase),n.nodeType!=null&&(this.nodeType=n.nodeType)}};function BA(e){if(e===`mdxTextExpression`||e===`mdxFlowExpression`)return`Literal braces in MDX text are parsed as expressions. Escape the braces or wrap the placeholder in code if you meant plain text.`;if(e===`mdxJsxAttributeValueExpression`)return`JSX attribute expressions must reference values that exist in scope.`}var VA=class extends zA{expression;constructor(e,t){super(`ScopeError`,e,t),t.expression!=null&&(this.expression=t.expression)}},HA=class extends VA{variableName;constructor(e,t,n={}){let r=NA({...n,expression:t,phase:n.phase??`expression-evaluation`,hint:n.hint??BA(n.nodeType)}),i=`Undefined variable "${e}" in expression "${t??``}"`;super(i,r),this.name=`UndefinedVariableError`,this.variableName=e}},UA=class extends VA{namespace;constructor(e,t,n={}){let r=NA({...n,expression:t,phase:n.phase??`expression-evaluation`,hint:n.hint??BA(n.nodeType)}),i=`Undefined namespace "${e}" in expression "${t??``}"`;super(i,r),this.name=`UndefinedNamespaceError`,this.namespace=e}},WA=class extends zA{exportName;constructor(e,t,n={}){let r=NA({...n,exportName:t,phase:n.phase??`export-parsing`,hint:n.hint??`Export metadata must be statically evaluable. Use plain literals, arrays, objects, or scope-backed references only.`});super(`ExportParseError`,e,r),t!=null&&(this.exportName=t)}};const GA=new Map;function KA(e,t){GA.set(e,t)}function qA(){return new Map(GA)}function JA(e){return GA.has(e)}const YA=/^export\s+default\s+/u,XA=/export\s+const\s+(\w+)\s*=\s*/gu,ZA=/^-?\d+(?:\.\d+)?$/u,QA=/^[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*$/iu,$A=/\s/u,ej=/[\w$]/u,tj=/^[\w$]+$/u;function nj(e,t={}){let n={},{yamlFrontMatter:r,scope:i,filePath:a,sourceText:o}=t;for(let t of e){let e=rj(t,i,{...a!=null&&{filePath:a},...o!=null&&{sourceText:o}});Object.assign(n,e)}let s=Object.keys(n).length>0,c=r!=null&&Object.keys(r).length>0,l;return l=s&&c?`mixed`:s?`export`:`yaml`,{fields:{...r,...n},source:l}}function rj(e,t,n={}){let r={},{filePath:i,sourceText:a}=n,o=e.value.trim(),s=YA.exec(o);if(s!=null){let n=s[0].length,c=ij(o,n);if(c!=null)try{let e=aj(c.trim(),t,i);typeof e==`object`&&e&&!Array.isArray(e)&&Object.assign(r,e)}catch(t){let n=t instanceof Error?t.message:String(t);throw new WA(`Cannot statically evaluate export default`,`default`,{...i!=null&&{filePath:i},...a!=null&&{sourceText:a},...e.position!=null&&{position:e.position},nodeType:`mdxjsEsm`,phase:`export-parsing`,cause:n})}return r}let c=XA.exec(o);for(;c!==null;){let n=c[1];if(n==null){c=XA.exec(o);continue}let s=ij(o,c.index+c[0].length);if(s==null){c=XA.exec(o);continue}try{let e=aj(s.trim(),t,i);n===`metadata`&&typeof e==`object`&&e&&!Array.isArray(e)?Object.assign(r,e):r[n]=e}catch(t){let r=t instanceof Error?t.message:String(t);throw new WA(`Cannot statically evaluate export "${n}"`,n,{...i!=null&&{filePath:i},...a!=null&&{sourceText:a},...e.position!=null&&{position:e.position},nodeType:`mdxjsEsm`,phase:`export-parsing`,cause:r})}c=XA.exec(o)}return r}function ij(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){if(t===`;`||t===`
363
- `){a=o;break}if(t===`/`&&o+1<e.length&&e[o+1]===`/`){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 aj(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(ZA.test(r))return Number(r);if(r.startsWith(`"`)&&r.endsWith(`"`)||r.startsWith(`'`)&&r.endsWith(`'`))return oj(r.slice(1,-1));if(r.startsWith("`")&&r.endsWith("`")){let e=r.slice(1,-1);if(e.includes("${"))throw Error(`Template literal with expressions cannot be statically evaluated: ${r}`);return oj(e)}if(r.startsWith(`[`)&&r.endsWith(`]`))return cj(r,t,n);if(r.startsWith(`{`)&&r.endsWith(`}`))return lj(r,t,n);if(QA.test(r))return sj(r,t,n);let i=n==null?``:` in file "${n}"`;throw Error(`Expression "${r}" cannot be statically evaluated${i}`)}function oj(e){return e.replaceAll(`\\n`,`
364
- `).replaceAll(`\\r`,`\r`).replaceAll(`\\t`,` `).replaceAll(`\\"`,`"`).replaceAll(`\\'`,`'`).replaceAll(`\\\\`,`\\`)}function sj(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`)return a;let o=n==null?``:` in file "${n}"`;throw Error(`Variable "${e}" resolved to unsupported type: ${typeof a}${o}`)}function cj(e,t,n){let r=e.slice(1,-1).trim();if(r===``)return[];if(t==null)try{let t=uj(e),n=JSON.parse(t);if(Array.isArray(n))return n}catch{}return dj(r).map(e=>aj(e.trim(),t,n))}function lj(e,t,n){let r=e.slice(1,-1).trim();if(r===``)return{};if(t==null)try{let t=uj(e),n=JSON.parse(t);if(typeof n==`object`&&n&&!Array.isArray(n))return n}catch{}let i={},a=fj(r);for(let e of a){let r=pj(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]=aj(o,t,n)}return i}function uj(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&&$A.test(t.charAt(e));)e--;let n=e+1;for(;e>=0&&ej.test(t.charAt(e));)e--;if(e++,e>0&&t.charAt(e-1)!==`"`){let r=t.slice(e,n);r.length>0&&tj.test(r)&&(t=`${t.slice(0,e)}"${r}"`)}}t+=a}return t}function dj(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 fj(e){return dj(e)}function pj(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}const mj=/^[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*$/iu,hj=/(\w+) is not defined/u;function gj(e,t,n){let r=e.trim(),i=_j(n,e);return r===``?``:mj.test(r)?vj(r,t,i):yj(r,t,i)}function _j(e,t){return{expression:t,...e?.filePath!=null&&{filePath:e.filePath},...e?.sourceText!=null&&{sourceText:e.sourceText},...e?.position!=null&&{position:e.position},...e?.nodeType!=null&&{nodeType:e.nodeType}}}function vj(e,t,n){let r=e.split(`.`),i=r[0];if(i==null||!(i in t))throw new UA(i??``,e,n);let a=t[i];for(let t=1;t<r.length;t++){let i=r[t];if(i==null)continue;if(a==null)throw new HA(i,e,n);if(typeof a!=`object`)throw TypeError(`Cannot read property "${i}" of ${typeof a} in expression "${e}"`);let o=a;if(!(i in o))throw new HA(i,e,n);a=o[i]}return bj(a)}function yj(e,t,n){let r=Object.keys(t),i=r.map(e=>t[e]);try{return bj(Function(...r,`return (${e})`)(...i))}catch(t){let r=t instanceof Error?t.message:String(t);if(r.includes(`is not defined`)){let t=hj.exec(r);if(t?.[1]!=null)throw new UA(t[1],e,{...n,cause:r})}let i=n?.filePath==null?[]:[`file: ${n.filePath}`],a=n?.position?.start==null?[]:[`location: ${n.position.start.line}:${n.position.start.column}`];throw Error([`Failed to evaluate expression: "${e}"`,...i,...a,`Cause: ${r}`].join(`
365
- `))}}function bj(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function xj(e,t){return e===null?!1:t.components.has(e)||JA(e)}async function Sj(e){return async(t,n)=>(await e({type:`root`,children:t},n)).children}async function Cj(e,t,n){let r=e.name;if(r==null||r===``)return[];let i=t.components.get(r);if(i==null)return[];if(t.processingStack.includes(r)){let e=[...t.processingStack,r].join(` → `);throw Error(`Circular dependency detected: ${e}`)}let a={scope:t.scope,components:t.components,processingStack:[...t.processingStack,r],...t.basePath==null?{}:{basePath:t.basePath}},o=await Sj(n);try{return await i(e,a,o)}catch(e){let n=e instanceof Error?e.message:String(e),i=t.processingStack.join(` → `);throw Error(`Failed to process component "${r}"${i===``?``:` (called from: ${i})`}:\n${n}`,{cause:e})}}const wj=/language-(\w+)/u;function Tj(e,t,n){return{...e.filePath!=null&&{filePath:e.filePath},...e.sourceText!=null&&{sourceText:e.sourceText},...n?.position!=null&&{position:n.position},nodeType:t}}function Ej(e,t){let n=e.name?.toLowerCase();if(n==null)return null;switch(n){case`pre`:return kj(e,t);case`a`:return Aj(e,t);case`strong`:case`b`:return jj(e,t);case`em`:case`i`:return Mj(e,t);case`img`:return Nj(e,t);case`blockquote`:return Pj(e,t);default:return null}}function Dj(e,t,n){let r=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return r==null?null:typeof r.value==`string`?r.value:r.value!=null&&typeof r.value==`object`&&r.value.type===`mdxJsxAttributeValueExpression`?gj(r.value.value,n.scope,Tj(n,`mdxJsxAttributeValueExpression`,r)):r.value===null?``:null}function Oj(e,t){let n=``;for(let r of e.children){if(r.type===`text`){n+=r.value;continue}if(r.type===`mdxTextExpression`){n+=gj(r.value,t.scope,Tj(t,`mdxTextExpression`,r));continue}(r.type===`mdxJsxFlowElement`||r.type===`mdxJsxTextElement`)&&(n+=Oj(r,t))}return n}function kj(e,t){let n=null;for(let t of e.children){if((t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)&&t.name?.toLowerCase()===`code`){n=t;break}if(t.type===`paragraph`&&`children`in t){let e=t.children;for(let t of e)if((t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)&&t.name?.toLowerCase()===`code`){n=t;break}if(n!=null)break}}if(n==null)return null;let r=Dj(n,`className`,t)??``,i=wj.exec(r)?.[1],a=Oj(n,t);return[{type:`code`,lang:i??null,value:a.trim()}]}function Aj(e,t){let n=Dj(e,`href`,t);if(n==null||n===``)return null;let r=Oj(e,t);return[{type:`paragraph`,children:[{type:`link`,url:n,title:Dj(e,`title`,t)??null,children:[{type:`text`,value:r}]}]}]}function jj(e,t){let n={type:`strong`,children:[{type:`text`,value:Oj(e,t)}]};return e.type,[{type:`paragraph`,children:[n]}]}function Mj(e,t){let n={type:`emphasis`,children:[{type:`text`,value:Oj(e,t)}]};return e.type,[{type:`paragraph`,children:[n]}]}function Nj(e,t){let n=Dj(e,`src`,t);if(n==null||n===``)return null;let r={type:`image`,url:n,alt:Dj(e,`alt`,t)??``,title:Dj(e,`title`,t)??null};return e.type,[{type:`paragraph`,children:[r]}]}function Pj(e,t){return[{type:`blockquote`,children:[{type:`paragraph`,children:[{type:`text`,value:Oj(e,t)}]}]}]}const Fj=/^-?\d+(?:\.\d+)?$/u;function Ij(e,t){return{...e.filePath!=null&&{filePath:e.filePath},...e.sourceText!=null&&{sourceText:e.sourceText},...t.position!=null&&{position:t.position},nodeType:t.type}}function Lj(e){return e==null?!1:JSON.stringify(e).includes(`"JSX`)}async function Rj(e,t,n){let r=e.data?.estree;if(r==null||r.body.length===0)return[];let i=r.body[0];return i?.type===`ExpressionStatement`?zj(i.expression,t,n,e):[]}async function zj(e,t,n,r){return e.type===`JSXElement`?Gj(e,t,n):e.type===`JSXFragment`?Kj(e,t,n,r):e.type===`LogicalExpression`?Bj(e,t,n,r):e.type===`ConditionalExpression`?Vj(e,t,n,r):e.type===`SequenceExpression`?Hj(e,t,n,r):e.type===`ArrayExpression`?Uj(e,t,n,r):tM(e,t,r)}async function Bj(e,t,n,r){let i=await Wj(e.left,t,n,r);return e.operator===`&&`?$j(i)?zj(e.right,t,n,r):[]:e.operator===`||`?$j(i)?Qj(e.left)?zj(e.left,t,n,r):eM(i):zj(e.right,t,n,r):e.operator===`??`?i==null?zj(e.right,t,n,r):Qj(e.left)?zj(e.left,t,n,r):eM(i):[]}async function Vj(e,t,n,r){return $j(await Wj(e.test,t,n,r))?zj(e.consequent,t,n,r):zj(e.alternate,t,n,r)}async function Hj(e,t,n,r){let i=[];for(let a of e.expressions){let e=await zj(a,t,n,r);i.push(...e)}return i}async function Uj(e,t,n,r){let i=[];for(let a of e.elements)if(a!=null)if(a.type===`SpreadElement`){let e=await zj(a.argument,t,n,r);i.push(...e)}else{let e=await zj(a,t,n,r);i.push(...e)}return i}async function Wj(e,t,n,r){if(Qj(e))return!0;if(e.type===`Literal`)return e.value;if(e.type===`Identifier`)return e.name===`undefined`?void 0:e.name===`NaN`?NaN:e.name===`Infinity`?1/0:t.scope[e.name];if(e.type===`UnaryExpression`){let i=await Wj(e.argument,t,n,r);return e.operator===`!`?!$j(i):e.operator===`-`?-i:e.operator===`+`?+i:e.operator===`typeof`?typeof i:void 0}if(e.type===`BinaryExpression`){let i=await Wj(e.left,t,n,r),a=await Wj(e.right,t,n,r);return e.operator===`===`?i===a:e.operator===`!==`?i!==a:e.operator===`==`?i===a:e.operator===`!=`?i!==a:e.operator===`<`?i<a:e.operator===`<=`?i<=a:e.operator===`>`?i>a:e.operator===`>=`?i>=a:e.operator===`+`?i+a:e.operator===`-`?i-a:e.operator===`*`?i*a:e.operator===`/`?i/a:e.operator===`%`?i%a:void 0}if(e.type===`LogicalExpression`){let i=await Wj(e.left,t,n,r);return e.operator===`&&`?$j(i)?Wj(e.right,t,n,r):i:e.operator===`||`?$j(i)?i:Wj(e.right,t,n,r):e.operator===`??`?i??Wj(e.right,t,n,r):void 0}if(e.type===`MemberExpression`){let i=await Wj(e.object,t,n,r);if(i==null)return;if(e.computed)return i[await Wj(e.property,t,n,r)];let{name:a}=e.property;return i[a]}if(e.type===`ConditionalExpression`)return $j(await Wj(e.test,t,n,r))?Wj(e.consequent,t,n,r):Wj(e.alternate,t,n,r);let i=Zj(e);if(i!==``)try{let e=gj(i,t.scope,Ij(t,r));return e===`true`?!0:e===`false`?!1:e===`null`?null:e===`undefined`||e===``?void 0:Fj.test(e)?Number(e):e}catch{return}}async function Gj(e,t,n){let r=Jj(e,t);return r.name!=null&&xj(r.name,t)?Cj(r,t,async(e,t)=>({type:`root`,children:await n(e.children,t)})):Ej(r,t)??(r.children.length>0?n(r.children,t):[])}async function Kj(e,t,n,r){let i=[];for(let a of e.children){let e=await qj(a,t,n,r);i.push(...e)}return i}async function qj(e,t,n,r){if(e.type===`JSXElement`)return Gj(e,t,n);if(e.type===`JSXFragment`)return Kj(e,t,n,r);if(e.type===`JSXText`){let t=e.value.trim();return t===``?[]:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}return e.type===`JSXExpressionContainer`?e.expression.type===`JSXEmptyExpression`?[]:zj(e.expression,t,n,r):e.type===`JSXSpreadChild`?zj(e.expression,t,n,r):[]}function Jj(e,t){let n=e.openingElement,r=null;n.name.type===`JSXIdentifier`?{name:r}=n.name:n.name.type===`JSXMemberExpression`?r=Yj(n.name):n.name.type===`JSXNamespacedName`&&(r=`${n.name.namespace.name}:${n.name.name.name}`);let i=[];for(let e of n.attributes)if(e.type===`JSXAttribute`){let t=e.name.type===`JSXIdentifier`?e.name.name:`${e.name.namespace.name}:${e.name.name.name}`,n=null;e.value==null?n=null:e.value.type===`Literal`?n=String(e.value.value):e.value.type===`JSXExpressionContainer`&&e.value.expression.type!==`JSXEmptyExpression`&&(n={type:`mdxJsxAttributeValueExpression`,value:Zj(e.value.expression)}),i.push({type:`mdxJsxAttribute`,name:t,value:n})}else e.type===`JSXSpreadAttribute`&&i.push({type:`mdxJsxExpressionAttribute`,value:`...${Zj(e.argument)}`});let a=[];for(let n of e.children){let e=Xj(n,t);e!=null&&a.push(...e)}return{type:`mdxJsxFlowElement`,name:r,attributes:i,children:a}}function Yj(e){return e.object.type===`JSXIdentifier`?`${e.object.name}.${e.property.name}`:`${Yj(e.object)}.${e.property.name}`}function Xj(e,t){if(e.type===`JSXText`){let{value:t}=e;return t.trim()===``?null:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}if(e.type===`JSXElement`)return[Jj(e,t)];if(e.type===`JSXFragment`){let n=[];for(let r of e.children){let e=Xj(r,t);e!=null&&n.push(...e)}return n}return e.type===`JSXExpressionContainer`?e.expression.type===`JSXEmptyExpression`?null:[{type:`paragraph`,children:[{type:`text`,value:Zj(e.expression)}]}]:e.type===`JSXSpreadChild`?[{type:`paragraph`,children:[{type:`text`,value:`...${Zj(e.expression)}`}]}]:null}function Zj(e){if(e.type===`Identifier`)return e.name;if(e.type===`Literal`)return typeof e.value==`string`?JSON.stringify(e.value):String(e.value);if(e.type===`MemberExpression`){let t=Zj(e.object);return e.computed?`${t}[${Zj(e.property)}]`:`${t}.${e.property.name}`}if(e.type===`CallExpression`)return`${Zj(e.callee)}(${e.arguments.map(e=>Zj(e)).join(`, `)})`;if(e.type===`BinaryExpression`||e.type===`LogicalExpression`){let t=Zj(e.left),n=Zj(e.right);return`(${t} ${e.operator} ${n})`}if(e.type===`UnaryExpression`){let t=Zj(e.argument);return`${e.operator}${t}`}if(e.type===`ConditionalExpression`)return`(${Zj(e.test)} ? ${Zj(e.consequent)} : ${Zj(e.alternate)})`;if(e.type===`ArrayExpression`)return`[${e.elements.filter(e=>e!=null&&e.type!==`SpreadElement`).map(e=>Zj(e)).join(`, `)}]`;if(e.type===`ObjectExpression`)return`{${e.properties.filter(e=>e.type===`Property`).map(e=>`${e.key.type===`Identifier`?e.key.name:Zj(e.key)}: ${Zj(e.value)}`).join(`, `)}}`;if(e.type===`TemplateLiteral`){let t="`";for(let n=0;n<e.quasis.length;n++)t+=e.quasis[n]?.value.raw??``,n<e.expressions.length&&(t+=`\${${Zj(e.expressions[n])}}`);return t+="`",t}return e.type===`SpreadElement`?`...${Zj(e.argument)}`:``}function Qj(e){return e.type===`JSXElement`||e.type===`JSXFragment`}function $j(e){return!!e}function eM(e){if(e==null)return[];let t=typeof e==`string`?e:String(e);return t===``||t===`undefined`||t===`null`?[]:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}function tM(e,t,n){let r=Zj(e);if(r===``)return[];try{return eM(gj(r,t.scope,Ij(t,n)))}catch{return[]}}const nM={}.hasOwnProperty;function rM(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&nM.call(t,e)){let n=String(t[e]);i=nM.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const iM={}.hasOwnProperty;function aM(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)aM(e,t.extensions[n]);for(r in t)if(iM.call(t,r))switch(r){case`extensions`:break;case`unsafe`:oM(e[r],t[r]);break;case`join`:oM(e[r],t[r]);break;case`handlers`:sM(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function oM(e,t){t&&e.push(...t)}function sM(e,t){t&&Object.assign(e,t)}const cM=[lM];function lM(e,t,n,r){if(t.type===`code`&&Ry(t,r)&&(e.type===`list`||e.type===t.type&&Ry(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&nb(t,r))?void 0:n.spread?1:0}const uM=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],dM=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
366
- `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:uM},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
367
- ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:uM},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
368
- *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:uM},{atBreak:!0,character:`+`,after:`(?:[ \r
360
+ `,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;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}}})),Ok=J((e=>{var t=bk(),n=rk(),r=ik(),i=OO(),a=fO(),o=Ek(),s=Dk();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})),kk=J((e=>{var t=bk(),n=rk(),r=tk(),i=ik(),a=yO(),o=fO(),s=jO(),c=bO(),l=NO(),u=FO();wk();var d=Tk(),f=Ek(),p=Dk(),m=Ok(),h=pO();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}));function Ak(){return a.env.TNMSC_FORCE_NATIVE_BINDING===`1`?!1:a.env.TNMSC_DISABLE_NATIVE_BINDING===`1`?!0:a.env.NODE_ENV===`test`||a.env.VITEST!=null||a.env.VITEST_WORKER_ID!=null}const jk=/\r?\n/u;function Mk(e={}){let{filePath:t,position:n,sourceText:r,expression:i,exportName:a,nodeType:o,phase:s,hint:c,cause:l}=e,u=n?.start.line,d=n?.start.column,f=n?.end?.line,p=n?.end?.column,m=n?.start.offset,h=n?.end?.offset,g=u!=null&&r!=null?Nk(r,u):void 0,_=Pk(r,m,h,g),v=u!=null&&d!=null&&g!=null?Fk(u,d,p,g):void 0,y={};return t!=null&&t.length>0&&Object.assign(y,{filePath:t}),u!=null&&Object.assign(y,{line:u}),d!=null&&Object.assign(y,{column:d}),f!=null&&Object.assign(y,{endLine:f}),p!=null&&Object.assign(y,{endColumn:p}),m!=null&&Object.assign(y,{offset:m}),h!=null&&Object.assign(y,{endOffset:h}),_!=null&&_.length>0&&Object.assign(y,{snippet:_}),g!=null&&g.length>0&&Object.assign(y,{sourceLine:g}),v!=null&&v.length>0&&Object.assign(y,{codeFrame:v}),i!=null&&i.length>0&&Object.assign(y,{expression:i}),a!=null&&a.length>0&&Object.assign(y,{exportName:a}),o!=null&&o.length>0&&Object.assign(y,{nodeType:o}),s!=null&&s.length>0&&Object.assign(y,{phase:s}),c!=null&&c.length>0&&Object.assign(y,{hint:c}),l!=null&&l.length>0&&Object.assign(y,{cause:l}),y}function Nk(e,t){return e.split(jk)[t-1]}function Pk(e,t,n,r){if(e!=null&&t!=null){let r=n!=null&&n>=t?n:t+1,i=e.slice(t,r).trim();if(i.length>0)return i.length>240?`${i.slice(0,240)}...`:i}let i=r?.trim();if(i!=null&&i.length>0)return i}function Fk(e,t,n,r){let i=`${e} | `,a=` `.repeat(i.length+Math.max(0,t-1)),o=Math.max(1,(n??t+1)-t);return`${i}${r}\n${a}${`^`.repeat(o)}`}function Ik(e){if(!(e.line==null||e.column==null))return e.endLine!=null&&e.endColumn!=null?`${e.line}:${e.column}-${e.endLine}:${e.endColumn}`:`${e.line}:${e.column}`}function Lk(e,t){let n=[e];t.phase!=null&&n.push(`phase: ${t.phase}`),t.nodeType!=null&&n.push(`node: ${t.nodeType}`),t.filePath!=null&&n.push(`file: ${t.filePath}`);let r=Ik(t);return r!=null&&n.push(`location: ${r}`),t.expression!=null&&n.push(`expression: ${t.expression}`),t.exportName!=null&&n.push(`export: ${t.exportName}`),t.sourceLine!=null&&n.push(`source line: ${t.sourceLine.trimEnd()}`),t.codeFrame!=null&&(n.push(`code frame:`),n.push(t.codeFrame)),t.hint!=null&&n.push(`hint: ${t.hint}`),t.cause!=null&&n.push(`cause: ${t.cause}`),n.join(`
361
+ `)}var Rk=class extends Error{diagnostic;filePath;line;column;endLine;endColumn;snippet;sourceLine;codeFrame;phase;nodeType;constructor(e,t,n){super(Lk(t,n)),this.name=e,this.diagnostic=n,n.filePath!=null&&(this.filePath=n.filePath),n.line!=null&&(this.line=n.line),n.column!=null&&(this.column=n.column),n.endLine!=null&&(this.endLine=n.endLine),n.endColumn!=null&&(this.endColumn=n.endColumn),n.snippet!=null&&(this.snippet=n.snippet),n.sourceLine!=null&&(this.sourceLine=n.sourceLine),n.codeFrame!=null&&(this.codeFrame=n.codeFrame),n.phase!=null&&(this.phase=n.phase),n.nodeType!=null&&(this.nodeType=n.nodeType)}};function zk(e){if(e===`mdxTextExpression`||e===`mdxFlowExpression`)return`Literal braces in MDX text are parsed as expressions. Escape the braces or wrap the placeholder in code if you meant plain text.`;if(e===`mdxJsxAttributeValueExpression`)return`JSX attribute expressions must reference values that exist in scope.`}var Bk=class extends Rk{expression;constructor(e,t){super(`ScopeError`,e,t),t.expression!=null&&(this.expression=t.expression)}},Vk=class extends Bk{variableName;constructor(e,t,n={}){let r=Mk({...n,expression:t,phase:n.phase??`expression-evaluation`,hint:n.hint??zk(n.nodeType)}),i=`Undefined variable "${e}" in expression "${t??``}"`;super(i,r),this.name=`UndefinedVariableError`,this.variableName=e}},Hk=class extends Bk{namespace;constructor(e,t,n={}){let r=Mk({...n,expression:t,phase:n.phase??`expression-evaluation`,hint:n.hint??zk(n.nodeType)}),i=`Undefined namespace "${e}" in expression "${t??``}"`;super(i,r),this.name=`UndefinedNamespaceError`,this.namespace=e}},Uk=class extends Rk{exportName;constructor(e,t,n={}){let r=Mk({...n,exportName:t,phase:n.phase??`export-parsing`,hint:n.hint??`Export metadata must be statically evaluable. Use plain literals, arrays, objects, or scope-backed references only.`});super(`ExportParseError`,e,r),t!=null&&(this.exportName=t)}};const Wk=new Map;function Gk(e,t){Wk.set(e,t)}function Kk(){return new Map(Wk)}function qk(e){return Wk.has(e)}const Jk=/^export\s+default\s+/u,Yk=/export\s+const\s+(\w+)\s*=\s*/gu,Xk=/^-?\d+(?:\.\d+)?$/u,Zk=/^[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*$/iu,Qk=/\s/u,$k=/[\w$]/u,eA=/^[\w$]+$/u;function tA(e,t={}){let n={},{yamlFrontMatter:r,scope:i,filePath:a,sourceText:o}=t;for(let t of e){let e=nA(t,i,{...a!=null&&{filePath:a},...o!=null&&{sourceText:o}});Object.assign(n,e)}let s=Object.keys(n).length>0,c=r!=null&&Object.keys(r).length>0,l;return l=s&&c?`mixed`:s?`export`:`yaml`,{fields:{...r,...n},source:l}}function nA(e,t,n={}){let r={},{filePath:i,sourceText:a}=n,o=e.value.trim(),s=Jk.exec(o);if(s!=null){let n=s[0].length,c=rA(o,n);if(c!=null)try{let e=iA(c.trim(),t,i);typeof e==`object`&&e&&!Array.isArray(e)&&Object.assign(r,e)}catch(t){let n=t instanceof Error?t.message:String(t);throw new Uk(`Cannot statically evaluate export default`,`default`,{...i!=null&&{filePath:i},...a!=null&&{sourceText:a},...e.position!=null&&{position:e.position},nodeType:`mdxjsEsm`,phase:`export-parsing`,cause:n})}return r}let c=Yk.exec(o);for(;c!==null;){let n=c[1];if(n==null){c=Yk.exec(o);continue}let s=rA(o,c.index+c[0].length);if(s==null){c=Yk.exec(o);continue}try{let e=iA(s.trim(),t,i);n===`metadata`&&typeof e==`object`&&e&&!Array.isArray(e)?Object.assign(r,e):r[n]=e}catch(t){let r=t instanceof Error?t.message:String(t);throw new Uk(`Cannot statically evaluate export "${n}"`,n,{...i!=null&&{filePath:i},...a!=null&&{sourceText:a},...e.position!=null&&{position:e.position},nodeType:`mdxjsEsm`,phase:`export-parsing`,cause:r})}c=Yk.exec(o)}return r}function rA(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){if(t===`;`||t===`
362
+ `){a=o;break}if(t===`/`&&o+1<e.length&&e[o+1]===`/`){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 iA(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(Xk.test(r))return Number(r);if(r.startsWith(`"`)&&r.endsWith(`"`)||r.startsWith(`'`)&&r.endsWith(`'`))return aA(r.slice(1,-1));if(r.startsWith("`")&&r.endsWith("`")){let e=r.slice(1,-1);if(e.includes("${"))throw Error(`Template literal with expressions cannot be statically evaluated: ${r}`);return aA(e)}if(r.startsWith(`[`)&&r.endsWith(`]`))return sA(r,t,n);if(r.startsWith(`{`)&&r.endsWith(`}`))return cA(r,t,n);if(Zk.test(r))return oA(r,t,n);let i=n==null?``:` in file "${n}"`;throw Error(`Expression "${r}" cannot be statically evaluated${i}`)}function aA(e){return e.replaceAll(`\\n`,`
363
+ `).replaceAll(`\\r`,`\r`).replaceAll(`\\t`,` `).replaceAll(`\\"`,`"`).replaceAll(`\\'`,`'`).replaceAll(`\\\\`,`\\`)}function oA(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`)return a;let o=n==null?``:` in file "${n}"`;throw Error(`Variable "${e}" resolved to unsupported type: ${typeof a}${o}`)}function sA(e,t,n){let r=e.slice(1,-1).trim();if(r===``)return[];if(t==null)try{let t=lA(e),n=JSON.parse(t);if(Array.isArray(n))return n}catch{}return uA(r).map(e=>iA(e.trim(),t,n))}function cA(e,t,n){let r=e.slice(1,-1).trim();if(r===``)return{};if(t==null)try{let t=lA(e),n=JSON.parse(t);if(typeof n==`object`&&n&&!Array.isArray(n))return n}catch{}let i={},a=dA(r);for(let e of a){let r=fA(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]=iA(o,t,n)}return i}function lA(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&&Qk.test(t.charAt(e));)e--;let n=e+1;for(;e>=0&&$k.test(t.charAt(e));)e--;if(e++,e>0&&t.charAt(e-1)!==`"`){let r=t.slice(e,n);r.length>0&&eA.test(r)&&(t=`${t.slice(0,e)}"${r}"`)}}t+=a}return t}function uA(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 dA(e){return uA(e)}function fA(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}const pA=/^[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*$/iu,mA=/(\w+) is not defined/u;function hA(e,t,n){let r=e.trim(),i=gA(n,e);return r===``?``:pA.test(r)?_A(r,t,i):vA(r,t,i)}function gA(e,t){return{expression:t,...e?.filePath!=null&&{filePath:e.filePath},...e?.sourceText!=null&&{sourceText:e.sourceText},...e?.position!=null&&{position:e.position},...e?.nodeType!=null&&{nodeType:e.nodeType}}}function _A(e,t,n){let r=e.split(`.`),i=r[0];if(i==null||!(i in t))throw new Hk(i??``,e,n);let a=t[i];for(let t=1;t<r.length;t++){let i=r[t];if(i==null)continue;if(a==null)throw new Vk(i,e,n);if(typeof a!=`object`)throw TypeError(`Cannot read property "${i}" of ${typeof a} in expression "${e}"`);let o=a;if(!(i in o))throw new Vk(i,e,n);a=o[i]}return yA(a)}function vA(e,t,n){let r=Object.keys(t),i=r.map(e=>t[e]);try{return yA(Function(...r,`return (${e})`)(...i))}catch(t){let r=t instanceof Error?t.message:String(t);if(r.includes(`is not defined`)){let t=mA.exec(r);if(t?.[1]!=null)throw new Hk(t[1],e,{...n,cause:r})}let i=n?.filePath==null?[]:[`file: ${n.filePath}`],a=n?.position?.start==null?[]:[`location: ${n.position.start.line}:${n.position.start.column}`];throw Error([`Failed to evaluate expression: "${e}"`,...i,...a,`Cause: ${r}`].join(`
364
+ `))}}function yA(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function bA(e,t){return e===null?!1:t.components.has(e)||qk(e)}async function xA(e){return async(t,n)=>(await e({type:`root`,children:t},n)).children}async function SA(e,t,n){let r=e.name;if(r==null||r===``)return[];let i=t.components.get(r);if(i==null)return[];if(t.processingStack.includes(r)){let e=[...t.processingStack,r].join(` → `);throw Error(`Circular dependency detected: ${e}`)}let a={scope:t.scope,components:t.components,processingStack:[...t.processingStack,r],...t.basePath==null?{}:{basePath:t.basePath}},o=await xA(n);try{return await i(e,a,o)}catch(e){let n=e instanceof Error?e.message:String(e),i=t.processingStack.join(` → `);throw Error(`Failed to process component "${r}"${i===``?``:` (called from: ${i})`}:\n${n}`,{cause:e})}}const CA=/language-(\w+)/u;function wA(e,t,n){return{...e.filePath!=null&&{filePath:e.filePath},...e.sourceText!=null&&{sourceText:e.sourceText},...n?.position!=null&&{position:n.position},nodeType:t}}function TA(e,t){let n=e.name?.toLowerCase();if(n==null)return null;switch(n){case`pre`:return OA(e,t);case`a`:return kA(e,t);case`strong`:case`b`:return AA(e,t);case`em`:case`i`:return jA(e,t);case`img`:return MA(e,t);case`blockquote`:return NA(e,t);default:return null}}function EA(e,t,n){let r=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return r==null?null:typeof r.value==`string`?r.value:r.value!=null&&typeof r.value==`object`&&r.value.type===`mdxJsxAttributeValueExpression`?hA(r.value.value,n.scope,wA(n,`mdxJsxAttributeValueExpression`,r)):r.value===null?``:null}function DA(e,t){let n=``;for(let r of e.children){if(r.type===`text`){n+=r.value;continue}if(r.type===`mdxTextExpression`){n+=hA(r.value,t.scope,wA(t,`mdxTextExpression`,r));continue}(r.type===`mdxJsxFlowElement`||r.type===`mdxJsxTextElement`)&&(n+=DA(r,t))}return n}function OA(e,t){let n=null;for(let t of e.children){if((t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)&&t.name?.toLowerCase()===`code`){n=t;break}if(t.type===`paragraph`&&`children`in t){let e=t.children;for(let t of e)if((t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)&&t.name?.toLowerCase()===`code`){n=t;break}if(n!=null)break}}if(n==null)return null;let r=EA(n,`className`,t)??``,i=CA.exec(r)?.[1],a=DA(n,t);return[{type:`code`,lang:i??null,value:a.trim()}]}function kA(e,t){let n=EA(e,`href`,t);if(n==null||n===``)return null;let r=DA(e,t);return[{type:`paragraph`,children:[{type:`link`,url:n,title:EA(e,`title`,t)??null,children:[{type:`text`,value:r}]}]}]}function AA(e,t){let n={type:`strong`,children:[{type:`text`,value:DA(e,t)}]};return e.type,[{type:`paragraph`,children:[n]}]}function jA(e,t){let n={type:`emphasis`,children:[{type:`text`,value:DA(e,t)}]};return e.type,[{type:`paragraph`,children:[n]}]}function MA(e,t){let n=EA(e,`src`,t);if(n==null||n===``)return null;let r={type:`image`,url:n,alt:EA(e,`alt`,t)??``,title:EA(e,`title`,t)??null};return e.type,[{type:`paragraph`,children:[r]}]}function NA(e,t){return[{type:`blockquote`,children:[{type:`paragraph`,children:[{type:`text`,value:DA(e,t)}]}]}]}const PA=/^-?\d+(?:\.\d+)?$/u;function FA(e,t){return{...e.filePath!=null&&{filePath:e.filePath},...e.sourceText!=null&&{sourceText:e.sourceText},...t.position!=null&&{position:t.position},nodeType:t.type}}function IA(e){return e==null?!1:JSON.stringify(e).includes(`"JSX`)}async function LA(e,t,n){let r=e.data?.estree;if(r==null||r.body.length===0)return[];let i=r.body[0];return i?.type===`ExpressionStatement`?RA(i.expression,t,n,e):[]}async function RA(e,t,n,r){return e.type===`JSXElement`?WA(e,t,n):e.type===`JSXFragment`?GA(e,t,n,r):e.type===`LogicalExpression`?zA(e,t,n,r):e.type===`ConditionalExpression`?BA(e,t,n,r):e.type===`SequenceExpression`?VA(e,t,n,r):e.type===`ArrayExpression`?HA(e,t,n,r):ej(e,t,r)}async function zA(e,t,n,r){let i=await UA(e.left,t,n,r);return e.operator===`&&`?QA(i)?RA(e.right,t,n,r):[]:e.operator===`||`?QA(i)?ZA(e.left)?RA(e.left,t,n,r):$A(i):RA(e.right,t,n,r):e.operator===`??`?i==null?RA(e.right,t,n,r):ZA(e.left)?RA(e.left,t,n,r):$A(i):[]}async function BA(e,t,n,r){return QA(await UA(e.test,t,n,r))?RA(e.consequent,t,n,r):RA(e.alternate,t,n,r)}async function VA(e,t,n,r){let i=[];for(let a of e.expressions){let e=await RA(a,t,n,r);i.push(...e)}return i}async function HA(e,t,n,r){let i=[];for(let a of e.elements)if(a!=null)if(a.type===`SpreadElement`){let e=await RA(a.argument,t,n,r);i.push(...e)}else{let e=await RA(a,t,n,r);i.push(...e)}return i}async function UA(e,t,n,r){if(ZA(e))return!0;if(e.type===`Literal`)return e.value;if(e.type===`Identifier`)return e.name===`undefined`?void 0:e.name===`NaN`?NaN:e.name===`Infinity`?1/0:t.scope[e.name];if(e.type===`UnaryExpression`){let i=await UA(e.argument,t,n,r);return e.operator===`!`?!QA(i):e.operator===`-`?-i:e.operator===`+`?+i:e.operator===`typeof`?typeof i:void 0}if(e.type===`BinaryExpression`){let i=await UA(e.left,t,n,r),a=await UA(e.right,t,n,r);return e.operator===`===`?i===a:e.operator===`!==`?i!==a:e.operator===`==`?i===a:e.operator===`!=`?i!==a:e.operator===`<`?i<a:e.operator===`<=`?i<=a:e.operator===`>`?i>a:e.operator===`>=`?i>=a:e.operator===`+`?i+a:e.operator===`-`?i-a:e.operator===`*`?i*a:e.operator===`/`?i/a:e.operator===`%`?i%a:void 0}if(e.type===`LogicalExpression`){let i=await UA(e.left,t,n,r);return e.operator===`&&`?QA(i)?UA(e.right,t,n,r):i:e.operator===`||`?QA(i)?i:UA(e.right,t,n,r):e.operator===`??`?i??UA(e.right,t,n,r):void 0}if(e.type===`MemberExpression`){let i=await UA(e.object,t,n,r);if(i==null)return;if(e.computed)return i[await UA(e.property,t,n,r)];let{name:a}=e.property;return i[a]}if(e.type===`ConditionalExpression`)return QA(await UA(e.test,t,n,r))?UA(e.consequent,t,n,r):UA(e.alternate,t,n,r);let i=XA(e);if(i!==``)try{let e=hA(i,t.scope,FA(t,r));return e===`true`?!0:e===`false`?!1:e===`null`?null:e===`undefined`||e===``?void 0:PA.test(e)?Number(e):e}catch{return}}async function WA(e,t,n){let r=qA(e,t);return r.name!=null&&bA(r.name,t)?SA(r,t,async(e,t)=>({type:`root`,children:await n(e.children,t)})):TA(r,t)??(r.children.length>0?n(r.children,t):[])}async function GA(e,t,n,r){let i=[];for(let a of e.children){let e=await KA(a,t,n,r);i.push(...e)}return i}async function KA(e,t,n,r){if(e.type===`JSXElement`)return WA(e,t,n);if(e.type===`JSXFragment`)return GA(e,t,n,r);if(e.type===`JSXText`){let t=e.value.trim();return t===``?[]:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}return e.type===`JSXExpressionContainer`?e.expression.type===`JSXEmptyExpression`?[]:RA(e.expression,t,n,r):e.type===`JSXSpreadChild`?RA(e.expression,t,n,r):[]}function qA(e,t){let n=e.openingElement,r=null;n.name.type===`JSXIdentifier`?{name:r}=n.name:n.name.type===`JSXMemberExpression`?r=JA(n.name):n.name.type===`JSXNamespacedName`&&(r=`${n.name.namespace.name}:${n.name.name.name}`);let i=[];for(let e of n.attributes)if(e.type===`JSXAttribute`){let t=e.name.type===`JSXIdentifier`?e.name.name:`${e.name.namespace.name}:${e.name.name.name}`,n=null;e.value==null?n=null:e.value.type===`Literal`?n=String(e.value.value):e.value.type===`JSXExpressionContainer`&&e.value.expression.type!==`JSXEmptyExpression`&&(n={type:`mdxJsxAttributeValueExpression`,value:XA(e.value.expression)}),i.push({type:`mdxJsxAttribute`,name:t,value:n})}else e.type===`JSXSpreadAttribute`&&i.push({type:`mdxJsxExpressionAttribute`,value:`...${XA(e.argument)}`});let a=[];for(let n of e.children){let e=YA(n,t);e!=null&&a.push(...e)}return{type:`mdxJsxFlowElement`,name:r,attributes:i,children:a}}function JA(e){return e.object.type===`JSXIdentifier`?`${e.object.name}.${e.property.name}`:`${JA(e.object)}.${e.property.name}`}function YA(e,t){if(e.type===`JSXText`){let{value:t}=e;return t.trim()===``?null:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}if(e.type===`JSXElement`)return[qA(e,t)];if(e.type===`JSXFragment`){let n=[];for(let r of e.children){let e=YA(r,t);e!=null&&n.push(...e)}return n}return e.type===`JSXExpressionContainer`?e.expression.type===`JSXEmptyExpression`?null:[{type:`paragraph`,children:[{type:`text`,value:XA(e.expression)}]}]:e.type===`JSXSpreadChild`?[{type:`paragraph`,children:[{type:`text`,value:`...${XA(e.expression)}`}]}]:null}function XA(e){if(e.type===`Identifier`)return e.name;if(e.type===`Literal`)return typeof e.value==`string`?JSON.stringify(e.value):String(e.value);if(e.type===`MemberExpression`){let t=XA(e.object);return e.computed?`${t}[${XA(e.property)}]`:`${t}.${e.property.name}`}if(e.type===`CallExpression`)return`${XA(e.callee)}(${e.arguments.map(e=>XA(e)).join(`, `)})`;if(e.type===`BinaryExpression`||e.type===`LogicalExpression`){let t=XA(e.left),n=XA(e.right);return`(${t} ${e.operator} ${n})`}if(e.type===`UnaryExpression`){let t=XA(e.argument);return`${e.operator}${t}`}if(e.type===`ConditionalExpression`)return`(${XA(e.test)} ? ${XA(e.consequent)} : ${XA(e.alternate)})`;if(e.type===`ArrayExpression`)return`[${e.elements.filter(e=>e!=null&&e.type!==`SpreadElement`).map(e=>XA(e)).join(`, `)}]`;if(e.type===`ObjectExpression`)return`{${e.properties.filter(e=>e.type===`Property`).map(e=>`${e.key.type===`Identifier`?e.key.name:XA(e.key)}: ${XA(e.value)}`).join(`, `)}}`;if(e.type===`TemplateLiteral`){let t="`";for(let n=0;n<e.quasis.length;n++)t+=e.quasis[n]?.value.raw??``,n<e.expressions.length&&(t+=`\${${XA(e.expressions[n])}}`);return t+="`",t}return e.type===`SpreadElement`?`...${XA(e.argument)}`:``}function ZA(e){return e.type===`JSXElement`||e.type===`JSXFragment`}function QA(e){return!!e}function $A(e){if(e==null)return[];let t=typeof e==`string`?e:String(e);return t===``||t===`undefined`||t===`null`?[]:[{type:`paragraph`,children:[{type:`text`,value:t}]}]}function ej(e,t,n){let r=XA(e);if(r===``)return[];try{return $A(hA(r,t.scope,FA(t,n)))}catch{return[]}}const tj={}.hasOwnProperty;function nj(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&tj.call(t,e)){let n=String(t[e]);i=tj.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const rj={}.hasOwnProperty;function ij(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)ij(e,t.extensions[n]);for(r in t)if(rj.call(t,r))switch(r){case`extensions`:break;case`unsafe`:aj(e[r],t[r]);break;case`join`:aj(e[r],t[r]);break;case`handlers`:oj(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function aj(e,t){t&&e.push(...t)}function oj(e,t){t&&Object.assign(e,t)}const sj=[cj];function cj(e,t,n,r){if(t.type===`code`&&Lv(t,r)&&(e.type===`list`||e.type===t.type&&Lv(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&ty(t,r))?void 0:n.spread?1:0}const lj=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],uj=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
365
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:lj},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
366
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:lj},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
367
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:lj},{atBreak:!0,character:`+`,after:`(?:[ \r
369
368
  ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
370
369
  -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
371
- ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:uM},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:uM},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:uM},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:uM},{atBreak:!0,character:`~`}];function fM(e){return e.label||!e.identifier?e.label||``:zb(e.identifier)}function pM(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function mM(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
372
- `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=Gy(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+Gy(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function hM(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
370
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:lj},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:lj},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:lj},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:lj},{atBreak:!0,character:`~`}];function dj(e){return e.label||!e.identifier?e.label||``:Ry(e.identifier)}function fj(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function pj(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
371
+ `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=Wv(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+Wv(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function mj(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
373
372
  `,after:`
374
- `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(gM(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function gM(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
373
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(hj(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function hj(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
375
374
  `.repeat(1+a);if(a===!1)return`
376
375
 
377
376
  <!---->
378
377
 
379
378
  `}return`
380
379
 
381
- `}const _M=/\r?\n|\r/g;function vM(e,t){let n=[],r=0,i=0,a;for(;a=_M.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function yM(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!Py(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(bM);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(xM(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Gy(r.charCodeAt(e))),c++))}return a.push(xM(r.slice(c,l),n.after)),a.join(``)}function bM(e,t){return e-t}function xM(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function SM(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function CM(e,t){let n=t||{},r={associationId:fM,containerPhrasing:DM,containerFlow:OM,createTracker:SM,compilePattern:pM,enter:a,handlers:{...Nb},handle:void 0,indentLines:vM,indexStack:[],join:[...cM],options:{},safe:kM,stack:[],unsafe:[...dM]};aM(r,n),r.options.tightDefinitions&&r.join.push(EM),r.handle=rM(`type`,{invalid:wM,unknown:TM,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
380
+ `}const gj=/\r?\n|\r/g;function _j(e,t){let n=[],r=0,i=0,a;for(;a=gj.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function vj(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!Nv(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(yj);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(bj(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Wv(r.charCodeAt(e))),c++))}return a.push(bj(r.slice(c,l),n.after)),a.join(``)}function yj(e,t){return e-t}function bj(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function xj(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function Sj(e,t){let n=t||{},r={associationId:dj,containerPhrasing:Ej,containerFlow:Dj,createTracker:xj,compilePattern:fj,enter:a,handlers:{...My},handle:void 0,indentLines:_j,indexStack:[],join:[...sj],options:{},safe:Oj,stack:[],unsafe:[...uj]};ij(r,n),r.options.tightDefinitions&&r.join.push(Tj),r.handle=nj(`type`,{invalid:Cj,unknown:wj,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
382
381
  `,after:`
383
382
  `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
384
- `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function wM(e){throw Error("Cannot handle value `"+e+"`, expected node")}function TM(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function EM(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function DM(e,t){return mM(e,this,t)}function OM(e,t){return hM(e,this,t)}function kM(e,t){return yM(this,e,t)}function AM(e,t,n){return{...e.filePath!=null&&{filePath:e.filePath},...e.sourceText!=null&&{sourceText:e.sourceText},...n?.position!=null&&{position:n.position},nodeType:t}}function jM(e,t){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`when`);if(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=gj(n.value.value,t.scope,AM(t,`mdxJsxAttributeValueExpression`,n));return e===`true`||e===`1`}catch{return!1}return!1}async function MM(e,t,n){return!jM(e,t)||e.children.length===0?[]:n(e.children,t)}async function NM(e,t){if(!jM(e,t)||e.children.length===0)return[];let n=PM(e.children,t);return n===``?[]:[{type:`text`,value:n}]}function PM(e,t){let n=``;for(let r of e)if(r.type===`text`)n+=r.value;else if(r.type===`mdxTextExpression`)try{n+=gj(r.value,t.scope,AM(t,`mdxTextExpression`,r))}catch{}else `children`in r&&Array.isArray(r.children)&&(n+=PM(r.children,t));return n}function FM(){KA(`Md`,MM),KA(`Md.Line`,NM)}function IM(e){let t=this;t.compiler=n;function n(n){return CM(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}var LM=q_(AA(),1);const RM=/\.\w+$/u,zM=/^[a-z]/u,BM=/^\.\.\./u,VM=/\n+$/u,HM=new Set([`break`,`delete`,`emphasis`,`html`,`image`,`inlineCode`,`link`,`strong`,`text`]),UM=nk().use(HC).use(IM,{bullet:`-`,fence:"`",fences:!0,emphasis:`*`,strong:`*`,rule:`-`,handlers:{text(e){return e.value}}});function WM(e,t,n){return{...e.filePath!=null&&{filePath:e.filePath},...e.sourceText!=null&&{sourceText:e.sourceText},...t.position!=null&&{position:t.position},nodeType:n}}function GM(e){if(!(e.includes(`/`)&&RM.test(e)))return e;let t=e.lastIndexOf(`/`);return e.slice(t+1)}function KM(e){return e==null||e===``?!1:zM.test(e)||e.includes(`-`)}function qM(e){return HM.has(e.type)}function JM(e,t){let n=e.position?.start.offset,r=e.position?.end?.offset;if(!(t.sourceText==null||n==null||r==null||n>=r))return t.sourceText.slice(n,r)}function YM(e,t,n){let r=e;for(let e of[...n].sort((e,t)=>t.start-e.start)){let n=e.start-t,i=e.end-t;n<0||i<n||i>r.length||(r=r.slice(0,n)+e.value+r.slice(i))}return r}function XM(e){return e.replaceAll(`&`,`&amp;`).replaceAll(`"`,`&quot;`).replaceAll(`<`,`&lt;`)}function ZM(e,t,n,r){let i=e.trim();if(i===``)return``;let a=Object.keys(t.scope),o=a.map(e=>t.scope[e]);try{return Function(...a,`return (${i})`)(...o)}catch(i){throw gj(e,t.scope,WM(t,n,r)),i}}function QM(e,t){return t==null||t===!1?null:t===!0?e:`${e}="${XM(typeof t==`string`?t:typeof t==`number`||typeof t==`bigint`||typeof t==`boolean`?String(t):JSON.stringify(t))}"`}function $M(e,t){let n=[];for(let r of e){if(r.type===`mdxJsxAttribute`){if(r.value==null){n.push(r.name);continue}if(typeof r.value==`string`){n.push(`${r.name}="${XM(r.value)}"`);continue}let e=ZM(r.value.value,t,r,`mdxJsxAttributeValueExpression`),i=QM(r.name,e);i!=null&&n.push(i);continue}let e=ZM(r.value.replace(BM,``).trim(),t,r,`mdxJsxExpressionAttribute`);if(!(typeof e!=`object`||!e||Array.isArray(e)))for(let[t,r]of Object.entries(e)){let e=QM(t,r);e!=null&&n.push(e)}}return n.length===0?``:` ${n.join(` `)}`}function eN(e){if(e.length===0)return``;let t=e.every(qM)?{type:`root`,children:[{type:`paragraph`,children:e}]}:{type:`root`,children:e};return UM.stringify(t).replace(VM,``)}async function tN(e){return eN(e)}async function nN(e,t){if(e.type===`mdxjsEsm`)return``;if(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`){let n=e.data?.estree,r=e.value.trim();return r.startsWith(`/*`)&&r.endsWith(`*/`)?``:Lj(n)?tN(await Rj(e,t,async(e,t)=>(await sN({type:`root`,children:e},t)).children)):gj(e.value,t.scope,WM(t,e,e.type))}if(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`){if(e.name!=null&&xj(e.name,t))return tN(await Cj(e,t,sN));if(KM(e.name))return iN(e,t);let n=Ej(e,t);return n==null?``:tN(n)}let n=JM(e,t);if(!(`children`in e)||!Array.isArray(e.children)||e.children.length===0)return n??tN([e]);if(n==null)return tN([e]);let r=e.position?.start.offset;if(r==null)return n;let i=[];for(let n of e.children){let e=n.position?.start.offset,r=n.position?.end?.offset;e==null||r==null||e>r||i.push({start:e,end:r,value:await nN(n,t)})}return YM(n,r,i)}function rN(e,t){return JM(e,t)?.trimEnd().endsWith(`/>`)??!1}async function iN(e,t){if(!KM(e.name))return``;let n=$M(e.attributes,t),r=(await Promise.all(e.children.map(async e=>nN(e,t)))).join(``);return r===``&&rN(e,t)?`<${e.name}${n} />`:`<${e.name}${n}>${r}</${e.name}>`}async function aN(e,t){let n=await iN(e,t);return n===``?[]:[{type:`html`,value:n}]}async function oN(e,t){let n=await iN(e,t);return n===``?[]:[{type:`text`,value:n}]}async function sN(e,t){return cN(e,t)}async function cN(e,t){let n=[];for(let r of e.children){let e=await lN(r,t);n.push(...e)}return{type:`root`,children:n}}async function lN(e,t){if(e.type===`mdxjsEsm`)return[];if(e.type===`mdxFlowExpression`){let n=e,r=n.data?.estree,i=n.value.trim();if(i.startsWith(`/*`)&&i.endsWith(`*/`))return[];if(Lj(r))return Rj(n,t,async(e,t)=>(await sN({type:`root`,children:e},t)).children);let a=gj(n.value,t.scope,WM(t,n,`mdxFlowExpression`));return a===``?[]:[{type:`paragraph`,children:[{type:`text`,value:a}]}]}if(e.type===`mdxJsxFlowElement`)return uN(e,t);if(e.type===`link`){let n=e,r=(await dN(n.children,t)).map(e=>e.type===`text`?{...e,value:GM(e.value)}:e);return[{...n,children:r}]}if(!(`children`in e&&Array.isArray(e.children)))return[e];let n=await dN(e.children,t);return[{...e,children:n}]}async function uN(e,t){return e.name!=null&&xj(e.name,t)?Cj(e,t,sN):Ej(e,t)??(KM(e.name)?aN(e,t):[])}async function dN(e,t){let n=[];for(let r of e){if(r.type===`mdxFlowExpression`){let e=r,i=e.data?.estree,a=e.value.trim();if(a.startsWith(`/*`)&&a.endsWith(`*/`))continue;if(Lj(i)){let r=await Rj(e,t,async(e,t)=>(await sN({type:`root`,children:e},t)).children);for(let e of r)n.push(e);continue}let o=gj(e.value,t.scope,WM(t,e,`mdxFlowExpression`));o!==``&&n.push({type:`paragraph`,children:[{type:`text`,value:o}]});continue}if(r.type===`mdxTextExpression`){let e=r,i=e.value.trim();if(i.startsWith(`/*`)&&i.endsWith(`*/`))continue;let a={type:`text`,value:gj(e.value,t.scope,WM(t,e,`mdxTextExpression`))};n.push(a);continue}if(r.type===`mdxJsxTextElement`){let e=r;if(e.name!=null&&xj(e.name,t)){let r=await Cj(e,t,sN);for(let e of r)e.type===`paragraph`&&`children`in e?n.push(...e.children):n.push(e);continue}let i=Ej(e,t);if(i!=null){for(let e of i)e.type===`paragraph`&&`children`in e?n.push(...e.children):n.push(e);continue}KM(e.name)&&n.push(...await oN(e,t));continue}if(`children`in r&&Array.isArray(r.children)){let e=await dN(r.children,t);if(r.type===`link`){let t=e.map(e=>e.type===`text`?{...e,value:GM(e.value)}:e);n.push({...r,children:t});continue}n.push({...r,children:e});continue}n.push(r)}return n}FM();function fN(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)){let t=n[e];n[e]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof t==`object`&&t&&!Array.isArray(t)?{...t,...r}:r}return n}async function pN(e,t){let n=fk(e),r=fN(t?.globalScope,t?.scope),i=qA(),a;if(t?.extractMetadata===!0){let i=n.children.find(e=>e.type===`yaml`),o;if(i!=null)try{o=LM.parse(i.value)}catch{}a=nj(n.children.filter(e=>e.type===`mdxjsEsm`),{...o!=null&&{yamlFrontMatter:o},scope:r,...t?.filePath!=null&&{filePath:t.filePath},sourceText:e}),n.children=n.children.filter(e=>e.type!==`yaml`&&e.type!==`mdxjsEsm`)}let o=await sN(n,{scope:r,components:i,processingStack:[],...t?.basePath!=null&&{basePath:t.basePath},...t?.filePath!=null&&{filePath:t.filePath},sourceText:e}),s=nk().use(Dv,[`yaml`]).use(HC).use(IM,{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 mN=/^\s*(```|~~~)/u,hN=/\r?\n/u,gN=[/^\s*export\s+default\b/u,/^\s*export\s+const\b/u,/^\s*import\b/u];let _N=null;function vN(e){return typeof e!=`object`||!e?!1:typeof e.compileMdxToMd==`function`}function yN(e,t){let n=`@truenine/memory-sync-cli-${t}`;try{let t=e(n).mdCompiler;if(vN(t))return t}catch{}try{let t=l(e.resolve(`${n}/package.json`)),i=r(t).filter(e=>e.startsWith(`napi-md-compiler.`)&&e.endsWith(`.node`)).sort();for(let n of i){let r=e(u(t,n));if(vN(r))return r}}catch{return null}return null}function bN(e,t){let n=[`./${t}.node`,`../dist/${t}.node`];for(let t of n)try{let n=e(t);if(vN(n))return n}catch{}return null}try{if(!jA()){let t=e(import.meta.url),{platform:n,arch:r}=a,i={"win32-x64":[`napi-md-compiler.win32-x64-msvc`,`win32-x64-msvc`],"linux-x64":[`napi-md-compiler.linux-x64-gnu`,`linux-x64-gnu`],"linux-arm64":[`napi-md-compiler.linux-arm64-gnu`,`linux-arm64-gnu`],"darwin-arm64":[`napi-md-compiler.darwin-arm64`,`darwin-arm64`],"darwin-x64":[`napi-md-compiler.darwin-x64`,`darwin-x64`]}[`${n}-${r}`];if(i!=null){let[e,n]=i;_N=bN(t,e)??yN(t,n)}}}catch{}async function xN(e,t){let n=t?.extractMetadata===!0?{...t,extractMetadata:!0}:null,r=SN(e,t);if(r!=null){if(n!=null){let{metadata:t}=r;return t==null||wN(r.content)?pN(e,n):{content:r.content,metadata:t}}return r.content}return n==null?t==null?pN(e):pN(e,{...t,extractMetadata:!1}):pN(e,n)}function SN(e,t){if(_N==null)return null;try{let n=_N.compileMdxToMd(e,CN(t)),r=JSON.parse(n);return t?.extractMetadata===!0&&r.metadata==null?null:r}catch{return null}}function CN(e){if(e==null)return null;let t={...e,...e.globalScope==null?{}:{globalScope:{os:e.globalScope.os,env:e.globalScope.env,profile:e.globalScope.profile,tool:e.globalScope.tool}}};return JSON.stringify(t)}function wN(e){let t;for(let n of e.split(hN)){let e=mN.exec(n);if(e?.[1]!=null){let n=e[1];t==null?t=n:t===n&&(t=void 0);continue}if(t==null&&gN.some(e=>e.test(n)))return!0}return!1}const TN=/^[\w-]+$/u,EN=/\r\n?/gu;function DN(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Date)}function ON(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`||e instanceof Date}function kN(e){return e.length>0&&e.every(e=>DN(e))}function AN(e){if(e==null)return;if(e instanceof Date)return e.toISOString();if(typeof e==`bigint`)return e.toString();if(Array.isArray(e))return e.map(e=>AN(e)).filter(e=>e!==void 0);if(!DN(e))return e;let t={};for(let[n,r]of Object.entries(e)){let e=AN(r);e!==void 0&&(t[n]=e)}return t}function jN(e){return TN.test(e)}function MN(e){return jN(e)?e:JSON.stringify(e)}function NN(e){return e.map(e=>MN(e)).join(`.`)}function PN(e){let t=e.replaceAll(EN,`
383
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function Cj(e){throw Error("Cannot handle value `"+e+"`, expected node")}function wj(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function Tj(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function Ej(e,t){return pj(e,this,t)}function Dj(e,t){return mj(e,this,t)}function Oj(e,t){return vj(this,e,t)}function kj(e,t,n){return{...e.filePath!=null&&{filePath:e.filePath},...e.sourceText!=null&&{sourceText:e.sourceText},...n?.position!=null&&{position:n.position},nodeType:t}}function Aj(e,t){let n=e.attributes.find(e=>e.type===`mdxJsxAttribute`&&e.name===`when`);if(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=hA(n.value.value,t.scope,kj(t,`mdxJsxAttributeValueExpression`,n));return e===`true`||e===`1`}catch{return!1}return!1}async function jj(e,t,n){return!Aj(e,t)||e.children.length===0?[]:n(e.children,t)}async function Mj(e,t){if(!Aj(e,t)||e.children.length===0)return[];let n=Nj(e.children,t);return n===``?[]:[{type:`text`,value:n}]}function Nj(e,t){let n=``;for(let r of e)if(r.type===`text`)n+=r.value;else if(r.type===`mdxTextExpression`)try{n+=hA(r.value,t.scope,kj(t,`mdxTextExpression`,r))}catch{}else `children`in r&&Array.isArray(r.children)&&(n+=Nj(r.children,t));return n}function Pj(){Gk(`Md`,jj),Gk(`Md.Line`,Mj)}function Fj(e){let t=this;t.compiler=n;function n(n){return Sj(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}var Ij=Kg(kk(),1);const Lj=/\.\w+$/u,Rj=/^[a-z]/u,zj=/^\.\.\./u,Bj=/\n+$/u,Vj=new Set([`break`,`delete`,`emphasis`,`html`,`image`,`inlineCode`,`link`,`strong`,`text`]),Hj=tO().use(VS).use(Fj,{bullet:`-`,fence:"`",fences:!0,emphasis:`*`,strong:`*`,rule:`-`,handlers:{text(e){return e.value}}});function Uj(e,t,n){return{...e.filePath!=null&&{filePath:e.filePath},...e.sourceText!=null&&{sourceText:e.sourceText},...t.position!=null&&{position:t.position},nodeType:n}}function Wj(e){if(!(e.includes(`/`)&&Lj.test(e)))return e;let t=e.lastIndexOf(`/`);return e.slice(t+1)}function Gj(e){return e==null||e===``?!1:Rj.test(e)||e.includes(`-`)}function Kj(e){return Vj.has(e.type)}function qj(e,t){let n=e.position?.start.offset,r=e.position?.end?.offset;if(!(t.sourceText==null||n==null||r==null||n>=r))return t.sourceText.slice(n,r)}function Jj(e,t,n){let r=e;for(let e of[...n].sort((e,t)=>t.start-e.start)){let n=e.start-t,i=e.end-t;n<0||i<n||i>r.length||(r=r.slice(0,n)+e.value+r.slice(i))}return r}function Yj(e){return e.replaceAll(`&`,`&amp;`).replaceAll(`"`,`&quot;`).replaceAll(`<`,`&lt;`)}function Xj(e,t,n,r){let i=e.trim();if(i===``)return``;let a=Object.keys(t.scope),o=a.map(e=>t.scope[e]);try{return Function(...a,`return (${i})`)(...o)}catch(i){throw hA(e,t.scope,Uj(t,n,r)),i}}function Zj(e,t){return t==null||t===!1?null:t===!0?e:`${e}="${Yj(typeof t==`string`?t:typeof t==`number`||typeof t==`bigint`||typeof t==`boolean`?String(t):JSON.stringify(t))}"`}function Qj(e,t){let n=[];for(let r of e){if(r.type===`mdxJsxAttribute`){if(r.value==null){n.push(r.name);continue}if(typeof r.value==`string`){n.push(`${r.name}="${Yj(r.value)}"`);continue}let e=Xj(r.value.value,t,r,`mdxJsxAttributeValueExpression`),i=Zj(r.name,e);i!=null&&n.push(i);continue}let e=Xj(r.value.replace(zj,``).trim(),t,r,`mdxJsxExpressionAttribute`);if(!(typeof e!=`object`||!e||Array.isArray(e)))for(let[t,r]of Object.entries(e)){let e=Zj(t,r);e!=null&&n.push(e)}}return n.length===0?``:` ${n.join(` `)}`}function $j(e){if(e.length===0)return``;let t=e.every(Kj)?{type:`root`,children:[{type:`paragraph`,children:e}]}:{type:`root`,children:e};return Hj.stringify(t).replace(Bj,``)}async function eM(e){return $j(e)}async function tM(e,t){if(e.type===`mdxjsEsm`)return``;if(e.type===`mdxFlowExpression`||e.type===`mdxTextExpression`){let n=e.data?.estree,r=e.value.trim();return r.startsWith(`/*`)&&r.endsWith(`*/`)?``:IA(n)?eM(await LA(e,t,async(e,t)=>(await oM({type:`root`,children:e},t)).children)):hA(e.value,t.scope,Uj(t,e,e.type))}if(e.type===`mdxJsxFlowElement`||e.type===`mdxJsxTextElement`){if(e.name!=null&&bA(e.name,t))return eM(await SA(e,t,oM));if(Gj(e.name))return rM(e,t);let n=TA(e,t);return n==null?``:eM(n)}let n=qj(e,t);if(!(`children`in e)||!Array.isArray(e.children)||e.children.length===0)return n??eM([e]);if(n==null)return eM([e]);let r=e.position?.start.offset;if(r==null)return n;let i=[];for(let n of e.children){let e=n.position?.start.offset,r=n.position?.end?.offset;e==null||r==null||e>r||i.push({start:e,end:r,value:await tM(n,t)})}return Jj(n,r,i)}function nM(e,t){return qj(e,t)?.trimEnd().endsWith(`/>`)??!1}async function rM(e,t){if(!Gj(e.name))return``;let n=Qj(e.attributes,t),r=(await Promise.all(e.children.map(async e=>tM(e,t)))).join(``);return r===``&&nM(e,t)?`<${e.name}${n} />`:`<${e.name}${n}>${r}</${e.name}>`}async function iM(e,t){let n=await rM(e,t);return n===``?[]:[{type:`html`,value:n}]}async function aM(e,t){let n=await rM(e,t);return n===``?[]:[{type:`text`,value:n}]}async function oM(e,t){return sM(e,t)}async function sM(e,t){let n=[];for(let r of e.children){let e=await cM(r,t);n.push(...e)}return{type:`root`,children:n}}async function cM(e,t){if(e.type===`mdxjsEsm`)return[];if(e.type===`mdxFlowExpression`){let n=e,r=n.data?.estree,i=n.value.trim();if(i.startsWith(`/*`)&&i.endsWith(`*/`))return[];if(IA(r))return LA(n,t,async(e,t)=>(await oM({type:`root`,children:e},t)).children);let a=hA(n.value,t.scope,Uj(t,n,`mdxFlowExpression`));return a===``?[]:[{type:`paragraph`,children:[{type:`text`,value:a}]}]}if(e.type===`mdxJsxFlowElement`)return lM(e,t);if(e.type===`link`){let n=e,r=(await uM(n.children,t)).map(e=>e.type===`text`?{...e,value:Wj(e.value)}:e);return[{...n,children:r}]}if(!(`children`in e&&Array.isArray(e.children)))return[e];let n=await uM(e.children,t);return[{...e,children:n}]}async function lM(e,t){return e.name!=null&&bA(e.name,t)?SA(e,t,oM):TA(e,t)??(Gj(e.name)?iM(e,t):[])}async function uM(e,t){let n=[];for(let r of e){if(r.type===`mdxFlowExpression`){let e=r,i=e.data?.estree,a=e.value.trim();if(a.startsWith(`/*`)&&a.endsWith(`*/`))continue;if(IA(i)){let r=await LA(e,t,async(e,t)=>(await oM({type:`root`,children:e},t)).children);for(let e of r)n.push(e);continue}let o=hA(e.value,t.scope,Uj(t,e,`mdxFlowExpression`));o!==``&&n.push({type:`paragraph`,children:[{type:`text`,value:o}]});continue}if(r.type===`mdxTextExpression`){let e=r,i=e.value.trim();if(i.startsWith(`/*`)&&i.endsWith(`*/`))continue;let a={type:`text`,value:hA(e.value,t.scope,Uj(t,e,`mdxTextExpression`))};n.push(a);continue}if(r.type===`mdxJsxTextElement`){let e=r;if(e.name!=null&&bA(e.name,t)){let r=await SA(e,t,oM);for(let e of r)e.type===`paragraph`&&`children`in e?n.push(...e.children):n.push(e);continue}let i=TA(e,t);if(i!=null){for(let e of i)e.type===`paragraph`&&`children`in e?n.push(...e.children):n.push(e);continue}Gj(e.name)&&n.push(...await aM(e,t));continue}if(`children`in r&&Array.isArray(r.children)){let e=await uM(r.children,t);if(r.type===`link`){let t=e.map(e=>e.type===`text`?{...e,value:Wj(e.value)}:e);n.push({...r,children:t});continue}n.push({...r,children:e});continue}n.push(r)}return n}Pj();function dM(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)){let t=n[e];n[e]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof t==`object`&&t&&!Array.isArray(t)?{...t,...r}:r}return n}async function fM(e,t){let n=dO(e),r=dM(t?.globalScope,t?.scope),i=Kk(),a;if(t?.extractMetadata===!0){let i=n.children.find(e=>e.type===`yaml`),o;if(i!=null)try{o=Ij.parse(i.value)}catch{}a=tA(n.children.filter(e=>e.type===`mdxjsEsm`),{...o!=null&&{yamlFrontMatter:o},scope:r,...t?.filePath!=null&&{filePath:t.filePath},sourceText:e}),n.children=n.children.filter(e=>e.type!==`yaml`&&e.type!==`mdxjsEsm`)}let o=await oM(n,{scope:r,components:i,processingStack:[],...t?.basePath!=null&&{basePath:t.basePath},...t?.filePath!=null&&{filePath:t.filePath},sourceText:e}),s=tO().use(E_,[`yaml`]).use(VS).use(Fj,{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 pM=/^\s*(```|~~~)/u,mM=/\r?\n/u,hM=[/^\s*export\s+default\b/u,/^\s*export\s+const\b/u,/^\s*import\b/u];let gM=null;function _M(e){return typeof e!=`object`||!e?!1:typeof e.compileMdxToMd==`function`}function vM(e,t){let n=`@truenine/memory-sync-cli-${t}`;try{let t=e(n).mdCompiler;if(_M(t))return t}catch{}try{let t=l(e.resolve(`${n}/package.json`)),i=r(t).filter(e=>e.startsWith(`napi-md-compiler.`)&&e.endsWith(`.node`)).sort();for(let n of i){let r=e(u(t,n));if(_M(r))return r}}catch{return null}return null}function yM(e,t){let n=[`./${t}.node`,`../dist/${t}.node`];for(let t of n)try{let n=e(t);if(_M(n))return n}catch{}return null}try{if(!Ak()){let t=e(import.meta.url),{platform:n,arch:r}=a,i={"win32-x64":[`napi-md-compiler.win32-x64-msvc`,`win32-x64-msvc`],"linux-x64":[`napi-md-compiler.linux-x64-gnu`,`linux-x64-gnu`],"linux-arm64":[`napi-md-compiler.linux-arm64-gnu`,`linux-arm64-gnu`],"darwin-arm64":[`napi-md-compiler.darwin-arm64`,`darwin-arm64`],"darwin-x64":[`napi-md-compiler.darwin-x64`,`darwin-x64`]}[`${n}-${r}`];if(i!=null){let[e,n]=i;gM=yM(t,e)??vM(t,n)}}}catch{}async function bM(e,t){let n=t?.extractMetadata===!0?{...t,extractMetadata:!0}:null,r=xM(e,t);if(r!=null){if(n!=null){let{metadata:t}=r;return t==null||CM(r.content)?fM(e,n):{content:r.content,metadata:t}}return r.content}return n==null?t==null?fM(e):fM(e,{...t,extractMetadata:!1}):fM(e,n)}function xM(e,t){if(gM==null)return null;try{let n=gM.compileMdxToMd(e,SM(t)),r=JSON.parse(n);return t?.extractMetadata===!0&&r.metadata==null?null:r}catch{return null}}function SM(e){if(e==null)return null;let t={...e,...e.globalScope==null?{}:{globalScope:{os:e.globalScope.os,env:e.globalScope.env,profile:e.globalScope.profile,tool:e.globalScope.tool}}};return JSON.stringify(t)}function CM(e){let t;for(let n of e.split(mM)){let e=pM.exec(n);if(e?.[1]!=null){let n=e[1];t==null?t=n:t===n&&(t=void 0);continue}if(t==null&&hM.some(e=>e.test(n)))return!0}return!1}const wM=/^[\w-]+$/u,TM=/\r\n?/gu;function EM(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof Date)}function DM(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`||e instanceof Date}function OM(e){return e.length>0&&e.every(e=>EM(e))}function kM(e){if(e==null)return;if(e instanceof Date)return e.toISOString();if(typeof e==`bigint`)return e.toString();if(Array.isArray(e))return e.map(e=>kM(e)).filter(e=>e!==void 0);if(!EM(e))return e;let t={};for(let[n,r]of Object.entries(e)){let e=kM(r);e!==void 0&&(t[n]=e)}return t}function AM(e){return wM.test(e)}function jM(e){return AM(e)?e:JSON.stringify(e)}function MM(e){return e.map(e=>jM(e)).join(`.`)}function NM(e){let t=e.replaceAll(TM,`
385
384
  `),n=``;for(let e of t)switch(e){case`\\`:n+=`\\\\`;break;case`"`:n+=`\\"`;break;case`\b`:n+=`\\b`;break;case` `:n+=`\\t`;break;case`\f`:n+=`\\f`;break;case`
386
385
  `:n+=`
387
- `;break;default:{let t=e.codePointAt(0);if(t!=null&&t<32){n+=`\\u${t.toString(16).padStart(4,`0`)}`;break}n+=e}}return`"""\n${n}"""`}function FN(e){if(typeof e==`string`)return e.includes(`
388
- `)||e.includes(`\r`)?PN(e):JSON.stringify(e);if(typeof e==`number`){if(!Number.isFinite(e))throw TypeError(`Unsupported TOML number value: ${e}`);return String(e)}return typeof e==`boolean`?e?`true`:`false`:typeof e==`bigint`?e.toString():JSON.stringify(e.toISOString())}function IN(e){if(e==null)throw TypeError(`TOML inline value cannot be null or undefined`);if(ON(e))return FN(e);if(Array.isArray(e)){if(kN(e))throw TypeError(`TOML inline arrays of tables are not supported`);let t=[],n=e;for(let e of n)t.push(IN(e));return`[${t.join(`, `)}]`}let t=[];for(let[n,r]of Object.entries(e))t.push(`${MN(n)} = ${IN(r)}`);return`{ ${t.join(`, `)} }`}function LN(e,t){if(t==null||t.length===0)return[...e];let n=new Map;for(let[e,r]of t.entries())n.set(r,e);return[...e].sort(([e],[t])=>{let r=n.get(e),i=n.get(t);return r!=null&&i!=null?r-i:r==null?i==null?e.localeCompare(t):1:-1})}function RN(e,t){let n=LN(Object.entries(e),t),r=[],i=[],a=[];for(let[e,t]of n)if(t!=null){if(Array.isArray(t)){if(kN(t)){a.push([e,t]);continue}r.push([e,t]);continue}if(DN(t)){i.push([e,t]);continue}r.push([e,t])}return{scalarEntries:r,tableEntries:i,arrayTableEntries:a}}function zN(e,t,n,r=!0){let i=[],{scalarEntries:a,tableEntries:o,arrayTableEntries:s}=RN(t,n?.fieldOrder);r&&e.length>0&&i.push(`[${NN(e)}]`);for(let[e,t]of a)i.push(`${MN(e)} = ${IN(t)}`);for(let[t,r]of o)i.length>0&&i.push(``),i.push(...zN([...e,t],r,n));for(let[t,r]of s)for(let a of r){i.length>0&&i.push(``),i.push(`[[${NN([...e,t])}]]`);let r=zN([...e,t],a,n,!1);i.push(...r)}return i}function BN(e,t){let n=AN(e);if(!DN(n))throw TypeError(`TOML document root must be an object`);return zN([],n,t).join(`
389
- `)}function VN(e){let{content:t,bodyFieldName:n,frontMatter:r,fieldNameMap:i,excludedKeys:a,extraFields:o,fieldOrder:s}=e,c=new Set(a??[]),l={};for(let[e,t]of Object.entries(r??{})){if(c.has(e))continue;let n=i?.[e]??e;l[n]=t}if(o!=null)for(let[e,t]of Object.entries(o))l[e]=t;return l[n]=t,BN(l,{...s!=null&&{fieldOrder:s}})}var HN=class{type;name;_log;get log(){return this._log??=om(this.name),this._log}dependsOn;constructor(e,t,n){this.name=e,this.type=t,n!=null&&(this.dependsOn=n)}};function UN(){return a.env.TNMSC_FORCE_NATIVE_BINDING===`1`?!1:a.env.TNMSC_DISABLE_NATIVE_BINDING===`1`?!0:a.env.NODE_ENV===`test`||a.env.VITEST!=null||a.env.VITEST_WORKER_ID!=null}function WN(){let t=globalThis.__TNMSC_TEST_NATIVE_BINDING__;if(typeof t==`object`&&t)return t;if(UN())return;let n={"win32-x64":`win32-x64-msvc`,"linux-x64":`linux-x64-gnu`,"linux-arm64":`linux-arm64-gnu`,"darwin-arm64":`darwin-arm64`,"darwin-x64":`darwin-x64`}[`${a.platform}-${a.arch}`];if(n!=null)try{let t=e(import.meta.url),r=`@truenine/memory-sync-cli-${n}`,i=`napi-memory-sync-cli.${n}.node`,a=[`${r}/${i}`,`./${i}`,`../npm/${n}/${i}`,`../../npm/${n}/${i}`,r,`../npm/${n}`,`../../npm/${n}`];for(let e of a)try{let n=t(e),r=[n?.config,n?.default?.config,n?.default,n];for(let e of r)if(typeof e==`object`&&e)return e}catch{}}catch{}}function GN(){return WN()}let KN;function qN(){if(KN!=null)return KN;let e=GN();if(e==null)throw TypeError(`Native series-filter binding is required. Build or install the Rust NAPI package before running tnmsc.`);if(typeof e.matchesSeries!=`function`||typeof e.resolveEffectiveIncludeSeries!=`function`||typeof e.resolveSubSeries!=`function`)throw TypeError(`Native series-filter binding is incomplete. Rebuild the Rust NAPI package before running tnmsc.`);return KN=e,e}function JN(e,t){return qN().resolveEffectiveIncludeSeries(e,t)}function YN(e,t){return qN().matchesSeries(e,t)}function XN(e,t){return qN().resolveSubSeries(e,t)}function $(e,t,n){let r=JN(t?.includeSeries,t?.[n]?.includeSeries);return e.filter(e=>YN(e.seriName,r))}function ZN(e){let t=e.replaceAll(/\.\/+/g,``);return t=t.replaceAll(/\/+$/g,``),t}function QN(e,t){return t.startsWith(`**/`)?`${e}/${t}`:t.startsWith(`*`)?`${e}/**/${t}`:`${e}/${t}`}function $N(e,t){for(let n of t){let t=n.replaceAll(/\/+$/g,``),r=[{prefix:t,pattern:`${t}/`},{prefix:t,pattern:`${t}\\`}];for(let{prefix:t,pattern:n}of r)if(e.startsWith(n))return{prefix:t,baseGlob:e.slice(n.length)};if(e===t)return{prefix:t,baseGlob:`**/*`}}return{prefix:null,baseGlob:e}}function eP(e,t){let n=XN(t?.subSeries,t?.rules?.subSeries);if(Object.keys(n).length===0)return e;let r={};for(let[e,t]of Object.entries(n)){let n=ZN(e);r[n]=t}let i=Object.keys(r);return e.map(e=>{if(e.seriName==null)return e;let t=[];for(let[n,i]of Object.entries(r))(Array.isArray(e.seriName)?e.seriName.some(e=>i.includes(e)):i.includes(e.seriName))&&t.push(n);if(t.length===0)return e;let n=[];for(let r of e.globs){let{prefix:e,baseGlob:a}=$N(r,i);e!=null&&n.push(r);for(let r of t){if(r===e)continue;let t=QN(r,a);n.includes(t)||n.push(t)}}return{...e,globs:n}})}function tP(e){let n=s.join(e,`.git`);if(!t.existsSync(n))return null;let r=t.lstatSync(n);if(r.isDirectory())return s.join(n,`info`);if(r.isFile())try{let r=t.readFileSync(n,`utf8`).trim(),i=/^gitdir: (.+)$/.exec(r);if(i?.[1]!=null){let t=s.resolve(e,i[1]);return s.join(t,`info`)}}catch{}return null}function nP(e,n=5){let r=[],i=new Set([`node_modules`,`.turbo`,`dist`,`build`,`out`,`.cache`]);function a(o,c){if(c>n)return;let l;try{let e=t.readdirSync(o,{withFileTypes:!0});if(!Array.isArray(e))return;l=e}catch{return}l.some(e=>e.name===`.git`)&&o!==e&&r.push(o);for(let e of l)e.isDirectory()&&(e.name===`.git`||i.has(e.name)||a(s.join(o,e.name),c+1))}return a(e,0),r}function rP(e){let n=s.join(e,`modules`);if(!t.existsSync(n))return[];let r=[];function i(e){let n;try{let r=t.readdirSync(e,{withFileTypes:!0});if(!Array.isArray(r))return;n=r}catch{return}if(n.some(e=>e.name===`info`&&e.isDirectory())&&r.push(s.join(e,`info`)),n.find(e=>e.name===`modules`&&e.isDirectory())==null)return;let a;try{let n=t.readdirSync(s.join(e,`modules`),{withFileTypes:!0});if(!Array.isArray(n))return;a=n}catch{return}for(let t of a)t.isDirectory()&&i(s.join(e,`modules`,t.name))}let a;try{let e=t.readdirSync(n,{withFileTypes:!0});if(!Array.isArray(e))return r;a=e}catch{return r}for(let e of a)e.isDirectory()&&i(s.join(n,e.name));return r}var iP=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(),Md:this.createMdComponent()}}collectOsInfo(){let e=p.platform();return{platform:e,arch:p.arch(),hostname:p.hostname(),homedir:e_(),tmpdir:p.tmpdir(),type:p.type(),release:p.release(),shellKind:this.detectShellKind(),kind:this.detectOsKind(e)}}detectOsKind(e){switch(e){case`win32`:return rp.Win;case`darwin`:return rp.Mac;case`linux`:case`freebsd`:case`openbsd`:case`sunos`:case`aix`:return rp.Linux;default:return rp.Unknown}}detectShellKind(){let e=(a.env.SHELL??a.env.ComSpec??``).toLowerCase();return e.includes(`bash`)?np.Bash:e.includes(`zsh`)?np.Zsh:e.includes(`fish`)?np.Fish:e.includes(`pwsh`)?np.Pwsh:e.includes(`powershell`)?np.PowerShell:e.includes(`cmd`)?np.Cmd:e.endsWith(`/sh`)?np.Sh:np.Unknown}collectEnvContext(){return{...a.env}}collectProfile(){return this.userConfig?.profile==null?{}:this.userConfig.profile}collectToolReferences(){let e={...tp.default};return this.toolPreset===`claudeCode`?{...e,...tp.claudeCode}:this.toolPreset===`kiro`?{...e,...tp.kiro}:e}createMdComponent(){let e=(e=>e.when===!1?null:e.children);return e.Line=e=>e.when===!1?null:e.children,e}};let aP=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 oP=class{registrations=[];globalScope=null;setGlobalScope(e){this.globalScope=e}getGlobalScope(){return this.globalScope}register(e,t,n=aP.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))t[n]=typeof r==`object`&&r&&!Array.isArray(r)?this.deepMerge(t[n],r):r;return t}deepMerge(e,t){if(e==null)return{...t};let n={...e};for(let[e,r]of Object.entries(t))n[e]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof n[e]==`object`&&n[e]!==null&&!Array.isArray(n[e])?this.deepMerge(n[e],r):r;return n}resolve(e){let t=this.merge();return e.replaceAll(/\$\{([^}]+)\}/g,(e,n)=>{let r=n.split(`.`),i=t;for(let e of r)i=i?.[e];return i==null?`\${${n}}`:String(i)})}clear(){this.registrations.length=0,this.globalScope=null}};const sP=new Map,cP=new Map,lP=/^export\s+default\s*/u;function uP(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(uP);let t=Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,uP(t)]);return Object.fromEntries(t)}function dP(e){return JSON.stringify(uP(e))}function fP(e,t,n){return[s.resolve(e),t,n.mode,dP(n.globalScope??{})].join(`::`)}function pP(e){return[s.resolve(e.filePath),e.cacheMtimeMs??e.rawMdx.length,dP(e.globalScope??{}),dP(e.rawMdx)].join(`::`)}function mP(e){return e.replace(/^\s*;?\s*/u,``).trim()}function hP(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function gP(e,t){if(e[t]!==`{`)return null;let n=0,r,i=!1,a=!1,o=!1;for(let s=t;s<e.length;s++){let c=e[s],l=e[s+1];if(c==null)break;if(a){c===`
390
- `&&(a=!1);continue}if(o){c===`*`&&l===`/`&&(o=!1,s++);continue}if(i){i=!1;continue}if(r!=null){if(c===`\\`){i=!0;continue}c===r&&(r=void 0);continue}if(c===`"`||c===`'`||c==="`"){r=c;continue}if(c===`/`&&l===`/`){a=!0,s++;continue}if(c===`/`&&l===`*`){o=!0,s++;continue}if(c===`{`){n++;continue}if(c===`}`&&(n--,n===0))return{value:e.slice(t,s+1),endIndex:s+1}}return null}function _P(e){let t=e.trimStart(),n=lP.exec(t);if(n==null)return null;let r=n[0].length,i=gP(t,r);if(i==null)return null;let a;try{a=h.parse(i.value)}catch{return null}return hP(a)?{content:mP(t.slice(i.endIndex)),metadata:a}:null}async function vP(e,n){let r=n.rawMdx??t.readFileSync(e,`utf8`),i=n.lastModified??t.statSync(e).mtime,a=$f(r);if(n.mode===`dist`){let e=_P(r);if(e!=null)return{rawMdx:r,parsed:a,content:e.content,metadata:e.metadata,lastModified:i}}let o=await xN(r,{globalScope:n.globalScope,extractMetadata:!0,basePath:s.dirname(e),filePath:e});return{rawMdx:r,parsed:a,content:o.content,metadata:o.metadata.fields,lastModified:i}}async function yP(e,n){let r=n.lastModified??t.statSync(e).mtime,i=r.getTime(),a=fP(e,i,n),o=sP.get(a);if(o!=null)return(await o).artifact;let s=vP(e,{...n,lastModified:r}).then(e=>({artifact:e,stamp:i}));sP.set(a,s);try{return(await s).artifact}catch(e){throw sP.delete(a),e}}async function bP(e){let t=pP(e),n=cP.get(t);if(n!=null)return n;let r=xN(e.rawMdx,{globalScope:e.globalScope,extractMetadata:!0,basePath:s.dirname(e.filePath),filePath:e.filePath}).then(e=>({content:e.content,metadata:e.metadata.fields}));cP.set(t,r);try{return await r}catch(e){throw cP.delete(t),e}}function xP(){sP.clear(),cP.clear()}function SP(e){return e.replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/gu,``)}function CP(e){let t=SP(e);return t.length===0?``:t.split(`/`).filter(e=>e.length>0).join(`-`)}function wP(e){let t=SP(e),n=t.split(`/`).filter(e=>e.length>0),r=n.at(-1)??t,i=n.slice(0,-1),a=CP(t),o=i.length>0?i.join(`-`):void 0;return{...o!=null&&{agentPrefix:o},agentName:r,canonicalName:a.length>0?a:r}}function TP(e){return e.skillName.trim().length>0?e.skillName:e.dir.getDirectoryName()}function EP(e){return e.canonicalName.trim().length>0?e.canonicalName:CP(e.agentPrefix!=null&&e.agentPrefix.length>0?`${e.agentPrefix}-${e.agentName}`:e.agentName)}const DP=[`project`,`global`];function OP(e){if(e==null)return[];if(typeof e==`string`)return[e];let t=[];for(let n of e)t.includes(n)||t.push(n);return t}function kP(e,t){let n=new Map;for(let[e,r]of t.entries())n.set(r,e);return[...e].sort((e,t)=>(n.get(e)??2**53-1)-(n.get(t)??2**53-1))}function AP(e){let{requestedScopes:t,defaultScopes:n,supportedScopes:r,singleScope:i,availableScopes:a,priority:o=DP}=e,s=OP(t),c=OP(n),l=new Set(OP(r)),u=(s.length>0?s:c).filter(e=>l.has(e));if(u.length===0)return[];let d=kP(u,o);if(!i)return d;if(a!=null&&a.length>0){let e=new Set(a),t=d.find(t=>e.has(t));return t==null?[]:[t]}let[f]=d;return f==null?[]:[f]}const jP=g.object({src:g.string(),dist:g.string()}),MP=Object.fromEntries(Uh.map(e=>[e,e===`softwares`?jP.default(Gh[e]):jP])),NP=g.object({dir:g.string().default(zh),...MP}),PP=g.object({includeSeriesPrefix:g.boolean().optional(),seriesSeparator:g.string().optional()}),FP=g.object({includeSeriesPrefix:g.boolean().optional(),pluginOverrides:g.record(g.string(),PP).optional()}),IP=g.enum([`project`,`global`]),LP=g.union([IP,g.array(IP).min(1)]),RP=g.object({prompt:LP.optional(),rules:LP.optional(),commands:LP.optional(),subagents:LP.optional(),skills:LP.optional(),mcp:LP.optional()}),zP=g.object({plugins:g.record(g.string(),RP).optional()}),BP=g.object({blankLineAfter:g.boolean().optional()}),VP=g.enum([`direct`,`recursive`]),HP=g.enum([`path`,`glob`]),UP=g.object({path:g.string(),protectionMode:VP,matcher:HP.optional(),reason:g.string().optional()}),WP=g.object({rules:g.array(UP).optional()}),GP=g.union([g.string(),g.array(g.string()).min(1)]),KP=g.object({instances:GP.optional()}),qP=g.object({wsl2:KP.optional()}),JP=g.object({name:g.string().optional(),username:g.string().optional(),gender:g.string().optional(),birthday:g.string().optional()}).catchall(g.unknown()),YP=g.object({version:g.string().optional(),workspaceDir:g.string().optional(),aindex:NP.optional(),logLevel:g.enum([`trace`,`debug`,`info`,`warn`,`error`]).optional(),commandSeriesOptions:FP.optional(),outputScopes:zP.optional(),frontMatter:BP.optional(),cleanupProtection:WP.optional(),windows:qP.optional(),profile:JP.optional()}),XP=g.object({names:g.array(g.string()).optional()}),ZP=g.object({includeSeries:g.array(g.string()).optional(),subSeries:g.record(g.string(),g.array(g.string())).optional()}),QP=g.object({mcp:XP.optional(),includeSeries:g.array(g.string()).optional(),subSeries:g.record(g.string(),g.array(g.string())).optional(),rules:ZP.optional(),skills:ZP.optional(),subAgents:ZP.optional(),commands:ZP.optional()}),$P=g.object({});function eF(e,t){let n=t==null?``:` in ${t}`;return e==null||e===`project`||e===`global`?{valid:!0,errors:[],warnings:[]}:{valid:!1,errors:[`Field "scope" must be "project" or "global"${n}`],warnings:[]}}function tF(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 nF(e,t){let n=t==null?``:` in ${t}`,r=[],i=[];!(`description`in e)||e.description==null?r.push(`Missing required field "description"${n}`):(typeof e.description!=`string`||e.description.trim().length===0)&&r.push(`Required field "description" cannot be empty${n}`),e.enabled??i.push(`Using default value for optional field "enabled": true${n}`),e.keywords??i.push(`Using default value for optional field "keywords": []${n}`);let a=eF(e.scope,t);return r.push(...a.errors),{valid:r.length===0,errors:r,warnings:i}}function rF(e,t){let n=tF(e,{requiredFields:[],optionalDefaults:{},filePath:t}),r=eF(e.scope,t);return{valid:n.valid&&r.valid,errors:[...n.errors,...r.errors],warnings:n.warnings}}function iF(e,t){let n=tF(e,{requiredFields:[`description`],optionalDefaults:{},filePath:t}),r=eF(e.scope,t);return{valid:n.valid&&r.valid,errors:[...n.errors,...r.errors],warnings:n.warnings}}function aF(e,t){let n=[],r=[],i=t==null?``:` in ${t}`;!Array.isArray(e.globs)||e.globs.length===0?n.push(`Missing or empty required field "globs"${i}`):e.globs.every(e=>typeof e==`string`)||n.push(`Field "globs" must be an array of strings${i}`),(typeof e.description!=`string`||e.description.length===0)&&n.push(`Missing or empty required field "description"${i}`);let{scope:a,seriName:o}=e,s=eF(a,t);return n.push(...s.errors),a??r.push(`Using default value for optional field "scope": "project"${i}`),o!=null&&typeof o!=`string`&&!Array.isArray(o)&&n.push(`Field "seriName" must be a string or string array${i}`),{valid:n.length===0,errors:n,warnings:r}}function oF(e,t){let n={...e};for(let[e,r]of Object.entries(t))(!(e in n)||n[e]==null)&&(n[e]=r);return n}function sF(e){return{workspace:{directory:e.workspace.directory,projects:[...e.workspace.projects]},...e.skills!=null&&{skills:[...e.skills]},...e.commands!=null&&{commands:[...e.commands]},...e.subAgents!=null&&{subAgents:[...e.subAgents]},...e.rules!=null&&{rules:[...e.rules]},...e.readmePrompts!=null&&{readmePrompts:[...e.readmePrompts]},...e.globalMemory!=null&&{globalMemory:e.globalMemory},...e.vscodeConfigFiles!=null&&{vscodeConfigFiles:[...e.vscodeConfigFiles]},...e.zedConfigFiles!=null&&{zedConfigFiles:[...e.zedConfigFiles]},...e.jetbrainsConfigFiles!=null&&{jetbrainsConfigFiles:[...e.jetbrainsConfigFiles]},...e.editorConfigFiles!=null&&{editorConfigFiles:[...e.editorConfigFiles]},...e.aiAgentIgnoreConfigFiles!=null&&{aiAgentIgnoreConfigFiles:[...e.aiAgentIgnoreConfigFiles]},...e.globalGitIgnore!=null&&{globalGitIgnore:e.globalGitIgnore},...e.shadowGitExclude!=null&&{shadowGitExclude:e.shadowGitExclude},...e.aindexDir!=null&&{aindexDir:e.aindexDir}}}const cF={Readme:{src:`rdm.mdx`,out:`README.md`},CodeOfConduct:{src:`coc.mdx`,out:`CODE_OF_CONDUCT.md`},Security:{src:`security.mdx`,out:`SECURITY.md`}},lF=[`prompt`,`rules`,`commands`,`subagents`,`skills`,`mcp`];function uF(e){return m.isBuffer(e)}function dF(e){if(typeof e==`string`)return[e];let t=[];for(let n of e)t.includes(n)||t.push(n);return t}function fF(e,t){return t?.outputScopes?.plugins?.[e]}function pF(e){for(let t of lF){let n=e.outputCapabilities[t];if(n!=null&&n.scopes.length===0)throw Error(`Plugin ${e.name} declares empty scopes for topic "${t}"`)}}function mF(e,t){let n=fF(e.name,t);if(n!=null)for(let t of lF){let r=n[t];if(r==null)continue;let i=e.outputCapabilities[t];if(i==null)throw Error(`Invalid outputScopes configuration: outputScopes.plugins.${e.name}.${t} is set, but plugin ${e.name} does not support topic "${t}".`);let a=dF(r);if(i.singleScope&&a.length>1){let n=a.join(`, `);throw Error(`Invalid outputScopes configuration: outputScopes.plugins.${e.name}.${t} is single-scope and cannot request multiple scopes [${n}].`)}let o=new Set(i.scopes),s=a.filter(e=>!o.has(e));if(s.length>0){let n=i.scopes.join(`, `),r=s.join(`, `);throw Error(`Invalid outputScopes configuration: outputScopes.plugins.${e.name}.${t} requests unsupported scopes [${r}]. Allowed scopes: [${n}].`)}}}function hF(e,t){for(let n of e)pF(n),mF(n,t)}async function gF(e,t){hF(e,t.pluginOptions);let n=await Promise.all(e.map(async e=>[e,await e.declareOutputFiles(t)]));return new Map(n)}async function _F(e,n,r){let i=new Map,a=r??await gF(e,n);for(let r of e){let e=a.get(r)??[],o=[];for(let i of e){if(n.dryRun===!0){o.push({path:i.path,success:!0,skipped:!1});continue}try{let e=s.dirname(i.path);if(t.mkdirSync(e,{recursive:!0}),i.ifExists===`skip`&&t.existsSync(i.path)){o.push({path:i.path,success:!0,skipped:!0});continue}if(i.ifExists===`error`&&t.existsSync(i.path))throw Error(`Refusing to overwrite existing file: ${i.path}`);let a=await r.convertContent(i,n);uF(a)?t.writeFileSync(i.path,a):t.writeFileSync(i.path,a,`utf8`),o.push({path:i.path,success:!0})}catch(e){o.push({path:i.path,success:!1,error:e})}}let c={files:o,dirs:[]};i.set(r.name,c)}return i}async function vF(e,t,n){let r=[],i=[],a=[],o=[],s=n==null?Array.from(await gF(e,{...t,dryRun:!0}),([,e])=>e):[...n.values()];for(let e of s)for(let t of e)t.scope===`global`?o.push(t.path):i.push(t.path);return{projectDirs:r,projectFiles:i,globalDirs:a,globalFiles:o}}var yF=class extends Error{nodeName;missingDependency;constructor(e,t){super(`Node "${e}" depends on missing dependency "${t}"`),this.name=`MissingDependencyError`,this.nodeName=e,this.missingDependency=t}},bF=class extends Error{cyclePath;constructor(e){super(`Circular dependency detected: ${e.join(` -> `)}`),this.name=`CircularDependencyError`,this.cyclePath=[...e]}},xF=class extends HN{declarativeOutput=!0;outputCapabilities;globalConfigDir;outputFileName;treatWorkspaceRootProjectAsProject;indexignore;commandsConfig;subAgentsConfig;commandOutputEnabled;subAgentOutputEnabled;skillsConfig;skillOutputEnabled;toolPreset;rulesConfig;ruleOutputEnabled;cleanupConfig;wslMirrorPaths;supportsBlankLineAfterFrontMatter;registryWriterCache=new Map;warnedDeprecatedSubAgentFileNameSource=!1;constructor(e,t){super(e,tg.Output,t?.dependsOn),this.globalConfigDir=t?.globalConfigDir??``,this.outputFileName=t?.outputFileName??``,this.treatWorkspaceRootProjectAsProject=t?.treatWorkspaceRootProjectAsProject??!1,this.indexignore=t?.indexignore,this.commandOutputEnabled=t?.commands!=null,this.commandsConfig=this.createCommandsConfig(t?.commands),this.subAgentOutputEnabled=t?.subagents!=null,this.subAgentsConfig=this.createSubAgentsConfig(t?.subagents),this.skillOutputEnabled=t?.skills!=null,this.skillsConfig=this.createSkillsConfig(t?.skills),this.toolPreset=t?.toolPreset,this.ruleOutputEnabled=t?.rules!=null,this.rulesConfig={...t?.rules,sourceScopes:t?.rules?.sourceScopes??[`project`,`global`]},this.cleanupConfig=t?.cleanup??{},this.wslMirrorPaths=t?.wslMirrors??[],this.supportsBlankLineAfterFrontMatter=t?.supportsBlankLineAfterFrontMatter??!0,this.outputCapabilities=t?.capabilities==null?this.buildInferredCapabilities():this.normalizeCapabilities(t.capabilities)}createCommandsConfig(e){return{subDir:e?.subDir??`commands`,sourceScopes:e?.sourceScopes??[`project`,`global`],...e?.scopeRemap!=null&&{scopeRemap:e.scopeRemap},...e?.transformFrontMatter!=null&&{transformFrontMatter:e.transformFrontMatter}}}createSubAgentsConfig(e){return{subDir:e?.subDir??`agents`,sourceScopes:e?.sourceScopes??[`project`,`global`],includePrefix:e?.includePrefix??!0,linkSymbol:e?.linkSymbol??`-`,ext:e?.ext??`.md`,artifactFormat:e?.artifactFormat??`markdown`,fileNameSource:e?.fileNameSource??`derivedPath`,...e?.bodyFieldName!=null&&{bodyFieldName:e.bodyFieldName},...e?.fieldNameMap!=null&&{fieldNameMap:e.fieldNameMap},...e?.excludedFrontMatterFields!=null&&{excludedFrontMatterFields:e.excludedFrontMatterFields},...e?.extraFields!=null&&{extraFields:e.extraFields},...e?.fieldOrder!=null&&{fieldOrder:e.fieldOrder},...e?.scopeRemap!=null&&{scopeRemap:e.scopeRemap},...e?.transformFrontMatter!=null&&{transformFrontMatter:e.transformFrontMatter}}}createSkillsConfig(e){return{subDir:e?.subDir??`skills`,sourceScopes:e?.sourceScopes??[`project`,`global`],...e?.scopeRemap!=null&&{scopeRemap:e.scopeRemap}}}buildInferredCapabilities(){let e={};return this.outputFileName.length>0&&(e.prompt={scopes:[`project`,`global`],singleScope:!1}),this.ruleOutputEnabled&&(e.rules={scopes:this.rulesConfig.sourceScopes??[`project`,`global`],singleScope:!1}),this.commandOutputEnabled&&(e.commands={scopes:this.commandsConfig.sourceScopes,singleScope:!0}),this.subAgentOutputEnabled&&(e.subagents={scopes:this.subAgentsConfig.sourceScopes,singleScope:!0}),this.skillOutputEnabled&&(e.skills={scopes:this.skillsConfig.sourceScopes,singleScope:!0}),e}normalizeCapabilities(e){let t={};for(let n of lF){let r=e[n];if(r==null)continue;let i=this.normalizeCapability(r);i!=null&&(t[n]=i)}return t}normalizeCapability(e){let t=[];for(let n of e.scopes)t.includes(n)||t.push(n);if(t.length!==0)return{scopes:t,singleScope:e.singleScope}}resolvePromptSourceProjectConfig(e){let t=this.getConcreteProjects(e);return t.find(e=>e.isPromptSourceProject===!0)?.projectConfig??t[0]?.projectConfig}getConcreteProjects(e){return e.collectedOutputContext.workspace.projects.filter(e=>e.isWorkspaceRootProject!==!0)}isProjectPromptOutputTarget(e){return e.isPromptSourceProject!==!0}getProjectOutputProjects(e){let t=[...this.getConcreteProjects(e)];if(!this.treatWorkspaceRootProjectAsProject)return t;let n=this.getWorkspaceRootProject(e);return n!=null&&t.push(n),t}getProjectPromptOutputProjects(e){return this.getProjectOutputProjects(e).filter(e=>this.isProjectPromptOutputTarget(e))}getWorkspaceRootProject(e){return e.collectedOutputContext.workspace.projects.find(e=>e.isWorkspaceRootProject===!0)}resolveProjectRootDir(e,t){if(t.isWorkspaceRootProject===!0)return this.resolveDirectoryPath(e.collectedOutputContext.workspace.directory);let n=t.dirFromWorkspacePath;if(n!=null)return this.resolveDirectoryPath(n)}resolveProjectConfigDir(e,t){let n=this.resolveProjectRootDir(e,t);if(n!=null)return this.globalConfigDir.length===0?n:s.join(n,this.globalConfigDir)}isRelativePath(e){return e.pathKind===rg.Relative}toRelativePath(e){return e.path}resolveFullPath(e,t){let n=this.resolveDirectoryPath(e),r=t??this.outputFileName;return r?s.join(n,r):n}resolveDirectoryPath(e){return e.pathKind===rg.Absolute?e.path:`basePath`in e?s.resolve(e.basePath,e.path):s.resolve(a.cwd(),e.path)}getWorkspaceConfigDir(e){let t=this.resolveDirectoryPath(e.collectedOutputContext.workspace.directory);return s.join(t,this.globalConfigDir)}createRelativePath(e,t,n){return s.join(t,e)}createFileRelativePath(e,t){return s.join(e,t)}getGlobalConfigDir(){return s.join(this.getHomeDir(),this.globalConfigDir)}getXdgConfigHomeDir(){let e=a.env.XDG_CONFIG_HOME;return typeof e==`string`&&e.trim().length>0?e:s.join(this.getHomeDir(),`.config`)}getHomeDir(){return e_()}joinPath(...e){return s.join(...e)}resolvePath(...e){return s.resolve(...e)}dirname(e){return s.dirname(e)}buildProjectPromptCleanupTargets(e,t=this.outputFileName){if(t.length===0)return[];let n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({path:e,kind:`file`,scope:`project`,label:t}))};for(let r of this.getProjectOutputProjects(e)){let a=this.resolveProjectRootDir(e,r);if(a!=null&&(n.push({path:this.resolvePath(a,`**`,t),kind:`glob`,scope:`project`,label:`delete.project.glob`}),i(this.resolvePath(a,t),`delete.project`),r.childMemoryPrompts!=null))for(let e of r.childMemoryPrompts)i(this.resolveFullPath(e.dir,t),`delete.project.child`)}return n}basename(e,t){return s.basename(e,t)}getIgnoreOutputPath(){if(this.indexignore!=null)return this.indexignore}resolveCleanupScopeBasePaths(e,t){if(e===`global`)return[this.getHomeDir()];if(e===`xdgConfig`)return[this.getXdgConfigHomeDir()];let n=[];for(let e of this.getProjectOutputProjects(t)){let r=this.resolveProjectRootDir(t,e);r!=null&&n.push(r)}return n}resolveCleanupDeclaredPath(e,t){return s.isAbsolute(t)?s.resolve(t):t===`~`?this.getHomeDir():t.startsWith(`~/`)||t.startsWith(`~\\`)?s.resolve(this.getHomeDir(),t.slice(2)):s.resolve(e,t)}normalizeGlobPattern(e){return e.replaceAll(`\\`,`/`)}buildCleanupTargetsFromScopeConfig(e,t,n){if(e==null)return[];let r=[],i=[`project`,`global`,`xdgConfig`],a=(e,i,a)=>{if(a==null||a.length===0)return;let o=this.resolveCleanupScopeBasePaths(e,n);for(let n of a)for(let a of o){let o=s.isAbsolute(n)?s.resolve(n):this.resolveCleanupDeclaredPath(a,n);r.push({path:i===`glob`?this.normalizeGlobPattern(o):o,kind:i,scope:e,label:`${t}.${e}`})}};for(let t of i){let n=e[t];n!=null&&(a(t,`file`,n.files),a(t,`directory`,n.dirs),a(t,`glob`,n.globs))}return r}resolveFrontMatterBlankLineAfter(e){return this.supportsBlankLineAfterFrontMatter?e?.pluginOptions?.frontMatter?.blankLineAfter??!0:!0}buildMarkdownContent(e,t,n){return Yf(t,e,{blankLineAfter:this.resolveFrontMatterBlankLineAfter(n)})}buildMarkdownContentWithRaw(e,t,n,r){return t!=null&&Object.keys(t).length>0?this.buildMarkdownContent(e,t,r):n!=null&&n.length>0?Zf(n,e,{blankLineAfter:this.resolveFrontMatterBlankLineAfter(r)}):e}buildTomlContent(e){return VN(e)}extractGlobalMemoryContent(e){return e.collectedOutputContext.globalMemory?.content}combineGlobalWithContent(e,t,n){let{separator:r=`
386
+ `;break;default:{let t=e.codePointAt(0);if(t!=null&&t<32){n+=`\\u${t.toString(16).padStart(4,`0`)}`;break}n+=e}}return`"""\n${n}"""`}function PM(e){if(typeof e==`string`)return e.includes(`
387
+ `)||e.includes(`\r`)?NM(e):JSON.stringify(e);if(typeof e==`number`){if(!Number.isFinite(e))throw TypeError(`Unsupported TOML number value: ${e}`);return String(e)}return typeof e==`boolean`?e?`true`:`false`:typeof e==`bigint`?e.toString():JSON.stringify(e.toISOString())}function FM(e){if(e==null)throw TypeError(`TOML inline value cannot be null or undefined`);if(DM(e))return PM(e);if(Array.isArray(e)){if(OM(e))throw TypeError(`TOML inline arrays of tables are not supported`);let t=[],n=e;for(let e of n)t.push(FM(e));return`[${t.join(`, `)}]`}let t=[];for(let[n,r]of Object.entries(e))t.push(`${jM(n)} = ${FM(r)}`);return`{ ${t.join(`, `)} }`}function IM(e,t){if(t==null||t.length===0)return[...e];let n=new Map;for(let[e,r]of t.entries())n.set(r,e);return[...e].sort(([e],[t])=>{let r=n.get(e),i=n.get(t);return r!=null&&i!=null?r-i:r==null?i==null?e.localeCompare(t):1:-1})}function LM(e,t){let n=IM(Object.entries(e),t),r=[],i=[],a=[];for(let[e,t]of n)if(t!=null){if(Array.isArray(t)){if(OM(t)){a.push([e,t]);continue}r.push([e,t]);continue}if(EM(t)){i.push([e,t]);continue}r.push([e,t])}return{scalarEntries:r,tableEntries:i,arrayTableEntries:a}}function RM(e,t,n,r=!0){let i=[],{scalarEntries:a,tableEntries:o,arrayTableEntries:s}=LM(t,n?.fieldOrder);r&&e.length>0&&i.push(`[${MM(e)}]`);for(let[e,t]of a)i.push(`${jM(e)} = ${FM(t)}`);for(let[t,r]of o)i.length>0&&i.push(``),i.push(...RM([...e,t],r,n));for(let[t,r]of s)for(let a of r){i.length>0&&i.push(``),i.push(`[[${MM([...e,t])}]]`);let r=RM([...e,t],a,n,!1);i.push(...r)}return i}function zM(e,t){let n=kM(e);if(!EM(n))throw TypeError(`TOML document root must be an object`);return RM([],n,t).join(`
388
+ `)}function BM(e){let{content:t,bodyFieldName:n,frontMatter:r,fieldNameMap:i,excludedKeys:a,extraFields:o,fieldOrder:s}=e,c=new Set(a??[]),l={};for(let[e,t]of Object.entries(r??{})){if(c.has(e))continue;let n=i?.[e]??e;l[n]=t}if(o!=null)for(let[e,t]of Object.entries(o))l[e]=t;return l[n]=t,zM(l,{...s!=null&&{fieldOrder:s}})}var VM=class{type;name;_log;get log(){return this._log??=om(this.name),this._log}dependsOn;constructor(e,t,n){this.name=e,this.type=t,n!=null&&(this.dependsOn=n)}};let HM=function(e){return e.Output=`output`,e}({}),UM=function(e){return e.GlobalMemory=`globalMemory`,e.ProjectRootMemory=`projectRootMemory`,e.ProjectChildrenMemory=`projectChildrenMemory`,e.Command=`command`,e.SubAgent=`subAgent`,e.Skill=`skill`,e.SkillChildDoc=`skillChildDoc`,e.SkillResource=`skillResource`,e.SkillMcpConfig=`skillMcpConfig`,e.Readme=`readme`,e.Rule=`rule`,e}({}),WM=function(e){return e.Relative=`relative`,e.Absolute=`absolute`,e.Root=`root`,e}({}),GM=function(e){return e.VSCode=`vscode`,e.Zed=`zed`,e.IntellijIDEA=`intellijIdea`,e.Git=`git`,e.EditorConfig=`editorconfig`,e.Original=`original`,e}({}),KM=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}({}),qM=function(e){return e.UserHome=`userHome`,e.External=`external`,e}({});function JM(){return a.env.TNMSC_FORCE_NATIVE_BINDING===`1`?!1:a.env.TNMSC_DISABLE_NATIVE_BINDING===`1`?!0:a.env.NODE_ENV===`test`||a.env.VITEST!=null||a.env.VITEST_WORKER_ID!=null}function YM(){let t=globalThis.__TNMSC_TEST_NATIVE_BINDING__;if(typeof t==`object`&&t)return t;if(JM())return;let n={"win32-x64":`win32-x64-msvc`,"linux-x64":`linux-x64-gnu`,"linux-arm64":`linux-arm64-gnu`,"darwin-arm64":`darwin-arm64`,"darwin-x64":`darwin-x64`}[`${a.platform}-${a.arch}`];if(n!=null)try{let t=e(import.meta.url),r=`@truenine/memory-sync-cli-${n}`,i=`napi-memory-sync-cli.${n}.node`,a=[`${r}/${i}`,`./${i}`,`../npm/${n}/${i}`,`../../npm/${n}/${i}`,r,`../npm/${n}`,`../../npm/${n}`];for(let e of a)try{let n=t(e),r=[n?.config,n?.default?.config,n?.default,n];for(let e of r)if(typeof e==`object`&&e)return e}catch{}}catch{}}function XM(){return YM()}let ZM;function QM(){if(ZM!=null)return ZM;let e=XM();if(e==null)throw TypeError(`Native series-filter binding is required. Build or install the Rust NAPI package before running tnmsc.`);if(typeof e.matchesSeries!=`function`||typeof e.resolveEffectiveIncludeSeries!=`function`||typeof e.resolveSubSeries!=`function`)throw TypeError(`Native series-filter binding is incomplete. Rebuild the Rust NAPI package before running tnmsc.`);return ZM=e,e}function $M(e,t){return QM().resolveEffectiveIncludeSeries(e,t)}function eN(e,t){return QM().matchesSeries(e,t)}function tN(e,t){return QM().resolveSubSeries(e,t)}function $(e,t,n){let r=$M(t?.includeSeries,t?.[n]?.includeSeries);return e.filter(e=>eN(e.seriName,r))}function nN(e){let t=e.replaceAll(/\.\/+/g,``);return t=t.replaceAll(/\/+$/g,``),t}function rN(e,t){return t.startsWith(`**/`)?`${e}/${t}`:t.startsWith(`*`)?`${e}/**/${t}`:`${e}/${t}`}function iN(e,t){for(let n of t){let t=n.replaceAll(/\/+$/g,``),r=[{prefix:t,pattern:`${t}/`},{prefix:t,pattern:`${t}\\`}];for(let{prefix:t,pattern:n}of r)if(e.startsWith(n))return{prefix:t,baseGlob:e.slice(n.length)};if(e===t)return{prefix:t,baseGlob:`**/*`}}return{prefix:null,baseGlob:e}}function aN(e,t){let n=tN(t?.subSeries,t?.rules?.subSeries);if(Object.keys(n).length===0)return e;let r={};for(let[e,t]of Object.entries(n)){let n=nN(e);r[n]=t}let i=Object.keys(r);return e.map(e=>{if(e.seriName==null)return e;let t=[];for(let[n,i]of Object.entries(r))(Array.isArray(e.seriName)?e.seriName.some(e=>i.includes(e)):i.includes(e.seriName))&&t.push(n);if(t.length===0)return e;let n=[];for(let r of e.globs){let{prefix:e,baseGlob:a}=iN(r,i);e!=null&&n.push(r);for(let r of t){if(r===e)continue;let t=rN(r,a);n.includes(t)||n.push(t)}}return{...e,globs:n}})}function oN(e){let n=s.join(e,`.git`);if(!t.existsSync(n))return null;let r=t.lstatSync(n);if(r.isDirectory())return s.join(n,`info`);if(r.isFile())try{let r=t.readFileSync(n,`utf8`).trim(),i=/^gitdir: (.+)$/.exec(r);if(i?.[1]!=null){let t=s.resolve(e,i[1]);return s.join(t,`info`)}}catch{}return null}function sN(e,n=5){let r=[],i=new Set([`node_modules`,`.turbo`,`dist`,`build`,`out`,`.cache`]);function a(o,c){if(c>n)return;let l;try{let e=t.readdirSync(o,{withFileTypes:!0});if(!Array.isArray(e))return;l=e}catch{return}l.some(e=>e.name===`.git`)&&o!==e&&r.push(o);for(let e of l)e.isDirectory()&&(e.name===`.git`||i.has(e.name)||a(s.join(o,e.name),c+1))}return a(e,0),r}function cN(e){let n=s.join(e,`modules`);if(!t.existsSync(n))return[];let r=[];function i(e){let n;try{let r=t.readdirSync(e,{withFileTypes:!0});if(!Array.isArray(r))return;n=r}catch{return}if(n.some(e=>e.name===`info`&&e.isDirectory())&&r.push(s.join(e,`info`)),n.find(e=>e.name===`modules`&&e.isDirectory())==null)return;let a;try{let n=t.readdirSync(s.join(e,`modules`),{withFileTypes:!0});if(!Array.isArray(n))return;a=n}catch{return}for(let t of a)t.isDirectory()&&i(s.join(e,`modules`,t.name))}let a;try{let e=t.readdirSync(n,{withFileTypes:!0});if(!Array.isArray(e))return r;a=e}catch{return r}for(let e of a)e.isDirectory()&&i(s.join(n,e.name));return r}var lN=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(),Md:this.createMdComponent()}}collectOsInfo(){let e=p.platform();return{platform:e,arch:p.arch(),hostname:p.hostname(),homedir:ng(),tmpdir:p.tmpdir(),type:p.type(),release:p.release(),shellKind:this.detectShellKind(),kind:this.detectOsKind(e)}}detectOsKind(e){switch(e){case`win32`:return rp.Win;case`darwin`:return rp.Mac;case`linux`:case`freebsd`:case`openbsd`:case`sunos`:case`aix`:return rp.Linux;default:return rp.Unknown}}detectShellKind(){let e=(a.env.SHELL??a.env.ComSpec??``).toLowerCase();return e.includes(`bash`)?np.Bash:e.includes(`zsh`)?np.Zsh:e.includes(`fish`)?np.Fish:e.includes(`pwsh`)?np.Pwsh:e.includes(`powershell`)?np.PowerShell:e.includes(`cmd`)?np.Cmd:e.endsWith(`/sh`)?np.Sh:np.Unknown}collectEnvContext(){return{...a.env}}collectProfile(){return this.userConfig?.profile==null?{}:this.userConfig.profile}collectToolReferences(){let e={...tp.default};return this.toolPreset===`claudeCode`?{...e,...tp.claudeCode}:this.toolPreset===`kiro`?{...e,...tp.kiro}:e}createMdComponent(){let e=(e=>e.when===!1?null:e.children);return e.Line=e=>e.when===!1?null:e.children,e}};let uN=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 dN=class{registrations=[];globalScope=null;setGlobalScope(e){this.globalScope=e}getGlobalScope(){return this.globalScope}register(e,t,n=uN.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))t[n]=typeof r==`object`&&r&&!Array.isArray(r)?this.deepMerge(t[n],r):r;return t}deepMerge(e,t){if(e==null)return{...t};let n={...e};for(let[e,r]of Object.entries(t))n[e]=typeof r==`object`&&r&&!Array.isArray(r)&&typeof n[e]==`object`&&n[e]!==null&&!Array.isArray(n[e])?this.deepMerge(n[e],r):r;return n}resolve(e){let t=this.merge();return e.replaceAll(/\$\{([^}]+)\}/g,(e,n)=>{let r=n.split(`.`),i=t;for(let e of r)i=i?.[e];return i==null?`\${${n}}`:String(i)})}clear(){this.registrations.length=0,this.globalScope=null}};const fN=new Map,pN=new Map,mN=/^export\s+default\s*/u;function hN(e){if(typeof e!=`object`||!e)return e;if(Array.isArray(e))return e.map(hN);let t=Object.entries(e).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>[e,hN(t)]);return Object.fromEntries(t)}function gN(e){return JSON.stringify(hN(e))}function _N(e,t,n){return[s.resolve(e),t,n.mode,gN(n.globalScope??{})].join(`::`)}function vN(e){return[s.resolve(e.filePath),e.cacheMtimeMs??e.rawMdx.length,gN(e.globalScope??{}),gN(e.rawMdx)].join(`::`)}function yN(e){return e.replace(/^\s*;?\s*/u,``).trim()}function bN(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function xN(e,t){if(e[t]!==`{`)return null;let n=0,r,i=!1,a=!1,o=!1;for(let s=t;s<e.length;s++){let c=e[s],l=e[s+1];if(c==null)break;if(a){c===`
389
+ `&&(a=!1);continue}if(o){c===`*`&&l===`/`&&(o=!1,s++);continue}if(i){i=!1;continue}if(r!=null){if(c===`\\`){i=!0;continue}c===r&&(r=void 0);continue}if(c===`"`||c===`'`||c==="`"){r=c;continue}if(c===`/`&&l===`/`){a=!0,s++;continue}if(c===`/`&&l===`*`){o=!0,s++;continue}if(c===`{`){n++;continue}if(c===`}`&&(n--,n===0))return{value:e.slice(t,s+1),endIndex:s+1}}return null}function SN(e){let t=e.trimStart(),n=mN.exec(t);if(n==null)return null;let r=n[0].length,i=xN(t,r);if(i==null)return null;let a;try{a=h.parse(i.value)}catch{return null}return bN(a)?{content:yN(t.slice(i.endIndex)),metadata:a}:null}async function CN(e,n){let r=n.rawMdx??t.readFileSync(e,`utf8`),i=n.lastModified??t.statSync(e).mtime,a=$f(r);if(n.mode===`dist`){let e=SN(r);if(e!=null)return{rawMdx:r,parsed:a,content:e.content,metadata:e.metadata,lastModified:i}}let o=await bM(r,{globalScope:n.globalScope,extractMetadata:!0,basePath:s.dirname(e),filePath:e});return{rawMdx:r,parsed:a,content:o.content,metadata:o.metadata.fields,lastModified:i}}async function wN(e,n){let r=n.lastModified??t.statSync(e).mtime,i=r.getTime(),a=_N(e,i,n),o=fN.get(a);if(o!=null)return(await o).artifact;let s=CN(e,{...n,lastModified:r}).then(e=>({artifact:e,stamp:i}));fN.set(a,s);try{return(await s).artifact}catch(e){throw fN.delete(a),e}}async function TN(e){let t=vN(e),n=pN.get(t);if(n!=null)return n;let r=bM(e.rawMdx,{globalScope:e.globalScope,extractMetadata:!0,basePath:s.dirname(e.filePath),filePath:e.filePath}).then(e=>({content:e.content,metadata:e.metadata.fields}));pN.set(t,r);try{return await r}catch(e){throw pN.delete(t),e}}function EN(){fN.clear(),pN.clear()}function DN(e){return e.replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/gu,``)}function ON(e){let t=DN(e);return t.length===0?``:t.split(`/`).filter(e=>e.length>0).join(`-`)}function kN(e){let t=DN(e),n=t.split(`/`).filter(e=>e.length>0),r=n.at(-1)??t,i=n.slice(0,-1),a=ON(t),o=i.length>0?i.join(`-`):void 0;return{...o!=null&&{agentPrefix:o},agentName:r,canonicalName:a.length>0?a:r}}function AN(e){return e.skillName.trim().length>0?e.skillName:e.dir.getDirectoryName()}function jN(e){return e.canonicalName.trim().length>0?e.canonicalName:ON(e.agentPrefix!=null&&e.agentPrefix.length>0?`${e.agentPrefix}-${e.agentName}`:e.agentName)}const MN=[`project`,`global`];function NN(e){if(e==null)return[];if(typeof e==`string`)return[e];let t=[];for(let n of e)t.includes(n)||t.push(n);return t}function PN(e,t){let n=new Map;for(let[e,r]of t.entries())n.set(r,e);return[...e].sort((e,t)=>(n.get(e)??2**53-1)-(n.get(t)??2**53-1))}function FN(e){let{requestedScopes:t,defaultScopes:n,supportedScopes:r,singleScope:i,availableScopes:a,priority:o=MN}=e,s=NN(t),c=NN(n),l=new Set(NN(r)),u=(s.length>0?s:c).filter(e=>l.has(e));if(u.length===0)return[];let d=PN(u,o);if(!i)return d;if(a!=null&&a.length>0){let e=new Set(a),t=d.find(t=>e.has(t));return t==null?[]:[t]}let[f]=d;return f==null?[]:[f]}const IN=Object.freeze({app:Object.freeze([]),ext:Object.freeze([]),arch:Object.freeze([]),softwares:Object.freeze([])});function LN(e){return s.resolve(e)}function RN(e,t){let n=LN(e),r=LN(t);if(n===r)return!0;let i=s.relative(r,n);return i.length>0&&i!==`..`&&!i.startsWith(`..${s.sep}`)&&!s.isAbsolute(i)}function zN(e){if(e.isWorkspaceRootProject===!0)return;let t=e.name,n=e.dirFromWorkspacePath?.getAbsolutePath();if(!(t==null||n==null))return{name:t,rootDir:LN(n),...e.promptSeries==null?{}:{series:e.promptSeries}}}function BN(e){return[...e].sort((e,t)=>{let n=e.series??``,r=t.series??``;return n===r?e.name.localeCompare(t.name):n.localeCompare(r)})}function VN(e){return BN(e.workspace.projects.map(zN).filter(e=>e!=null))}function HN(e){let t={app:[],ext:[],arch:[],softwares:[]};for(let n of e)n.series!=null&&t[n.series].push(n);return{app:Object.freeze([...t.app]),ext:Object.freeze([...t.ext]),arch:Object.freeze([...t.arch]),softwares:Object.freeze([...t.softwares])}}function UN(e,t){let n=t.filter(t=>RN(e,t.rootDir));if(n.length!==0)return[...n].sort((e,t)=>t.rootDir.length-e.rootDir.length)[0]}function WN(){return IN}function GN(e,t){let n=LN(t),r=LN(e.workspace.directory.path),i=VN(e),a=i.length===0?WN():HN(i);if(n===r)return{scope:`workspace`,cwd:n,workspaceDir:r,projectsBySeries:a};let o=UN(n,i);return o==null?RN(n,r)?{scope:`unsupported`,cwd:n,workspaceDir:r,projectsBySeries:a,managedProjects:i}:{scope:`external`,cwd:n,workspaceDir:r,projectsBySeries:a}:{scope:`project`,cwd:n,workspaceDir:r,projectsBySeries:a,matchedProject:o}}function KN(e){return e===`global`||e===`xdgConfig`}function qN(e,t,n){if(KN(e.scope))return`global`;let r=LN(e.path);return UN(r,n)==null?RN(r,t)?`workspace`:`external`:`project`}function JN(e,t,n,r){return e.scope===`unsupported`?!1:t===`global`||e.scope===`external`?!0:e.scope===`workspace`?t===`workspace`:t===`project`?UN(n,r)?.rootDir===e.matchedProject.rootDir:!1}function YN(e,t,n){if(t==null)return[...e];let r=LN(n.workspace.directory.path),i=VN(n);return e.filter(e=>JN(t,qN(e,r,i),e.path,i))}const XN=`aindex`,ZN=[`app`,`ext`,`arch`,`softwares`],QN=[`skills`,`commands`,`subAgents`,`rules`,...ZN],$N=[`globalPrompt`,`workspacePrompt`],eP=[`skills`,`commands`,`subAgents`,`rules`,`globalPrompt`,`workspacePrompt`,...ZN],tP=[`skills`,`commands`,`subAgents`,...ZN],nP={skills:{src:`skills`,dist:`dist/skills`},commands:{src:`commands`,dist:`dist/commands`},subAgents:{src:`subagents`,dist:`dist/subagents`},rules:{src:`rules`,dist:`dist/rules`},globalPrompt:{src:`global.src.mdx`,dist:`dist/global.mdx`},workspacePrompt:{src:`workspace.src.mdx`,dist:`dist/workspace.mdx`},app:{src:`app`,dist:`dist/app`},ext:{src:`ext`,dist:`dist/ext`},arch:{src:`arch`,dist:`dist/arch`},softwares:{src:`softwares`,dist:`dist/softwares`}};function rP(){let e=[];for(let t of eP)e.push(`aindex.${t}.src`,`aindex.${t}.dist`);return e}function iP(){return Object.fromEntries(eP.map(e=>[e,{...nP[e]}]))}const aP=rP();function oP(){return{dir:XN,...iP()}}function sP(e,t){if(t==null)return e;let n=Object.fromEntries(eP.map(n=>[n,{...e[n],...t[n]}]));return{...e,...t,dir:t.dir??e.dir,...n}}const cP={SRC:`src`,DIST:`dist`,SKILLS:`skills`,COMMANDS:`commands`,AGENTS:`agents`,RULES:`rules`,APP:`app`,EXT:`ext`,ARCH:`arch`,SOFTWARES:`softwares`,IDEA:`.idea`,IDEA_CODE_STYLES:`.idea/codeStyles`,VSCODE:`.vscode`,ZED:`.zed`},lP={GLOBAL_MEMORY:`global.mdx`,GLOBAL_MEMORY_SRC:`global.src.mdx`,WORKSPACE_MEMORY:`workspace.mdx`,WORKSPACE_MEMORY_SRC:`workspace.src.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`,ZED_SETTINGS:`.zed/settings.json`,QODER_IGNORE:`.qoderignore`,CURSOR_IGNORE:`.cursorignore`,WARP_INDEX_IGNORE:`.warpindexignore`,AI_IGNORE:`.aiignore`,WINDSURF_IGNORE:`.codeignore`,CODEIUM_IGNORE:`.codeiumignore`},uP={SRC_SKILLS:`src/skills`,SRC_COMMANDS:`src/commands`,SRC_AGENTS:`src/agents`,SRC_RULES:`src/rules`,SRC_GLOBAL_MEMORY:`global.src.mdx`,SRC_WORKSPACE_MEMORY:`workspace.src.mdx`,DIST_SKILLS:`dist/skills`,DIST_COMMANDS:`dist/commands`,DIST_AGENTS:`dist/agents`,DIST_RULES:`dist/rules`,DIST_APP:`dist/app`,DIST_EXT:`dist/ext`,DIST_ARCH:`dist/arch`,DIST_SOFTWARES:`dist/softwares`,DIST_GLOBAL_MEMORY:`dist/global.mdx`,DIST_WORKSPACE_MEMORY:`dist/workspace.mdx`,APP:`app`,EXT:`ext`,ARCH:`arch`,SOFTWARES:`softwares`},dP={src:{skills:{name:cP.SKILLS,required:!1,description:`Skill source files (.src.mdx)`},commands:{name:cP.COMMANDS,required:!1,description:`Fast command source files (.src.mdx)`},agents:{name:cP.AGENTS,required:!1,description:`Sub-agent source files (.src.mdx)`},rules:{name:cP.RULES,required:!1,description:`Rule source files (.src.mdx)`},globalMemoryFile:{name:lP.GLOBAL_MEMORY_SRC,required:!1,description:`Global memory source file`},workspaceMemoryFile:{name:lP.WORKSPACE_MEMORY_SRC,required:!1,description:`Workspace memory source file`}},dist:{skills:{name:cP.SKILLS,required:!1,description:`Compiled skill files (.mdx)`},commands:{name:cP.COMMANDS,required:!1,description:`Compiled fast command files (.mdx)`},agents:{name:cP.AGENTS,required:!1,description:`Compiled sub-agent files (.mdx)`},rules:{name:cP.RULES,required:!1,description:`Compiled rule files (.mdx)`},globalMemoryFile:{name:lP.GLOBAL_MEMORY,required:!1,description:`Compiled global memory file`},workspaceMemoryFile:{name:lP.WORKSPACE_MEMORY,required:!1,description:`Compiled workspace memory file`},app:{name:cP.APP,required:!1,description:`Compiled project-specific prompts`},ext:{name:cP.EXT,required:!1,description:`Compiled extension-specific prompts`},arch:{name:cP.ARCH,required:!1,description:`Compiled architecture-specific prompts`},softwares:{name:cP.SOFTWARES,required:!1,description:`Compiled software-repository prompts`}},app:{name:cP.APP,required:!1,description:`Project-specific prompts (standalone directory)`},ext:{name:cP.EXT,required:!1,description:`Extension-specific prompts (standalone directory)`},arch:{name:cP.ARCH,required:!1,description:`Architecture-specific prompts (standalone directory)`},softwares:{name:cP.SOFTWARES,required:!1,description:`Software-repository prompts (standalone directory)`},ide:{idea:{name:cP.IDEA,required:!1,description:`JetBrains IDE configuration directory`},ideaCodeStyles:{name:cP.IDEA_CODE_STYLES,required:!1,description:`JetBrains IDE code styles directory`},vscode:{name:cP.VSCODE,required:!1,description:`VS Code configuration directory`},zed:{name:cP.ZED,required:!1,description:`Zed configuration directory`}},ideFiles:[{name:lP.EDITOR_CONFIG,required:!1,description:`EditorConfig file`},{name:lP.IDEA_GITIGNORE,required:!1,description:`JetBrains IDE .gitignore`},{name:lP.IDEA_PROJECT_XML,required:!1,description:`JetBrains IDE Project.xml`},{name:lP.IDEA_CODE_STYLE_CONFIG_XML,required:!1,description:`JetBrains IDE codeStyleConfig.xml`},{name:lP.VSCODE_SETTINGS,required:!1,description:`VS Code settings.json`},{name:lP.VSCODE_EXTENSIONS,required:!1,description:`VS Code extensions.json`},{name:lP.ZED_SETTINGS,required:!1,description:`Zed settings.json`}],ignoreFiles:[{name:lP.QODER_IGNORE,required:!1,description:`Qoder ignore file`},{name:lP.CURSOR_IGNORE,required:!1,description:`Cursor ignore file`},{name:lP.WARP_INDEX_IGNORE,required:!1,description:`Warp index ignore file`},{name:lP.AI_IGNORE,required:!1,description:`AI ignore file`},{name:lP.WINDSURF_IGNORE,required:!1,description:`Windsurf ignore file`},{name:lP.CODEIUM_IGNORE,required:!1,description:`Windsurf legacy ignore file`}]},fP=g.object({src:g.string(),dist:g.string()}),pP=Object.fromEntries(eP.map(e=>[e,e===`softwares`?fP.default(nP[e]):fP])),mP=g.object({dir:g.string().default(XN),...pP}),hP=g.object({includeSeriesPrefix:g.boolean().optional(),seriesSeparator:g.string().optional()}),gP=g.object({includeSeriesPrefix:g.boolean().optional(),pluginOverrides:g.record(g.string(),hP).optional()}),_P=g.enum([`project`,`global`]),vP=g.union([_P,g.array(_P).min(1)]),yP=g.object({prompt:vP.optional(),rules:vP.optional(),commands:vP.optional(),subagents:vP.optional(),skills:vP.optional(),mcp:vP.optional()}),bP=g.object({plugins:g.record(g.string(),yP).optional()}),xP=g.object({blankLineAfter:g.boolean().optional()}),SP=g.enum([`direct`,`recursive`]),CP=g.enum([`path`,`glob`]),wP=g.object({path:g.string(),protectionMode:SP,matcher:CP.optional(),reason:g.string().optional()}),TP=g.object({rules:g.array(wP).optional()}),EP=g.union([g.string(),g.array(g.string()).min(1)]),DP=g.object({instances:EP.optional()}),OP=g.object({wsl2:DP.optional()}),kP=g.object({name:g.string().optional(),username:g.string().optional(),gender:g.string().optional(),birthday:g.string().optional()}).catchall(g.unknown()),AP=g.object({version:g.string().optional(),workspaceDir:g.string().optional(),aindex:mP.optional(),logLevel:g.enum([`trace`,`debug`,`info`,`warn`,`error`]).optional(),commandSeriesOptions:gP.optional(),outputScopes:bP.optional(),frontMatter:xP.optional(),cleanupProtection:TP.optional(),windows:OP.optional(),profile:kP.optional()}),jP=g.object({names:g.array(g.string()).optional()}),MP=g.object({includeSeries:g.array(g.string()).optional(),subSeries:g.record(g.string(),g.array(g.string())).optional()}),NP=g.object({mcp:jP.optional(),includeSeries:g.array(g.string()).optional(),subSeries:g.record(g.string(),g.array(g.string())).optional(),rules:MP.optional(),skills:MP.optional(),subAgents:MP.optional(),commands:MP.optional()}),PP=g.object({});function FP(e,t){let n=t==null?``:` in ${t}`;return e==null||e===`project`||e===`global`?{valid:!0,errors:[],warnings:[]}:{valid:!1,errors:[`Field "scope" must be "project" or "global"${n}`],warnings:[]}}function IP(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 LP(e,t){let n=t==null?``:` in ${t}`,r=[],i=[];!(`description`in e)||e.description==null?r.push(`Missing required field "description"${n}`):(typeof e.description!=`string`||e.description.trim().length===0)&&r.push(`Required field "description" cannot be empty${n}`),e.enabled??i.push(`Using default value for optional field "enabled": true${n}`),e.keywords??i.push(`Using default value for optional field "keywords": []${n}`);let a=FP(e.scope,t);return r.push(...a.errors),{valid:r.length===0,errors:r,warnings:i}}function RP(e,t){let n=IP(e,{requiredFields:[],optionalDefaults:{},filePath:t}),r=FP(e.scope,t);return{valid:n.valid&&r.valid,errors:[...n.errors,...r.errors],warnings:n.warnings}}function zP(e,t){let n=IP(e,{requiredFields:[`description`],optionalDefaults:{},filePath:t}),r=FP(e.scope,t);return{valid:n.valid&&r.valid,errors:[...n.errors,...r.errors],warnings:n.warnings}}function BP(e,t){let n=[],r=[],i=t==null?``:` in ${t}`;!Array.isArray(e.globs)||e.globs.length===0?n.push(`Missing or empty required field "globs"${i}`):e.globs.every(e=>typeof e==`string`)||n.push(`Field "globs" must be an array of strings${i}`),(typeof e.description!=`string`||e.description.length===0)&&n.push(`Missing or empty required field "description"${i}`);let{scope:a,seriName:o}=e,s=FP(a,t);return n.push(...s.errors),a??r.push(`Using default value for optional field "scope": "project"${i}`),o!=null&&typeof o!=`string`&&!Array.isArray(o)&&n.push(`Field "seriName" must be a string or string array${i}`),{valid:n.length===0,errors:n,warnings:r}}function VP(e,t){let n={...e};for(let[e,r]of Object.entries(t))(!(e in n)||n[e]==null)&&(n[e]=r);return n}function HP(e){return{workspace:{directory:e.workspace.directory,projects:[...e.workspace.projects]},...e.skills!=null&&{skills:[...e.skills]},...e.commands!=null&&{commands:[...e.commands]},...e.subAgents!=null&&{subAgents:[...e.subAgents]},...e.rules!=null&&{rules:[...e.rules]},...e.readmePrompts!=null&&{readmePrompts:[...e.readmePrompts]},...e.globalMemory!=null&&{globalMemory:e.globalMemory},...e.vscodeConfigFiles!=null&&{vscodeConfigFiles:[...e.vscodeConfigFiles]},...e.zedConfigFiles!=null&&{zedConfigFiles:[...e.zedConfigFiles]},...e.jetbrainsConfigFiles!=null&&{jetbrainsConfigFiles:[...e.jetbrainsConfigFiles]},...e.editorConfigFiles!=null&&{editorConfigFiles:[...e.editorConfigFiles]},...e.aiAgentIgnoreConfigFiles!=null&&{aiAgentIgnoreConfigFiles:[...e.aiAgentIgnoreConfigFiles]},...e.globalGitIgnore!=null&&{globalGitIgnore:e.globalGitIgnore},...e.shadowGitExclude!=null&&{shadowGitExclude:e.shadowGitExclude},...e.aindexDir!=null&&{aindexDir:e.aindexDir}}}const UP={Readme:{src:`rdm.mdx`,out:`README.md`},CodeOfConduct:{src:`coc.mdx`,out:`CODE_OF_CONDUCT.md`},Security:{src:`security.mdx`,out:`SECURITY.md`}},WP=[`prompt`,`rules`,`commands`,`subagents`,`skills`,`mcp`];function GP(e){return m.isBuffer(e)}function KP(e){if(typeof e==`string`)return[e];let t=[];for(let n of e)t.includes(n)||t.push(n);return t}function qP(e,t){return t?.outputScopes?.plugins?.[e]}function JP(e){for(let t of WP){let n=e.outputCapabilities[t];if(n!=null&&n.scopes.length===0)throw Error(`Plugin ${e.name} declares empty scopes for topic "${t}"`)}}function YP(e,t){let n=qP(e.name,t);if(n!=null)for(let t of WP){let r=n[t];if(r==null)continue;let i=e.outputCapabilities[t];if(i==null)throw Error(`Invalid outputScopes configuration: outputScopes.plugins.${e.name}.${t} is set, but plugin ${e.name} does not support topic "${t}".`);let a=KP(r);if(i.singleScope&&a.length>1){let n=a.join(`, `);throw Error(`Invalid outputScopes configuration: outputScopes.plugins.${e.name}.${t} is single-scope and cannot request multiple scopes [${n}].`)}let o=new Set(i.scopes),s=a.filter(e=>!o.has(e));if(s.length>0){let n=i.scopes.join(`, `),r=s.join(`, `);throw Error(`Invalid outputScopes configuration: outputScopes.plugins.${e.name}.${t} requests unsupported scopes [${r}]. Allowed scopes: [${n}].`)}}}function XP(e,t){for(let n of e)JP(n),YP(n,t)}async function ZP(e,t){XP(e,t.pluginOptions);let n=await Promise.all(e.map(async e=>[e,YN(await e.declareOutputFiles(t),t.executionPlan,t.collectedOutputContext)]));return new Map(n)}async function QP(e,n,r){let i=new Map,a=r??await ZP(e,n);for(let r of e){let e=a.get(r)??[],o=[];for(let i of e){if(n.dryRun===!0){o.push({path:i.path,success:!0,skipped:!1});continue}try{let e=s.dirname(i.path);if(t.mkdirSync(e,{recursive:!0}),i.ifExists===`skip`&&t.existsSync(i.path)){o.push({path:i.path,success:!0,skipped:!0});continue}if(i.ifExists===`error`&&t.existsSync(i.path))throw Error(`Refusing to overwrite existing file: ${i.path}`);let a=await r.convertContent(i,n);GP(a)?t.writeFileSync(i.path,a):t.writeFileSync(i.path,a,`utf8`),o.push({path:i.path,success:!0})}catch(e){o.push({path:i.path,success:!1,error:e})}}let c={files:o,dirs:[]};i.set(r.name,c)}return i}async function $P(e,t,n){let r=[],i=[],a=[],o=[],s=n==null?Array.from(await ZP(e,{...t,dryRun:!0}),([,e])=>e):[...n.values()];for(let e of s)for(let t of e)t.scope===`global`?o.push(t.path):i.push(t.path);return{projectDirs:r,projectFiles:i,globalDirs:a,globalFiles:o}}var eF=class extends Error{nodeName;missingDependency;constructor(e,t){super(`Node "${e}" depends on missing dependency "${t}"`),this.name=`MissingDependencyError`,this.nodeName=e,this.missingDependency=t}},tF=class extends Error{cyclePath;constructor(e){super(`Circular dependency detected: ${e.join(` -> `)}`),this.name=`CircularDependencyError`,this.cyclePath=[...e]}},nF=class extends VM{declarativeOutput=!0;outputCapabilities;globalConfigDir;outputFileName;treatWorkspaceRootProjectAsProject;indexignore;commandsConfig;subAgentsConfig;commandOutputEnabled;subAgentOutputEnabled;skillsConfig;skillOutputEnabled;toolPreset;rulesConfig;ruleOutputEnabled;cleanupConfig;wslMirrorPaths;supportsBlankLineAfterFrontMatter;registryWriterCache=new Map;warnedDeprecatedSubAgentFileNameSource=!1;constructor(e,t){super(e,HM.Output,t?.dependsOn),this.globalConfigDir=t?.globalConfigDir??``,this.outputFileName=t?.outputFileName??``,this.treatWorkspaceRootProjectAsProject=t?.treatWorkspaceRootProjectAsProject??!1,this.indexignore=t?.indexignore,this.commandOutputEnabled=t?.commands!=null,this.commandsConfig=this.createCommandsConfig(t?.commands),this.subAgentOutputEnabled=t?.subagents!=null,this.subAgentsConfig=this.createSubAgentsConfig(t?.subagents),this.skillOutputEnabled=t?.skills!=null,this.skillsConfig=this.createSkillsConfig(t?.skills),this.toolPreset=t?.toolPreset,this.ruleOutputEnabled=t?.rules!=null,this.rulesConfig={...t?.rules,sourceScopes:t?.rules?.sourceScopes??[`project`,`global`]},this.cleanupConfig=t?.cleanup??{},this.wslMirrorPaths=t?.wslMirrors??[],this.supportsBlankLineAfterFrontMatter=t?.supportsBlankLineAfterFrontMatter??!0,this.outputCapabilities=t?.capabilities==null?this.buildInferredCapabilities():this.normalizeCapabilities(t.capabilities)}createCommandsConfig(e){return{subDir:e?.subDir??`commands`,sourceScopes:e?.sourceScopes??[`project`,`global`],...e?.scopeRemap!=null&&{scopeRemap:e.scopeRemap},...e?.transformFrontMatter!=null&&{transformFrontMatter:e.transformFrontMatter}}}createSubAgentsConfig(e){return{subDir:e?.subDir??`agents`,sourceScopes:e?.sourceScopes??[`project`,`global`],includePrefix:e?.includePrefix??!0,linkSymbol:e?.linkSymbol??`-`,ext:e?.ext??`.md`,artifactFormat:e?.artifactFormat??`markdown`,fileNameSource:e?.fileNameSource??`derivedPath`,...e?.bodyFieldName!=null&&{bodyFieldName:e.bodyFieldName},...e?.fieldNameMap!=null&&{fieldNameMap:e.fieldNameMap},...e?.excludedFrontMatterFields!=null&&{excludedFrontMatterFields:e.excludedFrontMatterFields},...e?.extraFields!=null&&{extraFields:e.extraFields},...e?.fieldOrder!=null&&{fieldOrder:e.fieldOrder},...e?.scopeRemap!=null&&{scopeRemap:e.scopeRemap},...e?.transformFrontMatter!=null&&{transformFrontMatter:e.transformFrontMatter}}}createSkillsConfig(e){return{subDir:e?.subDir??`skills`,sourceScopes:e?.sourceScopes??[`project`,`global`],...e?.scopeRemap!=null&&{scopeRemap:e.scopeRemap}}}buildInferredCapabilities(){let e={};return this.outputFileName.length>0&&(e.prompt={scopes:[`project`,`global`],singleScope:!1}),this.ruleOutputEnabled&&(e.rules={scopes:this.rulesConfig.sourceScopes??[`project`,`global`],singleScope:!1}),this.commandOutputEnabled&&(e.commands={scopes:this.commandsConfig.sourceScopes,singleScope:!0}),this.subAgentOutputEnabled&&(e.subagents={scopes:this.subAgentsConfig.sourceScopes,singleScope:!0}),this.skillOutputEnabled&&(e.skills={scopes:this.skillsConfig.sourceScopes,singleScope:!0}),e}normalizeCapabilities(e){let t={};for(let n of WP){let r=e[n];if(r==null)continue;let i=this.normalizeCapability(r);i!=null&&(t[n]=i)}return t}normalizeCapability(e){let t=[];for(let n of e.scopes)t.includes(n)||t.push(n);if(t.length!==0)return{scopes:t,singleScope:e.singleScope}}resolvePromptSourceProjectConfig(e){let t=this.getConcreteProjects(e);return t.find(e=>e.isPromptSourceProject===!0)?.projectConfig??t[0]?.projectConfig}getConcreteProjects(e){return e.collectedOutputContext.workspace.projects.filter(e=>e.isWorkspaceRootProject!==!0)}isProjectPromptOutputTarget(e){return e.isPromptSourceProject!==!0}getProjectOutputProjects(e){let t=[...this.getConcreteProjects(e)];if(!this.treatWorkspaceRootProjectAsProject)return t;let n=this.getWorkspaceRootProject(e);return n!=null&&t.push(n),t}getProjectPromptOutputProjects(e){return this.getProjectOutputProjects(e).filter(e=>this.isProjectPromptOutputTarget(e))}getWorkspaceRootProject(e){return e.collectedOutputContext.workspace.projects.find(e=>e.isWorkspaceRootProject===!0)}resolveProjectRootDir(e,t){if(t.isWorkspaceRootProject===!0)return this.resolveDirectoryPath(e.collectedOutputContext.workspace.directory);let n=t.dirFromWorkspacePath;if(n!=null)return this.resolveDirectoryPath(n)}resolveProjectConfigDir(e,t){let n=this.resolveProjectRootDir(e,t);if(n!=null)return this.globalConfigDir.length===0?n:s.join(n,this.globalConfigDir)}isRelativePath(e){return e.pathKind===WM.Relative}toRelativePath(e){return e.path}resolveFullPath(e,t){let n=this.resolveDirectoryPath(e),r=t??this.outputFileName;return r?s.join(n,r):n}resolveDirectoryPath(e){return e.pathKind===WM.Absolute?e.path:`basePath`in e?s.resolve(e.basePath,e.path):s.resolve(a.cwd(),e.path)}getWorkspaceConfigDir(e){let t=this.resolveDirectoryPath(e.collectedOutputContext.workspace.directory);return s.join(t,this.globalConfigDir)}createRelativePath(e,t,n){return s.join(t,e)}createFileRelativePath(e,t){return s.join(e,t)}getGlobalConfigDir(){return s.join(this.getHomeDir(),this.globalConfigDir)}getXdgConfigHomeDir(){let e=a.env.XDG_CONFIG_HOME;return typeof e==`string`&&e.trim().length>0?e:s.join(this.getHomeDir(),`.config`)}getHomeDir(){return ng()}joinPath(...e){return s.join(...e)}resolvePath(...e){return s.resolve(...e)}dirname(e){return s.dirname(e)}buildProjectPromptCleanupTargets(e,t=this.outputFileName){if(t.length===0)return[];let n=[],r=new Set,i=(e,t)=>{r.has(e)||(r.add(e),n.push({path:e,kind:`file`,scope:`project`,label:t}))};for(let r of this.getProjectOutputProjects(e)){let a=this.resolveProjectRootDir(e,r);if(a!=null&&(n.push({path:this.resolvePath(a,`**`,t),kind:`glob`,scope:`project`,label:`delete.project.glob`}),i(this.resolvePath(a,t),`delete.project`),r.childMemoryPrompts!=null))for(let e of r.childMemoryPrompts)i(this.resolveFullPath(e.dir,t),`delete.project.child`)}return n}basename(e,t){return s.basename(e,t)}getIgnoreOutputPath(){if(this.indexignore!=null)return this.indexignore}resolveCleanupScopeBasePaths(e,t){if(e===`global`)return[this.getHomeDir()];if(e===`xdgConfig`)return[this.getXdgConfigHomeDir()];let n=[];for(let e of this.getProjectOutputProjects(t)){let r=this.resolveProjectRootDir(t,e);r!=null&&n.push(r)}return n}resolveCleanupDeclaredPath(e,t){return s.isAbsolute(t)?s.resolve(t):t===`~`?this.getHomeDir():t.startsWith(`~/`)||t.startsWith(`~\\`)?s.resolve(this.getHomeDir(),t.slice(2)):s.resolve(e,t)}normalizeGlobPattern(e){return e.replaceAll(`\\`,`/`)}buildCleanupTargetsFromScopeConfig(e,t,n){if(e==null)return[];let r=[],i=[`project`,`global`,`xdgConfig`],a=(e,i,a)=>{if(a==null||a.length===0)return;let o=this.resolveCleanupScopeBasePaths(e,n);for(let n of a)for(let a of o){let o=s.isAbsolute(n)?s.resolve(n):this.resolveCleanupDeclaredPath(a,n);r.push({path:i===`glob`?this.normalizeGlobPattern(o):o,kind:i,scope:e,label:`${t}.${e}`})}};for(let t of i){let n=e[t];n!=null&&(a(t,`file`,n.files),a(t,`directory`,n.dirs),a(t,`glob`,n.globs))}return r}resolveFrontMatterBlankLineAfter(e){return this.supportsBlankLineAfterFrontMatter?e?.pluginOptions?.frontMatter?.blankLineAfter??!0:!0}buildMarkdownContent(e,t,n){return Yf(t,e,{blankLineAfter:this.resolveFrontMatterBlankLineAfter(n)})}buildMarkdownContentWithRaw(e,t,n,r){return t!=null&&Object.keys(t).length>0?this.buildMarkdownContent(e,t,r):n!=null&&n.length>0?Zf(n,e,{blankLineAfter:this.resolveFrontMatterBlankLineAfter(r)}):e}buildTomlContent(e){return BM(e)}extractGlobalMemoryContent(e){return e.collectedOutputContext.globalMemory?.content}combineGlobalWithContent(e,t,n){let{separator:r=`
391
390
 
392
- `,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}`}getSkillName(e){return TP(e)}getSubAgentCanonicalName(e){return EP(e)}transformCommandName(e,t){let{includeSeriesPrefix:n=!0,seriesSeparator:r=`-`}=t??{};return!n||e.commandPrefix==null?`${e.commandName}.md`:`${e.commandPrefix}${r}${e.commandName}.md`}transformSubAgentName(e,t){let{fileNameSource:n}=this.subAgentsConfig,r=t?.includePrefix??this.subAgentsConfig.includePrefix,i=t?.linkSymbol??this.subAgentsConfig.linkSymbol,a=t?.ext??this.subAgentsConfig.ext,o=a.startsWith(`.`)?a:`.${a}`;return n===`frontMatterName`&&this.warnDeprecatedSubAgentFileNameSource(),r&&e.agentPrefix!=null&&e.agentPrefix.length>0?`${e.agentPrefix}${i}${e.agentName}${o}`:`${e.agentName}${o}`}normalizeOutputFileStem(e){let t=Array.from(e.trim(),e=>(e.codePointAt(0)??0)<=31||`<>:"/\\|?*`.includes(e)?`-`:e).join(``);for(;t.endsWith(`.`)||t.endsWith(` `);)t=t.slice(0,-1);if(t.length===0)throw Error(`Cannot derive a valid output file name from "${e}"`);return t}warnDeprecatedSubAgentFileNameSource(){this.warnedDeprecatedSubAgentFileNameSource||(this.warnedDeprecatedSubAgentFileNameSource=!0,this.log.warn(_p({code:`SUBAGENT_FRONTMATTER_NAME_SOURCE_DEPRECATED`,title:`Sub-agent fileNameSource="frontMatterName" now resolves from derived names`,reason:q(`The ${this.name} plugin no longer reads authored sub-agent front matter names.`,`tnmsc now derives sub-agent names from the sub-agent path.`),exactFix:q("Remove authored `name` fields from sub-agent sources.",'Keep using `fileNameSource="frontMatterName"` only as a temporary alias for the derived-path naming behavior.'),details:{plugin:this.name}})))}appendSubAgentDeclarations(e,t,n,r){let i=new Map;for(let a of r){let r=this.transformSubAgentName(a),o=s.join(t,this.subAgentsConfig.subDir,r),c=i.get(o);if(c!=null)throw Error(`Sub-agent output collision in ${this.name}: "${this.getSubAgentCanonicalName(a)}" and "${c}" both resolve to ${o}`);i.set(o,this.getSubAgentCanonicalName(a)),e.push({path:o,scope:n,source:{kind:`subAgent`,subAgent:a}})}}appendCommandDeclarations(e,t,n,r,i){for(let a of r){let r=this.transformCommandName(a,i);e.push({path:s.join(t,this.commandsConfig.subDir,r),scope:n,source:{kind:`command`,command:a}})}}appendSkillDeclarations(e,t,n,r){for(let i of r){let r=this.getSkillName(i),a=s.join(t,this.skillsConfig.subDir,r);if(e.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let t of i.childDocs)e.push({path:s.join(a,t.dir.path.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillReference`,content:t.content}});if(i.resources!=null)for(let t of i.resources)e.push({path:s.join(a,t.relativePath),scope:n,source:{kind:`skillResource`,content:t.content,encoding:t.encoding}})}}appendRuleDeclarations(e,t,n,r){let i=s.join(t,this.rulesConfig.subDir??`rules`);for(let t of r)e.push({path:s.join(i,this.buildRuleFileName(t)),scope:n,source:{kind:`rule`,rule:t}})}buildSubAgentTomlContent(e,t){let{bodyFieldName:n}=this.subAgentsConfig;if(n==null||n.length===0)throw Error(`subagents.bodyFieldName is required when artifactFormat="toml" for ${this.name}`);return this.buildTomlContent({content:e.content,bodyFieldName:n,...t!=null&&{frontMatter:t},...this.subAgentsConfig.fieldNameMap!=null&&{fieldNameMap:this.subAgentsConfig.fieldNameMap},...this.subAgentsConfig.excludedFrontMatterFields!=null&&{excludedKeys:this.subAgentsConfig.excludedFrontMatterFields},...this.subAgentsConfig.extraFields!=null&&{extraFields:this.subAgentsConfig.extraFields},...this.subAgentsConfig.fieldOrder!=null&&{fieldOrder:this.subAgentsConfig.fieldOrder}})}getCommandSeriesOptions(e){let t=e.pluginOptions?.commandSeriesOptions,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.getCommandSeriesOptions(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)}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)}normalizeRuleScope(e){return e.scope??`project`}normalizeSourceScope(e){return e===`global`||e===`project`?e:`project`}remapDeclarationScope(e,t){return t?.[e]??e}resolveCommandSourceScope(e){if(e.globalOnly===!0)return`global`;let t=e.yamlFrontMatter?.scope;return this.remapDeclarationScope(this.normalizeSourceScope(t),this.commandsConfig.scopeRemap)}resolveSubAgentSourceScope(e){let t=e.yamlFrontMatter?.scope;return this.remapDeclarationScope(this.normalizeSourceScope(t),this.subAgentsConfig.scopeRemap)}resolveSkillSourceScope(e){let t=e.yamlFrontMatter?.scope;return this.remapDeclarationScope(this.normalizeSourceScope(t),this.skillsConfig.scopeRemap)}selectSingleScopeItems(e,t,n,r){if(e.length===0)return{items:[]};let[i]=AP({requestedScopes:r,defaultScopes:t,supportedScopes:t,singleScope:!0,availableScopes:[...new Set(e.map(n))]});return i==null?{items:[]}:{selectedScope:i,items:e.filter(e=>n(e)===i)}}selectRuleScopes(e,t){let n=[...new Set(t.map(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))))];return AP({requestedScopes:this.getTopicScopeOverride(e,`rules`),defaultScopes:this.rulesConfig.sourceScopes??[`project`,`global`],supportedScopes:this.rulesConfig.sourceScopes??[`project`,`global`],singleScope:!1,availableScopes:n}).filter(e=>n.includes(e))}selectPromptScopes(e,t=[`project`,`global`],n=t){return AP({requestedScopes:this.getTopicScopeOverride(e,`prompt`),defaultScopes:n,supportedScopes:t,singleScope:!1})}getTopicScopeOverride(e,t){return e.pluginOptions?.outputScopes?.plugins?.[this.name]?.[t]}buildSkillFrontMatter(e,t){let n=e.yamlFrontMatter,r={name:this.getSkillName(e),description:n.description};return`displayName`in n&&n.displayName!=null&&(r.displayName=n.displayName),`keywords`in n&&n.keywords!=null&&n.keywords.length>0&&(r.keywords=n.keywords),`author`in n&&n.author!=null&&(r.author=n.author),`version`in n&&n.version!=null&&(r.version=n.version),(t?.includeTools??!0)&&`allowTools`in n&&n.allowTools!=null&&n.allowTools.length>0&&(r.allowTools=(t?.toolFormat??`array`)===`string`?n.allowTools.join(`,`):n.allowTools),t?.additionalFields!=null&&Object.assign(r,t.additionalFields),r}buildRuleContent(e,t){let n=this.rulesConfig.transformFrontMatter?this.rulesConfig.transformFrontMatter(e):{globs:e.globs.join(`, `)},r=n==null||Object.keys(n).length===0?void 0:n;return this.buildMarkdownContent(e.content,r,t)}buildRuleFileName(e){return`${`${this.rulesConfig.prefix??`rule`}${this.rulesConfig.linkSymbol??`-`}`}${e.prefix}${this.rulesConfig.linkSymbol??`-`}${e.ruleName}${this.rulesConfig.ext??`.md`}`}async declareOutputFiles(e){return this.buildDefaultOutputDeclarations(e)}async declareCleanupPaths(e){let t=[...this.buildCleanupTargetsFromScopeConfig(this.cleanupConfig.delete,`delete`,e)],n=[...this.buildCleanupTargetsFromScopeConfig(this.cleanupConfig.protect,`protect`,e)],{excludeScanGlobs:r}=this.cleanupConfig,i=this.getIgnoreOutputPath();if(i!=null)for(let n of this.getProjectOutputProjects(e)){if(n.isWorkspaceRootProject===!0||n.isPromptSourceProject===!0)continue;let r=this.resolveProjectRootDir(e,n);r!=null&&t.push({path:s.join(r,i),kind:`file`,scope:`project`,label:`delete.indexignore`})}return t.length===0&&n.length===0&&(r==null||r.length===0)?{}:{...t.length>0&&{delete:t},...n.length>0&&{protect:n},...r!=null&&r.length>0&&{excludeScanGlobs:r}}}async declareWslMirrorFiles(e){return this.wslMirrorPaths.map(e=>({sourcePath:e}))}async convertContent(e,t){let n=e.source;switch(n.kind){case`projectRootMemory`:case`projectChildMemory`:case`globalMemory`:case`skillReference`:case`ignoreFile`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`subAgent`:return this.buildSubAgentContent(n.subAgent,t);case`skillMain`:return this.buildSkillMainContent(n.skill,t);case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;case`rule`:return this.buildRuleContent(n.rule,t);default:throw Error(`Unsupported declaration source for plugin ${this.name}`)}}async buildDefaultOutputDeclarations(e){let t=[],{globalMemory:n,commands:r,subAgents:i,skills:a,rules:o,aiAgentIgnoreConfigFiles:c}=e.collectedOutputContext,l=this.getTransformOptionsFromContext(e),u=this.getIgnoreOutputPath(),d=this.indexignore==null?void 0:c?.find(e=>e.fileName===this.indexignore),f=this.commandOutputEnabled&&r!=null?this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)):{items:[]},p=this.subAgentOutputEnabled&&i!=null?this.selectSingleScopeItems(i,this.subAgentsConfig.sourceScopes,e=>this.resolveSubAgentSourceScope(e),this.getTopicScopeOverride(e,`subagents`)):{items:[]},m=this.skillOutputEnabled&&a!=null?this.selectSingleScopeItems(a,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)):{items:[]},h=o??[],g=this.ruleOutputEnabled&&h.length>0?new Set(this.selectRuleScopes(e,h)):new Set,_=new Set(this.selectPromptScopes(e,this.outputCapabilities.prompt?.scopes??[`project`,`global`])),v={project:[],global:[]};for(let e of h)v[this.normalizeSourceScope(this.normalizeRuleScope(e))].push(e);for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n),i=this.resolveProjectConfigDir(e,n);if(r==null||i==null)continue;if(this.outputFileName.length>0&&_.has(`project`)&&this.isProjectPromptOutputTarget(n)&&(n.rootMemoryPrompt!=null&&t.push({path:s.join(r,this.outputFileName),scope:`project`,source:{kind:`projectRootMemory`,content:n.rootMemoryPrompt.content}}),n.childMemoryPrompts!=null))for(let e of n.childMemoryPrompts)t.push({path:this.resolveFullPath(e.dir),scope:`project`,source:{kind:`projectChildMemory`,content:e.content}});let{projectConfig:a}=n;if(f.selectedScope===`project`&&f.items.length>0){let e=$(f.items,a,`commands`);this.appendCommandDeclarations(t,i,`project`,e,l)}if(p.selectedScope===`project`&&p.items.length>0){let e=$(p.items,a,`subAgents`);this.appendSubAgentDeclarations(t,i,`project`,e)}if(m.selectedScope===`project`&&m.items.length>0){let e=$(m.items,a,`skills`);this.appendSkillDeclarations(t,i,`project`,e)}if(g.has(`project`)){let e=eP($(v.project,a,`rules`),a);this.appendRuleDeclarations(t,i,`project`,e)}u!=null&&d!=null&&n.isWorkspaceRootProject!==!0&&n.isPromptSourceProject!==!0&&n.dirFromWorkspacePath!=null&&t.push({path:s.join(n.dirFromWorkspacePath.basePath,n.dirFromWorkspacePath.path,u),scope:`project`,source:{kind:`ignoreFile`,content:d.content}})}let y=this.resolvePromptSourceProjectConfig(e);if(f.selectedScope===`global`&&f.items.length>0){let e=$(f.items,y,`commands`),n=this.getGlobalConfigDir();this.appendCommandDeclarations(t,n,`global`,e,l)}if(p.selectedScope===`global`&&p.items.length>0){let e=$(p.items,y,`subAgents`),n=this.getGlobalConfigDir();this.appendSubAgentDeclarations(t,n,`global`,e)}if(m.selectedScope===`global`&&m.items.length>0){let e=$(m.items,y,`skills`),n=this.getGlobalConfigDir();this.appendSkillDeclarations(t,n,`global`,e)}for(let e of[`global`]){if(!g.has(e))continue;let n=this.getGlobalConfigDir(),r=eP($(v[e],y,`rules`),y);this.appendRuleDeclarations(t,n,e,r)}return n!=null&&this.outputFileName.length>0&&_.has(`global`)&&t.push({path:s.join(this.getGlobalConfigDir(),this.outputFileName),scope:`global`,source:{kind:`globalMemory`,content:n.content}}),t}async buildCommandContent(e,t){let n=e.content,r=e.yamlFrontMatter,i=!1;if(e.rawMdxContent!=null&&this.toolPreset!=null){this.log.debug(`recompiling command with tool preset`,{file:e.dir.getAbsolutePath(),toolPreset:this.toolPreset,hasRawContent:!0});let t=new iP({toolPreset:this.toolPreset}).collect(),a=await bP({filePath:e.dir.getAbsolutePath(),globalScope:t,rawMdx:e.rawMdxContent});n=a.content,r=a.metadata,i=!0}let a=this.commandsConfig.transformFrontMatter;if(a==null)throw Error(`commands.transformFrontMatter is required for command output plugin: ${this.name}`);let o=a(e,{isRecompiled:i,...r!=null&&{sourceFrontMatter:r}});return this.buildMarkdownContent(n,o,t)}buildSubAgentContent(e,t){let n=this.subAgentsConfig.transformFrontMatter,r=n?.(e,{...e.yamlFrontMatter!=null&&{sourceFrontMatter:e.yamlFrontMatter}});if(this.subAgentsConfig.artifactFormat===`toml`){let t=r??e.yamlFrontMatter;return this.buildSubAgentTomlContent(e,t)}return r==null?this.buildMarkdownContentWithRaw(e.content,e.yamlFrontMatter,e.rawFrontMatter,t):this.buildMarkdownContent(e.content,r,t)}buildSkillMainContent(e,t){return this.buildMarkdownContentWithRaw(e.content,e.yamlFrontMatter,e.rawFrontMatter,t)}};const SF={USER_HOME:`~`,WORKSPACE:`$WORKSPACE`},CF={},wF={AgentsOutput:`AgentsOutputPlugin`,GeminiCLIOutput:`GeminiCLIOutputPlugin`,CursorOutput:`CursorOutputPlugin`,WindsurfOutput:`WindsurfOutputPlugin`,ClaudeCodeCLIOutput:`ClaudeCodeCLIOutputPlugin`,KiroIDEOutput:`KiroCLIOutputPlugin`,OpencodeCLIOutput:`OpencodeCLIOutputPlugin`,OpenAICodexCLIOutput:`CodexCLIOutputPlugin`,DroidCLIOutput:`DroidCLIOutputPlugin`,WarpIDEOutput:`WarpIDEOutputPlugin`,TraeIDEOutput:`TraeIDEOutputPlugin`,TraeCNIDEOutput:`TraeCNIDEOutputPlugin`,QoderIDEOutput:`QoderIDEPluginOutputPlugin`,JetBrainsCodeStyleOutput:`JetBrainsIDECodeStyleConfigOutputPlugin`,JetBrainsAICodexOutput:`JetBrainsAIAssistantCodexOutputPlugin`,AgentSkillsCompactOutput:`GenericSkillsOutputPlugin`,GitExcludeOutput:`GitExcludeOutputPlugin`,ReadmeOutput:`ReadmeMdConfigFileOutputPlugin`,VSCodeOutput:`VisualStudioCodeIDEConfigOutputPlugin`,ZedOutput:`ZedIDEConfigOutputPlugin`,EditorConfigOutput:`EditorConfigOutputPlugin`,AntigravityOutput:`AntigravityOutputPlugin`},TF=`__workspace__`,EF={SKILL:`SKILL.md`,CURSOR_GLOBAL_RULE:`global.mdc`,CURSOR_PROJECT_RULE:`always.md`,MCP_CONFIG:`mcp.json`,CLAUDE_MEMORY:`CLAUDE.md`,WINDSURF_GLOBAL_RULE:`global_rules.md`},DF={RULE:`rule-`,CHILD_RULE:`glob-`},OF={RULES:`rules`,COMMANDS:`commands`,SKILLS:`skills`,AGENTS:`agents`,CURSOR_SKILLS:`skills-cursor`},kF={ALWAYS_APPLY:`alwaysApply`,GLOBS:`globs`,DESCRIPTION:`description`,NAME:`name`,TRIGGER:`trigger`},AF={MD:`.md`,MDC:`.mdc`,MDX:`.mdx`,JSON:`.json`},jF={PRIMARY:`.src.mdx`},MF=[jF.PRIMARY],NF={zh:MF,en:AF.MDX};function PF(e){return MF.some(t=>e.endsWith(t))}const FF={CURSOR:`.cursor`,CLAUDE:`.claude`,WINDSURF:`.codeium/windsurf`,WINDSURF_RULES:`.windsurf`},IF={CURSOR:`.cursorignore`,WINDSURF:`.codeignore`,WINDSURF_LEGACY:`.codeiumignore`},LF={CURSOR:new Set([`create-rule`,`create-skill`,`create-subagent`,`migrate-to-skills`,`update-cursor-settings`])},RF={CLAUDE_CODE:`claudeCode`};var zF=class extends Error{kind;nameOfPrompt;sourcePath;expectedDistPath;constructor(e){let{kind:t,name:n,sourcePath:r,expectedDistPath:i}=e;super([`Missing compiled dist prompt for ${t} "${n}".`,...r==null?[]:[`source: ${r}`],`expected dist: ${i}`].join(` `)),this.name=`MissingCompiledPromptError`,this.kind=t,this.nameOfPrompt=n,r!=null&&(this.sourcePath=r),this.expectedDistPath=i}},BF=class extends Error{filePath;lineNumber;constructor(e,t,n){super(`Compiled prompt still contains residual module syntax at ${e}:${t}: ${n.trim()}`),this.name=`ResidualModuleSyntaxError`,this.filePath=e,this.lineNumber=t}};const VF=/^\s*(```|~~~)/u,HF=[/^\s*export\s+default\b/u,/^\s*export\s+const\b/u,/^\s*import\b/u];function UF(e,t){let n,r=e.split(/\r?\n/u);for(let[e,i]of r.entries()){let r=VF.exec(i);if(r?.[1]!=null){let e=r[1];n==null?n=e:n===e&&(n=void 0);continue}if(n==null&&HF.some(e=>e.test(i)))throw new BF(t,e+1,i)}}function WF(e,t,n={}){let{preferredSourcePath:r,distRootDir:i,srcRootDir:a}=n;if(t==null||t.length===0||r!=null&&r.length>0)return r;if(i==null||a==null)return;let o=e.relative(i,t);if(!(o.startsWith(`..`)||e.isAbsolute(o)))return e.join(a,o.replace(/\.mdx$/u,`.src.mdx`))}function GF(e){if(e instanceof sp&&e.filePath!=null)return e.filePath;if(!(e instanceof Error)||!(`filePath`in e))return;let{filePath:t}=e;if(typeof t==`string`&&t.length>0)return t}function KF(e,t){let n=GF(e)??t.distPath,r=[t.operation??`Prompt compilation failed.`,`prompt kind: ${t.promptKind}`,`logical name: ${t.logicalName}`];return t.entryDistPath!=null&&t.entryDistPath.length>0&&t.entryDistPath!==n&&r.push(`entry dist file: ${t.entryDistPath}`),n!=null&&n.length>0&&r.push(`dist file: ${n}`),r.push(`src file: ${t.srcPath??`<unresolved>`}`),r.push(`diagnostic:`),r.push(e instanceof Error?op(e):String(e)),r.join(`
393
- `)}function qF(e){return e instanceof zF||e instanceof BF}var JF=class{constructor(e,t,n,r){this.fs=e,this.path=t,this.logger=n,this.globalScope=r}async readDirectoryStructure(e,t,n){let r=[],i=[];if(!this.exists(e))return{prompts:r,errors:i};try{let a=this.fs.readdirSync(e,{withFileTypes:!0});for(let o of a){if(!o.isDirectory())continue;let{name:a}=o,s=this.path.join(e,a),c=this.path.join(t,a);try{let e=await this.readEntry(a,s,c,n,!0);e&&r.push(e)}catch(e){if(i.push({path:s,error:e,phase:`read`}),this.logger.error(hp({code:`LOCALIZED_PROMPT_ENTRY_READ_FAILED`,title:`Failed to read localized prompt entry`,operation:`read`,targetKind:`${String(n.kind)} prompt entry`,path:s,error:e,details:{entryName:a,promptKind:String(n.kind)}})),qF(e))throw e}}}catch(t){if(i.push({path:e,error:t,phase:`scan`}),this.logger.error(hp({code:`LOCALIZED_PROMPT_DIRECTORY_SCAN_FAILED`,title:`Failed to scan localized prompt source directory`,operation:`scan`,targetKind:`${String(n.kind)} prompt source directory`,path:e,error:t,details:{promptKind:String(n.kind)}})),qF(t))throw t}return{prompts:r,errors:i}}async readFlatFiles(e,t,n){let r=[],i=[],a=this.exists(e),o=this.exists(t);if(this.logger.debug(`readFlatFiles: srcDir=${e}, exists=${a}`),this.logger.debug(`readFlatFiles: distDir=${t}, exists=${o}`),!a&&!o)return{prompts:r,errors:i};let s=this.normalizeExtensions(n.localeExtensions.zh),c=new Set,l=async(a,o)=>{if(!c.has(a)){c.add(a);try{let i=await this.readFlatEntry(a,e,t,a,n);i&&r.push(i)}catch(e){if(i.push({path:o,error:e,phase:`read`}),this.logger.error(hp({code:`LOCALIZED_PROMPT_FILE_READ_FAILED`,title:`Failed to read localized prompt file`,operation:`read`,targetKind:`${String(n.kind)} prompt file`,path:o,error:e,details:{promptKind:String(n.kind),logicalName:a}})),qF(e))throw e}}},u=async(e,t=``)=>{if(this.exists(e))try{let n=this.fs.readdirSync(e,{withFileTypes:!0});for(let r of n){let n=t?this.path.join(t,r.name):r.name;if(r.isDirectory()){await u(this.path.join(e,r.name),n);continue}let i=this.findMatchingExtension(r.name,s);if(!r.isFile()||i==null)continue;let a=r.name.slice(0,-i.length);await l(t?this.path.join(t,a):a,this.path.join(e,r.name))}}catch(t){if(i.push({path:e,error:t,phase:`scan`}),this.logger.error(hp({code:`LOCALIZED_SOURCE_DIRECTORY_SCAN_FAILED`,title:`Failed to scan localized source directory`,operation:`scan`,targetKind:`${String(n.kind)} source directory`,path:e,error:t,details:{promptKind:String(n.kind)}})),qF(t))throw t}},d=async(e,t=``)=>{if(this.exists(e))try{let n=this.fs.readdirSync(e,{withFileTypes:!0});for(let r of n){let n=t?this.path.join(t,r.name):r.name;if(r.isDirectory()){await d(this.path.join(e,r.name),n);continue}if(!r.isFile()||!r.name.endsWith(`.mdx`))continue;let i=r.name.slice(0,-4);await l(t?this.path.join(t,i):i,this.path.join(e,r.name))}}catch(t){if(i.push({path:e,error:t,phase:`scan`}),this.logger.error(hp({code:`LOCALIZED_DIST_DIRECTORY_SCAN_FAILED`,title:`Failed to scan localized dist directory`,operation:`scan`,targetKind:`${String(n.kind)} dist directory`,path:e,error:t,details:{promptKind:String(n.kind)}})),qF(t))throw t}};return a&&await u(e),o&&await d(t),{prompts:r,errors:i}}async readSingleFile(e,t,n){let r=this.path.basename(e);return this.readFlatEntry(r,this.path.dirname(e),this.path.dirname(t),e,n,!0)}async readEntry(e,t,n,r,i=!0){let{localeExtensions:a,entryFileName:o,createPrompt:s,kind:c}=r,l=r.hydrateSourceContents??!0,u=o??e,d=this.normalizeExtensions(a.zh),f=this.normalizeExtensions(a.en),p=this.resolveLocalizedPath(t,u,d),m=this.resolveLocalizedPath(t,u,f),h=this.path.join(n,`${u}.mdx`),g=this.exists(p),_=this.exists(m),v=g?p:_?m:void 0,y={promptKind:String(c),logicalName:e,entryDistPath:h,...v!=null&&{srcPath:v}},b=await this.readDistContent(h,s,e,y),x=g&&l?await this.readLocaleContent(p,`zh`,s,e,String(c)):null,S=_&&l?await this.readLocaleContent(m,`en`,s,e,String(c)):null,C=b!=null,w=g?p:_?m:void 0;if(!C&&!g&&!_)return this.logger.warn(dp({code:`LOCALIZED_PROMPT_ARTIFACTS_MISSING`,title:`Missing source and dist prompt artifacts for ${e}`,rootCause:q(`tnmsc could not find either the source prompt or the compiled dist prompt for "${e}".`),exactFix:q(`Create the source prompt and rebuild the compiled dist prompt before retrying tnmsc.`),details:{promptKind:String(c),name:e,srcZhPath:p,srcEnPath:m,distPath:h}})),null;if(!C)throw new zF({kind:String(c),name:e,...w!=null&&{sourcePath:w},expectedDistPath:h});let T=l&&x!=null?{zh:x,...S!=null&&{en:S},default:x,defaultLocale:`zh`}:void 0,E=i?this.scanChildren(n,u,[`.mdx`]):void 0;return{name:e,type:c,...T!=null&&{src:T},...C&&{dist:b},metadata:{hasDist:C,hasMultipleLocales:_,isDirectoryStructure:i,...E&&E.length>0&&{children:E}},paths:{...g&&{zh:p},..._&&{en:m},...C&&{dist:h}}}}async readFlatEntry(e,t,n,r,i,a=!1){let{localeExtensions:o,createPrompt:s,kind:c}=i,l=i.hydrateSourceContents??!0,u=this.normalizeExtensions(o.zh),d=this.normalizeExtensions(o.en),f=this.resolveLocalizedPath(``,r,u),p=this.resolveLocalizedPath(``,r,d),m=this.path.join(n,`${e}.mdx`),h=a?f:this.path.join(t,f),g=a?p:this.path.join(t,p),_=this.exists(h),v=this.exists(g),y=_?h:v?g:void 0,b={promptKind:String(c),logicalName:e,entryDistPath:m,...y!=null&&{srcPath:y}},x=await this.readDistContent(m,s,e,b),S=_&&l?await this.readLocaleContent(h,`zh`,s,e,String(c)):null,C=v&&l?await this.readLocaleContent(g,`en`,s,e,String(c)):null,w=x!=null,T=_?h:v?g:void 0;if(!w&&!_&&!v)return this.logger.warn(dp({code:`LOCALIZED_PROMPT_ARTIFACTS_MISSING`,title:`Missing source and dist prompt artifacts for ${e}`,rootCause:q(`tnmsc could not find either the source prompt or the compiled dist prompt for "${e}".`),exactFix:q(`Create the source prompt and rebuild the compiled dist prompt before retrying tnmsc.`),details:{promptKind:String(c),name:e,srcZhPath:h,srcEnPath:g,distPath:m}})),null;if(!w)throw new zF({kind:String(c),name:e,...T!=null&&{sourcePath:T},expectedDistPath:m});let E=l&&S!=null?{zh:S,...C!=null&&{en:C},default:S,defaultLocale:`zh`}:void 0;return{name:e,type:c,...E!=null&&{src:E},...w&&{dist:x},metadata:{hasDist:w,hasMultipleLocales:v,isDirectoryStructure:!1},paths:{..._&&{zh:h},...v&&{en:g},...w&&{dist:m}}}}async readLocaleContent(e,t,n,r,i){if(!this.exists(e))return null;try{let i=await yP(e,{mode:`source`,globalScope:this.globalScope});UF(i.content,e);let a=await n(i.content,t,r,i.metadata),o={content:i.content,lastModified:i.lastModified,filePath:e};return i.rawMdx.length>0&&Object.assign(o,{rawMdx:i.rawMdx}),i.parsed.yamlFrontMatter!=null&&Object.assign(o,{frontMatter:i.parsed.yamlFrontMatter}),a!=null&&Object.assign(o,{prompt:a}),o}catch(n){throw this.logger.error(bp({code:`LOCALIZED_SOURCE_PROMPT_READ_FAILED`,title:`Failed to read localized source prompt`,diagnosticText:KF(n,{operation:`Failed to read localized source prompt.`,promptKind:i,logicalName:r,distPath:e}),details:{promptKind:i,locale:t,filePath:e}})),n}}async readDistContent(e,t,n,r){if(!this.exists(e))return null;try{let r=await yP(e,{mode:`dist`,globalScope:this.globalScope});UF(r.content,e);let i=await t(r.content,`zh`,n,r.metadata),a={content:r.content,lastModified:r.lastModified,prompt:i,filePath:e,rawMdx:r.rawMdx};return r.parsed.yamlFrontMatter!=null&&Object.assign(a,{frontMatter:r.parsed.yamlFrontMatter}),a}catch(t){throw this.logger.error(this.buildDistReadDiagnostic(t,e,r)),t}}buildDistReadDiagnostic(e,t,n){let r=WF(this.path,t,{preferredSourcePath:t===n.entryDistPath?n.srcPath:void 0,distRootDir:this.path.dirname(n.entryDistPath),srcRootDir:n.srcPath==null?void 0:this.path.dirname(n.srcPath)});return bp({code:`LOCALIZED_DIST_PROMPT_READ_FAILED`,title:`Failed to read localized dist prompt`,diagnosticText:KF(e,{operation:`Failed to read dist content.`,promptKind:n.promptKind,logicalName:n.logicalName,entryDistPath:n.entryDistPath,distPath:t,srcPath:r}),details:{promptKind:n.promptKind,logicalName:n.logicalName,filePath:t,srcPath:r}})}scanChildren(e,t,n){let r=[];if(!this.exists(e))return r;let i=new Set(n.map(e=>`${t}${e}`));try{let t=(e,a)=>{let o=this.fs.readdirSync(e,{withFileTypes:!0});for(let s of o){let o=this.path.join(e,s.name),c=a?this.path.join(a,s.name):s.name;if(s.isDirectory())t(o,c);else{let e=this.findMatchingExtension(s.name,n);if(e==null||i.has(s.name))continue;let t=s.name.slice(0,-e.length),a=this.path.dirname(c),o=a===`.`?t:this.path.join(a,t);r.push(o)}}};t(e,``)}catch(t){this.logger.warn(hp({code:`LOCALIZED_PROMPT_CHILD_SCAN_FAILED`,title:`Failed to scan localized prompt child documents`,operation:`scan`,targetKind:`localized prompt child directory`,path:e,error:t}))}return r}exists(e){try{return this.fs.existsSync(e)}catch{return!1}}normalizeExtensions(e){return typeof e==`string`?[e]:e}findMatchingExtension(e,t){return t.find(t=>e.endsWith(t))}resolveLocalizedPath(e,t,n){let r=e===``?`${t}${n[0]}`:this.path.join(e,`${t}${n[0]}`);for(let r of n){let n=e===``?`${t}${r}`:this.path.join(e,`${t}${r}`);if(this.exists(n))return n}return r}};function YF(e,t,n,r){return new JF(e,t,n,r)}function XF(e,t){let n=new Map,r=new Map;for(let t of e){if(t.mcpConfig==null)continue;let e=TP(t),i=0;for(let[e,r]of Object.entries(t.mcpConfig.mcpServers))n.set(e,r),i++;i>0&&r.set(e,i)}if(r.size>0&&t==null)return n;let i=[...r.values()].reduce((e,t)=>e+t,0);return t?.debug(`mcp servers collected`,{totalSkills:r.size,totalServers:i,bySkill:Object.fromEntries(r)}),n}function ZF(e,t){let n={};for(let[r,i]of e)n[r]=t(i);return n}var QF=class{fs;logger;constructor(e){this.fs=e.fs,this.logger=e.logger}collectMcpServers(e){return XF(e,this.logger)}transformMcpServers(e,t){return ZF(e,t)}readExistingConfig(e){try{if(this.fs.existsSync(e)){let t=this.fs.readFileSync(e,`utf8`);return JSON.parse(t)}}catch(t){this.logger.warn(hp({code:`MCP_CONFIG_READ_FAILED`,title:`Failed to read existing MCP config`,operation:`read`,targetKind:`MCP config file`,path:e,error:t,details:{fallback:`starting fresh`}}))}return{}}writeCursorMcpConfig(e,t,n){let r=this.readExistingConfig(e);r.mcpServers={...r.mcpServers??{},...t};let i=JSON.stringify(r,null,2);return this.writeConfigFile(e,i,Object.keys(t).length,n)}writeOpencodeMcpConfig(e,t,n,r){let i={...this.readExistingConfig(e),...r,mcp:t},a=JSON.stringify(i,null,2);return this.writeConfigFile(e,a,Object.keys(t).length,n)}writeSkillMcpConfig(e,t,n){return this.writeConfigFile(e,t,1,n)}ensureDirectory(e){this.fs.existsSync(e)||this.fs.mkdirSync(e,{recursive:!0})}writeConfigFile(e,t,n,r){if(r)return this.logger.trace({action:`dryRun`,type:`mcpConfig`,path:e,serverCount:n}),{success:!0,path:e,serverCount:n,skipped:!0};try{return this.ensureDirectory(s.dirname(e)),this.fs.writeFileSync(e,t),this.logger.trace({action:`write`,type:`mcpConfig`,path:e,serverCount:n}),{success:!0,path:e,serverCount:n}}catch(t){let n=t instanceof Error?t.message:String(t);return this.logger.error(hp({code:`MCP_CONFIG_WRITE_FAILED`,title:`Failed to write MCP config`,operation:`write`,targetKind:`MCP config file`,path:e,error:n})),{success:!1,path:e,serverCount:0,error:t}}}};function $F(e){let t={};if(e.command!=null)return t.command=e.command,e.args!=null&&(t.args=e.args),e.env!=null&&(t.env=e.env),t;let n=e,r=n.url??n.serverUrl;if(r==null)return t;t.url=r;let{headers:i}=n;return i!=null&&(t.headers=i),t}function eI(e){let t={};if(e.command!=null){t.type=`local`;let n=[e.command];e.args!=null&&n.push(...e.args),t.command=n,e.env!=null&&(t.environment=e.env)}else{t.type=`remote`;let n=e;n.url==null?n.serverUrl!=null&&(t.url=n.serverUrl):t.url=n.url}return t.enabled=e.disabled!==!0,t}var tI=class{registryPath;log;constructor(e,t){this.registryPath=this.resolvePath(e),this.log=t??om(this.constructor.name)}resolvePath(e){return e.startsWith(`~`)?r_(e):s.resolve(e)}getRegistryDir(){return s.dirname(this.registryPath)}ensureRegistryDir(){let e=this.getRegistryDir();t.existsSync(e)||t.mkdirSync(e,{recursive:!0})}read(){if(!t.existsSync(this.registryPath))return this.log.debug(`registry not found`,{path:this.registryPath}),this.createInitialRegistry();try{let e=t.readFileSync(this.registryPath,`utf8`);return JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error(hp({code:`REGISTRY_READ_FAILED`,title:`Failed to read registry file`,operation:`read`,targetKind:`registry file`,path:this.registryPath,error:t})),this.createInitialRegistry()}}write(e,n){let r={...e,lastUpdated:new Date().toISOString()};if(n===!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(r,null,2);return t.writeFileSync(i,e,`utf8`),t.renameSync(i,this.registryPath),this.log.trace({action:`write`,type:`registry`,path:this.registryPath}),!0}catch(e){let n=e instanceof Error?e.message:String(e);this.log.error(hp({code:`REGISTRY_WRITE_FAILED`,title:`Failed to write registry file`,operation:`write`,targetKind:`registry file`,path:this.registryPath,error:n}));try{t.existsSync(i)&&t.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(dp({code:`REGISTRY_ENTRY_REGISTRATION_FAILED`,title:`Failed to register registry entry: ${e}`,rootCause:q(`tnmsc could not persist the registry entry "${e}" because the registry write step failed.`),exactFix:q(`Fix the registry path permissions or invalid on-disk state, then rerun tnmsc.`),details:{entryName:e,registryPath:this.registryPath}})))}return n}generateEntryId(e){let t=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return e==null?t:`${e}-${t}`}};function nI(){rm()}function rI(e,t){return om(e,t)}function iI(){return im()}function aI(){am()}function oI(){return nm()}function sI(e){tm(e)}const cI=`.tnmsc.json`,lI=`.aindex`;function uI(){return n_()}var dI=class{logger;constructor(e={}){this.logger=om(`ConfigLoader`)}getSearchPaths(e=a.cwd()){let t=$g();if(!t.isWsl)return[n_()];if(this.logger.info(`wsl environment detected`,{effectiveHomeDir:t.effectiveHomeDir}),t.selectedGlobalConfigPath==null)throw Error(`WSL host config file not found under "${t.windowsUsersRoot}/*/${lI}/${cI}".`);return this.logger.info(`using wsl host global config`,{path:t.selectedGlobalConfigPath}),[n_()]}loadFromFile(e){let n=this.resolveTilde(e);try{if(!t.existsSync(n))return{config:{},source:null,found:!1};let e=t.readFileSync(n,`utf8`),r=this.parseConfig(e,n);return this.logger.debug(`loaded`,{source:n}),{config:r,source:n,found:!0}}catch(e){return this.logger.warn(hp({code:`CONFIG_FILE_LOAD_FAILED`,title:`Failed to load config file`,operation:`read`,targetKind:`config file`,path:n,error:e})),{config:{},source:null,found:!1}}}load(e=a.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){let n;try{n=JSON.parse(e)}catch(e){throw e instanceof SyntaxError?Error(`Invalid JSON in ${t}: ${e.message}`):e}let r=YP.safeParse(n);if(r.success)return r.data;let i=r.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`);throw Error(`Config validation failed in ${t}:\n${i.join(`
394
- `)}`)}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=this.mergeAindex(e.aindex,t.aindex),r=this.mergeOutputScopeOptions(e.outputScopes,t.outputScopes),i=this.mergeFrontMatterOptions(e.frontMatter,t.frontMatter),a=this.mergeCleanupProtectionOptions(e.cleanupProtection,t.cleanupProtection),o=this.mergeWindowsOptions(e.windows,t.windows);return{...e,...t,...n==null?{}:{aindex:n},...r==null?{}:{outputScopes:r},...i==null?{}:{frontMatter:i},...a==null?{}:{cleanupProtection:a},...o==null?{}:{windows:o}}},{})}mergeAindex(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:Xh(e,t)}mergeOutputScopeTopics(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{...e,...t}}mergeOutputScopeOptions(e,t){if(e==null&&t==null)return;if(e==null)return t;if(t==null)return e;let n={};for(let[t,r]of Object.entries(e.plugins??{}))r!=null&&(n[t]={...r});for(let[e,r]of Object.entries(t.plugins??{})){let t=this.mergeOutputScopeTopics(n[e],r);t!=null&&(n[e]=t)}return Object.keys(n).length===0?{}:{plugins:n}}mergeFrontMatterOptions(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{...e,...t}}mergeCleanupProtectionOptions(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{rules:[...e.rules??[],...t.rules??[]]}}mergeWindowsOptions(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{...e,...t,...e.wsl2!=null||t.wsl2!=null?{wsl2:{...e.wsl2,...t.wsl2}}:{}}}resolveTilde(e){return e.startsWith(`~`)?r_(e):e}};let fI=null;function pI(e){return(e||!fI)&&(fI=new dI(e)),fI}function mI(e){return pI().load(e)}function hI(){let e=om(`ConfigLoader`),n;try{n=n_()}catch(t){let n=t instanceof Error?t.message:String(t);return e.error(_p({code:`GLOBAL_CONFIG_PATH_RESOLUTION_FAILED`,title:`Failed to resolve global config path`,reason:q(n),configPath:`${wg}/${Tg}`,exactFix:q(`Ensure the required global config exists in the expected runtime-specific location before running tnmsc again.`)})),{valid:!1,exists:!1,errors:[n],shouldExit:!0}}if(!t.existsSync(n)){let t=`Global config not found at ${n}. Please create it manually.`;return e.error(_p({code:`GLOBAL_CONFIG_MISSING`,title:`Global config file is missing`,reason:q(`tnmsc could not find the required global config file at "${n}".`),configPath:n,exactFix:q(`Create the global config file manually before running tnmsc again.`),possibleFixes:[q("Initialize the file with a valid JSON object, for example `{}`.")]})),{valid:!1,exists:!1,errors:[t],shouldExit:!0}}let r;try{r=t.readFileSync(n,`utf8`)}catch(t){let r=t instanceof Error?t.message:String(t);return e.error(hp({code:`GLOBAL_CONFIG_READ_FAILED`,title:`Failed to read global config file`,operation:`read`,targetKind:`global config file`,path:n,error:r})),{valid:!1,exists:!0,errors:[`Failed to read config: ${r}`],shouldExit:!0}}let i;try{i=JSON.parse(r)}catch(t){let r=t instanceof Error?t.message:String(t);return e.error(_p({code:`GLOBAL_CONFIG_JSON_INVALID`,title:`Global config contains invalid JSON`,reason:q(`tnmsc could not parse the JSON in "${n}".`,`Parser error: ${r}`),configPath:n,exactFix:q(`Fix the JSON syntax in the global config file so it parses as a single JSON object.`),possibleFixes:[q(`Validate the file with a JSON parser and remove trailing commas or invalid tokens.`)]})),{valid:!1,exists:!0,errors:[`Invalid JSON: ${r}`],shouldExit:!0}}if(typeof i!=`object`||!i||Array.isArray(i))return e.error(_p({code:`GLOBAL_CONFIG_NOT_OBJECT`,title:`Global config must be a JSON object`,reason:q(`tnmsc parsed "${n}" successfully, but the top-level value is not a JSON object.`),configPath:n,exactFix:q("Replace the top-level JSON value with an object like `{}` or a valid config object.")})),{valid:!1,exists:!0,errors:[`Config must be a JSON object`],shouldExit:!0};let a=YP.safeParse(i);if(!a.success){let t=a.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`);for(let r of t)e.error(_p({code:`GLOBAL_CONFIG_VALIDATION_FAILED`,title:`Global config validation failed`,reason:up(r),configPath:n,exactFix:q(`Update the invalid config field so it matches the tnmsc schema.`),possibleFixes:[q(`Compare the field name and value against the current config schema or examples.`)],details:{validationError:r}}));return{valid:!1,exists:!0,errors:t,shouldExit:!0}}return{valid:!0,exists:!0,errors:[],shouldExit:!1}}function gI(e){return Bh.includes(e)}function _I(e){return Bh.map(t=>bI(e.aindex,t))}function vI(e,t){return bI(e.aindex,t)}function yI(e){let t=new Map;for(let n of e){let e=t.get(n.projectName);e==null?t.set(n.projectName,[n]):e.push(n)}return Array.from(t.entries(),([e,t])=>({projectName:e,refs:[...t].sort((e,t)=>e.seriesName.localeCompare(t.seriesName))})).filter(e=>new Set(e.refs.map(e=>e.seriesName)).size>1).sort((e,t)=>e.projectName.localeCompare(t.projectName))}function bI(e,t){return{name:t,src:e[t].src,dist:e[t].dist}}var xI=class extends R_{constructor(){super(`MarkdownWhitespaceCleanupEffectInputCapability`),this.registerEffect(`markdown-whitespace-cleanup`,this.cleanupWhitespace.bind(this),30)}async cleanupWhitespace(e){let{fs:t,path:n,aindexDir:r,dryRun:i,logger:a,userConfigOptions:o}=e,s=[],c=[],l=[],u=_I(o).map(e=>n.join(r,e.src)),d=[n.join(r,`src`),...u,n.join(r,`dist`)];for(let n of d){if(!t.existsSync(n)){a.debug({action:`whitespace-cleanup`,message:`Directory does not exist, skipping`,dir:n});continue}this.processDirectory(e,n,s,c,l,i??!1)}let f=l.length>0;return{success:!f,description:i?`Would modify ${s.length} files, skip ${c.length} files`:`Modified ${s.length} files, skipped ${c.length} files`,modifiedFiles:s,skippedFiles:c,...f&&{error:Error(`${l.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(hp({code:`WHITESPACE_CLEANUP_DIRECTORY_READ_FAILED`,title:`Whitespace cleanup could not read a directory`,operation:`read`,targetKind:`cleanup directory`,path:t,error:e}));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,`utf8`),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,`utf8`),n.push(t),s.debug({action:`whitespace-cleanup`,modified:t}))}catch(e){i.push({path:t,error:e}),s.warn(hp({code:`WHITESPACE_CLEANUP_FILE_PROCESS_FAILED`,title:`Whitespace cleanup could not process a markdown file`,operation:`process`,targetKind:`markdown file`,path:t,error:e}))}}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
391
+ `,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}`}getSkillName(e){return AN(e)}getSubAgentCanonicalName(e){return jN(e)}transformCommandName(e,t){let{includeSeriesPrefix:n=!0,seriesSeparator:r=`-`}=t??{};return!n||e.commandPrefix==null?`${e.commandName}.md`:`${e.commandPrefix}${r}${e.commandName}.md`}transformSubAgentName(e,t){let{fileNameSource:n}=this.subAgentsConfig,r=t?.includePrefix??this.subAgentsConfig.includePrefix,i=t?.linkSymbol??this.subAgentsConfig.linkSymbol,a=t?.ext??this.subAgentsConfig.ext,o=a.startsWith(`.`)?a:`.${a}`;return n===`frontMatterName`&&this.warnDeprecatedSubAgentFileNameSource(),r&&e.agentPrefix!=null&&e.agentPrefix.length>0?`${e.agentPrefix}${i}${e.agentName}${o}`:`${e.agentName}${o}`}normalizeOutputFileStem(e){let t=Array.from(e.trim(),e=>(e.codePointAt(0)??0)<=31||`<>:"/\\|?*`.includes(e)?`-`:e).join(``);for(;t.endsWith(`.`)||t.endsWith(` `);)t=t.slice(0,-1);if(t.length===0)throw Error(`Cannot derive a valid output file name from "${e}"`);return t}warnDeprecatedSubAgentFileNameSource(){this.warnedDeprecatedSubAgentFileNameSource||(this.warnedDeprecatedSubAgentFileNameSource=!0,this.log.warn(_p({code:`SUBAGENT_FRONTMATTER_NAME_SOURCE_DEPRECATED`,title:`Sub-agent fileNameSource="frontMatterName" now resolves from derived names`,reason:q(`The ${this.name} plugin no longer reads authored sub-agent front matter names.`,`tnmsc now derives sub-agent names from the sub-agent path.`),exactFix:q("Remove authored `name` fields from sub-agent sources.",'Keep using `fileNameSource="frontMatterName"` only as a temporary alias for the derived-path naming behavior.'),details:{plugin:this.name}})))}appendSubAgentDeclarations(e,t,n,r){let i=new Map;for(let a of r){let r=this.transformSubAgentName(a),o=s.join(t,this.subAgentsConfig.subDir,r),c=i.get(o);if(c!=null)throw Error(`Sub-agent output collision in ${this.name}: "${this.getSubAgentCanonicalName(a)}" and "${c}" both resolve to ${o}`);i.set(o,this.getSubAgentCanonicalName(a)),e.push({path:o,scope:n,source:{kind:`subAgent`,subAgent:a}})}}appendCommandDeclarations(e,t,n,r,i){for(let a of r){let r=this.transformCommandName(a,i);e.push({path:s.join(t,this.commandsConfig.subDir,r),scope:n,source:{kind:`command`,command:a}})}}appendSkillDeclarations(e,t,n,r){for(let i of r){let r=this.getSkillName(i),a=s.join(t,this.skillsConfig.subDir,r);if(e.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let t of i.childDocs)e.push({path:s.join(a,t.dir.path.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillReference`,content:t.content}});if(i.resources!=null)for(let t of i.resources)e.push({path:s.join(a,t.relativePath),scope:n,source:{kind:`skillResource`,content:t.content,encoding:t.encoding}})}}appendRuleDeclarations(e,t,n,r){let i=s.join(t,this.rulesConfig.subDir??`rules`);for(let t of r)e.push({path:s.join(i,this.buildRuleFileName(t)),scope:n,source:{kind:`rule`,rule:t}})}buildSubAgentTomlContent(e,t){let{bodyFieldName:n}=this.subAgentsConfig;if(n==null||n.length===0)throw Error(`subagents.bodyFieldName is required when artifactFormat="toml" for ${this.name}`);return this.buildTomlContent({content:e.content,bodyFieldName:n,...t!=null&&{frontMatter:t},...this.subAgentsConfig.fieldNameMap!=null&&{fieldNameMap:this.subAgentsConfig.fieldNameMap},...this.subAgentsConfig.excludedFrontMatterFields!=null&&{excludedKeys:this.subAgentsConfig.excludedFrontMatterFields},...this.subAgentsConfig.extraFields!=null&&{extraFields:this.subAgentsConfig.extraFields},...this.subAgentsConfig.fieldOrder!=null&&{fieldOrder:this.subAgentsConfig.fieldOrder}})}getCommandSeriesOptions(e){let t=e.pluginOptions?.commandSeriesOptions,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.getCommandSeriesOptions(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)}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)}normalizeRuleScope(e){return e.scope??`project`}normalizeSourceScope(e){return e===`global`||e===`project`?e:`project`}remapDeclarationScope(e,t){return t?.[e]??e}resolveCommandSourceScope(e){if(e.globalOnly===!0)return`global`;let t=e.yamlFrontMatter?.scope;return this.remapDeclarationScope(this.normalizeSourceScope(t),this.commandsConfig.scopeRemap)}resolveSubAgentSourceScope(e){let t=e.yamlFrontMatter?.scope;return this.remapDeclarationScope(this.normalizeSourceScope(t),this.subAgentsConfig.scopeRemap)}resolveSkillSourceScope(e){let t=e.yamlFrontMatter?.scope;return this.remapDeclarationScope(this.normalizeSourceScope(t),this.skillsConfig.scopeRemap)}selectSingleScopeItems(e,t,n,r){if(e.length===0)return{items:[]};let[i]=FN({requestedScopes:r,defaultScopes:t,supportedScopes:t,singleScope:!0,availableScopes:[...new Set(e.map(n))]});return i==null?{items:[]}:{selectedScope:i,items:e.filter(e=>n(e)===i)}}selectRuleScopes(e,t){let n=[...new Set(t.map(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))))];return FN({requestedScopes:this.getTopicScopeOverride(e,`rules`),defaultScopes:this.rulesConfig.sourceScopes??[`project`,`global`],supportedScopes:this.rulesConfig.sourceScopes??[`project`,`global`],singleScope:!1,availableScopes:n}).filter(e=>n.includes(e))}selectPromptScopes(e,t=[`project`,`global`],n=t){return FN({requestedScopes:this.getTopicScopeOverride(e,`prompt`),defaultScopes:n,supportedScopes:t,singleScope:!1})}getTopicScopeOverride(e,t){return e.pluginOptions?.outputScopes?.plugins?.[this.name]?.[t]}buildSkillFrontMatter(e,t){let n=e.yamlFrontMatter,r={name:this.getSkillName(e),description:n.description};return`displayName`in n&&n.displayName!=null&&(r.displayName=n.displayName),`keywords`in n&&n.keywords!=null&&n.keywords.length>0&&(r.keywords=n.keywords),`author`in n&&n.author!=null&&(r.author=n.author),`version`in n&&n.version!=null&&(r.version=n.version),(t?.includeTools??!0)&&`allowTools`in n&&n.allowTools!=null&&n.allowTools.length>0&&(r.allowTools=(t?.toolFormat??`array`)===`string`?n.allowTools.join(`,`):n.allowTools),t?.additionalFields!=null&&Object.assign(r,t.additionalFields),r}buildRuleContent(e,t){let n=this.rulesConfig.transformFrontMatter?this.rulesConfig.transformFrontMatter(e):{globs:e.globs.join(`, `)},r=n==null||Object.keys(n).length===0?void 0:n;return this.buildMarkdownContent(e.content,r,t)}buildRuleFileName(e){return`${`${this.rulesConfig.prefix??`rule`}${this.rulesConfig.linkSymbol??`-`}`}${e.prefix}${this.rulesConfig.linkSymbol??`-`}${e.ruleName}${this.rulesConfig.ext??`.md`}`}async declareOutputFiles(e){return this.buildDefaultOutputDeclarations(e)}async declareCleanupPaths(e){let t=[...this.buildCleanupTargetsFromScopeConfig(this.cleanupConfig.delete,`delete`,e)],n=[...this.buildCleanupTargetsFromScopeConfig(this.cleanupConfig.protect,`protect`,e)],{excludeScanGlobs:r}=this.cleanupConfig,i=this.getIgnoreOutputPath();if(i!=null)for(let n of this.getProjectOutputProjects(e)){if(n.isWorkspaceRootProject===!0||n.isPromptSourceProject===!0)continue;let r=this.resolveProjectRootDir(e,n);r!=null&&t.push({path:s.join(r,i),kind:`file`,scope:`project`,label:`delete.indexignore`})}return t.length===0&&n.length===0&&(r==null||r.length===0)?{}:{...t.length>0&&{delete:t},...n.length>0&&{protect:n},...r!=null&&r.length>0&&{excludeScanGlobs:r}}}async declareWslMirrorFiles(e){return this.wslMirrorPaths.map(e=>({sourcePath:e}))}async convertContent(e,t){let n=e.source;switch(n.kind){case`projectRootMemory`:case`projectChildMemory`:case`globalMemory`:case`skillReference`:case`ignoreFile`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`subAgent`:return this.buildSubAgentContent(n.subAgent,t);case`skillMain`:return this.buildSkillMainContent(n.skill,t);case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;case`rule`:return this.buildRuleContent(n.rule,t);default:throw Error(`Unsupported declaration source for plugin ${this.name}`)}}async buildDefaultOutputDeclarations(e){let t=[],{globalMemory:n,commands:r,subAgents:i,skills:a,rules:o,aiAgentIgnoreConfigFiles:c}=e.collectedOutputContext,l=this.getTransformOptionsFromContext(e),u=this.getIgnoreOutputPath(),d=this.indexignore==null?void 0:c?.find(e=>e.fileName===this.indexignore),f=this.commandOutputEnabled&&r!=null?this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)):{items:[]},p=this.subAgentOutputEnabled&&i!=null?this.selectSingleScopeItems(i,this.subAgentsConfig.sourceScopes,e=>this.resolveSubAgentSourceScope(e),this.getTopicScopeOverride(e,`subagents`)):{items:[]},m=this.skillOutputEnabled&&a!=null?this.selectSingleScopeItems(a,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)):{items:[]},h=o??[],g=this.ruleOutputEnabled&&h.length>0?new Set(this.selectRuleScopes(e,h)):new Set,_=new Set(this.selectPromptScopes(e,this.outputCapabilities.prompt?.scopes??[`project`,`global`])),v={project:[],global:[]};for(let e of h)v[this.normalizeSourceScope(this.normalizeRuleScope(e))].push(e);for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n),i=this.resolveProjectConfigDir(e,n);if(r==null||i==null)continue;if(this.outputFileName.length>0&&_.has(`project`)&&this.isProjectPromptOutputTarget(n)&&(n.rootMemoryPrompt!=null&&t.push({path:s.join(r,this.outputFileName),scope:`project`,source:{kind:`projectRootMemory`,content:n.rootMemoryPrompt.content}}),n.childMemoryPrompts!=null))for(let e of n.childMemoryPrompts)t.push({path:this.resolveFullPath(e.dir),scope:`project`,source:{kind:`projectChildMemory`,content:e.content}});let{projectConfig:a}=n;if(f.selectedScope===`project`&&f.items.length>0){let e=$(f.items,a,`commands`);this.appendCommandDeclarations(t,i,`project`,e,l)}if(p.selectedScope===`project`&&p.items.length>0){let e=$(p.items,a,`subAgents`);this.appendSubAgentDeclarations(t,i,`project`,e)}if(m.selectedScope===`project`&&m.items.length>0){let e=$(m.items,a,`skills`);this.appendSkillDeclarations(t,i,`project`,e)}if(g.has(`project`)){let e=aN($(v.project,a,`rules`),a);this.appendRuleDeclarations(t,i,`project`,e)}u!=null&&d!=null&&n.isWorkspaceRootProject!==!0&&n.isPromptSourceProject!==!0&&n.dirFromWorkspacePath!=null&&t.push({path:s.join(n.dirFromWorkspacePath.basePath,n.dirFromWorkspacePath.path,u),scope:`project`,source:{kind:`ignoreFile`,content:d.content}})}let y=this.resolvePromptSourceProjectConfig(e);if(f.selectedScope===`global`&&f.items.length>0){let e=$(f.items,y,`commands`),n=this.getGlobalConfigDir();this.appendCommandDeclarations(t,n,`global`,e,l)}if(p.selectedScope===`global`&&p.items.length>0){let e=$(p.items,y,`subAgents`),n=this.getGlobalConfigDir();this.appendSubAgentDeclarations(t,n,`global`,e)}if(m.selectedScope===`global`&&m.items.length>0){let e=$(m.items,y,`skills`),n=this.getGlobalConfigDir();this.appendSkillDeclarations(t,n,`global`,e)}for(let e of[`global`]){if(!g.has(e))continue;let n=this.getGlobalConfigDir(),r=aN($(v[e],y,`rules`),y);this.appendRuleDeclarations(t,n,e,r)}return n!=null&&this.outputFileName.length>0&&_.has(`global`)&&t.push({path:s.join(this.getGlobalConfigDir(),this.outputFileName),scope:`global`,source:{kind:`globalMemory`,content:n.content}}),t}async buildCommandContent(e,t){let n=e.content,r=e.yamlFrontMatter,i=!1;if(e.rawMdxContent!=null&&this.toolPreset!=null){this.log.debug(`recompiling command with tool preset`,{file:e.dir.getAbsolutePath(),toolPreset:this.toolPreset,hasRawContent:!0});let t=new lN({toolPreset:this.toolPreset}).collect(),a=await TN({filePath:e.dir.getAbsolutePath(),globalScope:t,rawMdx:e.rawMdxContent});n=a.content,r=a.metadata,i=!0}let a=this.commandsConfig.transformFrontMatter;if(a==null)throw Error(`commands.transformFrontMatter is required for command output plugin: ${this.name}`);let o=a(e,{isRecompiled:i,...r!=null&&{sourceFrontMatter:r}});return this.buildMarkdownContent(n,o,t)}buildSubAgentContent(e,t){let n=this.subAgentsConfig.transformFrontMatter,r=n?.(e,{...e.yamlFrontMatter!=null&&{sourceFrontMatter:e.yamlFrontMatter}});if(this.subAgentsConfig.artifactFormat===`toml`){let t=r??e.yamlFrontMatter;return this.buildSubAgentTomlContent(e,t)}return r==null?this.buildMarkdownContentWithRaw(e.content,e.yamlFrontMatter,e.rawFrontMatter,t):this.buildMarkdownContent(e.content,r,t)}buildSkillMainContent(e,t){return this.buildMarkdownContentWithRaw(e.content,e.yamlFrontMatter,e.rawFrontMatter,t)}};const rF={USER_HOME:`~`,WORKSPACE:`$WORKSPACE`},iF={},aF={AgentsOutput:`AgentsOutputPlugin`,GeminiCLIOutput:`GeminiCLIOutputPlugin`,CursorOutput:`CursorOutputPlugin`,WindsurfOutput:`WindsurfOutputPlugin`,ClaudeCodeCLIOutput:`ClaudeCodeCLIOutputPlugin`,KiroIDEOutput:`KiroCLIOutputPlugin`,OpencodeCLIOutput:`OpencodeCLIOutputPlugin`,OpenAICodexCLIOutput:`CodexCLIOutputPlugin`,DroidCLIOutput:`DroidCLIOutputPlugin`,WarpIDEOutput:`WarpIDEOutputPlugin`,TraeIDEOutput:`TraeIDEOutputPlugin`,TraeCNIDEOutput:`TraeCNIDEOutputPlugin`,QoderIDEOutput:`QoderIDEPluginOutputPlugin`,JetBrainsCodeStyleOutput:`JetBrainsIDECodeStyleConfigOutputPlugin`,JetBrainsAICodexOutput:`JetBrainsAIAssistantCodexOutputPlugin`,AgentSkillsCompactOutput:`GenericSkillsOutputPlugin`,GitExcludeOutput:`GitExcludeOutputPlugin`,ReadmeOutput:`ReadmeMdConfigFileOutputPlugin`,VSCodeOutput:`VisualStudioCodeIDEConfigOutputPlugin`,ZedOutput:`ZedIDEConfigOutputPlugin`,EditorConfigOutput:`EditorConfigOutputPlugin`,AntigravityOutput:`AntigravityOutputPlugin`},oF=`__workspace__`,sF={SKILL:`SKILL.md`,CURSOR_GLOBAL_RULE:`global.mdc`,CURSOR_PROJECT_RULE:`always.md`,MCP_CONFIG:`mcp.json`,CLAUDE_MEMORY:`CLAUDE.md`,WINDSURF_GLOBAL_RULE:`global_rules.md`},cF={RULE:`rule-`,CHILD_RULE:`glob-`},lF={RULES:`rules`,COMMANDS:`commands`,SKILLS:`skills`,AGENTS:`agents`,CURSOR_SKILLS:`skills-cursor`},uF={ALWAYS_APPLY:`alwaysApply`,GLOBS:`globs`,DESCRIPTION:`description`,NAME:`name`,TRIGGER:`trigger`},dF={MD:`.md`,MDC:`.mdc`,MDX:`.mdx`,JSON:`.json`},fF={PRIMARY:`.src.mdx`},pF=[fF.PRIMARY],mF={zh:pF,en:dF.MDX};function hF(e){return pF.some(t=>e.endsWith(t))}const gF={CURSOR:`.cursor`,CLAUDE:`.claude`,WINDSURF:`.codeium/windsurf`,WINDSURF_RULES:`.windsurf`},_F={CURSOR:`.cursorignore`,WINDSURF:`.codeignore`,WINDSURF_LEGACY:`.codeiumignore`},vF={CURSOR:new Set([`create-rule`,`create-skill`,`create-subagent`,`migrate-to-skills`,`update-cursor-settings`])},yF={CLAUDE_CODE:`claudeCode`};var bF=class extends Error{kind;nameOfPrompt;sourcePath;expectedDistPath;constructor(e){let{kind:t,name:n,sourcePath:r,expectedDistPath:i}=e;super([`Missing compiled dist prompt for ${t} "${n}".`,...r==null?[]:[`source: ${r}`],`expected dist: ${i}`].join(` `)),this.name=`MissingCompiledPromptError`,this.kind=t,this.nameOfPrompt=n,r!=null&&(this.sourcePath=r),this.expectedDistPath=i}},xF=class extends Error{filePath;lineNumber;constructor(e,t,n){super(`Compiled prompt still contains residual module syntax at ${e}:${t}: ${n.trim()}`),this.name=`ResidualModuleSyntaxError`,this.filePath=e,this.lineNumber=t}};const SF=/^\s*(```|~~~)/u,CF=[/^\s*export\s+default\b/u,/^\s*export\s+const\b/u,/^\s*import\b/u];function wF(e,t){let n,r=e.split(/\r?\n/u);for(let[e,i]of r.entries()){let r=SF.exec(i);if(r?.[1]!=null){let e=r[1];n==null?n=e:n===e&&(n=void 0);continue}if(n==null&&CF.some(e=>e.test(i)))throw new xF(t,e+1,i)}}function TF(e,t,n={}){let{preferredSourcePath:r,distRootDir:i,srcRootDir:a}=n;if(t==null||t.length===0||r!=null&&r.length>0)return r;if(i==null||a==null)return;let o=e.relative(i,t);if(!(o.startsWith(`..`)||e.isAbsolute(o)))return e.join(a,o.replace(/\.mdx$/u,`.src.mdx`))}function EF(e){if(e instanceof sp&&e.filePath!=null)return e.filePath;if(!(e instanceof Error)||!(`filePath`in e))return;let{filePath:t}=e;if(typeof t==`string`&&t.length>0)return t}function DF(e,t){let n=EF(e)??t.distPath,r=[t.operation??`Prompt compilation failed.`,`prompt kind: ${t.promptKind}`,`logical name: ${t.logicalName}`];return t.entryDistPath!=null&&t.entryDistPath.length>0&&t.entryDistPath!==n&&r.push(`entry dist file: ${t.entryDistPath}`),n!=null&&n.length>0&&r.push(`dist file: ${n}`),r.push(`src file: ${t.srcPath??`<unresolved>`}`),r.push(`diagnostic:`),r.push(e instanceof Error?op(e):String(e)),r.join(`
392
+ `)}function OF(e){return e instanceof bF||e instanceof xF}var kF=class{constructor(e,t,n,r){this.fs=e,this.path=t,this.logger=n,this.globalScope=r}async readDirectoryStructure(e,t,n){let r=[],i=[];if(!this.exists(e))return{prompts:r,errors:i};try{let a=this.fs.readdirSync(e,{withFileTypes:!0});for(let o of a){if(!o.isDirectory())continue;let{name:a}=o,s=this.path.join(e,a),c=this.path.join(t,a);try{let e=await this.readEntry(a,s,c,n,!0);e&&r.push(e)}catch(e){if(i.push({path:s,error:e,phase:`read`}),this.logger.error(hp({code:`LOCALIZED_PROMPT_ENTRY_READ_FAILED`,title:`Failed to read localized prompt entry`,operation:`read`,targetKind:`${String(n.kind)} prompt entry`,path:s,error:e,details:{entryName:a,promptKind:String(n.kind)}})),OF(e))throw e}}}catch(t){if(i.push({path:e,error:t,phase:`scan`}),this.logger.error(hp({code:`LOCALIZED_PROMPT_DIRECTORY_SCAN_FAILED`,title:`Failed to scan localized prompt source directory`,operation:`scan`,targetKind:`${String(n.kind)} prompt source directory`,path:e,error:t,details:{promptKind:String(n.kind)}})),OF(t))throw t}return{prompts:r,errors:i}}async readFlatFiles(e,t,n){let r=[],i=[],a=this.exists(e),o=this.exists(t);if(this.logger.debug(`readFlatFiles: srcDir=${e}, exists=${a}`),this.logger.debug(`readFlatFiles: distDir=${t}, exists=${o}`),!a&&!o)return{prompts:r,errors:i};let s=this.normalizeExtensions(n.localeExtensions.zh),c=new Set,l=async(a,o)=>{if(!c.has(a)){c.add(a);try{let i=await this.readFlatEntry(a,e,t,a,n);i&&r.push(i)}catch(e){if(i.push({path:o,error:e,phase:`read`}),this.logger.error(hp({code:`LOCALIZED_PROMPT_FILE_READ_FAILED`,title:`Failed to read localized prompt file`,operation:`read`,targetKind:`${String(n.kind)} prompt file`,path:o,error:e,details:{promptKind:String(n.kind),logicalName:a}})),OF(e))throw e}}},u=async(e,t=``)=>{if(this.exists(e))try{let n=this.fs.readdirSync(e,{withFileTypes:!0});for(let r of n){let n=t?this.path.join(t,r.name):r.name;if(r.isDirectory()){await u(this.path.join(e,r.name),n);continue}let i=this.findMatchingExtension(r.name,s);if(!r.isFile()||i==null)continue;let a=r.name.slice(0,-i.length);await l(t?this.path.join(t,a):a,this.path.join(e,r.name))}}catch(t){if(i.push({path:e,error:t,phase:`scan`}),this.logger.error(hp({code:`LOCALIZED_SOURCE_DIRECTORY_SCAN_FAILED`,title:`Failed to scan localized source directory`,operation:`scan`,targetKind:`${String(n.kind)} source directory`,path:e,error:t,details:{promptKind:String(n.kind)}})),OF(t))throw t}},d=async(e,t=``)=>{if(this.exists(e))try{let n=this.fs.readdirSync(e,{withFileTypes:!0});for(let r of n){let n=t?this.path.join(t,r.name):r.name;if(r.isDirectory()){await d(this.path.join(e,r.name),n);continue}if(!r.isFile()||!r.name.endsWith(`.mdx`))continue;let i=r.name.slice(0,-4);await l(t?this.path.join(t,i):i,this.path.join(e,r.name))}}catch(t){if(i.push({path:e,error:t,phase:`scan`}),this.logger.error(hp({code:`LOCALIZED_DIST_DIRECTORY_SCAN_FAILED`,title:`Failed to scan localized dist directory`,operation:`scan`,targetKind:`${String(n.kind)} dist directory`,path:e,error:t,details:{promptKind:String(n.kind)}})),OF(t))throw t}};return a&&await u(e),o&&await d(t),{prompts:r,errors:i}}async readSingleFile(e,t,n){let r=this.path.basename(e);return this.readFlatEntry(r,this.path.dirname(e),this.path.dirname(t),e,n,!0)}async readEntry(e,t,n,r,i=!0){let{localeExtensions:a,entryFileName:o,createPrompt:s,kind:c}=r,l=r.hydrateSourceContents??!0,u=o??e,d=this.normalizeExtensions(a.zh),f=this.normalizeExtensions(a.en),p=this.resolveLocalizedPath(t,u,d),m=this.resolveLocalizedPath(t,u,f),h=this.path.join(n,`${u}.mdx`),g=this.exists(p),_=this.exists(m),v=g?p:_?m:void 0,y={promptKind:String(c),logicalName:e,entryDistPath:h,...v!=null&&{srcPath:v}},b=await this.readDistContent(h,s,e,y),x=g&&l?await this.readLocaleContent(p,`zh`,s,e,String(c)):null,S=_&&l?await this.readLocaleContent(m,`en`,s,e,String(c)):null,C=b!=null,w=g?p:_?m:void 0;if(!C&&!g&&!_)return this.logger.warn(dp({code:`LOCALIZED_PROMPT_ARTIFACTS_MISSING`,title:`Missing source and dist prompt artifacts for ${e}`,rootCause:q(`tnmsc could not find either the source prompt or the compiled dist prompt for "${e}".`),exactFix:q(`Create the source prompt and rebuild the compiled dist prompt before retrying tnmsc.`),details:{promptKind:String(c),name:e,srcZhPath:p,srcEnPath:m,distPath:h}})),null;if(!C)throw new bF({kind:String(c),name:e,...w!=null&&{sourcePath:w},expectedDistPath:h});let T=l&&x!=null?{zh:x,...S!=null&&{en:S},default:x,defaultLocale:`zh`}:void 0,E=i?this.scanChildren(n,u,[`.mdx`]):void 0;return{name:e,type:c,...T!=null&&{src:T},...C&&{dist:b},metadata:{hasDist:C,hasMultipleLocales:_,isDirectoryStructure:i,...E&&E.length>0&&{children:E}},paths:{...g&&{zh:p},..._&&{en:m},...C&&{dist:h}}}}async readFlatEntry(e,t,n,r,i,a=!1){let{localeExtensions:o,createPrompt:s,kind:c}=i,l=i.hydrateSourceContents??!0,u=this.normalizeExtensions(o.zh),d=this.normalizeExtensions(o.en),f=this.resolveLocalizedPath(``,r,u),p=this.resolveLocalizedPath(``,r,d),m=this.path.join(n,`${e}.mdx`),h=a?f:this.path.join(t,f),g=a?p:this.path.join(t,p),_=this.exists(h),v=this.exists(g),y=_?h:v?g:void 0,b={promptKind:String(c),logicalName:e,entryDistPath:m,...y!=null&&{srcPath:y}},x=await this.readDistContent(m,s,e,b),S=_&&l?await this.readLocaleContent(h,`zh`,s,e,String(c)):null,C=v&&l?await this.readLocaleContent(g,`en`,s,e,String(c)):null,w=x!=null,T=_?h:v?g:void 0;if(!w&&!_&&!v)return this.logger.warn(dp({code:`LOCALIZED_PROMPT_ARTIFACTS_MISSING`,title:`Missing source and dist prompt artifacts for ${e}`,rootCause:q(`tnmsc could not find either the source prompt or the compiled dist prompt for "${e}".`),exactFix:q(`Create the source prompt and rebuild the compiled dist prompt before retrying tnmsc.`),details:{promptKind:String(c),name:e,srcZhPath:h,srcEnPath:g,distPath:m}})),null;if(!w)throw new bF({kind:String(c),name:e,...T!=null&&{sourcePath:T},expectedDistPath:m});let E=l&&S!=null?{zh:S,...C!=null&&{en:C},default:S,defaultLocale:`zh`}:void 0;return{name:e,type:c,...E!=null&&{src:E},...w&&{dist:x},metadata:{hasDist:w,hasMultipleLocales:v,isDirectoryStructure:!1},paths:{..._&&{zh:h},...v&&{en:g},...w&&{dist:m}}}}async readLocaleContent(e,t,n,r,i){if(!this.exists(e))return null;try{let i=await wN(e,{mode:`source`,globalScope:this.globalScope});wF(i.content,e);let a=await n(i.content,t,r,i.metadata),o={content:i.content,lastModified:i.lastModified,filePath:e};return i.rawMdx.length>0&&Object.assign(o,{rawMdx:i.rawMdx}),i.parsed.yamlFrontMatter!=null&&Object.assign(o,{frontMatter:i.parsed.yamlFrontMatter}),a!=null&&Object.assign(o,{prompt:a}),o}catch(n){throw this.logger.error(bp({code:`LOCALIZED_SOURCE_PROMPT_READ_FAILED`,title:`Failed to read localized source prompt`,diagnosticText:DF(n,{operation:`Failed to read localized source prompt.`,promptKind:i,logicalName:r,distPath:e}),details:{promptKind:i,locale:t,filePath:e}})),n}}async readDistContent(e,t,n,r){if(!this.exists(e))return null;try{let r=await wN(e,{mode:`dist`,globalScope:this.globalScope});wF(r.content,e);let i=await t(r.content,`zh`,n,r.metadata),a={content:r.content,lastModified:r.lastModified,prompt:i,filePath:e,rawMdx:r.rawMdx};return r.parsed.yamlFrontMatter!=null&&Object.assign(a,{frontMatter:r.parsed.yamlFrontMatter}),a}catch(t){throw this.logger.error(this.buildDistReadDiagnostic(t,e,r)),t}}buildDistReadDiagnostic(e,t,n){let r=TF(this.path,t,{preferredSourcePath:t===n.entryDistPath?n.srcPath:void 0,distRootDir:this.path.dirname(n.entryDistPath),srcRootDir:n.srcPath==null?void 0:this.path.dirname(n.srcPath)});return bp({code:`LOCALIZED_DIST_PROMPT_READ_FAILED`,title:`Failed to read localized dist prompt`,diagnosticText:DF(e,{operation:`Failed to read dist content.`,promptKind:n.promptKind,logicalName:n.logicalName,entryDistPath:n.entryDistPath,distPath:t,srcPath:r}),details:{promptKind:n.promptKind,logicalName:n.logicalName,filePath:t,srcPath:r}})}scanChildren(e,t,n){let r=[];if(!this.exists(e))return r;let i=new Set(n.map(e=>`${t}${e}`));try{let t=(e,a)=>{let o=this.fs.readdirSync(e,{withFileTypes:!0});for(let s of o){let o=this.path.join(e,s.name),c=a?this.path.join(a,s.name):s.name;if(s.isDirectory())t(o,c);else{let e=this.findMatchingExtension(s.name,n);if(e==null||i.has(s.name))continue;let t=s.name.slice(0,-e.length),a=this.path.dirname(c),o=a===`.`?t:this.path.join(a,t);r.push(o)}}};t(e,``)}catch(t){this.logger.warn(hp({code:`LOCALIZED_PROMPT_CHILD_SCAN_FAILED`,title:`Failed to scan localized prompt child documents`,operation:`scan`,targetKind:`localized prompt child directory`,path:e,error:t}))}return r}exists(e){try{return this.fs.existsSync(e)}catch{return!1}}normalizeExtensions(e){return typeof e==`string`?[e]:e}findMatchingExtension(e,t){return t.find(t=>e.endsWith(t))}resolveLocalizedPath(e,t,n){let r=e===``?`${t}${n[0]}`:this.path.join(e,`${t}${n[0]}`);for(let r of n){let n=e===``?`${t}${r}`:this.path.join(e,`${t}${r}`);if(this.exists(n))return n}return r}};function AF(e,t,n,r){return new kF(e,t,n,r)}function jF(e,t){let n=new Map,r=new Map;for(let t of e){if(t.mcpConfig==null)continue;let e=AN(t),i=0;for(let[e,r]of Object.entries(t.mcpConfig.mcpServers))n.set(e,r),i++;i>0&&r.set(e,i)}if(r.size>0&&t==null)return n;let i=[...r.values()].reduce((e,t)=>e+t,0);return t?.debug(`mcp servers collected`,{totalSkills:r.size,totalServers:i,bySkill:Object.fromEntries(r)}),n}function MF(e,t){let n={};for(let[r,i]of e)n[r]=t(i);return n}var NF=class{fs;logger;constructor(e){this.fs=e.fs,this.logger=e.logger}collectMcpServers(e){return jF(e,this.logger)}transformMcpServers(e,t){return MF(e,t)}readExistingConfig(e){try{if(this.fs.existsSync(e)){let t=this.fs.readFileSync(e,`utf8`);return JSON.parse(t)}}catch(t){this.logger.warn(hp({code:`MCP_CONFIG_READ_FAILED`,title:`Failed to read existing MCP config`,operation:`read`,targetKind:`MCP config file`,path:e,error:t,details:{fallback:`starting fresh`}}))}return{}}writeCursorMcpConfig(e,t,n){let r=this.readExistingConfig(e);r.mcpServers={...r.mcpServers??{},...t};let i=JSON.stringify(r,null,2);return this.writeConfigFile(e,i,Object.keys(t).length,n)}writeOpencodeMcpConfig(e,t,n,r){let i={...this.readExistingConfig(e),...r,mcp:t},a=JSON.stringify(i,null,2);return this.writeConfigFile(e,a,Object.keys(t).length,n)}writeSkillMcpConfig(e,t,n){return this.writeConfigFile(e,t,1,n)}ensureDirectory(e){this.fs.existsSync(e)||this.fs.mkdirSync(e,{recursive:!0})}writeConfigFile(e,t,n,r){if(r)return this.logger.trace({action:`dryRun`,type:`mcpConfig`,path:e,serverCount:n}),{success:!0,path:e,serverCount:n,skipped:!0};try{return this.ensureDirectory(s.dirname(e)),this.fs.writeFileSync(e,t),this.logger.trace({action:`write`,type:`mcpConfig`,path:e,serverCount:n}),{success:!0,path:e,serverCount:n}}catch(t){let n=t instanceof Error?t.message:String(t);return this.logger.error(hp({code:`MCP_CONFIG_WRITE_FAILED`,title:`Failed to write MCP config`,operation:`write`,targetKind:`MCP config file`,path:e,error:n})),{success:!1,path:e,serverCount:0,error:t}}}};function PF(e){let t={};if(e.command!=null)return t.command=e.command,e.args!=null&&(t.args=e.args),e.env!=null&&(t.env=e.env),t;let n=e,r=n.url??n.serverUrl;if(r==null)return t;t.url=r;let{headers:i}=n;return i!=null&&(t.headers=i),t}function FF(e){let t={};if(e.command!=null){t.type=`local`;let n=[e.command];e.args!=null&&n.push(...e.args),t.command=n,e.env!=null&&(t.environment=e.env)}else{t.type=`remote`;let n=e;n.url==null?n.serverUrl!=null&&(t.url=n.serverUrl):t.url=n.url}return t.enabled=e.disabled!==!0,t}var IF=class{registryPath;log;constructor(e,t){this.registryPath=this.resolvePath(e),this.log=t??om(this.constructor.name)}resolvePath(e){return e.startsWith(`~`)?ag(e):s.resolve(e)}getRegistryDir(){return s.dirname(this.registryPath)}ensureRegistryDir(){let e=this.getRegistryDir();t.existsSync(e)||t.mkdirSync(e,{recursive:!0})}read(){if(!t.existsSync(this.registryPath))return this.log.debug(`registry not found`,{path:this.registryPath}),this.createInitialRegistry();try{let e=t.readFileSync(this.registryPath,`utf8`);return JSON.parse(e)}catch(e){let t=e instanceof Error?e.message:String(e);return this.log.error(hp({code:`REGISTRY_READ_FAILED`,title:`Failed to read registry file`,operation:`read`,targetKind:`registry file`,path:this.registryPath,error:t})),this.createInitialRegistry()}}write(e,n){let r={...e,lastUpdated:new Date().toISOString()};if(n===!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(r,null,2);return t.writeFileSync(i,e,`utf8`),t.renameSync(i,this.registryPath),this.log.trace({action:`write`,type:`registry`,path:this.registryPath}),!0}catch(e){let n=e instanceof Error?e.message:String(e);this.log.error(hp({code:`REGISTRY_WRITE_FAILED`,title:`Failed to write registry file`,operation:`write`,targetKind:`registry file`,path:this.registryPath,error:n}));try{t.existsSync(i)&&t.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(dp({code:`REGISTRY_ENTRY_REGISTRATION_FAILED`,title:`Failed to register registry entry: ${e}`,rootCause:q(`tnmsc could not persist the registry entry "${e}" because the registry write step failed.`),exactFix:q(`Fix the registry path permissions or invalid on-disk state, then rerun tnmsc.`),details:{entryName:e,registryPath:this.registryPath}})))}return n}generateEntryId(e){let t=`${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return e==null?t:`${e}-${t}`}};function LF(){rm()}function RF(e,t){return om(e,t)}function zF(){return im()}function BF(){am()}function VF(){return nm()}function HF(e){tm(e)}const UF=`.tnmsc.json`,WF=`.aindex`;function GF(){return ig()}var KF=class{logger;constructor(e={}){this.logger=om(`ConfigLoader`)}getSearchPaths(e=a.cwd()){let t=tg();if(!t.isWsl)return[ig()];if(this.logger.info(`wsl environment detected`,{effectiveHomeDir:t.effectiveHomeDir}),t.selectedGlobalConfigPath==null)throw Error(`WSL host config file not found under "${t.windowsUsersRoot}/*/${WF}/${UF}".`);return this.logger.info(`using wsl host global config`,{path:t.selectedGlobalConfigPath}),[ig()]}loadFromFile(e){let n=this.resolveTilde(e);try{if(!t.existsSync(n))return{config:{},source:null,found:!1};let e=t.readFileSync(n,`utf8`),r=this.parseConfig(e,n);return this.logger.debug(`loaded`,{source:n}),{config:r,source:n,found:!0}}catch(e){return this.logger.warn(hp({code:`CONFIG_FILE_LOAD_FAILED`,title:`Failed to load config file`,operation:`read`,targetKind:`config file`,path:n,error:e})),{config:{},source:null,found:!1}}}load(e=a.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){let n;try{n=JSON.parse(e)}catch(e){throw e instanceof SyntaxError?Error(`Invalid JSON in ${t}: ${e.message}`):e}let r=AP.safeParse(n);if(r.success)return r.data;let i=r.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`);throw Error(`Config validation failed in ${t}:\n${i.join(`
393
+ `)}`)}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=this.mergeAindex(e.aindex,t.aindex),r=this.mergeOutputScopeOptions(e.outputScopes,t.outputScopes),i=this.mergeFrontMatterOptions(e.frontMatter,t.frontMatter),a=this.mergeCleanupProtectionOptions(e.cleanupProtection,t.cleanupProtection),o=this.mergeWindowsOptions(e.windows,t.windows);return{...e,...t,...n==null?{}:{aindex:n},...r==null?{}:{outputScopes:r},...i==null?{}:{frontMatter:i},...a==null?{}:{cleanupProtection:a},...o==null?{}:{windows:o}}},{})}mergeAindex(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:sP(e,t)}mergeOutputScopeTopics(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{...e,...t}}mergeOutputScopeOptions(e,t){if(e==null&&t==null)return;if(e==null)return t;if(t==null)return e;let n={};for(let[t,r]of Object.entries(e.plugins??{}))r!=null&&(n[t]={...r});for(let[e,r]of Object.entries(t.plugins??{})){let t=this.mergeOutputScopeTopics(n[e],r);t!=null&&(n[e]=t)}return Object.keys(n).length===0?{}:{plugins:n}}mergeFrontMatterOptions(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{...e,...t}}mergeCleanupProtectionOptions(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{rules:[...e.rules??[],...t.rules??[]]}}mergeWindowsOptions(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{...e,...t,...e.wsl2!=null||t.wsl2!=null?{wsl2:{...e.wsl2,...t.wsl2}}:{}}}resolveTilde(e){return e.startsWith(`~`)?ag(e):e}};let qF=null;function JF(e){return(e||!qF)&&(qF=new KF(e)),qF}function YF(e){return JF().load(e)}function XF(){let e=om(`ConfigLoader`),n;try{n=ig()}catch(t){let n=t instanceof Error?t.message:String(t);return e.error(_p({code:`GLOBAL_CONFIG_PATH_RESOLUTION_FAILED`,title:`Failed to resolve global config path`,reason:q(n),configPath:`${Eh}/${Dh}`,exactFix:q(`Ensure the required global config exists in the expected runtime-specific location before running tnmsc again.`)})),{valid:!1,exists:!1,errors:[n],shouldExit:!0}}if(!t.existsSync(n)){let t=`Global config not found at ${n}. Please create it manually.`;return e.error(_p({code:`GLOBAL_CONFIG_MISSING`,title:`Global config file is missing`,reason:q(`tnmsc could not find the required global config file at "${n}".`),configPath:n,exactFix:q(`Create the global config file manually before running tnmsc again.`),possibleFixes:[q("Initialize the file with a valid JSON object, for example `{}`.")]})),{valid:!1,exists:!1,errors:[t],shouldExit:!0}}let r;try{r=t.readFileSync(n,`utf8`)}catch(t){let r=t instanceof Error?t.message:String(t);return e.error(hp({code:`GLOBAL_CONFIG_READ_FAILED`,title:`Failed to read global config file`,operation:`read`,targetKind:`global config file`,path:n,error:r})),{valid:!1,exists:!0,errors:[`Failed to read config: ${r}`],shouldExit:!0}}let i;try{i=JSON.parse(r)}catch(t){let r=t instanceof Error?t.message:String(t);return e.error(_p({code:`GLOBAL_CONFIG_JSON_INVALID`,title:`Global config contains invalid JSON`,reason:q(`tnmsc could not parse the JSON in "${n}".`,`Parser error: ${r}`),configPath:n,exactFix:q(`Fix the JSON syntax in the global config file so it parses as a single JSON object.`),possibleFixes:[q(`Validate the file with a JSON parser and remove trailing commas or invalid tokens.`)]})),{valid:!1,exists:!0,errors:[`Invalid JSON: ${r}`],shouldExit:!0}}if(typeof i!=`object`||!i||Array.isArray(i))return e.error(_p({code:`GLOBAL_CONFIG_NOT_OBJECT`,title:`Global config must be a JSON object`,reason:q(`tnmsc parsed "${n}" successfully, but the top-level value is not a JSON object.`),configPath:n,exactFix:q("Replace the top-level JSON value with an object like `{}` or a valid config object.")})),{valid:!1,exists:!0,errors:[`Config must be a JSON object`],shouldExit:!0};let a=AP.safeParse(i);if(!a.success){let t=a.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`);for(let r of t)e.error(_p({code:`GLOBAL_CONFIG_VALIDATION_FAILED`,title:`Global config validation failed`,reason:up(r),configPath:n,exactFix:q(`Update the invalid config field so it matches the tnmsc schema.`),possibleFixes:[q(`Compare the field name and value against the current config schema or examples.`)],details:{validationError:r}}));return{valid:!1,exists:!0,errors:t,shouldExit:!0}}return{valid:!0,exists:!0,errors:[],shouldExit:!1}}function ZF(e){return ZN.includes(e)}function QF(e){return ZN.map(t=>tI(e.aindex,t))}function $F(e,t){return tI(e.aindex,t)}function eI(e){let t=new Map;for(let n of e){let e=t.get(n.projectName);e==null?t.set(n.projectName,[n]):e.push(n)}return Array.from(t.entries(),([e,t])=>({projectName:e,refs:[...t].sort((e,t)=>e.seriesName.localeCompare(t.seriesName))})).filter(e=>new Set(e.refs.map(e=>e.seriesName)).size>1).sort((e,t)=>e.projectName.localeCompare(t.projectName))}function tI(e,t){return{name:t,src:e[t].src,dist:e[t].dist}}var nI=class extends Lg{constructor(){super(`MarkdownWhitespaceCleanupEffectInputCapability`),this.registerEffect(`markdown-whitespace-cleanup`,this.cleanupWhitespace.bind(this),30)}async cleanupWhitespace(e){let{fs:t,path:n,aindexDir:r,dryRun:i,logger:a,userConfigOptions:o}=e,s=[],c=[],l=[],u=QF(o).map(e=>n.join(r,e.src)),d=[n.join(r,`src`),...u,n.join(r,`dist`)];for(let n of d){if(!t.existsSync(n)){a.debug({action:`whitespace-cleanup`,message:`Directory does not exist, skipping`,dir:n});continue}this.processDirectory(e,n,s,c,l,i??!1)}let f=l.length>0;return{success:!f,description:i?`Would modify ${s.length} files, skip ${c.length} files`:`Modified ${s.length} files, skipped ${c.length} files`,modifiedFiles:s,skippedFiles:c,...f&&{error:Error(`${l.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(hp({code:`WHITESPACE_CLEANUP_DIRECTORY_READ_FAILED`,title:`Whitespace cleanup could not read a directory`,operation:`read`,targetKind:`cleanup directory`,path:t,error:e}));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,`utf8`),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,`utf8`),n.push(t),s.debug({action:`whitespace-cleanup`,modified:t}))}catch(e){i.push({path:t,error:e}),s.warn(hp({code:`WHITESPACE_CLEANUP_FILE_PROCESS_FAILED`,title:`Whitespace cleanup could not process a markdown file`,operation:`process`,targetKind:`markdown file`,path:t,error:e}))}}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
395
394
  `)?`\r
396
395
  `:`
397
- `}collect(e){return{}}};function SI(e){let{root:t}=s.parse(e);return e===t?e:e.endsWith(s.sep)?e.slice(0,-1):e}function CI(e,t){let n=SI(e),r=SI(t);return n===r?!0:n.startsWith(`${r}${s.sep}`)}function wI(e,t){let n=new Map,r=new Map;for(let t of e){let e=f_(t);n.set(e,e)}for(let e of t){let t=f_(e);r.set(t,t)}let i=new Map,a=[...r.entries()].sort((e,t)=>e[0].length-t[0].length);for(let[e,t]of a){let n=!1;for(let t of i.keys())if(CI(e,t)){n=!0;break}n||i.set(e,t)}let o=[];for(let[e,t]of n){let n=!1;for(let t of i.keys())if(CI(e,t)){n=!0;break}n||o.push(t)}return o.sort((e,t)=>e.localeCompare(t)),{files:o,dirs:[...i.values()].sort((e,t)=>e.localeCompare(t))}}function TI(){let e=GN();if(e==null)throw Error(`Native desk-paths binding is required. Build or install the Rust NAPI package before running tnmsc.`);return e}function EI(e){let t=TI()[e];if(t==null)throw Error(`Native desk-paths binding is missing "${String(e)}". Rebuild the Rust NAPI package before running tnmsc.`);return t}function DI(e){return{deletedFiles:e.deletedFiles??e.deleted_files??[],deletedDirs:e.deletedDirs??e.deleted_dirs??[],fileErrors:e.fileErrors??e.file_errors??[],dirErrors:e.dirErrors??e.dir_errors??[]}}function OI(){return EI(`getPlatformFixedDir`)()}async function kI(e){return DI(await Promise.resolve(EI(`deleteTargets`)({files:e.files??[],dirs:e.dirs??[]})))}var AI=class extends R_{constructor(){super(`OrphanFileCleanupEffectInputCapability`),this.registerEffect(`orphan-file-cleanup`,this.cleanupOrphanFiles.bind(this),20)}buildProtectedDeletionGuard(e){return j_({workspaceDir:e.workspaceDir,aindexDir:e.aindexDir,includeReservedWorkspaceContentRoots:!1,rules:[...O_(e.userConfigOptions,e.aindexDir,{workspaceDir:e.workspaceDir}),...(e.userConfigOptions.cleanupProtection?.rules??[]).map(e=>({path:e.path,protectionMode:e.protectionMode,reason:e.reason??`configured cleanup protection rule`,source:`configured-cleanup-protection`,matcher:e.matcher??`path`}))]})}buildDeletionPlan(e,t){let n=[],r=[],i=[];for(let a of t){let t=e.path.join(e.aindexDir,a.distPath);e.fs.existsSync(t)&&e.fs.statSync(t).isDirectory()&&this.collectDirectoryPlan(e,t,a,n,r,i)&&r.push(t)}return{filesToDelete:n,dirsToDelete:r,errors:i}}resolveDirectoryConfigs(e){return Wh.map(t=>({key:t,srcPath:e.aindex[t].src,distPath:e.aindex[t].dist}))}async cleanupOrphanFiles(e){let{fs:t,path:n,aindexDir:r,logger:i,userConfigOptions:a,dryRun:o}=e,s=n.join(r,`dist`);if(!t.existsSync(s))return i.debug({action:`orphan-cleanup`,message:`dist/ directory does not exist, skipping`,distDir:s}),{success:!0,description:`dist/ directory does not exist, nothing to clean`,deletedFiles:[],deletedDirs:[]};let c=this.buildDeletionPlan(e,this.resolveDirectoryConfigs(a)),l=this.buildProtectedDeletionGuard(e),u=F_(c.filesToDelete,l),d=F_(c.dirsToDelete,l),f=wI(u.safePaths,d.safePaths),p=[...u.violations,...d.violations].sort((e,t)=>e.targetPath.localeCompare(t.targetPath));if(p.length>0)return{success:!1,description:`Protected deletion guard blocked orphan cleanup for ${p.length} path(s)`,deletedFiles:[],deletedDirs:[],error:new i_(`orphan-file-cleanup`,p)};if(o)return{success:!0,description:`Would delete ${f.files.length} files and ${f.dirs.length} directories`,deletedFiles:[...f.files],deletedDirs:[...f.dirs]};let m=[...c.errors];i.debug(`orphan cleanup delete execution started`,{filesToDelete:f.files.length,dirsToDelete:f.dirs.length});let h=await kI({files:f.files,dirs:f.dirs});for(let e of h.fileErrors){let t=e.error instanceof Error?e.error:Error(String(e.error));m.push({path:e.path,error:t}),i.warn(hp({code:`ORPHAN_CLEANUP_FILE_DELETE_FAILED`,title:`Orphan cleanup could not delete a file`,operation:`delete`,targetKind:`orphan file`,path:e.path,error:t}))}for(let e of h.dirErrors){let t=e.error instanceof Error?e.error:Error(String(e.error));m.push({path:e.path,error:t}),i.warn(hp({code:`ORPHAN_CLEANUP_DIRECTORY_DELETE_FAILED`,title:`Orphan cleanup could not delete a directory`,operation:`delete`,targetKind:`orphan directory`,path:e.path,error:t}))}i.debug(`orphan cleanup delete execution complete`,{deletedFiles:h.deletedFiles.length,deletedDirs:h.deletedDirs.length,errors:m.length});let g=m.length>0;return{success:!g,description:`Deleted ${h.deletedFiles.length} files and ${h.deletedDirs.length} directories`,deletedFiles:[...h.deletedFiles],deletedDirs:[...h.deletedDirs],...g&&{error:Error(`${m.length} errors occurred during cleanup`)}}}collectDirectoryPlan(e,t,n,r,i,a){let{fs:o,path:s,aindexDir:c,logger:l}=e,u;try{u=o.readdirSync(t,{withFileTypes:!0})}catch(e){return a.push({path:t,error:e}),l.warn(hp({code:`ORPHAN_CLEANUP_DIRECTORY_READ_FAILED`,title:`Orphan cleanup could not read a directory`,operation:`read`,targetKind:`dist cleanup directory`,path:t,error:e})),!1}let d=!1;for(let o of u){let l=s.join(t,o.name);if(o.isDirectory()){this.collectDirectoryPlan(e,l,n,r,i,a)?i.push(l):d=!0;continue}if(!o.isFile()){d=!0;continue}this.isOrphanFile(e,l,n,c)?r.push(l):d=!0}return!d}isOrphanFile(e,t,n,r){let{fs:i,path:a}=e,o=a.basename(t),s=o.endsWith(`.mdx`),c=a.join(r,n.distPath),l=a.relative(c,t),u=a.dirname(l),d=o.replace(/\.mdx$/,``);return s?!this.getPossibleSourcePaths(a,r,n.key,n.srcPath,d,u).some(e=>i.existsSync(e)):!i.existsSync(a.join(r,n.srcPath,l))}getPossibleSourcePaths(e,t,n,r,i,a){if(n===`skills`){let n=(a===`.`?[i]:a.split(e.sep))[0]??i,o=a===`.`?``:a.slice(n.length+1);return o===``?[...MF.map(i=>e.join(t,r,n,`SKILL${i}`)),...MF.map(i=>e.join(t,r,n,`skill${i}`))]:MF.map(a=>e.join(t,r,n,o,`${i}${a}`))}return a===`.`?MF.map(n=>e.join(t,r,`${i}${n}`)):MF.map(n=>e.join(t,r,a,`${i}${n}`))}collect(e){return{}}},jI=class extends R_{constructor(){super(`SkillDistCleanupEffectInputCapability`),this.registerEffect(`skill-dist-cleanup`,this.cleanupDistSkillArtifacts.bind(this),10)}async cleanupDistSkillArtifacts(e){let{fs:t,logger:n,userConfigOptions:r,aindexDir:i,dryRun:a}=e,o=this.resolveAindexPath(r.aindex.skills.src,i),s=this.resolveAindexPath(r.aindex.skills.dist,i);if(!t.existsSync(s))return n.debug({action:`skill-dist-cleanup`,message:`dist skills directory does not exist, skipping`,srcSkillsDir:o,distSkillsDir:s}),{success:!0,description:`dist skills directory does not exist, nothing to clean`,deletedFiles:[],deletedDirs:[]};let c=this.buildCleanupPlan(e,s),l=wI(c.filesToDelete,c.dirsToDelete);if(a)return{success:!0,description:`Would delete ${l.files.length} files and ${l.dirs.length} directories`,deletedFiles:[...l.files],deletedDirs:[...l.dirs]};let u=[...c.errors];n.debug(`skill dist cleanup delete execution started`,{filesToDelete:l.files.length,dirsToDelete:l.dirs.length});let d=await kI({files:l.files,dirs:l.dirs});for(let e of d.fileErrors){let t=e.error instanceof Error?e.error:Error(String(e.error));u.push({path:e.path,error:t}),n.warn(hp({code:`SKILL_DIST_CLEANUP_FILE_DELETE_FAILED`,title:`Skill dist cleanup could not delete a file`,operation:`delete`,targetKind:`skill dist file`,path:e.path,error:t}))}for(let e of d.dirErrors){let t=e.error instanceof Error?e.error:Error(String(e.error));u.push({path:e.path,error:t}),n.warn(hp({code:`SKILL_DIST_CLEANUP_DIRECTORY_DELETE_FAILED`,title:`Skill dist cleanup could not delete a directory`,operation:`delete`,targetKind:`skill dist directory`,path:e.path,error:t}))}n.debug(`skill dist cleanup delete execution complete`,{deletedFiles:d.deletedFiles.length,deletedDirs:d.deletedDirs.length,errors:u.length});let f=u.length>0;return{success:!f,description:`Deleted ${d.deletedFiles.length} files and ${d.deletedDirs.length} directories`,deletedFiles:[...d.deletedFiles],deletedDirs:[...d.deletedDirs],...f&&{error:Error(`${u.length} errors occurred during cleanup`)}}}buildCleanupPlan(e,t){let n=[],r=[],i=[];return this.collectCleanupPlan(e,t,n,r,i)&&r.push(t),{filesToDelete:n,dirsToDelete:r,errors:i}}collectCleanupPlan(e,t,n,r,i){let{fs:a,path:o,logger:s}=e,c;try{c=a.readdirSync(t,{withFileTypes:!0})}catch(e){return i.push({path:t,error:e}),s.warn(hp({code:`SKILL_DIST_CLEANUP_DIRECTORY_READ_FAILED`,title:`Skill dist cleanup could not read a directory`,operation:`read`,targetKind:`skill dist directory`,path:t,error:e})),!1}let l=!1;for(let a of c){let s=o.join(t,a.name);if(a.isDirectory()){this.collectCleanupPlan(e,s,n,r,i)?r.push(s):l=!0;continue}if(!a.isFile()){l=!0;continue}if(this.shouldRetainCompiledSkillFile(a.name)){l=!0;continue}n.push(s)}return!l}shouldRetainCompiledSkillFile(e){return e.endsWith(`.mdx`)&&!PF(e)}collect(e){return{}}};const MI=/export\s+default\s*\{([\s\S]*?)\}/u,NI=/description\s*:\s*['"`]([^'"`]+)['"`]/u,PI=/name\s*:\s*['"`]([^'"`]+)['"`]/u,FI=/displayName\s*:\s*['"`]([^'"`]+)['"`]/u,II=/keywords\s*:\s*\[([^\]]+)\]/u,LI=/author\s*:\s*['"`]([^'"`]+)['"`]/u,RI=/version\s*:\s*['"`]([^'"`]+)['"`]/u;function zI(e){let t={},n=MI.exec(e);if(n?.[1]==null)return t;let r=n[1],i=NI.exec(r);i?.[1]!=null&&(t.description=i[1]);let a=PI.exec(r);a?.[1]!=null&&(t.name=a[1]);let o=FI.exec(r);o?.[1]!=null&&(t.displayName=o[1]);let s=II.exec(r);s?.[1]!=null&&(t.keywords=s[1].split(`,`).map(e=>e.trim().replaceAll(/['"]/gu,``)).filter(e=>e.length>0));let c=LI.exec(r);c?.[1]!=null&&(t.author=c[1]);let l=RI.exec(r);return l?.[1]!=null&&(t.version=l[1]),t}function BI(...e){let t={};for(let n of e)if(n!=null)for(let[e,r]of Object.entries(n))r!==void 0&&(t[e]=r);return t}function VI(e){let{logger:t,warnedDerivedNames:n,sourcePath:r,authoredName:i,skillName:a}=e;n?.has(r)!==!0&&(n?.add(r),t.warn(_p({code:`SKILL_NAME_IGNORED`,title:`Skill authored name is ignored`,reason:q(`tnmsc ignores the authored skill name "${i}" in favor of the directory-derived name "${a}".`),configPath:r,exactFix:q("Remove the `name` field from the skill front matter or exported metadata.",`Rename the skill directory if you need a different skill name.`),details:{authoredName:i,derivedName:a}})))}const HI={".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`},UI=new Set(`.png,.jpg,.jpeg,.gif,.webp,.ico,.bmp,.tiff,.svg,.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,.pdf,.docx,.doc,.xlsx,.xls,.pptx,.ppt,.odt,.ods,.odp`.split(`,`));function WI(e){return UI.has(e.toLowerCase())}function GI(e){return HI[e.toLowerCase()]}function KI(...e){return s.join(...e).replaceAll(`\\`,`/`)}var qI=class{ctx;constructor(e){this.ctx=e}async processDirectory(e,t,n){let r=t?`${t}/${e.name}`:e.name;return this.scanSkillDirectoryAsync(n,r)}async processFile(e,t,n){let r=t?`${t}/${e.name}`:e.name;if(this.ctx.scanMode===`distChildDocs`){if(t===``&&e.name===`skill.mdx`||PF(e.name)||!e.name.endsWith(`.mdx`))return{childDocs:[],resources:[]};let i=await this.processChildDoc(r,n);return{childDocs:i?[i]:[],resources:[]}}if(t===``&&e.name===`mcp.json`||PF(e.name)||e.name.endsWith(`.mdx`))return{childDocs:[],resources:[]};let i=this.processResourceFile(e.name,r,n);return{childDocs:[],resources:i?[i]:[]}}async processChildDoc(e,t){try{let n=await yP(t,{mode:`dist`,globalScope:this.ctx.globalScope}),r=ep(n.content);return UF(r,t),{type:ng.SkillChildDoc,content:r,length:r.length,filePathKind:rg.Relative,markdownAst:n.parsed.markdownAst,markdownContents:n.parsed.markdownContents,...n.parsed.rawFrontMatter!=null&&{rawFrontMatter:n.parsed.rawFrontMatter},relativePath:e,dir:{pathKind:rg.Relative,path:e,basePath:this.ctx.skillDir,getDirectoryName:()=>s.dirname(e),getAbsolutePath:()=>t}}}catch(n){throw this.ctx.logger.error(bp({code:`SKILL_CHILD_DOC_COMPILE_FAILED`,title:`Failed to compile skill child doc`,diagnosticText:KF(n,{operation:`Failed to compile skill child doc.`,promptKind:`skill-child-doc`,logicalName:`${s.basename(this.ctx.skillDir)}/${e.replace(/\.mdx$/u,``)}`,distPath:t,srcPath:WF(s,t,{distRootDir:this.ctx.skillDir,srcRootDir:this.ctx.sourceSkillDir})}),details:{skillDir:this.ctx.skillDir,relativePath:e,filePath:t}})),n}}processResourceFile(e,t,n){let r=s.extname(e);try{let{content:i,encoding:a,length:o}=this.readFileContent(n,r),s=GI(r);return{type:ng.SkillResource,extension:r,fileName:e,relativePath:t,sourcePath:n,content:i,encoding:a,length:o,...s!=null&&{mimeType:s}}}catch(r){return this.ctx.logger.warn(hp({code:`SKILL_RESOURCE_READ_FAILED`,title:`Failed to read skill resource file`,operation:`read`,targetKind:`skill resource file`,path:n,error:r,details:{relativePath:t,fileName:e,skillDir:this.ctx.skillDir}})),null}}readFileContent(e,t){if(WI(t)){let t=this.ctx.fs.readFileSync(e);return{content:t.toString(`base64`),encoding:`base64`,length:t.length}}let n=this.ctx.fs.readFileSync(e,`utf8`);return{content:n,encoding:`text`,length:m.from(n,`utf8`).length}}async scanSkillDirectoryAsync(e,t=``){let n=[],r=[],i;try{i=this.ctx.fs.readdirSync(e,{withFileTypes:!0})}catch(t){return this.ctx.logger.warn(hp({code:`SKILL_DIRECTORY_SCAN_FAILED`,title:`Failed to scan skill directory`,operation:`scan`,targetKind:`skill directory`,path:e,error:t,details:{skillDir:this.ctx.skillDir,scanMode:this.ctx.scanMode}})),{childDocs:n,resources:r}}for(let a of i){let i=KI(e,a.name);if(a.isDirectory()){let e=await this.processDirectory(a,t,i);n.push(...e.childDocs),r.push(...e.resources);continue}if(!a.isFile())continue;let o=await this.processFile(a,t,i);n.push(...o.childDocs),r.push(...o.resources)}return{childDocs:n,resources:r}}};function JI(e,t,n,r=``){let i=[],a=r===``?e:KI(e,r),o;try{o=t.readdirSync(a,{withFileTypes:!0})}catch(e){return n.warn(hp({code:`SKILL_SOURCE_CHILD_SCAN_FAILED`,title:`Failed to scan skill source child docs`,operation:`scan`,targetKind:`skill source child doc directory`,path:a,error:e})),i}for(let a of o){let o=r?`${r}/${a.name}`:a.name;if(a.isDirectory()){i.push(...JI(e,t,n,o));continue}!a.isFile()||!PF(a.name)||r===``&&a.name===`skill.src.mdx`||i.push(o.replace(/\.src\.mdx$/u,`.mdx`))}return i}function YI(e,t,n,r,i){if(r.existsSync(t))for(let a of JI(t,r,i)){let i=s.join(n,a);if(!r.existsSync(i))throw new zF({kind:`skill child doc`,name:`${e}/${a}`,sourcePath:s.join(t,a.replace(/\.mdx$/u,`.src.mdx`)),expectedDistPath:i})}}function XI(e,t,n){let r=s.join(e,`mcp.json`);if(t.existsSync(r)){if(!t.statSync(r).isFile()){n.warn(yp({code:`SKILL_MCP_CONFIG_NOT_FILE`,title:`Skill MCP config path is not a file`,path:r,expectedKind:`mcp.json file`,actualState:`path exists but is not a regular file`,details:{skillDir:e}}));return}try{let i=t.readFileSync(r,`utf8`),a=JSON.parse(i);if(a.mcpServers==null||typeof a.mcpServers!=`object`){n.warn(_p({code:`SKILL_MCP_CONFIG_INVALID`,title:`Skill MCP config is missing mcpServers`,reason:q(`The skill MCP config at "${r}" does not contain a top-level mcpServers object.`),configPath:r,exactFix:q("Add a top-level `mcpServers` object to mcp.json before retrying tnmsc."),details:{skillDir:e}}));return}return{type:ng.SkillMcpConfig,mcpServers:a.mcpServers,rawContent:i}}catch(t){n.warn(_p({code:`SKILL_MCP_CONFIG_PARSE_FAILED`,title:`Failed to parse skill MCP config`,reason:q(`tnmsc could not parse the MCP config file at "${r}".`,`Underlying error: ${t instanceof Error?t.message:String(t)}`),configPath:r,exactFix:q(`Fix the JSON syntax in mcp.json and rerun tnmsc.`),details:{skillDir:e,errorMessage:t instanceof Error?t.message:String(t)}}));return}}}async function ZI(e,t,n,r,i,a,o,c,l=[],u=[],d,f,p){let{logger:m,fs:h}=o,g=s.join(i,`skill.mdx`),_=h.existsSync(s.join(a,`skill.src.mdx`))?s.join(a,`skill.src.mdx`):g,v=e,y,b;if(h.existsSync(g)){let t=await yP(g,{mode:`dist`,globalScope:o.globalScope});v=t.rawMdx,y=t.parsed,e=ep(t.content),UF(e,g),b=t.metadata}let x=BI(zI(v),f,b),S=new Set,C=y?.yamlFrontMatter?.name;typeof C==`string`&&C.trim().length>0&&S.add(C);let w=x.name;typeof w==`string`&&w.trim().length>0&&S.add(w);for(let e of S)VI({logger:m,sourcePath:_,authoredName:e,skillName:n,...p!=null&&{warnedDerivedNames:p}});let T=y?.yamlFrontMatter?.description??x?.description;if(T==null||T.trim().length===0)throw m.error(dp({code:`SKILL_VALIDATION_FAILED`,title:`Skill description is required`,rootCause:q(`The skill "${n}" does not provide a non-empty description in its compiled metadata or front matter.`),exactFix:q(`Add a non-empty description field to the skill front matter or exported metadata and rebuild the skill.`),possibleFixes:[q("Set `description` in `SKILL.md` front matter."),q(`If you export metadata from code, ensure the exported description is non-empty.`)],details:{skill:n,skillDir:r,yamlDescription:y?.yamlFrontMatter?.description,exportDescription:x?.description}})),Error(`Skill "${n}" validation failed: description is required and cannot be empty`);let E={...x,...y?.yamlFrontMatter??{},name:n,description:T},ee=nF(E,g);if(!ee.valid)throw Error(ee.errors.join(`
398
- `));return{type:ng.Skill,content:e,length:e.length,filePathKind:rg.Relative,skillName:n,yamlFrontMatter:E,markdownAst:y?.markdownAst,markdownContents:y?.markdownContents??[],dir:{pathKind:rg.Relative,path:n,basePath:r,getDirectoryName:()=>n,getAbsolutePath:()=>s.join(r,n)},...y?.rawFrontMatter!=null&&{rawFrontMatter:y.rawFrontMatter},...c!=null&&{mcpConfig:c},...l!=null&&l.length>0&&{childDocs:l},...u!=null&&u.length>0&&{resources:u},...d!=null&&{seriName:d}}}var QI=class extends R_{constructor(){super(`SkillInputCapability`)}readMcpConfig(e,t,n){return XI(e,t,n)}async scanSkillDirectory(e,t,n,r=``,i=`srcResources`,a,o){return new qI({fs:t,logger:n,skillDir:e,scanMode:i,...a!=null&&{globalScope:a},...o!=null&&{sourceSkillDir:o}}).scanSkillDirectoryAsync(e,r)}async collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i,globalScope:a}=e,{aindexDir:o}=this.resolveBasePaths(t),s=this.resolveAindexPath(t.aindex.skills.src,o),c=this.resolveAindexPath(t.aindex.skills.dist,o),l=[],u=YF(r,i,n,a),d=new Set,f=new Map,p=async e=>{let t=f.get(e);if(t!=null)return t;let o=i.join(s,e),l=i.join(c,e),u=r.existsSync(l)?(await this.scanSkillDirectory(l,r,n,``,`distChildDocs`,a,o)).childDocs:[],d=r.existsSync(o)?(await this.scanSkillDirectory(o,r,n,``,`srcResources`,a)).resources:[],p=XI(o,r,n);YI(e,o,l,r,n);let m={childDocs:u,resources:d,...p!=null&&{mcpConfig:p}};return f.set(e,m),m},{prompts:m,errors:h}=await u.readDirectoryStructure(s,c,{kind:ng.Skill,entryFileName:`skill`,localeExtensions:NF,hydrateSourceContents:!1,isDirectoryStructure:!0,createPrompt:async(t,n,r,a)=>{let o=i.join(c,r),{childDocs:l,resources:u,mcpConfig:f}=await p(r);return ZI(t,n,r,c,o,i.join(s,r),e,f,l,u,void 0,a,d)}});for(let e of h)n.warn(hp({code:`SKILL_PROMPT_READ_FAILED`,title:`Failed to read skill prompt`,operation:e.phase===`scan`?`scan`:`read`,targetKind:`skill prompt`,path:e.path,error:e.error,details:{phase:e.phase}}));if(h.length>0)throw Error(h.map(e=>e.error instanceof Error?e.error.message:String(e.error)).join(`
399
- `));for(let e of m){let t=e.dist?.prompt;t!=null&&l.push(t)}return{skills:l}}},$I=class e extends R_{static projectConfigFileName=`project.json5`;static conflictingProjectSeriesCode=`AINDEX_PROJECT_SERIES_NAME_CONFLICT`;constructor(){super(`AindexInputCapability`)}loadProjectConfig(t,n,r,i,a,o){let s=a.join(n,r,t,e.projectConfigFileName);if(i.existsSync(s))try{let n=i.readFileSync(s,`utf8`);try{return h.parse(n)}catch(n){o.warn(_p({code:`AINDEX_PROJECT_JSON5_INVALID`,title:`Failed to parse ${e.projectConfigFileName} for ${t}`,reason:q(`tnmsc could not parse the ${e.projectConfigFileName} file for "${t}".`,`Underlying error: ${n instanceof Error?n.message:String(n)}`),configPath:s,exactFix:q(`Fix the JSON5 syntax in ${e.projectConfigFileName} and rerun tnmsc.`),details:{projectName:t,errorMessage:n instanceof Error?n.message:String(n)}}));return}}catch(n){o.warn(_p({code:`AINDEX_PROJECT_JSON5_READ_FAILED`,title:`Failed to load ${e.projectConfigFileName} for ${t}`,reason:q(`tnmsc could not read the ${e.projectConfigFileName} file for "${t}".`,`Underlying error: ${n instanceof Error?n.message:String(n)}`),configPath:s,exactFix:q(`Ensure ${e.projectConfigFileName} exists, is readable, and contains valid JSON5.`),details:{projectName:t,errorMessage:n instanceof Error?n.message:String(n)}}));return}}async scanSeriesProjects(e,t,n,r,i){let{logger:a,fs:o,path:s}=e;return(await Promise.all(i.map(async e=>{let i=this.resolveAindexPath(e.dist,n);if((await o.promises.stat(i).catch(()=>void 0))?.isDirectory()!==!0)return[];try{let c=(await o.promises.readdir(i,{withFileTypes:!0})).filter(e=>e.isDirectory()).sort((e,t)=>e.name.localeCompare(t.name)),l=[];for(let i of c){let c=i.name===r,u=this.loadProjectConfig(i.name,n,e.src,o,s,a);l.push({name:i.name,promptSeries:e.name,...c&&{isPromptSourceProject:!0},...u!=null&&{projectConfig:u},dirFromWorkspacePath:{pathKind:rg.Relative,path:i.name,basePath:t,getDirectoryName:()=>i.name,getAbsolutePath:()=>s.resolve(t,i.name)}})}return l}catch(t){return a.error(hp({code:`AINDEX_PROJECT_DIRECTORY_SCAN_FAILED`,title:`Failed to scan aindex ${e.name} projects directory`,operation:`scan`,targetKind:`aindex ${e.name} projects directory`,path:i,error:t})),[]}}))).flat()}loadFallbackProjectConfig(e,t,n){for(let r of _I(n.userConfigOptions)){let i=this.loadProjectConfig(e,t,r.src,n.fs,n.path,n.logger);if(i!=null)return i}}assertNoCrossSeriesProjectNameConflicts(t,n,r){let{logger:i,fs:a,path:o}=t,s=yI(r.flatMap(e=>{let t=o.join(n,e.src);return a.existsSync(t)&&a.statSync(t).isDirectory()?a.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(n=>({projectName:n.name,seriesName:e.name,seriesDir:o.join(t,n.name)})):[]}));if(s.length!==0)throw i.error(_p({code:e.conflictingProjectSeriesCode,title:`Project names must be unique across app, ext, arch, and softwares`,reason:q(`tnmsc maps project-scoped outputs back to workspace project names, so app/ext/arch/softwares cannot reuse the same directory name.`,`Conflicting project names: ${s.map(e=>e.projectName).join(`, `)}`),exactFix:q(`Rename the conflicting project directory in one of the app/ext/arch/softwares source trees and rerun tnmsc.`),possibleFixes:s.map(e=>q(`"${e.projectName}" is currently declared in: ${e.refs.map(e=>`${e.seriesName} (${e.seriesDir})`).join(`, `)}`)),details:{aindexDir:n,conflicts:s.map(e=>({projectName:e.projectName,refs:e.refs.map(e=>({seriesName:e.seriesName,seriesDir:e.seriesDir}))}))}})),Error(`Aindex project series name conflict`)}async collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i}=e,{workspaceDir:a,aindexDir:o}=this.resolveBasePaths(t),s=i.basename(o),c=_I(t);this.assertNoCrossSeriesProjectNameConflicts(e,o,c);let l=await this.scanSeriesProjects(e,a,o,s,c);if(l.length===0&&r.existsSync(a)&&r.statSync(a).isDirectory()){n.debug(`no projects in dist/app, dist/ext, or dist/arch; falling back to workspace scan`,{workspaceDir:a});try{let t=r.readdirSync(a,{withFileTypes:!0}).filter(e=>e.isDirectory()).sort((e,t)=>e.name.localeCompare(t.name));for(let n of t){if(n.name.startsWith(`.`))continue;let t=n.name===s,r=this.loadFallbackProjectConfig(n.name,o,e);l.push({name:n.name,...t&&{isPromptSourceProject:!0},...r!=null&&{projectConfig:r},dirFromWorkspacePath:{pathKind:rg.Relative,path:n.name,basePath:a,getDirectoryName:()=>n.name,getAbsolutePath:()=>i.resolve(a,n.name)}})}}catch(e){n.error(hp({code:`WORKSPACE_DIRECTORY_SCAN_FAILED`,title:`Failed to scan workspace directory`,operation:`scan`,targetKind:`workspace directory`,path:a,error:e}))}}return{workspace:{directory:{pathKind:rg.Absolute,path:a,getDirectoryName:()=>i.basename(a)},projects:l}}}},eL=class extends R_{constructor(){super(`CommandInputCapability`)}createCommandPrompt(e,t,n,r,i,a){let{path:o}=i,s=n.replaceAll(`\\`,`/`),c=s.indexOf(`/`),l=c===-1?void 0:s.slice(0,c),u=(c===-1?s:s.slice(c+1)).replace(/\.mdx$/,``),d=u.indexOf(`_`),f=l??(d===-1?void 0:u.slice(0,Math.max(0,d))),p=l!=null||d===-1?u:u.slice(Math.max(0,d+1)),m=o.join(r,`${n}.mdx`),h=`${n}.mdx`,g=a,_={type:ng.Command,content:e,length:e.length,filePathKind:rg.Relative,dir:{pathKind:rg.Relative,path:h,basePath:r,getDirectoryName:()=>h.replace(/\.mdx$/,``),getAbsolutePath:()=>m},...f!=null&&{commandPrefix:f},commandName:p};if(g==null)return _;let v=rF(g,m);if(!v.valid)throw Error(v.errors.join(`
400
- `));return Object.assign(_,{yamlFrontMatter:g}),g.seriName!=null&&Object.assign(_,{seriName:g.seriName}),g.scope===`global`&&Object.assign(_,{globalOnly:!0}),_}async collect(e){let{userConfigOptions:t,logger:n,path:r,fs:i,globalScope:a}=e,o=this.resolveBasePaths(t),s=this.resolveAindexPath(t.aindex.commands.src,o.aindexDir),c=this.resolveAindexPath(t.aindex.commands.dist,o.aindexDir);n.debug(`CommandInputCapability collecting`,{srcDir:s,distDir:c,aindexDir:o.aindexDir});let{prompts:l,errors:u}=await YF(i,r,n,a).readFlatFiles(s,c,{kind:ng.Command,localeExtensions:NF,hydrateSourceContents:!1,isDirectoryStructure:!1,createPrompt:(t,n,r,i)=>this.createCommandPrompt(t,n,r,c,e,i)});n.debug(`CommandInputCapability read complete`,{commandCount:l.length,errorCount:u.length});for(let e of u)n.warn(hp({code:`COMMAND_PROMPT_READ_FAILED`,title:`Failed to read command prompt`,operation:e.phase===`scan`?`scan`:`read`,targetKind:`command prompt`,path:e.path,error:e.error,details:{phase:e.phase}}));if(u.length>0)throw Error(u.map(e=>e.error instanceof Error?e.error.message:String(e.error)).join(`
401
- `));let d=[];for(let e of l){let t=e.dist;if(t?.prompt==null)continue;let{prompt:n,rawMdx:r}=t;d.push(r==null?n:{...n,rawMdxContent:r})}return n.debug(`CommandInputCapability flattened commands`,{count:d.length,commands:d.map(e=>e.commandName)}),{commands:d}}},tL=class extends R_{constructor(){super(`EditorConfigInputCapability`)}collect(e){let{userConfigOptions:t,fs:n}=e,{workspaceDir:r,aindexDir:i}=this.resolveBasePaths(t),a=[],o=Cg(ig.EditorConfig,`.editorconfig`,i,n,{command:e.runtimeCommand,workspaceDir:r});return o!=null&&a.push(o),{editorConfigFiles:a}}},nL=class extends R_{constructor(){super(`GitExcludeInputCapability`)}collect(e){let{workspaceDir:t,aindexDir:n}=this.resolveBasePaths(e.userConfigOptions),r=xg(n,lg,{command:e.runtimeCommand,workspaceDir:t});if(!e.fs.existsSync(r))return this.log.debug({action:`collect`,message:`File not found`,path:r}),{};let i=e.fs.readFileSync(r,`utf8`);return i.length===0?(this.log.debug({action:`collect`,message:`File is empty`,path:r}),{}):(this.log.debug({action:`collect`,message:`Loaded file content`,path:r,length:i.length}),{shadowGitExclude:i})}},rL=class extends R_{constructor(){super(`GitIgnoreInputCapability`)}collect(e){let{workspaceDir:t,aindexDir:n}=this.resolveBasePaths(e.userConfigOptions),r=xg(n,cg,{command:e.runtimeCommand,workspaceDir:t});if(!e.fs.existsSync(r))return this.log.debug({action:`collect`,message:`File not found`,path:r}),{};let i=e.fs.readFileSync(r,`utf8`);return i.length===0?(this.log.debug({action:`collect`,message:`File is empty`,path:r}),{}):(this.log.debug({action:`collect`,message:`Loaded file content`,path:r,length:i.length}),{globalGitIgnore:i})}},iL=class extends R_{constructor(){super(`GlobalMemoryInputCapability`)}async collect(e){let{userConfigOptions:t,fs:n,path:r,globalScope:i}=e,{aindexDir:o}=this.resolveBasePaths(t),s=uI(),c=e_(),l=this.resolveAindexPath(t.aindex.globalPrompt.dist,o);if(!n.existsSync(l))return this.log.warn(yp({code:`GLOBAL_MEMORY_PROMPT_MISSING`,title:`Global memory prompt is missing`,path:l,expectedKind:`compiled global memory prompt file`,actualState:`path does not exist`})),{};if(!n.statSync(l).isFile())return this.log.warn(yp({code:`GLOBAL_MEMORY_PROMPT_NOT_FILE`,title:`Global memory prompt path is not a file`,path:l,expectedKind:`compiled global memory prompt file`,actualState:`path exists but is not a regular file`})),{};let u,d;try{d=await yP(l,{mode:`dist`,globalScope:i}),u=d.content,UF(u,l)}catch(e){throw e instanceof sp&&(this.log.error(bp({code:`GLOBAL_MEMORY_PROMPT_COMPILE_FAILED`,title:`Failed to compile global memory prompt`,diagnosticText:KF(e,{operation:`Failed to compile global memory prompt.`,promptKind:`global-memory`,logicalName:`global-memory`,distPath:l}),details:{promptKind:`global-memory`,distPath:l}})),e instanceof cp&&this.log.error(_p({code:`GLOBAL_MEMORY_SCOPE_VARIABLES_MISSING`,title:`Global memory prompt references missing config variables`,reason:q(`The global memory prompt uses scope variables that are not defined in "${s}".`),configPath:s,exactFix:q(`Add the missing variables to "${s}" and rerun tnmsc.`),possibleFixes:[q("If you reference `{profile.name}`, define `profile.name` in the config file.")],details:{promptPath:l,errorMessage:e.message}})),a.exit(1)),e}return this.log.debug({action:`collect`,path:l,contentLength:u.length}),{globalMemory:{type:ng.GlobalMemory,content:u,length:u.length,filePathKind:rg.Relative,...d.parsed.rawFrontMatter!=null&&{rawFrontMatter:d.parsed.rawFrontMatter},markdownAst:d.parsed.markdownAst,markdownContents:d.parsed.markdownContents,dir:{pathKind:rg.Relative,path:r.basename(l),basePath:r.dirname(l),getDirectoryName:()=>r.basename(l),getAbsolutePath:()=>l},parentDirectoryPath:{type:og.UserHome,directory:{pathKind:rg.Relative,path:``,basePath:c,getDirectoryName:()=>r.basename(c),getAbsolutePath:()=>c}}}}}},aL=class extends R_{constructor(){super(`JetBrainsConfigInputCapability`)}collect(e){let{userConfigOptions:t,fs:n}=e,{workspaceDir:r,aindexDir:i}=this.resolveBasePaths(t),a=[`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`],o=[];for(let t of a){let a=Cg(ig.IntellijIDEA,t,i,n,{command:e.runtimeCommand,workspaceDir:r});a!=null&&o.push(a)}return{jetbrainsConfigFiles:o}}};const oL=`agt.mdx`,sL=[`node_modules`,`.git`];var cL=class extends R_{constructor(){super(`ProjectPromptInputCapability`,[`AindexInputCapability`])}async collect(e){let{dependencyContext:t,fs:n,userConfigOptions:r,path:i,globalScope:a}=e,{aindexDir:o}=this.resolveBasePaths(r),s=this.resolveAindexPath(r.aindex.workspacePrompt.dist,o),c=t.workspace;if(c==null)return this.log.info(`No workspace found in dependency context, skipping project prompt enhancement`),{};let l=c.projects??[],u=await Promise.all(l.map(async t=>{let s=t.name;if(s==null||t.isWorkspaceRootProject===!0)return t;let c=(t.promptSeries==null?_I(r):[vI(r,t.promptSeries)]).find(e=>{let t=i.join(o,e.dist,s);return n.existsSync(t)&&n.statSync(t).isDirectory()});if(c==null)return t;let l=i.join(o,c.dist,s),u=t.dirFromWorkspacePath?.getAbsolutePath(),d=await this.readRootMemoryPrompt(e,l,a),f=u==null?[]:await this.scanChildMemoryPrompts(e,l,u,a);return{...t,...t.promptSeries==null?{promptSeries:c.name}:{},...d!=null&&{rootMemoryPrompt:d},...f.length>0&&{childMemoryPrompts:f}}})),d=await this.readWorkspaceRootProjectPrompt(e,s,a,this.resolveWorkspaceRootProjectConfig(l));return{workspace:{directory:c.directory,projects:d==null?u:[...u,d]}}}async readWorkspaceRootProjectPrompt(e,t,n,r){let{fs:i,logger:o}=e;if(!(!i.existsSync(t)||!i.statSync(t).isFile()))try{let e;try{e=await yP(t,{mode:`dist`,globalScope:n}),UF(e.content,t)}catch(e){if(e instanceof sp){if(o.error(bp({code:`WORKSPACE_ROOT_MEMORY_PROMPT_COMPILE_FAILED`,title:`Failed to compile workspace root memory prompt`,diagnosticText:KF(e,{operation:`Failed to compile workspace root memory prompt.`,promptKind:`workspace-root-memory`,logicalName:t,distPath:t}),details:{promptKind:`workspace-root-memory`,distPath:t}})),e instanceof cp){let n=uI();o.error(_p({code:`WORKSPACE_ROOT_MEMORY_SCOPE_VARIABLES_MISSING`,title:`Workspace root memory prompt references missing config variables`,reason:q(`The workspace root memory prompt uses scope variables that are not defined in "${n}".`),configPath:n,exactFix:q(`Define the missing variables in "${n}" and rerun tnmsc.`),details:{promptPath:t,errorMessage:e.message}}))}a.exit(1)}throw e}let i={type:ng.ProjectRootMemory,content:e.content,length:e.content.length,filePathKind:rg.Relative,...e.parsed.yamlFrontMatter!=null&&{yamlFrontMatter:e.parsed.yamlFrontMatter},...e.parsed.rawFrontMatter!=null&&{rawFrontMatter:e.parsed.rawFrontMatter},markdownAst:e.parsed.markdownAst,markdownContents:e.parsed.markdownContents,dir:{pathKind:rg.Root,path:``,getDirectoryName:()=>``}};return{name:TF,isWorkspaceRootProject:!0,...r!=null&&{projectConfig:r},rootMemoryPrompt:i}}catch(e){o.error(hp({code:`WORKSPACE_ROOT_MEMORY_PROMPT_READ_FAILED`,title:`Failed to read workspace root memory prompt`,operation:`read`,targetKind:`workspace root memory prompt`,path:t,error:e}));return}}resolveWorkspaceRootProjectConfig(e){let t=e.filter(e=>e.isWorkspaceRootProject!==!0);return t.find(e=>e.isPromptSourceProject===!0)?.projectConfig??t[0]?.projectConfig}async readRootMemoryPrompt(e,t,n){let{fs:r,path:i,logger:o}=e,s=i.join(t,oL);if(!(!r.existsSync(s)||!r.statSync(s).isFile()))try{let e;try{e=await yP(s,{mode:`dist`,globalScope:n}),UF(e.content,s)}catch(e){if(e instanceof sp){if(o.error(bp({code:`PROJECT_ROOT_MEMORY_PROMPT_COMPILE_FAILED`,title:`Failed to compile project root memory prompt`,diagnosticText:KF(e,{operation:`Failed to compile project root memory prompt.`,promptKind:`project-root-memory`,logicalName:s,distPath:s}),details:{promptKind:`project-root-memory`,distPath:s}})),e instanceof cp){let t=uI();o.error(_p({code:`PROJECT_ROOT_MEMORY_SCOPE_VARIABLES_MISSING`,title:`Project root memory prompt references missing config variables`,reason:q(`The project root memory prompt uses scope variables that are not defined in "${t}".`),configPath:t,exactFix:q(`Define the missing variables in "${t}" and rerun tnmsc.`),details:{promptPath:s,errorMessage:e.message}}))}a.exit(1)}throw e}return{type:ng.ProjectRootMemory,content:e.content,length:e.content.length,filePathKind:rg.Relative,...e.parsed.yamlFrontMatter!=null&&{yamlFrontMatter:e.parsed.yamlFrontMatter},...e.parsed.rawFrontMatter!=null&&{rawFrontMatter:e.parsed.rawFrontMatter},markdownAst:e.parsed.markdownAst,markdownContents:e.parsed.markdownContents,dir:{pathKind:rg.Root,path:``,getDirectoryName:()=>``}}}catch(e){o.error(hp({code:`PROJECT_ROOT_MEMORY_PROMPT_READ_FAILED`,title:`Failed to read project root memory prompt`,operation:`read`,targetKind:`project root memory prompt`,path:s,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(hp({code:`PROJECT_CHILD_MEMORY_SCAN_FAILED`,title:`Failed to scan project child memory prompts`,operation:`scan`,targetKind:`project child memory prompt directory`,path: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()||sL.includes(l.name))continue;let c=s.join(n,l.name),u=s.join(c,oL);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{path:o,logger:s}=e,c=o.join(n,oL);try{let e;try{e=await yP(c,{mode:`dist`,globalScope:i}),UF(e.content,c)}catch(e){if(e instanceof sp){if(s.error(bp({code:`PROJECT_CHILD_MEMORY_PROMPT_COMPILE_FAILED`,title:`Failed to compile project child memory prompt`,diagnosticText:KF(e,{operation:`Failed to compile project child memory prompt.`,promptKind:`project-child-memory`,logicalName:c,distPath:c}),details:{promptKind:`project-child-memory`,distPath:c}})),e instanceof cp){let t=uI();s.error(_p({code:`PROJECT_CHILD_MEMORY_SCOPE_VARIABLES_MISSING`,title:`Project child memory prompt references missing config variables`,reason:q(`The project child memory prompt uses scope variables that are not defined in "${t}".`),configPath:t,exactFix:q(`Define the missing variables in "${t}" and rerun tnmsc.`),details:{promptPath:c,errorMessage:e.message}}))}a.exit(1)}throw e}let l=o.relative(t,n),u=o.join(r,l),d=o.basename(n);return{type:ng.ProjectChildrenMemory,content:e.content,length:e.content.length,filePathKind:rg.Relative,...e.parsed.yamlFrontMatter!=null&&{yamlFrontMatter:e.parsed.yamlFrontMatter},...e.parsed.rawFrontMatter!=null&&{rawFrontMatter:e.parsed.rawFrontMatter},markdownAst:e.parsed.markdownAst,markdownContents:e.parsed.markdownContents,dir:{pathKind:rg.Relative,path:l,basePath:r,getDirectoryName:()=>d,getAbsolutePath:()=>u},workingChildDirectoryPath:{pathKind:rg.Relative,path:l,basePath:r,getDirectoryName:()=>d,getAbsolutePath:()=>u}}}catch(e){s.error(hp({code:`PROJECT_CHILD_MEMORY_PROMPT_READ_FAILED`,title:`Failed to read project child memory prompt`,operation:`read`,targetKind:`project child memory prompt`,path:c,error:e}));return}}};const lL=Object.entries(cF);var uL=class extends R_{constructor(){super(`ReadmeMdInputCapability`,[`AindexInputCapability`])}async collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i,globalScope:a}=e,{workspaceDir:o,aindexDir:s}=this.resolveBasePaths(t),c=[],l=_I(t),u=yI(l.flatMap(e=>{let t=this.resolveAindexPath(e.src,s);return r.existsSync(t)&&r.statSync(t).isDirectory()?r.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(n=>({projectName:n.name,seriesName:e.name,seriesDir:i.join(t,n.name)})):[]}));if(u.length>0)throw n.error(_p({code:`README_PROJECT_SERIES_NAME_CONFLICT`,title:`Readme project names must be unique across app, ext, arch, and softwares`,reason:q(`Readme-family outputs target bare workspace project directories, so app/ext/arch/softwares cannot reuse the same project directory name.`,`Conflicting project names: ${u.map(e=>e.projectName).join(`, `)}`),exactFix:q(`Rename the conflicting project directory in one of the app/ext/arch/softwares source trees and rerun tnmsc.`),possibleFixes:u.map(e=>q(`"${e.projectName}" is currently declared in: ${e.refs.map(e=>`${e.seriesName} (${e.seriesDir})`).join(`, `)}`)),details:{aindexDir:s,conflicts:u.map(e=>({projectName:e.projectName,refs:e.refs.map(e=>({seriesName:e.seriesName,seriesDir:e.seriesDir}))}))}})),Error(`Readme project series name conflict`);return await Promise.all(l.map(async t=>{let l=this.resolveAindexPath(t.dist,s);if(!(r.existsSync(l)&&r.statSync(l).isDirectory())){n.debug(`aindex project series directory does not exist`,{path:l,series:t.name});return}try{let t=r.readdirSync(l,{withFileTypes:!0}).filter(e=>e.isDirectory()).sort((e,t)=>e.name.localeCompare(t.name));for(let n of t){let t=n.name,r=i.join(l,t);await this.collectReadmeFiles(e,r,t,o,``,c,a)}}catch(e){n.error(hp({code:`README_PROJECT_SCAN_FAILED`,title:`Failed to scan aindex ${t.name} projects for readme prompts`,operation:`scan`,targetKind:`aindex ${t.name} project directory`,path:l,error:e}))}})),c.sort((e,t)=>{let n=e.projectName.localeCompare(t.projectName);if(n!==0)return n;let r=e.targetDir.path.localeCompare(t.targetDir.path);return r===0?e.fileKind.localeCompare(t.fileKind):r}),{readmePrompts:c}}async collectReadmeFiles(e,t,n,r,i,o,s){let{fs:c,path:l,logger:u}=e,d=i===``;for(let[e,{src:f}]of lL){let p=l.join(t,f);if(!(!c.existsSync(p)||!c.statSync(p).isFile()))try{let t;try{let{content:e}=await yP(p,{mode:`dist`,globalScope:s});t=e,UF(t,p)}catch(t){if(t instanceof sp){if(u.error(bp({code:`README_PROMPT_COMPILE_FAILED`,title:`Failed to compile readme-family prompt`,diagnosticText:KF(t,{operation:`Failed to compile readme-family prompt.`,promptKind:`readme-family`,logicalName:`${n}/${f}`,distPath:p}),details:{promptKind:`readme-family`,distPath:p,projectName:n,fileKind:e}})),t instanceof cp){let e=uI();u.error(_p({code:`README_SCOPE_VARIABLES_MISSING`,title:`Readme-family prompt references missing config variables`,reason:q(`The readme-family prompt uses scope variables that are not defined in "${e}".`),configPath:e,exactFix:q(`Define the missing variables in "${e}" and rerun tnmsc.`),details:{promptPath:p,errorMessage:t.message}}))}a.exit(1)}throw t}let c=d?n:l.join(n,i),m={pathKind:rg.Relative,path:c,basePath:r,getDirectoryName:()=>d?n:l.basename(i),getAbsolutePath:()=>l.resolve(r,c)},h={pathKind:rg.Relative,path:l.dirname(p),basePath:r,getDirectoryName:()=>l.basename(l.dirname(p)),getAbsolutePath:()=>l.dirname(p)};o.push({type:ng.Readme,content:t,length:t.length,filePathKind:rg.Relative,projectName:n,targetDir:m,isRoot:d,fileKind:e,markdownContents:[],dir:h})}catch(t){u.warn(hp({code:`README_PROMPT_READ_FAILED`,title:`Failed to read readme-family file`,operation:`read`,targetKind:`readme-family prompt file`,path:p,error:t,details:{fileKind:e}}))}}try{let a=c.readdirSync(t,{withFileTypes:!0});for(let c of a)if(c.isDirectory()){let a=d?c.name:l.join(i,c.name),u=l.join(t,c.name);await this.collectReadmeFiles(e,u,n,r,a,o,s)}}catch(e){u.warn(hp({code:`README_DIRECTORY_SCAN_FAILED`,title:`Failed to scan readme-family directory`,operation:`scan`,targetKind:`readme-family directory`,path:t,error:e}))}}},dL=class extends R_{constructor(){super(`RuleInputCapability`)}async collect(e){let{userConfigOptions:t,logger:n,path:r,fs:i,globalScope:a}=e,o=this.resolveBasePaths(t),s=this.resolveAindexPath(t.aindex.rules.src,o.aindexDir),c=this.resolveAindexPath(t.aindex.rules.dist,o.aindexDir),{prompts:l,errors:u}=await YF(i,r,n,a).readFlatFiles(s,c,{kind:ng.Rule,localeExtensions:NF,hydrateSourceContents:!1,isDirectoryStructure:!1,createPrompt:async(e,t,n,i)=>{let a=i,o=r.join(c,`${n}.mdx`);if(a!=null){let e=aF(a,o);if(!e.valid)throw Error(e.errors.join(`
402
- `))}let s=a?.globs??[],l=a?.scope??`project`,u=a?.seriName,d=n.replaceAll(`\\`,`/`),f=d.includes(`/`)?d.split(`/`)[0]??``:``,p=d.split(`/`).pop()??d,m={type:ng.Rule,content:e,length:e.length,filePathKind:rg.Relative,dir:{pathKind:rg.Relative,path:`${n}.mdx`,basePath:c,getDirectoryName:()=>p,getAbsolutePath:()=>o},prefix:f,ruleName:p,globs:s,scope:l,markdownContents:[]};return a!=null&&Object.assign(m,{yamlFrontMatter:a}),u!=null&&Object.assign(m,{seriName:u}),m}});for(let e of u)n.warn(hp({code:`RULE_PROMPT_READ_FAILED`,title:`Failed to read rule prompt`,operation:e.phase===`scan`?`scan`:`read`,targetKind:`rule prompt`,path:e.path,error:e.error,details:{phase:e.phase}}));if(u.length>0)throw Error(u.map(e=>e.error instanceof Error?e.error.message:String(e.error)).join(`
403
- `));return{rules:l.map(e=>e.dist?.prompt).filter(e=>e!=null)}}},fL=class extends R_{constructor(){super(`AIAgentIgnoreInputCapability`)}collect(e){let{workspaceDir:t,aindexDir:n}=this.resolveBasePaths(e.userConfigOptions),r=[];for(let i of ug){let a=xg(n,i,{command:e.runtimeCommand,workspaceDir:t});if(!e.fs.existsSync(a)){this.log.debug({action:`collect`,message:`Ignore file not found`,path:a});continue}let o=e.fs.readFileSync(a,`utf8`);if(o.length===0){this.log.debug({action:`collect`,message:`Ignore file is empty`,path:a});continue}r.push({fileName:i,content:o,sourcePath:a}),this.log.debug({action:`collect`,message:`Loaded ignore file`,path:a,fileName:i})}return r.length===0?{}:{aiAgentIgnoreConfigFiles:r}}},pL=class extends R_{constructor(){super(`SubAgentInputCapability`)}createSubAgentPrompt(e,t,n,r,i,a,o,s){let{fs:c,logger:l,path:u}=a,{agentPrefix:d,agentName:f,canonicalName:p}=wP(n),m=u.join(i,`${n}.mdx`),h=`${n}.mdx`,g=c.existsSync(u.join(r,`${n}.src.mdx`))?u.join(r,`${n}.src.mdx`):m,_=o==null?void 0:(()=>{let e={...o},t=e.name;return typeof t==`string`&&t.trim().length>0&&s?.has(g)!==!0&&(s?.add(g),l.warn(_p({code:`SUBAGENT_NAME_IGNORED`,title:`Sub-agent authored name is ignored`,reason:q(`tnmsc ignores the authored sub-agent name "${t}" in favor of the derived path name "${p}".`),configPath:g,exactFix:q("Remove the `name` field from the sub-agent front matter or exported metadata.",`Rename the sub-agent directory or file if you need a different sub-agent name.`),details:{authoredName:t,derivedName:p,logicalName:n}}))),delete e.name,e})(),v={type:ng.SubAgent,content:e,length:e.length,filePathKind:rg.Relative,dir:{pathKind:rg.Relative,path:h,basePath:i,getDirectoryName:()=>h.replace(/\.mdx$/,``),getAbsolutePath:()=>m},...d!=null&&{agentPrefix:d},agentName:f,canonicalName:p};if(_==null)return v;let y=iF(_,m);if(!y.valid)throw Error(y.errors.join(`
404
- `));return Object.assign(v,{yamlFrontMatter:_}),_.seriName!=null&&Object.assign(v,{seriName:_.seriName}),v}async collect(e){let{userConfigOptions:t,logger:n,path:r,fs:i,globalScope:a}=e,o=this.resolveBasePaths(t),s=this.resolveAindexPath(t.aindex.subAgents.src,o.aindexDir),c=this.resolveAindexPath(t.aindex.subAgents.dist,o.aindexDir);n.debug(`SubAgentInputCapability collecting`,{srcDir:s,distDir:c,aindexDir:o.aindexDir});let l=YF(i,r,n,a),u=new Set,{prompts:d,errors:f}=await l.readFlatFiles(s,c,{kind:ng.SubAgent,localeExtensions:NF,hydrateSourceContents:!1,isDirectoryStructure:!1,createPrompt:(t,n,r,i)=>this.createSubAgentPrompt(t,n,r,s,c,e,i,u)});n.debug(`SubAgentInputCapability read complete`,{subAgentCount:d.length,errorCount:f.length});for(let e of f)n.warn(hp({code:`SUBAGENT_PROMPT_READ_FAILED`,title:`Failed to read sub-agent prompt`,operation:e.phase===`scan`?`scan`:`read`,targetKind:`sub-agent prompt`,path:e.path,error:e.error,details:{phase:e.phase}}));if(f.length>0)throw Error(f.map(e=>e.error instanceof Error?e.error.message:String(e.error)).join(`
405
- `));let p=[];for(let e of d){let t=e.dist;if(t?.prompt==null)continue;let{prompt:n,rawMdx:r}=t;p.push(r==null?n:{...n,rawMdxContent:r})}return n.debug(`SubAgentInputCapability flattened subAgents`,{count:p.length,agents:p.map(e=>e.canonicalName)}),{subAgents:p}}},mL=class extends R_{constructor(){super(`VSCodeConfigInputCapability`)}collect(e){let{userConfigOptions:t,fs:n}=e,{workspaceDir:r,aindexDir:i}=this.resolveBasePaths(t),a=[`.vscode/settings.json`,`.vscode/extensions.json`],o=[];for(let t of a){let a=Cg(ig.VSCode,t,i,n,{command:e.runtimeCommand,workspaceDir:r});a!=null&&o.push(a)}return{vscodeConfigFiles:o}}},hL=class extends R_{constructor(){super(`WorkspaceInputCapability`)}collect(e){let{userConfigOptions:t}=e,{workspaceDir:n,aindexDir:r}=this.resolveBasePaths(t);return{workspace:{directory:{pathKind:rg.Absolute,path:n,getDirectoryName:()=>s.basename(n)},projects:[]},aindexDir:r}}},gL=class extends R_{constructor(){super(`ZedConfigInputCapability`)}collect(e){let{userConfigOptions:t,fs:n}=e,{workspaceDir:r,aindexDir:i}=this.resolveBasePaths(t),a=[],o=Cg(ig.Zed,`.zed/settings.json`,i,n,{command:e.runtimeCommand,workspaceDir:r});return o!=null&&a.push(o),{zedConfigFiles:a}}};const _L={workspace:{strategy:`mergeProjects`,getter:e=>e.workspace},vscodeConfigFiles:{strategy:`concat`,getter:e=>e.vscodeConfigFiles},zedConfigFiles:{strategy:`concat`,getter:e=>e.zedConfigFiles},jetbrainsConfigFiles:{strategy:`concat`,getter:e=>e.jetbrainsConfigFiles},editorConfigFiles:{strategy:`concat`,getter:e=>e.editorConfigFiles},commands:{strategy:`concat`,getter:e=>e.commands},subAgents:{strategy:`concat`,getter:e=>e.subAgents},skills:{strategy:`concat`,getter:e=>e.skills},rules:{strategy:`concat`,getter:e=>e.rules},aiAgentIgnoreConfigFiles:{strategy:`concat`,getter:e=>e.aiAgentIgnoreConfigFiles},readmePrompts:{strategy:`concat`,getter:e=>e.readmePrompts},globalMemory:{strategy:`override`,getter:e=>e.globalMemory},aindexDir:{strategy:`override`,getter:e=>e.aindexDir},globalGitIgnore:{strategy:`override`,getter:e=>e.globalGitIgnore},shadowGitExclude:{strategy:`override`,getter:e=>e.shadowGitExclude}};function vL(e,t){return t==null?e??[]:e==null?t:[...e,...t]}function yL(e){return e.isWorkspaceRootProject===!0?`workspace-root:${e.name??``}`:`${e.promptSeries??`workspace`}:${e.name??``}`}function bL(e,t){let n=new Map;for(let t of e.projects)n.set(yL(t),t);for(let e of t.projects)n.set(yL(e),e);return{directory:t.directory??e.directory,projects:[...n.values()]}}function xL(e,t){return t==null?e:e==null?t:bL(e,t)}function SL(e,t,n){switch(n){case`concat`:return vL(e,t);case`override`:return t??e;case`mergeProjects`:return xL(e,t);default:return t??e}}function CL(e,t){let n={};for(let[r,i]of Object.entries(_L)){let a=SL(i.getter(e),i.getter(t),i.strategy);a!=null&&(n[r]=a)}return n}function wL(e,t,n){let r=e.dependsOn??[];if(r.length===0)return{};let i=new Set,a={};for(let e of r){if(i.has(e))continue;i.add(e);let r=t.get(e);r!=null&&(a=n(a,r))}return a}function TL(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.at(-1);if(e==null)return[...n];let t=a.indexOf(e);return a.slice(t)}i.clear(),a.length=0}return[...n]}function EL(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 yF(n.name,r)}let n=new Map;for(let t of e)n.set(t.name,t);let r=new Map;for(let t of e)r.set(t.name,0);let i=new Map;for(let t of e)i.set(t.name,[]);for(let t of e){let e=t.dependsOn??[];for(let n of e){r.set(t.name,(r.get(t.name)??0)+1);let e=i.get(n)??[];e.push(t.name),i.set(n,e)}}let a=[];for(let t of e)r.get(t.name)===0&&a.push(t.name);let o=[],s=new Map;for(let t=0;t<e.length;t++){let n=e[t];n!=null&&s.set(n.name,t)}for(;a.length>0;){let e=a.shift();if(e==null)continue;let t=n.get(e);if(t==null)continue;o.push(t);let c=(i.get(e)??[]).sort((e,t)=>(s.get(e)??-1)-(s.get(t)??-1));for(let e of c){let t=(r.get(e)??0)-1;r.set(e,t),t===0&&a.push(e)}}if(o.length===e.length)return o;throw new bF(TL(e,r))}function DL(){return[new jI,new AI,new xI]}function OL(){return[new hL,new $I,new mL,new gL,new aL,new tL,new QI,new eL,new pL,new dL,new iL,new cL,new uL,new rL,new nL,new fL]}async function kL(e){let{runtimeCommand:n,userConfigOptions:r,userConfig:i,capabilities:a,includeBuiltinEffects:o=!0}=e,c=om(`InputRuntime`,r.logLevel),l={logger:c,userConfigOptions:r,fs:t,path:s,glob:Th.default},u=EL([...o?DL():[],...a??OL()]),d=new iP({userConfig:i}).collect(),f=new oP;f.setGlobalScope(d),c.debug(`global scope collected`,{osInfo:{platform:d.os.platform,arch:d.os.arch,shellKind:d.os.shellKind},hasProfile:Object.keys(d.profile).length>0,hasTool:Object.keys(d.tool).length>0});let p=new Map,m={};for(let e of u){let t=wL(e,p,CL),r={...l,dependencyContext:t,...n==null?{}:{runtimeCommand:n},globalScope:d,scopeRegistry:f},i=e;i.executeEffects!=null&&await i.executeEffects(r,!1);let a=await e.collect(r);p.set(e.name,a),m=CL(m,a);let o=e;if(o.getRegisteredScopes!=null){let t=o.getRegisteredScopes();for(let{namespace:n,values:r}of t)f.register(n,r,aP.PluginRegistered),c.debug(`input capability scope registered`,{capability:e.name,namespace:n,keys:Object.keys(r)})}}return m}function AL(e){return`declarativeOutput`in e}function jL(e){return`collect`in e&&!AL(e)}const ML={version:`0.0.0`,workspaceDir:`~/project`,logLevel:`info`,aindex:Yh(),commandSeriesOptions:{},outputScopes:{},frontMatter:{blankLineAfter:!0},cleanupProtection:{},windows:{},plugins:[]};function NL(e){return{...e.version==null?{}:{version:e.version},...e.workspaceDir==null?{}:{workspaceDir:e.workspaceDir},...e.aindex==null?{}:{aindex:e.aindex},...e.commandSeriesOptions==null?{}:{commandSeriesOptions:e.commandSeriesOptions},...e.outputScopes==null?{}:{outputScopes:e.outputScopes},...e.frontMatter==null?{}:{frontMatter:e.frontMatter},...e.cleanupProtection==null?{}:{cleanupProtection:e.cleanupProtection},...e.windows==null?{}:{windows:e.windows},...e.logLevel==null?{}:{logLevel:e.logLevel}}}function PL(...e){let t={...ML};return e.reduce((e,t)=>FL(e,t),t)}function FL(e,t){let n=t.plugins,r=t.commandSeriesOptions,i=t.outputScopes,a=t.frontMatter,o=t.cleanupProtection,s=t.windows;return{...e,...t,aindex:Xh(e.aindex,t.aindex),plugins:[...e.plugins,...n??[]],commandSeriesOptions:IL(e.commandSeriesOptions,r),outputScopes:RL(e.outputScopes,i),frontMatter:zL(e.frontMatter,a),cleanupProtection:BL(e.cleanupProtection,o),windows:VL(e.windows,s)}}function IL(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 LL(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{...e,...t}}function RL(e,t){if(t==null)return e??{};if(e==null)return t;let n={};if(e.plugins!=null)for(let[t,r]of Object.entries(e.plugins))r!=null&&(n[t]={...r});if(t.plugins!=null)for(let[e,r]of Object.entries(t.plugins)){let t=LL(n[e],r);t!=null&&(n[e]=t)}return Object.keys(n).length===0?{}:{plugins:n}}function zL(e,t){return t==null?e:{...e,...t}}function BL(e,t){return t==null?e??{}:e==null?t:{rules:[...e.rules??[],...t.rules??[]]}}function VL(e,t){if(t==null)return e??{};if(e==null)return t;let n=e.wsl2,r=t.wsl2;return{...e,...t,...n!=null||r!=null?{wsl2:{...n,...r}}:{}}}function HL(e){return`pluginOptions`in e||`configLoaderOptions`in e||`loadUserConfig`in e||`cwd`in e||`runtimeCommand`in e}function UL(e){return HL(e)?{hasExplicitProgrammaticPlugins:Object.hasOwn(e.pluginOptions??{},`plugins`),explicitProgrammaticPlugins:e.pluginOptions?.plugins}:{hasExplicitProgrammaticPlugins:Object.hasOwn(e,`plugins`),explicitProgrammaticPlugins:e.plugins}}function WL(e,t){let n=e;return n.includes(SF.WORKSPACE)&&(n=n.replace(SF.WORKSPACE,t)),s.normalize(r_(n))}function GL(e){let t=WL(e.workspaceDir,``),n=s.join(t,e.aindex.dir);return sF({workspace:{directory:{pathKind:rg.Absolute,path:t,getDirectoryName:()=>s.basename(t)},projects:[]},aindexDir:n})}function KL(e){return e===`plugins`}async function qL(e={}){let t,n,r,i,a;HL(e)?({pluginOptions:r={},cwd:n,configLoaderOptions:i,runtimeCommand:a}={pluginOptions:e.pluginOptions,cwd:e.cwd,configLoaderOptions:e.configLoaderOptions,runtimeCommand:e.runtimeCommand},t=e.loadUserConfig??!0):(r=e,t=!0,i=void 0,a=void 0);let o={},s=!1,c=[],l;if(t)try{let e=pI(i).load(n);s=e.found,c=e.sources,e.found&&(o=NL(e.config),l=e.config)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to load user config: ${t}`)}let u=PL(o,r),{plugins:d=[],logLevel:f}=u,p=om(`defineConfig`,f);s?p.info(`user config loaded`,{sources:c}):p.info(`no user config found, using defaults/programmatic options`,{workspaceDir:u.workspaceDir,aindexDir:u.aindex.dir,logLevel:u.logLevel});let m=d.filter(AL),h=d.filter(jL);return hF(m,u),{mergedOptions:u,outputPlugins:m,inputCapabilities:h,...l!=null&&{userConfigFile:l},...a!=null&&{runtimeCommand:a},userConfigFound:s,userConfigSources:c}}async function JL(e={}){let{hasExplicitProgrammaticPlugins:t,explicitProgrammaticPlugins:n}=UL(e),{mergedOptions:r,outputPlugins:i,inputCapabilities:a,userConfigFile:o,runtimeCommand:s}=await qL(e),c=om(`defineConfig`,r.logLevel);if(KL(s))return{context:GL(r),outputPlugins:i,userConfigOptions:r};let l=await kL({userConfigOptions:r,...a.length>0?{capabilities:a}:{},includeBuiltinEffects:!(a.length>0||t&&(n?.length??0)===0),...s==null?{}:{runtimeCommand:s},...o==null?{}:{userConfig:o}});if(l.workspace==null)throw Error(`Workspace not initialized by any plugin`);let u=sF({workspace:l.workspace,...l.vscodeConfigFiles!=null&&{vscodeConfigFiles:l.vscodeConfigFiles},...l.zedConfigFiles!=null&&{zedConfigFiles:l.zedConfigFiles},...l.jetbrainsConfigFiles!=null&&{jetbrainsConfigFiles:l.jetbrainsConfigFiles},...l.editorConfigFiles!=null&&{editorConfigFiles:l.editorConfigFiles},...l.commands!=null&&{commands:l.commands},...l.subAgents!=null&&{subAgents:l.subAgents},...l.skills!=null&&{skills:l.skills},...l.rules!=null&&{rules:l.rules},...l.globalMemory!=null&&{globalMemory:l.globalMemory},...l.aiAgentIgnoreConfigFiles!=null&&{aiAgentIgnoreConfigFiles:l.aiAgentIgnoreConfigFiles},...l.aindexDir!=null&&{aindexDir:l.aindexDir},...l.readmePrompts!=null&&{readmePrompts:l.readmePrompts},...l.globalGitIgnore!=null&&{globalGitIgnore:l.globalGitIgnore},...l.shadowGitExclude!=null&&{shadowGitExclude:l.shadowGitExclude}});return l.aindexDir!=null&&wp(l.aindexDir,c),{context:u,outputPlugins:i,userConfigOptions:r}}const YL=[`IntelliJIdea`,`WebStorm`,`RustRover`,`PyCharm`,`PyCharmCE`,`PhpStorm`,`GoLand`,`CLion`,`DataGrip`,`RubyMine`,`Rider`,`DataSpell`,`Aqua`];function XL(e){return YL.some(t=>e.startsWith(t))}function ZL(e){let n=s.join(OI(),`JetBrains`);try{return t.readdirSync(n,{withFileTypes:!0}).filter(e=>e.isDirectory()&&XL(e.name)).map(e=>s.join(n,e.name,`aia`,`codex`))}catch(t){return e.debug(hp({code:`JETBRAINS_CODEX_DIRECTORY_SCAN_SKIPPED`,title:`JetBrains Codex directories are unavailable`,operation:`scan`,targetKind:`JetBrains IDE directory`,path:n,error:t})),[]}}function QL(e){return{jetbrainsCodexDirs:ZL(e)}}const $L=`.agents/skills`,eR=`.skills`,tR=`SKILL.md`;var nR=class extends xF{constructor(){super(`GenericSkillsOutputPlugin`,{outputFileName:tR,treatWorkspaceRootProjectAsProject:!0,skills:{},cleanup:{delete:{project:{dirs:[$L,eR]},global:{dirs:[$L,eR]}}},capabilities:{skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{skills:n}=e.collectedOutputContext;if(n==null||n.length===0)return t;let r=this.selectSingleScopeItems(n,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),i=this.selectSingleScopeItems(n,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`)),a=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=this.joinPath(e,r);if(t.push({path:this.joinPath(a,tR),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:this.joinPath(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:this.joinPath(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},o=(e,n,r)=>{for(let i of r)i.mcpConfig!=null&&t.push({path:this.joinPath(e,this.getSkillName(i),`mcp.json`),scope:n,source:{kind:`skillMcp`,rawContent:i.mcpConfig.rawContent}})};if(r.selectedScope===`project`||i.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectRootDir(e,t);if(n==null)continue;let s=$(r.items,t.projectConfig,`skills`),c=$(i.items,t.projectConfig,`skills`),l=this.joinPath(n,$L);r.selectedScope===`project`&&s.length>0&&a(l,`project`,s),i.selectedScope===`project`&&o(l,`project`,c)}if(r.selectedScope!==`global`&&i.selectedScope!==`global`)return t;let s=this.joinPath(this.getHomeDir(),$L),c=this.resolvePromptSourceProjectConfig(e);if(r.selectedScope===`global`){let e=$(r.items,c,`skills`);e.length>0&&a(s,`global`,e)}return i.selectedScope===`global`&&o(s,`global`,$(i.items,c,`skills`)),t}async convertContent(e,t){let n=e.source;switch(n.kind){case`skillMain`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillMcp`:return n.rawContent;case`skillChildDoc`:return n.content;case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;default:throw Error(`Unsupported declaration source for ${this.name}`)}}};const rR=`AGENTS.md`;var iR=class extends xF{constructor(){super(`AgentsOutputPlugin`,{outputFileName:rR,treatWorkspaceRootProjectAsProject:!0,capabilities:{prompt:{scopes:[`project`],singleScope:!1}}})}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:[...t.delete??[],...this.buildProjectPromptCleanupTargets(e,rR)]}}async declareOutputFiles(e){let t=[],n=this.getProjectPromptOutputProjects(e);if(!new Set(this.selectPromptScopes(e,[`project`])).has(`project`))return t;for(let[r,i]of n.entries()){let n=this.resolveProjectRootDir(e,i);if(i.rootMemoryPrompt!=null&&n!=null&&t.push({path:this.resolvePath(n,rR),scope:`project`,source:{type:`projectRootMemory`,projectIndex:r}}),i.childMemoryPrompts!=null)for(let[e,n]of i.childMemoryPrompts.entries())t.push({path:this.resolveFullPath(n.dir),scope:`project`,source:{type:`projectChildMemory`,projectIndex:r,childIndex:e}})}return t}async convertContent(e,t){let n=this.getProjectPromptOutputProjects(t),r=e.source,i=r.projectIndex??-1;if(i<0||i>=n.length)throw Error(`Invalid project index in declaration for ${this.name}`);let a=n[i];if(a==null)throw Error(`Project not found for declaration in ${this.name}`);if(r.type===`projectRootMemory`){if(a.rootMemoryPrompt==null)throw Error(`Root memory prompt missing for project index ${i}`);return a.rootMemoryPrompt.content}if(r.type===`projectChildMemory`){let e=r.childIndex??-1,t=a.childMemoryPrompts?.[e];if(t==null)throw Error(`Child memory prompt missing for project ${i}, child ${e}`);return t.content}throw Error(`Unsupported declaration source for ${this.name}`)}};const aR=`CLAUDE.md`;var oR=class extends xF{constructor(){super(`ClaudeCodeCLIOutputPlugin`,{globalConfigDir:`.claude`,outputFileName:aR,treatWorkspaceRootProjectAsProject:!0,toolPreset:`claudeCode`,commands:{subDir:`commands`,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},subagents:{subDir:`agents`,sourceScopes:[`project`],includePrefix:!0,linkSymbol:`-`,ext:`.md`},skills:{subDir:`skills`},rules:{transformFrontMatter:e=>({paths:e.globs.map(Qf)})},cleanup:{delete:{project:{files:[`.claude/settings.json`,`.claude/settings.local.json`],dirs:[`.claude/rules`,`.claude/commands`,`.claude/agents`,`.claude/skills`]},global:{files:[`.claude/CLAUDE.md`],dirs:[`.claude/rules`,`.claude/commands`,`.claude/agents`,`.claude/skills`]}}},wslMirrors:[`~/.claude/settings.json`,`~/.claude/config.json`],capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},subagents:{scopes:[`project`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:[...t.delete??[],...this.buildProjectPromptCleanupTargets(e,aR)]}}};const sR=FF.CURSOR,cR=EF.MCP_CONFIG,lR=OF.COMMANDS,uR=OF.RULES,dR=EF.CURSOR_GLOBAL_RULE,fR=OF.CURSOR_SKILLS,pR=`skills`,mR=EF.SKILL,hR=LF.CURSOR;var gR=class extends xF{constructor(){super(`CursorOutputPlugin`,{globalConfigDir:sR,outputFileName:``,treatWorkspaceRootProjectAsProject:!0,dependsOn:[wF.AgentsOutput],indexignore:IF.CURSOR,commands:{subDir:lR,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{subDir:fR},rules:{subDir:uR,prefix:`rule`,sourceScopes:[`project`,`global`]},cleanup:{delete:{project:{files:[`.cursor/mcp.json`],dirs:[`.cursor/commands`,`.cursor/rules`],globs:[`.cursor/skills/*`,`.cursor/skills-cursor/*`]},global:{files:[`.cursor/mcp.json`],dirs:[`.cursor/commands`,`.cursor/rules`],globs:[`.cursor/skills-cursor/*`]}},protect:{global:{dirs:Array.from(hR,e=>`.cursor/skills-cursor/${e}`)}},excludeScanGlobs:Array.from(hR,e=>`.cursor/skills-cursor/${e}/**`)},capabilities:{prompt:{scopes:[`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}})}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:(t.delete??[]).map(e=>e.kind!==`glob`||!e.path.replaceAll(`\\`,`/`).endsWith(`/.cursor/${fR}/*`)?e:{...e,excludeBasenames:[...hR]})}}async declareOutputFiles(e){let t=[],{globalMemory:n,commands:r,skills:i,rules:a,aiAgentIgnoreConfigFiles:o}=e.collectedOutputContext,c=this.getGlobalConfigDir(),l=this.resolvePromptSourceProjectConfig(e),u=this.getConcreteProjects(e),d=this.getProjectPromptOutputProjects(e),f=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0}),p=new Set(this.selectPromptScopes(e,[`global`])),m=new Set(a==null?[]:this.selectRuleScopes(e,a)),h=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),g=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`)),_=r==null?{items:[]}:this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),v=(e,n,r)=>{let i=n===`global`?fR:pR;for(let a of r){let r=this.getSkillName(a);if(this.isPreservedSkill(r))continue;let o=s.join(e,i,r);if(t.push({path:s.join(o,mR),scope:n,source:{kind:`skill`,skill:a}}),a.childDocs!=null)for(let e of a.childDocs)t.push({path:s.join(o,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(a.resources!=null)for(let e of a.resources)t.push({path:s.join(o,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},y=(e,n,r)=>{let i=n===`global`?fR:pR;for(let a of r){if(a.mcpConfig==null)continue;let r=s.join(e,i,this.getSkillName(a));t.push({path:s.join(r,cR),scope:n,source:{kind:`skillMcpConfig`,rawContent:a.mcpConfig.rawContent}})}},b=(e,n,r)=>{if(r.length===0)return;let i=XF(r,this.log);i.size!==0&&t.push({path:s.join(e,cR),scope:n,source:{kind:`mcpConfig`,mcpServers:ZF(i,$F)}})};if(h.selectedScope===`project`||g.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectConfigDir(e,t);if(n!=null&&(h.selectedScope===`project`&&v(n,`project`,$(h.items,t.projectConfig,`skills`)),g.selectedScope===`project`)){let e=$(g.items,t.projectConfig,`skills`);y(n,`project`,e),b(n,`project`,e)}}if((h.selectedScope===`global`||g.selectedScope===`global`)&&(h.selectedScope===`global`&&v(c,`global`,$(h.items,l,`skills`)),g.selectedScope===`global`)){let e=$(g.items,l,`skills`);y(c,`global`,e),b(c,`global`,e)}if(_.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=$(_.items,n.projectConfig,`commands`);for(let e of i)t.push({path:s.join(r,lR,this.transformCommandName(e,f)),scope:`project`,source:{kind:`command`,command:e}})}if(_.selectedScope===`global`){let e=$(_.items,l,`commands`);for(let n of e)t.push({path:s.join(c,lR,this.transformCommandName(n,f)),scope:`global`,source:{kind:`command`,command:n}})}if(a!=null&&a.length>0){let n=a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`global`);if(m.has(`global`))for(let e of n)t.push({path:s.join(c,uR,this.buildRuleFileName(e)),scope:`global`,source:{kind:`ruleMdc`,rule:e}});if(m.has(`project`))for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=eP($(a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`project`),n.projectConfig,`rules`),n.projectConfig);for(let e of i)t.push({path:s.join(r,uR,this.buildRuleFileName(e)),scope:`project`,source:{kind:`ruleMdc`,rule:e}})}}if(n!=null&&p.has(`global`)){let r=this.buildGlobalRuleContent(n.content,e);for(let n of d){let i=this.resolveProjectConfigDir(e,n);i!=null&&t.push({path:s.join(i,uR,dR),scope:`project`,source:{kind:`globalRuleContent`,content:r}})}}let x=this.getIgnoreOutputPath(),S=this.indexignore==null?void 0:o?.find(e=>e.fileName===this.indexignore);if(x!=null&&S!=null)for(let e of u){let n=e.dirFromWorkspacePath;n==null||e.isPromptSourceProject===!0||t.push({path:s.join(n.basePath,n.path,x),scope:`project`,source:{kind:`ignoreFile`,content:S.content}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`command`:return this.buildCommandContent(n.command,t);case`mcpConfig`:return JSON.stringify({mcpServers:n.mcpServers},null,2);case`skill`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillMcpConfig`:return n.rawContent;case`skillChildDoc`:case`globalRuleContent`:case`ignoreFile`:return n.content;case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;case`ruleMdc`:return this.buildRuleMdcContent(n.rule,t);default:throw Error(`Unsupported declaration source for ${this.name}`)}}buildGlobalRuleContent(e,t){return this.buildMarkdownContent(e,{description:`Global prompt (synced)`,alwaysApply:!0},t)}isPreservedSkill(e){return hR.has(e)}buildRuleMdcContent(e,t){let n={alwaysApply:!1,globs:e.globs.length>0?e.globs.join(`, `):``};return this.buildMarkdownContent(e.content,n,t).split(`
396
+ `}collect(e){return{}}};function rI(e){let{root:t}=s.parse(e);return e===t?e:e.endsWith(s.sep)?e.slice(0,-1):e}function iI(e,t){let n=rI(e),r=rI(t);return n===r?!0:n.startsWith(`${r}${s.sep}`)}function aI(e,t){let n=new Map,r=new Map;for(let t of e){let e=pg(t);n.set(e,e)}for(let e of t){let t=pg(e);r.set(t,t)}let i=new Map,a=[...r.entries()].sort((e,t)=>e[0].length-t[0].length);for(let[e,t]of a){let n=!1;for(let t of i.keys())if(iI(e,t)){n=!0;break}n||i.set(e,t)}let o=[];for(let[e,t]of n){let n=!1;for(let t of i.keys())if(iI(e,t)){n=!0;break}n||o.push(t)}return o.sort((e,t)=>e.localeCompare(t)),{files:o,dirs:[...i.values()].sort((e,t)=>e.localeCompare(t))}}function oI(){let e=XM();if(e==null)throw Error(`Native desk-paths binding is required. Build or install the Rust NAPI package before running tnmsc.`);return e}function sI(e){let t=oI()[e];if(t==null)throw Error(`Native desk-paths binding is missing "${String(e)}". Rebuild the Rust NAPI package before running tnmsc.`);return t}function cI(e){return{deletedFiles:e.deletedFiles??e.deleted_files??[],deletedDirs:e.deletedDirs??e.deleted_dirs??[],fileErrors:e.fileErrors??e.file_errors??[],dirErrors:e.dirErrors??e.dir_errors??[]}}function lI(){return sI(`getPlatformFixedDir`)()}async function uI(e){return cI(await Promise.resolve(sI(`deleteTargets`)({files:e.files??[],dirs:e.dirs??[]})))}var dI=class extends Lg{constructor(){super(`OrphanFileCleanupEffectInputCapability`),this.registerEffect(`orphan-file-cleanup`,this.cleanupOrphanFiles.bind(this),20)}buildProtectedDeletionGuard(e){return Ag({workspaceDir:e.workspaceDir,aindexDir:e.aindexDir,includeReservedWorkspaceContentRoots:!1,rules:[...(e.userConfigOptions.cleanupProtection?.rules??[]).map(e=>({path:e.path,protectionMode:e.protectionMode,reason:e.reason??`configured cleanup protection rule`,source:`configured-cleanup-protection`,matcher:e.matcher??`path`}))]})}buildDeletionPlan(e,t){let n=[],r=[],i=[];for(let a of t){let t=e.path.join(e.aindexDir,a.distPath);e.fs.existsSync(t)&&e.fs.statSync(t).isDirectory()&&this.collectDirectoryPlan(e,t,a,n,r,i)&&r.push(t)}return{filesToDelete:n,dirsToDelete:r,errors:i}}resolveDirectoryConfigs(e){return tP.map(t=>({key:t,srcPath:e.aindex[t].src,distPath:e.aindex[t].dist}))}async cleanupOrphanFiles(e){let{fs:t,path:n,aindexDir:r,logger:i,userConfigOptions:a,dryRun:o}=e,s=n.join(r,`dist`);if(!t.existsSync(s))return i.debug({action:`orphan-cleanup`,message:`dist/ directory does not exist, skipping`,distDir:s}),{success:!0,description:`dist/ directory does not exist, nothing to clean`,deletedFiles:[],deletedDirs:[]};let c=this.buildDeletionPlan(e,this.resolveDirectoryConfigs(a)),l=this.buildProtectedDeletionGuard(e),u=Pg(c.filesToDelete,l),d=Pg(c.dirsToDelete,l),f=aI(u.safePaths,d.safePaths),p=[...u.violations,...d.violations].sort((e,t)=>e.targetPath.localeCompare(t.targetPath));if(p.length>0)return{success:!1,description:`Protected deletion guard blocked orphan cleanup for ${p.length} path(s)`,deletedFiles:[],deletedDirs:[],error:new og(`orphan-file-cleanup`,p)};if(o)return{success:!0,description:`Would delete ${f.files.length} files and ${f.dirs.length} directories`,deletedFiles:[...f.files],deletedDirs:[...f.dirs]};let m=[...c.errors];i.debug(`orphan cleanup delete execution started`,{filesToDelete:f.files.length,dirsToDelete:f.dirs.length});let h=await uI({files:f.files,dirs:f.dirs});for(let e of h.fileErrors){let t=e.error instanceof Error?e.error:Error(String(e.error));m.push({path:e.path,error:t}),i.warn(hp({code:`ORPHAN_CLEANUP_FILE_DELETE_FAILED`,title:`Orphan cleanup could not delete a file`,operation:`delete`,targetKind:`orphan file`,path:e.path,error:t}))}for(let e of h.dirErrors){let t=e.error instanceof Error?e.error:Error(String(e.error));m.push({path:e.path,error:t}),i.warn(hp({code:`ORPHAN_CLEANUP_DIRECTORY_DELETE_FAILED`,title:`Orphan cleanup could not delete a directory`,operation:`delete`,targetKind:`orphan directory`,path:e.path,error:t}))}i.debug(`orphan cleanup delete execution complete`,{deletedFiles:h.deletedFiles.length,deletedDirs:h.deletedDirs.length,errors:m.length});let g=m.length>0;return{success:!g,description:`Deleted ${h.deletedFiles.length} files and ${h.deletedDirs.length} directories`,deletedFiles:[...h.deletedFiles],deletedDirs:[...h.deletedDirs],...g&&{error:Error(`${m.length} errors occurred during cleanup`)}}}collectDirectoryPlan(e,t,n,r,i,a){let{fs:o,path:s,aindexDir:c,logger:l}=e,u;try{u=o.readdirSync(t,{withFileTypes:!0})}catch(e){return a.push({path:t,error:e}),l.warn(hp({code:`ORPHAN_CLEANUP_DIRECTORY_READ_FAILED`,title:`Orphan cleanup could not read a directory`,operation:`read`,targetKind:`dist cleanup directory`,path:t,error:e})),!1}let d=!1;for(let o of u){let l=s.join(t,o.name);if(o.isDirectory()){this.collectDirectoryPlan(e,l,n,r,i,a)?i.push(l):d=!0;continue}if(!o.isFile()){d=!0;continue}this.isOrphanFile(e,l,n,c)?r.push(l):d=!0}return!d}isOrphanFile(e,t,n,r){let{fs:i,path:a}=e,o=a.basename(t),s=o.endsWith(`.mdx`),c=a.join(r,n.distPath),l=a.relative(c,t),u=a.dirname(l),d=o.replace(/\.mdx$/,``);return s?!this.getPossibleSourcePaths(a,r,n.key,n.srcPath,d,u).some(e=>i.existsSync(e)):!i.existsSync(a.join(r,n.srcPath,l))}getPossibleSourcePaths(e,t,n,r,i,a){if(n===`skills`){let n=(a===`.`?[i]:a.split(e.sep))[0]??i,o=a===`.`?``:a.slice(n.length+1);return o===``?[...pF.map(i=>e.join(t,r,n,`SKILL${i}`)),...pF.map(i=>e.join(t,r,n,`skill${i}`))]:pF.map(a=>e.join(t,r,n,o,`${i}${a}`))}return a===`.`?pF.map(n=>e.join(t,r,`${i}${n}`)):pF.map(n=>e.join(t,r,a,`${i}${n}`))}collect(e){return{}}},fI=class extends Lg{constructor(){super(`SkillDistCleanupEffectInputCapability`),this.registerEffect(`skill-dist-cleanup`,this.cleanupDistSkillArtifacts.bind(this),10)}async cleanupDistSkillArtifacts(e){let{fs:t,logger:n,userConfigOptions:r,aindexDir:i,dryRun:a}=e,o=this.resolveAindexPath(r.aindex.skills.src,i),s=this.resolveAindexPath(r.aindex.skills.dist,i);if(!t.existsSync(s))return n.debug({action:`skill-dist-cleanup`,message:`dist skills directory does not exist, skipping`,srcSkillsDir:o,distSkillsDir:s}),{success:!0,description:`dist skills directory does not exist, nothing to clean`,deletedFiles:[],deletedDirs:[]};let c=this.buildCleanupPlan(e,s),l=aI(c.filesToDelete,c.dirsToDelete);if(a)return{success:!0,description:`Would delete ${l.files.length} files and ${l.dirs.length} directories`,deletedFiles:[...l.files],deletedDirs:[...l.dirs]};let u=[...c.errors];n.debug(`skill dist cleanup delete execution started`,{filesToDelete:l.files.length,dirsToDelete:l.dirs.length});let d=await uI({files:l.files,dirs:l.dirs});for(let e of d.fileErrors){let t=e.error instanceof Error?e.error:Error(String(e.error));u.push({path:e.path,error:t}),n.warn(hp({code:`SKILL_DIST_CLEANUP_FILE_DELETE_FAILED`,title:`Skill dist cleanup could not delete a file`,operation:`delete`,targetKind:`skill dist file`,path:e.path,error:t}))}for(let e of d.dirErrors){let t=e.error instanceof Error?e.error:Error(String(e.error));u.push({path:e.path,error:t}),n.warn(hp({code:`SKILL_DIST_CLEANUP_DIRECTORY_DELETE_FAILED`,title:`Skill dist cleanup could not delete a directory`,operation:`delete`,targetKind:`skill dist directory`,path:e.path,error:t}))}n.debug(`skill dist cleanup delete execution complete`,{deletedFiles:d.deletedFiles.length,deletedDirs:d.deletedDirs.length,errors:u.length});let f=u.length>0;return{success:!f,description:`Deleted ${d.deletedFiles.length} files and ${d.deletedDirs.length} directories`,deletedFiles:[...d.deletedFiles],deletedDirs:[...d.deletedDirs],...f&&{error:Error(`${u.length} errors occurred during cleanup`)}}}buildCleanupPlan(e,t){let n=[],r=[],i=[];return this.collectCleanupPlan(e,t,n,r,i)&&r.push(t),{filesToDelete:n,dirsToDelete:r,errors:i}}collectCleanupPlan(e,t,n,r,i){let{fs:a,path:o,logger:s}=e,c;try{c=a.readdirSync(t,{withFileTypes:!0})}catch(e){return i.push({path:t,error:e}),s.warn(hp({code:`SKILL_DIST_CLEANUP_DIRECTORY_READ_FAILED`,title:`Skill dist cleanup could not read a directory`,operation:`read`,targetKind:`skill dist directory`,path:t,error:e})),!1}let l=!1;for(let a of c){let s=o.join(t,a.name);if(a.isDirectory()){this.collectCleanupPlan(e,s,n,r,i)?r.push(s):l=!0;continue}if(!a.isFile()){l=!0;continue}if(this.shouldRetainCompiledSkillFile(a.name)){l=!0;continue}n.push(s)}return!l}shouldRetainCompiledSkillFile(e){return e.endsWith(`.mdx`)&&!hF(e)}collect(e){return{}}};const pI=/export\s+default\s*\{([\s\S]*?)\}/u,mI=/description\s*:\s*['"`]([^'"`]+)['"`]/u,hI=/name\s*:\s*['"`]([^'"`]+)['"`]/u,gI=/displayName\s*:\s*['"`]([^'"`]+)['"`]/u,_I=/keywords\s*:\s*\[([^\]]+)\]/u,vI=/author\s*:\s*['"`]([^'"`]+)['"`]/u,yI=/version\s*:\s*['"`]([^'"`]+)['"`]/u;function bI(e){let t={},n=pI.exec(e);if(n?.[1]==null)return t;let r=n[1],i=mI.exec(r);i?.[1]!=null&&(t.description=i[1]);let a=hI.exec(r);a?.[1]!=null&&(t.name=a[1]);let o=gI.exec(r);o?.[1]!=null&&(t.displayName=o[1]);let s=_I.exec(r);s?.[1]!=null&&(t.keywords=s[1].split(`,`).map(e=>e.trim().replaceAll(/['"]/gu,``)).filter(e=>e.length>0));let c=vI.exec(r);c?.[1]!=null&&(t.author=c[1]);let l=yI.exec(r);return l?.[1]!=null&&(t.version=l[1]),t}function xI(...e){let t={};for(let n of e)if(n!=null)for(let[e,r]of Object.entries(n))r!==void 0&&(t[e]=r);return t}function SI(e){let{logger:t,warnedDerivedNames:n,sourcePath:r,authoredName:i,skillName:a}=e;n?.has(r)!==!0&&(n?.add(r),t.warn(_p({code:`SKILL_NAME_IGNORED`,title:`Skill authored name is ignored`,reason:q(`tnmsc ignores the authored skill name "${i}" in favor of the directory-derived name "${a}".`),configPath:r,exactFix:q("Remove the `name` field from the skill front matter or exported metadata.",`Rename the skill directory if you need a different skill name.`),details:{authoredName:i,derivedName:a}})))}const CI={".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`},wI=new Set(`.png,.jpg,.jpeg,.gif,.webp,.ico,.bmp,.tiff,.svg,.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,.pdf,.docx,.doc,.xlsx,.xls,.pptx,.ppt,.odt,.ods,.odp`.split(`,`));function TI(e){return wI.has(e.toLowerCase())}function EI(e){return CI[e.toLowerCase()]}function DI(...e){return s.join(...e).replaceAll(`\\`,`/`)}var OI=class{ctx;constructor(e){this.ctx=e}async processDirectory(e,t,n){let r=t?`${t}/${e.name}`:e.name;return this.scanSkillDirectoryAsync(n,r)}async processFile(e,t,n){let r=t?`${t}/${e.name}`:e.name;if(this.ctx.scanMode===`distChildDocs`){if(t===``&&e.name===`skill.mdx`||hF(e.name)||!e.name.endsWith(`.mdx`))return{childDocs:[],resources:[]};let i=await this.processChildDoc(r,n);return{childDocs:i?[i]:[],resources:[]}}if(t===``&&e.name===`mcp.json`||hF(e.name)||e.name.endsWith(`.mdx`))return{childDocs:[],resources:[]};let i=this.processResourceFile(e.name,r,n);return{childDocs:[],resources:i?[i]:[]}}async processChildDoc(e,t){try{let n=await wN(t,{mode:`dist`,globalScope:this.ctx.globalScope}),r=ep(n.content);return wF(r,t),{type:UM.SkillChildDoc,content:r,length:r.length,filePathKind:WM.Relative,markdownAst:n.parsed.markdownAst,markdownContents:n.parsed.markdownContents,...n.parsed.rawFrontMatter!=null&&{rawFrontMatter:n.parsed.rawFrontMatter},relativePath:e,dir:{pathKind:WM.Relative,path:e,basePath:this.ctx.skillDir,getDirectoryName:()=>s.dirname(e),getAbsolutePath:()=>t}}}catch(n){throw this.ctx.logger.error(bp({code:`SKILL_CHILD_DOC_COMPILE_FAILED`,title:`Failed to compile skill child doc`,diagnosticText:DF(n,{operation:`Failed to compile skill child doc.`,promptKind:`skill-child-doc`,logicalName:`${s.basename(this.ctx.skillDir)}/${e.replace(/\.mdx$/u,``)}`,distPath:t,srcPath:TF(s,t,{distRootDir:this.ctx.skillDir,srcRootDir:this.ctx.sourceSkillDir})}),details:{skillDir:this.ctx.skillDir,relativePath:e,filePath:t}})),n}}processResourceFile(e,t,n){let r=s.extname(e);try{let{content:i,encoding:a,length:o}=this.readFileContent(n,r),s=EI(r);return{type:UM.SkillResource,extension:r,fileName:e,relativePath:t,sourcePath:n,content:i,encoding:a,length:o,...s!=null&&{mimeType:s}}}catch(r){return this.ctx.logger.warn(hp({code:`SKILL_RESOURCE_READ_FAILED`,title:`Failed to read skill resource file`,operation:`read`,targetKind:`skill resource file`,path:n,error:r,details:{relativePath:t,fileName:e,skillDir:this.ctx.skillDir}})),null}}readFileContent(e,t){if(TI(t)){let t=this.ctx.fs.readFileSync(e);return{content:t.toString(`base64`),encoding:`base64`,length:t.length}}let n=this.ctx.fs.readFileSync(e,`utf8`);return{content:n,encoding:`text`,length:m.from(n,`utf8`).length}}async scanSkillDirectoryAsync(e,t=``){let n=[],r=[],i;try{i=this.ctx.fs.readdirSync(e,{withFileTypes:!0})}catch(t){return this.ctx.logger.warn(hp({code:`SKILL_DIRECTORY_SCAN_FAILED`,title:`Failed to scan skill directory`,operation:`scan`,targetKind:`skill directory`,path:e,error:t,details:{skillDir:this.ctx.skillDir,scanMode:this.ctx.scanMode}})),{childDocs:n,resources:r}}for(let a of i){let i=DI(e,a.name);if(a.isDirectory()){let e=await this.processDirectory(a,t,i);n.push(...e.childDocs),r.push(...e.resources);continue}if(!a.isFile())continue;let o=await this.processFile(a,t,i);n.push(...o.childDocs),r.push(...o.resources)}return{childDocs:n,resources:r}}};function kI(e,t,n,r=``){let i=[],a=r===``?e:DI(e,r),o;try{o=t.readdirSync(a,{withFileTypes:!0})}catch(e){return n.warn(hp({code:`SKILL_SOURCE_CHILD_SCAN_FAILED`,title:`Failed to scan skill source child docs`,operation:`scan`,targetKind:`skill source child doc directory`,path:a,error:e})),i}for(let a of o){let o=r?`${r}/${a.name}`:a.name;if(a.isDirectory()){i.push(...kI(e,t,n,o));continue}!a.isFile()||!hF(a.name)||r===``&&a.name===`skill.src.mdx`||i.push(o.replace(/\.src\.mdx$/u,`.mdx`))}return i}function AI(e,t,n,r,i){if(r.existsSync(t))for(let a of kI(t,r,i)){let i=s.join(n,a);if(!r.existsSync(i))throw new bF({kind:`skill child doc`,name:`${e}/${a}`,sourcePath:s.join(t,a.replace(/\.mdx$/u,`.src.mdx`)),expectedDistPath:i})}}function jI(e,t,n){let r=s.join(e,`mcp.json`);if(t.existsSync(r)){if(!t.statSync(r).isFile()){n.warn(yp({code:`SKILL_MCP_CONFIG_NOT_FILE`,title:`Skill MCP config path is not a file`,path:r,expectedKind:`mcp.json file`,actualState:`path exists but is not a regular file`,details:{skillDir:e}}));return}try{let i=t.readFileSync(r,`utf8`),a=JSON.parse(i);if(a.mcpServers==null||typeof a.mcpServers!=`object`){n.warn(_p({code:`SKILL_MCP_CONFIG_INVALID`,title:`Skill MCP config is missing mcpServers`,reason:q(`The skill MCP config at "${r}" does not contain a top-level mcpServers object.`),configPath:r,exactFix:q("Add a top-level `mcpServers` object to mcp.json before retrying tnmsc."),details:{skillDir:e}}));return}return{type:UM.SkillMcpConfig,mcpServers:a.mcpServers,rawContent:i}}catch(t){n.warn(_p({code:`SKILL_MCP_CONFIG_PARSE_FAILED`,title:`Failed to parse skill MCP config`,reason:q(`tnmsc could not parse the MCP config file at "${r}".`,`Underlying error: ${t instanceof Error?t.message:String(t)}`),configPath:r,exactFix:q(`Fix the JSON syntax in mcp.json and rerun tnmsc.`),details:{skillDir:e,errorMessage:t instanceof Error?t.message:String(t)}}));return}}}async function MI(e,t,n,r,i,a,o,c,l=[],u=[],d,f,p){let{logger:m,fs:h}=o,g=s.join(i,`skill.mdx`),_=h.existsSync(s.join(a,`skill.src.mdx`))?s.join(a,`skill.src.mdx`):g,v=e,y,b;if(h.existsSync(g)){let t=await wN(g,{mode:`dist`,globalScope:o.globalScope});v=t.rawMdx,y=t.parsed,e=ep(t.content),wF(e,g),b=t.metadata}let x=xI(bI(v),f,b),S=new Set,C=y?.yamlFrontMatter?.name;typeof C==`string`&&C.trim().length>0&&S.add(C);let w=x.name;typeof w==`string`&&w.trim().length>0&&S.add(w);for(let e of S)SI({logger:m,sourcePath:_,authoredName:e,skillName:n,...p!=null&&{warnedDerivedNames:p}});let T=y?.yamlFrontMatter?.description??x?.description;if(T==null||T.trim().length===0)throw m.error(dp({code:`SKILL_VALIDATION_FAILED`,title:`Skill description is required`,rootCause:q(`The skill "${n}" does not provide a non-empty description in its compiled metadata or front matter.`),exactFix:q(`Add a non-empty description field to the skill front matter or exported metadata and rebuild the skill.`),possibleFixes:[q("Set `description` in `SKILL.md` front matter."),q(`If you export metadata from code, ensure the exported description is non-empty.`)],details:{skill:n,skillDir:r,yamlDescription:y?.yamlFrontMatter?.description,exportDescription:x?.description}})),Error(`Skill "${n}" validation failed: description is required and cannot be empty`);let E={...x,...y?.yamlFrontMatter??{},name:n,description:T},ee=LP(E,g);if(!ee.valid)throw Error(ee.errors.join(`
397
+ `));return{type:UM.Skill,content:e,length:e.length,filePathKind:WM.Relative,skillName:n,yamlFrontMatter:E,markdownAst:y?.markdownAst,markdownContents:y?.markdownContents??[],dir:{pathKind:WM.Relative,path:n,basePath:r,getDirectoryName:()=>n,getAbsolutePath:()=>s.join(r,n)},...y?.rawFrontMatter!=null&&{rawFrontMatter:y.rawFrontMatter},...c!=null&&{mcpConfig:c},...l!=null&&l.length>0&&{childDocs:l},...u!=null&&u.length>0&&{resources:u},...d!=null&&{seriName:d}}}var NI=class extends Lg{constructor(){super(`SkillInputCapability`)}readMcpConfig(e,t,n){return jI(e,t,n)}async scanSkillDirectory(e,t,n,r=``,i=`srcResources`,a,o){return new OI({fs:t,logger:n,skillDir:e,scanMode:i,...a!=null&&{globalScope:a},...o!=null&&{sourceSkillDir:o}}).scanSkillDirectoryAsync(e,r)}async collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i,globalScope:a}=e,{aindexDir:o}=this.resolveBasePaths(t),s=this.resolveAindexPath(t.aindex.skills.src,o),c=this.resolveAindexPath(t.aindex.skills.dist,o),l=[],u=AF(r,i,n,a),d=new Set,f=new Map,p=async e=>{let t=f.get(e);if(t!=null)return t;let o=i.join(s,e),l=i.join(c,e),u=r.existsSync(l)?(await this.scanSkillDirectory(l,r,n,``,`distChildDocs`,a,o)).childDocs:[],d=r.existsSync(o)?(await this.scanSkillDirectory(o,r,n,``,`srcResources`,a)).resources:[],p=jI(o,r,n);AI(e,o,l,r,n);let m={childDocs:u,resources:d,...p!=null&&{mcpConfig:p}};return f.set(e,m),m},{prompts:m,errors:h}=await u.readDirectoryStructure(s,c,{kind:UM.Skill,entryFileName:`skill`,localeExtensions:mF,hydrateSourceContents:!1,isDirectoryStructure:!0,createPrompt:async(t,n,r,a)=>{let o=i.join(c,r),{childDocs:l,resources:u,mcpConfig:f}=await p(r);return MI(t,n,r,c,o,i.join(s,r),e,f,l,u,void 0,a,d)}});for(let e of h)n.warn(hp({code:`SKILL_PROMPT_READ_FAILED`,title:`Failed to read skill prompt`,operation:e.phase===`scan`?`scan`:`read`,targetKind:`skill prompt`,path:e.path,error:e.error,details:{phase:e.phase}}));if(h.length>0)throw Error(h.map(e=>e.error instanceof Error?e.error.message:String(e.error)).join(`
398
+ `));for(let e of m){let t=e.dist?.prompt;t!=null&&l.push(t)}return{skills:l}}},PI=class e extends Lg{static projectConfigFileName=`project.json5`;static conflictingProjectSeriesCode=`AINDEX_PROJECT_SERIES_NAME_CONFLICT`;constructor(){super(`AindexInputCapability`)}loadProjectConfig(t,n,r,i,a,o){let s=a.join(n,r,t,e.projectConfigFileName);if(i.existsSync(s))try{let n=i.readFileSync(s,`utf8`);try{return h.parse(n)}catch(n){o.warn(_p({code:`AINDEX_PROJECT_JSON5_INVALID`,title:`Failed to parse ${e.projectConfigFileName} for ${t}`,reason:q(`tnmsc could not parse the ${e.projectConfigFileName} file for "${t}".`,`Underlying error: ${n instanceof Error?n.message:String(n)}`),configPath:s,exactFix:q(`Fix the JSON5 syntax in ${e.projectConfigFileName} and rerun tnmsc.`),details:{projectName:t,errorMessage:n instanceof Error?n.message:String(n)}}));return}}catch(n){o.warn(_p({code:`AINDEX_PROJECT_JSON5_READ_FAILED`,title:`Failed to load ${e.projectConfigFileName} for ${t}`,reason:q(`tnmsc could not read the ${e.projectConfigFileName} file for "${t}".`,`Underlying error: ${n instanceof Error?n.message:String(n)}`),configPath:s,exactFix:q(`Ensure ${e.projectConfigFileName} exists, is readable, and contains valid JSON5.`),details:{projectName:t,errorMessage:n instanceof Error?n.message:String(n)}}));return}}async scanSeriesProjects(e,t,n,r,i){let{logger:a,fs:o,path:s}=e;return(await Promise.all(i.map(async e=>{let i=this.resolveAindexPath(e.dist,n);if((await o.promises.stat(i).catch(()=>void 0))?.isDirectory()!==!0)return[];try{let c=(await o.promises.readdir(i,{withFileTypes:!0})).filter(e=>e.isDirectory()).sort((e,t)=>e.name.localeCompare(t.name)),l=[];for(let i of c){let c=i.name===r,u=this.loadProjectConfig(i.name,n,e.src,o,s,a);l.push({name:i.name,promptSeries:e.name,...c&&{isPromptSourceProject:!0},...u!=null&&{projectConfig:u},dirFromWorkspacePath:{pathKind:WM.Relative,path:i.name,basePath:t,getDirectoryName:()=>i.name,getAbsolutePath:()=>s.resolve(t,i.name)}})}return l}catch(t){return a.error(hp({code:`AINDEX_PROJECT_DIRECTORY_SCAN_FAILED`,title:`Failed to scan aindex ${e.name} projects directory`,operation:`scan`,targetKind:`aindex ${e.name} projects directory`,path:i,error:t})),[]}}))).flat()}loadFallbackProjectConfig(e,t,n){for(let r of QF(n.userConfigOptions)){let i=this.loadProjectConfig(e,t,r.src,n.fs,n.path,n.logger);if(i!=null)return i}}assertNoCrossSeriesProjectNameConflicts(t,n,r){let{logger:i,fs:a,path:o}=t,s=eI(r.flatMap(e=>{let t=o.join(n,e.src);return a.existsSync(t)&&a.statSync(t).isDirectory()?a.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(n=>({projectName:n.name,seriesName:e.name,seriesDir:o.join(t,n.name)})):[]}));if(s.length!==0)throw i.error(_p({code:e.conflictingProjectSeriesCode,title:`Project names must be unique across app, ext, arch, and softwares`,reason:q(`tnmsc maps project-scoped outputs back to workspace project names, so app/ext/arch/softwares cannot reuse the same directory name.`,`Conflicting project names: ${s.map(e=>e.projectName).join(`, `)}`),exactFix:q(`Rename the conflicting project directory in one of the app/ext/arch/softwares source trees and rerun tnmsc.`),possibleFixes:s.map(e=>q(`"${e.projectName}" is currently declared in: ${e.refs.map(e=>`${e.seriesName} (${e.seriesDir})`).join(`, `)}`)),details:{aindexDir:n,conflicts:s.map(e=>({projectName:e.projectName,refs:e.refs.map(e=>({seriesName:e.seriesName,seriesDir:e.seriesDir}))}))}})),Error(`Aindex project series name conflict`)}async collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i}=e,{workspaceDir:a,aindexDir:o}=this.resolveBasePaths(t),s=i.basename(o),c=QF(t);this.assertNoCrossSeriesProjectNameConflicts(e,o,c);let l=await this.scanSeriesProjects(e,a,o,s,c);if(l.length===0&&r.existsSync(a)&&r.statSync(a).isDirectory()){n.debug(`no projects in dist/app, dist/ext, or dist/arch; falling back to workspace scan`,{workspaceDir:a});try{let t=r.readdirSync(a,{withFileTypes:!0}).filter(e=>e.isDirectory()).sort((e,t)=>e.name.localeCompare(t.name));for(let n of t){if(n.name.startsWith(`.`))continue;let t=n.name===s,r=this.loadFallbackProjectConfig(n.name,o,e);l.push({name:n.name,...t&&{isPromptSourceProject:!0},...r!=null&&{projectConfig:r},dirFromWorkspacePath:{pathKind:WM.Relative,path:n.name,basePath:a,getDirectoryName:()=>n.name,getAbsolutePath:()=>i.resolve(a,n.name)}})}}catch(e){n.error(hp({code:`WORKSPACE_DIRECTORY_SCAN_FAILED`,title:`Failed to scan workspace directory`,operation:`scan`,targetKind:`workspace directory`,path:a,error:e}))}}return{workspace:{directory:{pathKind:WM.Absolute,path:a,getDirectoryName:()=>i.basename(a)},projects:l}}}},FI=class extends Lg{constructor(){super(`CommandInputCapability`)}createCommandPrompt(e,t,n,r,i,a){let{path:o}=i,s=n.replaceAll(`\\`,`/`),c=s.indexOf(`/`),l=c===-1?void 0:s.slice(0,c),u=(c===-1?s:s.slice(c+1)).replace(/\.mdx$/,``),d=u.indexOf(`_`),f=l??(d===-1?void 0:u.slice(0,Math.max(0,d))),p=l!=null||d===-1?u:u.slice(Math.max(0,d+1)),m=o.join(r,`${n}.mdx`),h=`${n}.mdx`,g=a,_={type:UM.Command,content:e,length:e.length,filePathKind:WM.Relative,dir:{pathKind:WM.Relative,path:h,basePath:r,getDirectoryName:()=>h.replace(/\.mdx$/,``),getAbsolutePath:()=>m},...f!=null&&{commandPrefix:f},commandName:p};if(g==null)return _;let v=RP(g,m);if(!v.valid)throw Error(v.errors.join(`
399
+ `));return Object.assign(_,{yamlFrontMatter:g}),g.seriName!=null&&Object.assign(_,{seriName:g.seriName}),g.scope===`global`&&Object.assign(_,{globalOnly:!0}),_}async collect(e){let{userConfigOptions:t,logger:n,path:r,fs:i,globalScope:a}=e,o=this.resolveBasePaths(t),s=this.resolveAindexPath(t.aindex.commands.src,o.aindexDir),c=this.resolveAindexPath(t.aindex.commands.dist,o.aindexDir);n.debug(`CommandInputCapability collecting`,{srcDir:s,distDir:c,aindexDir:o.aindexDir});let{prompts:l,errors:u}=await AF(i,r,n,a).readFlatFiles(s,c,{kind:UM.Command,localeExtensions:mF,hydrateSourceContents:!1,isDirectoryStructure:!1,createPrompt:(t,n,r,i)=>this.createCommandPrompt(t,n,r,c,e,i)});n.debug(`CommandInputCapability read complete`,{commandCount:l.length,errorCount:u.length});for(let e of u)n.warn(hp({code:`COMMAND_PROMPT_READ_FAILED`,title:`Failed to read command prompt`,operation:e.phase===`scan`?`scan`:`read`,targetKind:`command prompt`,path:e.path,error:e.error,details:{phase:e.phase}}));if(u.length>0)throw Error(u.map(e=>e.error instanceof Error?e.error.message:String(e.error)).join(`
400
+ `));let d=[];for(let e of l){let t=e.dist;if(t?.prompt==null)continue;let{prompt:n,rawMdx:r}=t;d.push(r==null?n:{...n,rawMdxContent:r})}return n.debug(`CommandInputCapability flattened commands`,{count:d.length,commands:d.map(e=>e.commandName)}),{commands:d}}};const II={"win32-x64":{local:`napi-script-runtime.win32-x64-msvc`,suffix:`win32-x64-msvc`},"linux-x64":{local:`napi-script-runtime.linux-x64-gnu`,suffix:`linux-x64-gnu`},"linux-arm64":{local:`napi-script-runtime.linux-arm64-gnu`,suffix:`linux-arm64-gnu`},"darwin-arm64":{local:`napi-script-runtime.darwin-arm64`,suffix:`darwin-arm64`},"darwin-x64":{local:`napi-script-runtime.darwin-x64`,suffix:`darwin-x64`}};let LI,RI,zI;function BI(){let e=II[`${a.platform}-${a.arch}`];if(e!=null)return e;throw Error(`Unsupported platform for @truenine/script-runtime native binding: ${a.platform}-${a.arch}`)}function VI(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.validate_public_path==`function`||typeof t.validatePublicPath==`function`||typeof t.resolve_public_path==`function`||typeof t.resolvePublicPath==`function`}function HI(e,t,n){let r=e instanceof Error?e.message:String(e),i=t instanceof Error?t.message:String(t);return Error([`Failed to load @truenine/script-runtime native binding.`,`Tried local binary "./${II[`${a.platform}-${a.arch}`]?.local??`unknown`}.node" and package "@truenine/memory-sync-cli-${n}".`,`Local error: ${r}`,`Package error: ${i}`,"Run `pnpm -F @truenine/script-runtime run build` to build the native module."].join(`
401
+ `))}function UI(e,n){let r=`@truenine/memory-sync-cli-${n}`;try{let t=e(r).scriptRuntime;if(VI(t))return t}catch{}let i=l(e.resolve(`${r}/package.json`)),a=t.readdirSync(i).filter(e=>e.startsWith(`napi-script-runtime.`)&&e.endsWith(`.node`)).sort();for(let t of a){let n=e(u(i,t));if(VI(n))return n}throw Error(`Package "${r}" does not export a scriptRuntime binding or contain a compatible native module`)}function WI(){let t=e(import.meta.url),{local:n,suffix:r}=BI();try{return t(`./${n}.node`)}catch(e){try{return UI(t,r)}catch(t){throw HI(e,t,r)}}}function GI(){if(LI!=null)return LI;if(RI!=null)throw RI;try{return LI=WI(),LI}catch(e){throw RI=e instanceof Error?e:Error(String(e)),RI}}function KI(e,t,n){let r=GI(),i=r.resolve_public_path??r.resolvePublicPath;if(i==null)throw Error(`resolve_public_path native binding is unavailable`);return i(e,t,n)}function qI(){if(zI!=null)return zI;let e=[o(new URL(`./resolve-proxy-worker.mjs`,import.meta.url)),o(new URL(`./script-runtime-worker.mjs`,import.meta.url))];for(let n of e)if(t.existsSync(n))return zI=n,n;return zI=e[0],zI}function JI(e,t,n,r=5e3){return KI(e,JSON.stringify({...t,workerPath:qI(),timeoutMs:r}),n)}const YI=`proxy.ts`,XI=[lP.QODER_IGNORE,lP.CURSOR_IGNORE,lP.WARP_INDEX_IGNORE,lP.AI_IGNORE,lP.WINDSURF_IGNORE,lP.CODEIUM_IGNORE,`.kiroignore`,`.traeignore`];[lP.EDITOR_CONFIG,lP.VSCODE_SETTINGS,lP.VSCODE_EXTENSIONS,lP.ZED_SETTINGS,lP.IDEA_PROJECT_XML,lP.IDEA_CODE_STYLE_CONFIG_XML,lP.IDEA_GITIGNORE,...XI];const ZI=new Map;function QI(e){let t=e.split(/[\\/]+/).filter(e=>e.length>0).join(`/`);if(t.length===0)throw Error(`public target relative path cannot be empty`);return t}function $I(e){return s.join(e,`public`)}function eL(e){return s.join($I(e),YI)}function tL(e){return e?.command??`execute`}function nL(e,t){return s.resolve(t?.workspaceDir??s.dirname(e))}function rL(e,t,n){return{cwd:t,workspaceDir:t,aindexDir:s.resolve(e),command:n,platform:a.platform}}function iL(e,t,n){return JI(e,t,n)}function aL(e,n,r){let i=QI(n);if(i===`proxy.ts`)return YI;let a=eL(e);if(!(t.existsSync(a)&&t.statSync(a).isFile()))return i;let o=tL(r),s=nL(e,r),c=[a,s,o,i].join(`::`),l=ZI.get(c);if(l!=null)return l;let u=iL(a,rL(e,s,o),i);return ZI.set(c,u),u}function oL(e,t,n){let r=aL(e,t,n);return s.join($I(e),...r.split(/[\\/]+/))}function sL(e,t,n,r,i){let a=oL(n,t,i);if(!(r.existsSync(a)&&r.statSync(a).isFile()))return;let o=r.readFileSync(a,`utf8`);return{type:e,content:o,length:o.length,filePathKind:WM.Absolute,dir:{pathKind:WM.Absolute,path:a,getDirectoryName:()=>s.basename(a)}}}var cL=class extends Lg{constructor(){super(`EditorConfigInputCapability`)}collect(e){let{userConfigOptions:t,fs:n}=e,{workspaceDir:r,aindexDir:i}=this.resolveBasePaths(t),a=[],o=sL(GM.EditorConfig,`.editorconfig`,i,n,{command:e.runtimeCommand,workspaceDir:r});return o!=null&&a.push(o),{editorConfigFiles:a}}},lL=class extends Lg{constructor(){super(`GitExcludeInputCapability`)}collect(e){let{workspaceDir:t,aindexDir:n}=this.resolveBasePaths(e.userConfigOptions),r=oL(n,`.git/info/exclude`,{command:e.runtimeCommand,workspaceDir:t});if(!e.fs.existsSync(r))return this.log.debug({action:`collect`,message:`File not found`,path:r}),{};let i=e.fs.readFileSync(r,`utf8`);return i.length===0?(this.log.debug({action:`collect`,message:`File is empty`,path:r}),{}):(this.log.debug({action:`collect`,message:`Loaded file content`,path:r,length:i.length}),{shadowGitExclude:i})}},uL=class extends Lg{constructor(){super(`GitIgnoreInputCapability`)}collect(e){let{workspaceDir:t,aindexDir:n}=this.resolveBasePaths(e.userConfigOptions),r=oL(n,`.gitignore`,{command:e.runtimeCommand,workspaceDir:t});if(!e.fs.existsSync(r))return this.log.debug({action:`collect`,message:`File not found`,path:r}),{};let i=e.fs.readFileSync(r,`utf8`);return i.length===0?(this.log.debug({action:`collect`,message:`File is empty`,path:r}),{}):(this.log.debug({action:`collect`,message:`Loaded file content`,path:r,length:i.length}),{globalGitIgnore:i})}},dL=class extends Lg{constructor(){super(`GlobalMemoryInputCapability`)}async collect(e){let{userConfigOptions:t,fs:n,path:r,globalScope:i}=e,{aindexDir:o}=this.resolveBasePaths(t),s=GF(),c=ng(),l=this.resolveAindexPath(t.aindex.globalPrompt.dist,o);if(!n.existsSync(l))return this.log.warn(yp({code:`GLOBAL_MEMORY_PROMPT_MISSING`,title:`Global memory prompt is missing`,path:l,expectedKind:`compiled global memory prompt file`,actualState:`path does not exist`})),{};if(!n.statSync(l).isFile())return this.log.warn(yp({code:`GLOBAL_MEMORY_PROMPT_NOT_FILE`,title:`Global memory prompt path is not a file`,path:l,expectedKind:`compiled global memory prompt file`,actualState:`path exists but is not a regular file`})),{};let u,d;try{d=await wN(l,{mode:`dist`,globalScope:i}),u=d.content,wF(u,l)}catch(e){throw e instanceof sp&&(this.log.error(bp({code:`GLOBAL_MEMORY_PROMPT_COMPILE_FAILED`,title:`Failed to compile global memory prompt`,diagnosticText:DF(e,{operation:`Failed to compile global memory prompt.`,promptKind:`global-memory`,logicalName:`global-memory`,distPath:l}),details:{promptKind:`global-memory`,distPath:l}})),e instanceof cp&&this.log.error(_p({code:`GLOBAL_MEMORY_SCOPE_VARIABLES_MISSING`,title:`Global memory prompt references missing config variables`,reason:q(`The global memory prompt uses scope variables that are not defined in "${s}".`),configPath:s,exactFix:q(`Add the missing variables to "${s}" and rerun tnmsc.`),possibleFixes:[q("If you reference `{profile.name}`, define `profile.name` in the config file.")],details:{promptPath:l,errorMessage:e.message}})),a.exit(1)),e}return this.log.debug({action:`collect`,path:l,contentLength:u.length}),{globalMemory:{type:UM.GlobalMemory,content:u,length:u.length,filePathKind:WM.Relative,...d.parsed.rawFrontMatter!=null&&{rawFrontMatter:d.parsed.rawFrontMatter},markdownAst:d.parsed.markdownAst,markdownContents:d.parsed.markdownContents,dir:{pathKind:WM.Relative,path:r.basename(l),basePath:r.dirname(l),getDirectoryName:()=>r.basename(l),getAbsolutePath:()=>l},parentDirectoryPath:{type:qM.UserHome,directory:{pathKind:WM.Relative,path:``,basePath:c,getDirectoryName:()=>r.basename(c),getAbsolutePath:()=>c}}}}}},fL=class extends Lg{constructor(){super(`JetBrainsConfigInputCapability`)}collect(e){let{userConfigOptions:t,fs:n}=e,{workspaceDir:r,aindexDir:i}=this.resolveBasePaths(t),a=[`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`],o=[];for(let t of a){let a=sL(GM.IntellijIDEA,t,i,n,{command:e.runtimeCommand,workspaceDir:r});a!=null&&o.push(a)}return{jetbrainsConfigFiles:o}}};const pL=`agt.mdx`,mL=[`node_modules`,`.git`];var hL=class extends Lg{constructor(){super(`ProjectPromptInputCapability`,[`AindexInputCapability`])}async collect(e){let{dependencyContext:t,fs:n,userConfigOptions:r,path:i,globalScope:a}=e,{aindexDir:o}=this.resolveBasePaths(r),s=this.resolveAindexPath(r.aindex.workspacePrompt.dist,o),c=t.workspace;if(c==null)return this.log.info(`No workspace found in dependency context, skipping project prompt enhancement`),{};let l=c.projects??[],u=await Promise.all(l.map(async t=>{let s=t.name;if(s==null||t.isWorkspaceRootProject===!0)return t;let c=(t.promptSeries==null?QF(r):[$F(r,t.promptSeries)]).find(e=>{let t=i.join(o,e.dist,s);return n.existsSync(t)&&n.statSync(t).isDirectory()});if(c==null)return t;let l=i.join(o,c.dist,s),u=t.dirFromWorkspacePath?.getAbsolutePath(),d=await this.readRootMemoryPrompt(e,l,a),f=u==null?[]:await this.scanChildMemoryPrompts(e,l,u,a);return{...t,...t.promptSeries==null?{promptSeries:c.name}:{},...d!=null&&{rootMemoryPrompt:d},...f.length>0&&{childMemoryPrompts:f}}})),d=await this.readWorkspaceRootProjectPrompt(e,s,a,this.resolveWorkspaceRootProjectConfig(l));return{workspace:{directory:c.directory,projects:d==null?u:[...u,d]}}}async readWorkspaceRootProjectPrompt(e,t,n,r){let{fs:i,logger:o}=e;if(!(!i.existsSync(t)||!i.statSync(t).isFile()))try{let e;try{e=await wN(t,{mode:`dist`,globalScope:n}),wF(e.content,t)}catch(e){if(e instanceof sp){if(o.error(bp({code:`WORKSPACE_ROOT_MEMORY_PROMPT_COMPILE_FAILED`,title:`Failed to compile workspace root memory prompt`,diagnosticText:DF(e,{operation:`Failed to compile workspace root memory prompt.`,promptKind:`workspace-root-memory`,logicalName:t,distPath:t}),details:{promptKind:`workspace-root-memory`,distPath:t}})),e instanceof cp){let n=GF();o.error(_p({code:`WORKSPACE_ROOT_MEMORY_SCOPE_VARIABLES_MISSING`,title:`Workspace root memory prompt references missing config variables`,reason:q(`The workspace root memory prompt uses scope variables that are not defined in "${n}".`),configPath:n,exactFix:q(`Define the missing variables in "${n}" and rerun tnmsc.`),details:{promptPath:t,errorMessage:e.message}}))}a.exit(1)}throw e}let i={type:UM.ProjectRootMemory,content:e.content,length:e.content.length,filePathKind:WM.Relative,...e.parsed.yamlFrontMatter!=null&&{yamlFrontMatter:e.parsed.yamlFrontMatter},...e.parsed.rawFrontMatter!=null&&{rawFrontMatter:e.parsed.rawFrontMatter},markdownAst:e.parsed.markdownAst,markdownContents:e.parsed.markdownContents,dir:{pathKind:WM.Root,path:``,getDirectoryName:()=>``}};return{name:oF,isWorkspaceRootProject:!0,...r!=null&&{projectConfig:r},rootMemoryPrompt:i}}catch(e){o.error(hp({code:`WORKSPACE_ROOT_MEMORY_PROMPT_READ_FAILED`,title:`Failed to read workspace root memory prompt`,operation:`read`,targetKind:`workspace root memory prompt`,path:t,error:e}));return}}resolveWorkspaceRootProjectConfig(e){let t=e.filter(e=>e.isWorkspaceRootProject!==!0);return t.find(e=>e.isPromptSourceProject===!0)?.projectConfig??t[0]?.projectConfig}async readRootMemoryPrompt(e,t,n){let{fs:r,path:i,logger:o}=e,s=i.join(t,pL);if(!(!r.existsSync(s)||!r.statSync(s).isFile()))try{let e;try{e=await wN(s,{mode:`dist`,globalScope:n}),wF(e.content,s)}catch(e){if(e instanceof sp){if(o.error(bp({code:`PROJECT_ROOT_MEMORY_PROMPT_COMPILE_FAILED`,title:`Failed to compile project root memory prompt`,diagnosticText:DF(e,{operation:`Failed to compile project root memory prompt.`,promptKind:`project-root-memory`,logicalName:s,distPath:s}),details:{promptKind:`project-root-memory`,distPath:s}})),e instanceof cp){let t=GF();o.error(_p({code:`PROJECT_ROOT_MEMORY_SCOPE_VARIABLES_MISSING`,title:`Project root memory prompt references missing config variables`,reason:q(`The project root memory prompt uses scope variables that are not defined in "${t}".`),configPath:t,exactFix:q(`Define the missing variables in "${t}" and rerun tnmsc.`),details:{promptPath:s,errorMessage:e.message}}))}a.exit(1)}throw e}return{type:UM.ProjectRootMemory,content:e.content,length:e.content.length,filePathKind:WM.Relative,...e.parsed.yamlFrontMatter!=null&&{yamlFrontMatter:e.parsed.yamlFrontMatter},...e.parsed.rawFrontMatter!=null&&{rawFrontMatter:e.parsed.rawFrontMatter},markdownAst:e.parsed.markdownAst,markdownContents:e.parsed.markdownContents,dir:{pathKind:WM.Root,path:``,getDirectoryName:()=>``}}}catch(e){o.error(hp({code:`PROJECT_ROOT_MEMORY_PROMPT_READ_FAILED`,title:`Failed to read project root memory prompt`,operation:`read`,targetKind:`project root memory prompt`,path:s,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(hp({code:`PROJECT_CHILD_MEMORY_SCAN_FAILED`,title:`Failed to scan project child memory prompts`,operation:`scan`,targetKind:`project child memory prompt directory`,path: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()||mL.includes(l.name))continue;let c=s.join(n,l.name),u=s.join(c,pL);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{path:o,logger:s}=e,c=o.join(n,pL);try{let e;try{e=await wN(c,{mode:`dist`,globalScope:i}),wF(e.content,c)}catch(e){if(e instanceof sp){if(s.error(bp({code:`PROJECT_CHILD_MEMORY_PROMPT_COMPILE_FAILED`,title:`Failed to compile project child memory prompt`,diagnosticText:DF(e,{operation:`Failed to compile project child memory prompt.`,promptKind:`project-child-memory`,logicalName:c,distPath:c}),details:{promptKind:`project-child-memory`,distPath:c}})),e instanceof cp){let t=GF();s.error(_p({code:`PROJECT_CHILD_MEMORY_SCOPE_VARIABLES_MISSING`,title:`Project child memory prompt references missing config variables`,reason:q(`The project child memory prompt uses scope variables that are not defined in "${t}".`),configPath:t,exactFix:q(`Define the missing variables in "${t}" and rerun tnmsc.`),details:{promptPath:c,errorMessage:e.message}}))}a.exit(1)}throw e}let l=o.relative(t,n),u=o.join(r,l),d=o.basename(n);return{type:UM.ProjectChildrenMemory,content:e.content,length:e.content.length,filePathKind:WM.Relative,...e.parsed.yamlFrontMatter!=null&&{yamlFrontMatter:e.parsed.yamlFrontMatter},...e.parsed.rawFrontMatter!=null&&{rawFrontMatter:e.parsed.rawFrontMatter},markdownAst:e.parsed.markdownAst,markdownContents:e.parsed.markdownContents,dir:{pathKind:WM.Relative,path:l,basePath:r,getDirectoryName:()=>d,getAbsolutePath:()=>u},workingChildDirectoryPath:{pathKind:WM.Relative,path:l,basePath:r,getDirectoryName:()=>d,getAbsolutePath:()=>u}}}catch(e){s.error(hp({code:`PROJECT_CHILD_MEMORY_PROMPT_READ_FAILED`,title:`Failed to read project child memory prompt`,operation:`read`,targetKind:`project child memory prompt`,path:c,error:e}));return}}};const gL=Object.entries(UP);var _L=class extends Lg{constructor(){super(`ReadmeMdInputCapability`,[`AindexInputCapability`])}async collect(e){let{userConfigOptions:t,logger:n,fs:r,path:i,globalScope:a}=e,{workspaceDir:o,aindexDir:s}=this.resolveBasePaths(t),c=[],l=QF(t),u=eI(l.flatMap(e=>{let t=this.resolveAindexPath(e.src,s);return r.existsSync(t)&&r.statSync(t).isDirectory()?r.readdirSync(t,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(n=>({projectName:n.name,seriesName:e.name,seriesDir:i.join(t,n.name)})):[]}));if(u.length>0)throw n.error(_p({code:`README_PROJECT_SERIES_NAME_CONFLICT`,title:`Readme project names must be unique across app, ext, arch, and softwares`,reason:q(`Readme-family outputs target bare workspace project directories, so app/ext/arch/softwares cannot reuse the same project directory name.`,`Conflicting project names: ${u.map(e=>e.projectName).join(`, `)}`),exactFix:q(`Rename the conflicting project directory in one of the app/ext/arch/softwares source trees and rerun tnmsc.`),possibleFixes:u.map(e=>q(`"${e.projectName}" is currently declared in: ${e.refs.map(e=>`${e.seriesName} (${e.seriesDir})`).join(`, `)}`)),details:{aindexDir:s,conflicts:u.map(e=>({projectName:e.projectName,refs:e.refs.map(e=>({seriesName:e.seriesName,seriesDir:e.seriesDir}))}))}})),Error(`Readme project series name conflict`);return await Promise.all(l.map(async t=>{let l=this.resolveAindexPath(t.dist,s);if(!(r.existsSync(l)&&r.statSync(l).isDirectory())){n.debug(`aindex project series directory does not exist`,{path:l,series:t.name});return}try{let t=r.readdirSync(l,{withFileTypes:!0}).filter(e=>e.isDirectory()).sort((e,t)=>e.name.localeCompare(t.name));for(let n of t){let t=n.name,r=i.join(l,t);await this.collectReadmeFiles(e,r,t,o,``,c,a)}}catch(e){n.error(hp({code:`README_PROJECT_SCAN_FAILED`,title:`Failed to scan aindex ${t.name} projects for readme prompts`,operation:`scan`,targetKind:`aindex ${t.name} project directory`,path:l,error:e}))}})),c.sort((e,t)=>{let n=e.projectName.localeCompare(t.projectName);if(n!==0)return n;let r=e.targetDir.path.localeCompare(t.targetDir.path);return r===0?e.fileKind.localeCompare(t.fileKind):r}),{readmePrompts:c}}async collectReadmeFiles(e,t,n,r,i,o,s){let{fs:c,path:l,logger:u}=e,d=i===``;for(let[e,{src:f}]of gL){let p=l.join(t,f);if(!(!c.existsSync(p)||!c.statSync(p).isFile()))try{let t;try{let{content:e}=await wN(p,{mode:`dist`,globalScope:s});t=e,wF(t,p)}catch(t){if(t instanceof sp){if(u.error(bp({code:`README_PROMPT_COMPILE_FAILED`,title:`Failed to compile readme-family prompt`,diagnosticText:DF(t,{operation:`Failed to compile readme-family prompt.`,promptKind:`readme-family`,logicalName:`${n}/${f}`,distPath:p}),details:{promptKind:`readme-family`,distPath:p,projectName:n,fileKind:e}})),t instanceof cp){let e=GF();u.error(_p({code:`README_SCOPE_VARIABLES_MISSING`,title:`Readme-family prompt references missing config variables`,reason:q(`The readme-family prompt uses scope variables that are not defined in "${e}".`),configPath:e,exactFix:q(`Define the missing variables in "${e}" and rerun tnmsc.`),details:{promptPath:p,errorMessage:t.message}}))}a.exit(1)}throw t}let c=d?n:l.join(n,i),m={pathKind:WM.Relative,path:c,basePath:r,getDirectoryName:()=>d?n:l.basename(i),getAbsolutePath:()=>l.resolve(r,c)},h={pathKind:WM.Relative,path:l.dirname(p),basePath:r,getDirectoryName:()=>l.basename(l.dirname(p)),getAbsolutePath:()=>l.dirname(p)};o.push({type:UM.Readme,content:t,length:t.length,filePathKind:WM.Relative,projectName:n,targetDir:m,isRoot:d,fileKind:e,markdownContents:[],dir:h})}catch(t){u.warn(hp({code:`README_PROMPT_READ_FAILED`,title:`Failed to read readme-family file`,operation:`read`,targetKind:`readme-family prompt file`,path:p,error:t,details:{fileKind:e}}))}}try{let a=c.readdirSync(t,{withFileTypes:!0});for(let c of a)if(c.isDirectory()){let a=d?c.name:l.join(i,c.name),u=l.join(t,c.name);await this.collectReadmeFiles(e,u,n,r,a,o,s)}}catch(e){u.warn(hp({code:`README_DIRECTORY_SCAN_FAILED`,title:`Failed to scan readme-family directory`,operation:`scan`,targetKind:`readme-family directory`,path:t,error:e}))}}},vL=class extends Lg{constructor(){super(`RuleInputCapability`)}async collect(e){let{userConfigOptions:t,logger:n,path:r,fs:i,globalScope:a}=e,o=this.resolveBasePaths(t),s=this.resolveAindexPath(t.aindex.rules.src,o.aindexDir),c=this.resolveAindexPath(t.aindex.rules.dist,o.aindexDir),{prompts:l,errors:u}=await AF(i,r,n,a).readFlatFiles(s,c,{kind:UM.Rule,localeExtensions:mF,hydrateSourceContents:!1,isDirectoryStructure:!1,createPrompt:async(e,t,n,i)=>{let a=i,o=r.join(c,`${n}.mdx`);if(a!=null){let e=BP(a,o);if(!e.valid)throw Error(e.errors.join(`
402
+ `))}let s=a?.globs??[],l=a?.scope??`project`,u=a?.seriName,d=n.replaceAll(`\\`,`/`),f=d.includes(`/`)?d.split(`/`)[0]??``:``,p=d.split(`/`).pop()??d,m={type:UM.Rule,content:e,length:e.length,filePathKind:WM.Relative,dir:{pathKind:WM.Relative,path:`${n}.mdx`,basePath:c,getDirectoryName:()=>p,getAbsolutePath:()=>o},prefix:f,ruleName:p,globs:s,scope:l,markdownContents:[]};return a!=null&&Object.assign(m,{yamlFrontMatter:a}),u!=null&&Object.assign(m,{seriName:u}),m}});for(let e of u)n.warn(hp({code:`RULE_PROMPT_READ_FAILED`,title:`Failed to read rule prompt`,operation:e.phase===`scan`?`scan`:`read`,targetKind:`rule prompt`,path:e.path,error:e.error,details:{phase:e.phase}}));if(u.length>0)throw Error(u.map(e=>e.error instanceof Error?e.error.message:String(e.error)).join(`
403
+ `));return{rules:l.map(e=>e.dist?.prompt).filter(e=>e!=null)}}},yL=class extends Lg{constructor(){super(`AIAgentIgnoreInputCapability`)}collect(e){let{workspaceDir:t,aindexDir:n}=this.resolveBasePaths(e.userConfigOptions),r=[];for(let i of XI){let a=oL(n,i,{command:e.runtimeCommand,workspaceDir:t});if(!e.fs.existsSync(a)){this.log.debug({action:`collect`,message:`Ignore file not found`,path:a});continue}let o=e.fs.readFileSync(a,`utf8`);if(o.length===0){this.log.debug({action:`collect`,message:`Ignore file is empty`,path:a});continue}r.push({fileName:i,content:o,sourcePath:a}),this.log.debug({action:`collect`,message:`Loaded ignore file`,path:a,fileName:i})}return r.length===0?{}:{aiAgentIgnoreConfigFiles:r}}},bL=class extends Lg{constructor(){super(`SubAgentInputCapability`)}createSubAgentPrompt(e,t,n,r,i,a,o,s){let{fs:c,logger:l,path:u}=a,{agentPrefix:d,agentName:f,canonicalName:p}=kN(n),m=u.join(i,`${n}.mdx`),h=`${n}.mdx`,g=c.existsSync(u.join(r,`${n}.src.mdx`))?u.join(r,`${n}.src.mdx`):m,_=o==null?void 0:(()=>{let e={...o},t=e.name;return typeof t==`string`&&t.trim().length>0&&s?.has(g)!==!0&&(s?.add(g),l.warn(_p({code:`SUBAGENT_NAME_IGNORED`,title:`Sub-agent authored name is ignored`,reason:q(`tnmsc ignores the authored sub-agent name "${t}" in favor of the derived path name "${p}".`),configPath:g,exactFix:q("Remove the `name` field from the sub-agent front matter or exported metadata.",`Rename the sub-agent directory or file if you need a different sub-agent name.`),details:{authoredName:t,derivedName:p,logicalName:n}}))),delete e.name,e})(),v={type:UM.SubAgent,content:e,length:e.length,filePathKind:WM.Relative,dir:{pathKind:WM.Relative,path:h,basePath:i,getDirectoryName:()=>h.replace(/\.mdx$/,``),getAbsolutePath:()=>m},...d!=null&&{agentPrefix:d},agentName:f,canonicalName:p};if(_==null)return v;let y=zP(_,m);if(!y.valid)throw Error(y.errors.join(`
404
+ `));return Object.assign(v,{yamlFrontMatter:_}),_.seriName!=null&&Object.assign(v,{seriName:_.seriName}),v}async collect(e){let{userConfigOptions:t,logger:n,path:r,fs:i,globalScope:a}=e,o=this.resolveBasePaths(t),s=this.resolveAindexPath(t.aindex.subAgents.src,o.aindexDir),c=this.resolveAindexPath(t.aindex.subAgents.dist,o.aindexDir);n.debug(`SubAgentInputCapability collecting`,{srcDir:s,distDir:c,aindexDir:o.aindexDir});let l=AF(i,r,n,a),u=new Set,{prompts:d,errors:f}=await l.readFlatFiles(s,c,{kind:UM.SubAgent,localeExtensions:mF,hydrateSourceContents:!1,isDirectoryStructure:!1,createPrompt:(t,n,r,i)=>this.createSubAgentPrompt(t,n,r,s,c,e,i,u)});n.debug(`SubAgentInputCapability read complete`,{subAgentCount:d.length,errorCount:f.length});for(let e of f)n.warn(hp({code:`SUBAGENT_PROMPT_READ_FAILED`,title:`Failed to read sub-agent prompt`,operation:e.phase===`scan`?`scan`:`read`,targetKind:`sub-agent prompt`,path:e.path,error:e.error,details:{phase:e.phase}}));if(f.length>0)throw Error(f.map(e=>e.error instanceof Error?e.error.message:String(e.error)).join(`
405
+ `));let p=[];for(let e of d){let t=e.dist;if(t?.prompt==null)continue;let{prompt:n,rawMdx:r}=t;p.push(r==null?n:{...n,rawMdxContent:r})}return n.debug(`SubAgentInputCapability flattened subAgents`,{count:p.length,agents:p.map(e=>e.canonicalName)}),{subAgents:p}}},xL=class extends Lg{constructor(){super(`VSCodeConfigInputCapability`)}collect(e){let{userConfigOptions:t,fs:n}=e,{workspaceDir:r,aindexDir:i}=this.resolveBasePaths(t),a=[`.vscode/settings.json`,`.vscode/extensions.json`],o=[];for(let t of a){let a=sL(GM.VSCode,t,i,n,{command:e.runtimeCommand,workspaceDir:r});a!=null&&o.push(a)}return{vscodeConfigFiles:o}}},SL=class extends Lg{constructor(){super(`WorkspaceInputCapability`)}collect(e){let{userConfigOptions:t}=e,{workspaceDir:n,aindexDir:r}=this.resolveBasePaths(t);return{workspace:{directory:{pathKind:WM.Absolute,path:n,getDirectoryName:()=>s.basename(n)},projects:[]},aindexDir:r}}},CL=class extends Lg{constructor(){super(`ZedConfigInputCapability`)}collect(e){let{userConfigOptions:t,fs:n}=e,{workspaceDir:r,aindexDir:i}=this.resolveBasePaths(t),a=[],o=sL(GM.Zed,`.zed/settings.json`,i,n,{command:e.runtimeCommand,workspaceDir:r});return o!=null&&a.push(o),{zedConfigFiles:a}}};const wL={workspace:{strategy:`mergeProjects`,getter:e=>e.workspace},vscodeConfigFiles:{strategy:`concat`,getter:e=>e.vscodeConfigFiles},zedConfigFiles:{strategy:`concat`,getter:e=>e.zedConfigFiles},jetbrainsConfigFiles:{strategy:`concat`,getter:e=>e.jetbrainsConfigFiles},editorConfigFiles:{strategy:`concat`,getter:e=>e.editorConfigFiles},commands:{strategy:`concat`,getter:e=>e.commands},subAgents:{strategy:`concat`,getter:e=>e.subAgents},skills:{strategy:`concat`,getter:e=>e.skills},rules:{strategy:`concat`,getter:e=>e.rules},aiAgentIgnoreConfigFiles:{strategy:`concat`,getter:e=>e.aiAgentIgnoreConfigFiles},readmePrompts:{strategy:`concat`,getter:e=>e.readmePrompts},globalMemory:{strategy:`override`,getter:e=>e.globalMemory},aindexDir:{strategy:`override`,getter:e=>e.aindexDir},globalGitIgnore:{strategy:`override`,getter:e=>e.globalGitIgnore},shadowGitExclude:{strategy:`override`,getter:e=>e.shadowGitExclude}};function TL(e,t){return t==null?e??[]:e==null?t:[...e,...t]}function EL(e){return e.isWorkspaceRootProject===!0?`workspace-root:${e.name??``}`:`${e.promptSeries??`workspace`}:${e.name??``}`}function DL(e,t){let n=new Map;for(let t of e.projects)n.set(EL(t),t);for(let e of t.projects)n.set(EL(e),e);return{directory:t.directory??e.directory,projects:[...n.values()]}}function OL(e,t){return t==null?e:e==null?t:DL(e,t)}function kL(e,t,n){switch(n){case`concat`:return TL(e,t);case`override`:return t??e;case`mergeProjects`:return OL(e,t);default:return t??e}}function AL(e,t){let n={};for(let[r,i]of Object.entries(wL)){let a=kL(i.getter(e),i.getter(t),i.strategy);a!=null&&(n[r]=a)}return n}function jL(e,t,n){let r=e.dependsOn??[];if(r.length===0)return{};let i=new Set,a={};for(let e of r){if(i.has(e))continue;i.add(e);let r=t.get(e);r!=null&&(a=n(a,r))}return a}function ML(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.at(-1);if(e==null)return[...n];let t=a.indexOf(e);return a.slice(t)}i.clear(),a.length=0}return[...n]}function NL(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 eF(n.name,r)}let n=new Map;for(let t of e)n.set(t.name,t);let r=new Map;for(let t of e)r.set(t.name,0);let i=new Map;for(let t of e)i.set(t.name,[]);for(let t of e){let e=t.dependsOn??[];for(let n of e){r.set(t.name,(r.get(t.name)??0)+1);let e=i.get(n)??[];e.push(t.name),i.set(n,e)}}let a=[];for(let t of e)r.get(t.name)===0&&a.push(t.name);let o=[],s=new Map;for(let t=0;t<e.length;t++){let n=e[t];n!=null&&s.set(n.name,t)}for(;a.length>0;){let e=a.shift();if(e==null)continue;let t=n.get(e);if(t==null)continue;o.push(t);let c=(i.get(e)??[]).sort((e,t)=>(s.get(e)??-1)-(s.get(t)??-1));for(let e of c){let t=(r.get(e)??0)-1;r.set(e,t),t===0&&a.push(e)}}if(o.length===e.length)return o;throw new tF(ML(e,r))}function PL(){return[new fI,new dI,new nI]}function FL(){return[new SL,new PI,new xL,new CL,new fL,new cL,new NI,new FI,new bL,new vL,new dL,new hL,new _L,new uL,new lL,new yL]}async function IL(e){let{runtimeCommand:n,userConfigOptions:r,userConfig:i,capabilities:a,includeBuiltinEffects:o=!0}=e,c=om(`InputRuntime`,r.logLevel),l={logger:c,userConfigOptions:r,fs:t,path:s,glob:Th.default},u=NL([...o?PL():[],...a??FL()]),d=new lN({userConfig:i}).collect(),f=new dN;f.setGlobalScope(d),c.debug(`global scope collected`,{osInfo:{platform:d.os.platform,arch:d.os.arch,shellKind:d.os.shellKind},hasProfile:Object.keys(d.profile).length>0,hasTool:Object.keys(d.tool).length>0});let p=new Map,m={};for(let e of u){let t=jL(e,p,AL),r={...l,dependencyContext:t,...n==null?{}:{runtimeCommand:n},globalScope:d,scopeRegistry:f},i=e;i.executeEffects!=null&&await i.executeEffects(r,!1);let a=await e.collect(r);p.set(e.name,a),m=AL(m,a);let o=e;if(o.getRegisteredScopes!=null){let t=o.getRegisteredScopes();for(let{namespace:n,values:r}of t)f.register(n,r,uN.PluginRegistered),c.debug(`input capability scope registered`,{capability:e.name,namespace:n,keys:Object.keys(r)})}}return m}function LL(e){return`declarativeOutput`in e}function RL(e){return`collect`in e&&!LL(e)}const zL={version:`0.0.0`,workspaceDir:`~/project`,logLevel:`info`,aindex:oP(),commandSeriesOptions:{},outputScopes:{},frontMatter:{blankLineAfter:!0},cleanupProtection:{},windows:{},plugins:[]};function BL(e){return{...e.version==null?{}:{version:e.version},...e.workspaceDir==null?{}:{workspaceDir:e.workspaceDir},...e.aindex==null?{}:{aindex:e.aindex},...e.commandSeriesOptions==null?{}:{commandSeriesOptions:e.commandSeriesOptions},...e.outputScopes==null?{}:{outputScopes:e.outputScopes},...e.frontMatter==null?{}:{frontMatter:e.frontMatter},...e.cleanupProtection==null?{}:{cleanupProtection:e.cleanupProtection},...e.windows==null?{}:{windows:e.windows},...e.logLevel==null?{}:{logLevel:e.logLevel}}}function VL(...e){let t={...zL};return e.reduce((e,t)=>HL(e,t),t)}function HL(e,t){let n=t.plugins,r=t.commandSeriesOptions,i=t.outputScopes,a=t.frontMatter,o=t.cleanupProtection,s=t.windows;return{...e,...t,aindex:sP(e.aindex,t.aindex),plugins:[...e.plugins,...n??[]],commandSeriesOptions:UL(e.commandSeriesOptions,r),outputScopes:GL(e.outputScopes,i),frontMatter:KL(e.frontMatter,a),cleanupProtection:qL(e.cleanupProtection,o),windows:JL(e.windows,s)}}function UL(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 WL(e,t){if(!(e==null&&t==null))return e==null?t:t==null?e:{...e,...t}}function GL(e,t){if(t==null)return e??{};if(e==null)return t;let n={};if(e.plugins!=null)for(let[t,r]of Object.entries(e.plugins))r!=null&&(n[t]={...r});if(t.plugins!=null)for(let[e,r]of Object.entries(t.plugins)){let t=WL(n[e],r);t!=null&&(n[e]=t)}return Object.keys(n).length===0?{}:{plugins:n}}function KL(e,t){return t==null?e:{...e,...t}}function qL(e,t){return t==null?e??{}:e==null?t:{rules:[...e.rules??[],...t.rules??[]]}}function JL(e,t){if(t==null)return e??{};if(e==null)return t;let n=e.wsl2,r=t.wsl2;return{...e,...t,...n!=null||r!=null?{wsl2:{...n,...r}}:{}}}function YL(e){return`pluginOptions`in e||`configLoaderOptions`in e||`loadUserConfig`in e||`cwd`in e||`executionCwd`in e||`runtimeCommand`in e}function XL(e){return YL(e)?{hasExplicitProgrammaticPlugins:Object.hasOwn(e.pluginOptions??{},`plugins`),explicitProgrammaticPlugins:e.pluginOptions?.plugins}:{hasExplicitProgrammaticPlugins:Object.hasOwn(e,`plugins`),explicitProgrammaticPlugins:e.plugins}}function ZL(e,t){let n=e;return n.includes(rF.WORKSPACE)&&(n=n.replace(rF.WORKSPACE,t)),s.normalize(ag(n))}function QL(e){let t=ZL(e.workspaceDir,``),n=s.join(t,e.aindex.dir);return HP({workspace:{directory:{pathKind:WM.Absolute,path:t,getDirectoryName:()=>s.basename(t)},projects:[]},aindexDir:n})}function $L(e){return e===`plugins`}async function eR(e={}){let t,n,r,i,o,c;YL(e)?({pluginOptions:i={},cwd:n,executionCwd:r,configLoaderOptions:o,runtimeCommand:c}={pluginOptions:e.pluginOptions,cwd:e.cwd,executionCwd:e.executionCwd,configLoaderOptions:e.configLoaderOptions,runtimeCommand:e.runtimeCommand},t=e.loadUserConfig??!0):(i=e,t=!0,o=void 0,c=void 0);let l={},u=!1,d=[],f;if(t)try{let e=JF(o).load(n);u=e.found,d=e.sources,e.found&&(l=BL(e.config),f=e.config)}catch(e){let t=e instanceof Error?e.message:String(e);throw Error(`Failed to load user config: ${t}`)}let p=VL(l,i),{plugins:m=[],logLevel:h}=p,g=om(`defineConfig`,h),_=s.resolve(r??n??a.cwd());u?g.info(`user config loaded`,{sources:d}):g.info(`no user config found, using defaults/programmatic options`,{workspaceDir:p.workspaceDir,aindexDir:p.aindex.dir,logLevel:p.logLevel});let v=m.filter(LL),y=m.filter(RL);return XP(v,p),{mergedOptions:p,outputPlugins:v,inputCapabilities:y,executionCwd:_,...f!=null&&{userConfigFile:f},...c!=null&&{runtimeCommand:c},userConfigFound:u,userConfigSources:d}}async function tR(e={}){let{hasExplicitProgrammaticPlugins:t,explicitProgrammaticPlugins:n}=XL(e),{mergedOptions:r,outputPlugins:i,inputCapabilities:a,userConfigFile:o,runtimeCommand:s,executionCwd:c}=await eR(e),l=om(`defineConfig`,r.logLevel);if($L(s)){let e=QL(r);return{context:e,outputPlugins:i,userConfigOptions:r,executionPlan:GN(e,c)}}let u=await IL({userConfigOptions:r,...a.length>0?{capabilities:a}:{},includeBuiltinEffects:!(a.length>0||t&&(n?.length??0)===0),...s==null?{}:{runtimeCommand:s},...o==null?{}:{userConfig:o}});if(u.workspace==null)throw Error(`Workspace not initialized by any plugin`);let d=HP({workspace:u.workspace,...u.vscodeConfigFiles!=null&&{vscodeConfigFiles:u.vscodeConfigFiles},...u.zedConfigFiles!=null&&{zedConfigFiles:u.zedConfigFiles},...u.jetbrainsConfigFiles!=null&&{jetbrainsConfigFiles:u.jetbrainsConfigFiles},...u.editorConfigFiles!=null&&{editorConfigFiles:u.editorConfigFiles},...u.commands!=null&&{commands:u.commands},...u.subAgents!=null&&{subAgents:u.subAgents},...u.skills!=null&&{skills:u.skills},...u.rules!=null&&{rules:u.rules},...u.globalMemory!=null&&{globalMemory:u.globalMemory},...u.aiAgentIgnoreConfigFiles!=null&&{aiAgentIgnoreConfigFiles:u.aiAgentIgnoreConfigFiles},...u.aindexDir!=null&&{aindexDir:u.aindexDir},...u.readmePrompts!=null&&{readmePrompts:u.readmePrompts},...u.globalGitIgnore!=null&&{globalGitIgnore:u.globalGitIgnore},...u.shadowGitExclude!=null&&{shadowGitExclude:u.shadowGitExclude}});return u.aindexDir!=null&&wp(u.aindexDir,l),{context:d,outputPlugins:i,userConfigOptions:r,executionPlan:GN(d,c)}}const nR=[`IntelliJIdea`,`WebStorm`,`RustRover`,`PyCharm`,`PyCharmCE`,`PhpStorm`,`GoLand`,`CLion`,`DataGrip`,`RubyMine`,`Rider`,`DataSpell`,`Aqua`];function rR(e){return nR.some(t=>e.startsWith(t))}function iR(e){let n=s.join(lI(),`JetBrains`);try{return t.readdirSync(n,{withFileTypes:!0}).filter(e=>e.isDirectory()&&rR(e.name)).map(e=>s.join(n,e.name,`aia`,`codex`))}catch(t){return e.debug(hp({code:`JETBRAINS_CODEX_DIRECTORY_SCAN_SKIPPED`,title:`JetBrains Codex directories are unavailable`,operation:`scan`,targetKind:`JetBrains IDE directory`,path:n,error:t})),[]}}function aR(e){return{jetbrainsCodexDirs:iR(e)}}const oR=`.agents/skills`,sR=`.skills`,cR=`SKILL.md`;var lR=class extends nF{constructor(){super(`GenericSkillsOutputPlugin`,{outputFileName:cR,treatWorkspaceRootProjectAsProject:!0,skills:{},cleanup:{delete:{project:{dirs:[oR,sR]},global:{dirs:[oR,sR]}}},capabilities:{skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{skills:n}=e.collectedOutputContext;if(n==null||n.length===0)return t;let r=this.selectSingleScopeItems(n,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),i=this.selectSingleScopeItems(n,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`)),a=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=this.joinPath(e,r);if(t.push({path:this.joinPath(a,cR),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:this.joinPath(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:this.joinPath(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},o=(e,n,r)=>{for(let i of r)i.mcpConfig!=null&&t.push({path:this.joinPath(e,this.getSkillName(i),`mcp.json`),scope:n,source:{kind:`skillMcp`,rawContent:i.mcpConfig.rawContent}})};if(r.selectedScope===`project`||i.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectRootDir(e,t);if(n==null)continue;let s=$(r.items,t.projectConfig,`skills`),c=$(i.items,t.projectConfig,`skills`),l=this.joinPath(n,oR);r.selectedScope===`project`&&s.length>0&&a(l,`project`,s),i.selectedScope===`project`&&o(l,`project`,c)}if(r.selectedScope!==`global`&&i.selectedScope!==`global`)return t;let s=this.joinPath(this.getHomeDir(),oR),c=this.resolvePromptSourceProjectConfig(e);if(r.selectedScope===`global`){let e=$(r.items,c,`skills`);e.length>0&&a(s,`global`,e)}return i.selectedScope===`global`&&o(s,`global`,$(i.items,c,`skills`)),t}async convertContent(e,t){let n=e.source;switch(n.kind){case`skillMain`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillMcp`:return n.rawContent;case`skillChildDoc`:return n.content;case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;default:throw Error(`Unsupported declaration source for ${this.name}`)}}};const uR=`AGENTS.md`;var dR=class extends nF{constructor(){super(`AgentsOutputPlugin`,{outputFileName:uR,treatWorkspaceRootProjectAsProject:!0,capabilities:{prompt:{scopes:[`project`],singleScope:!1}}})}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:[...t.delete??[],...this.buildProjectPromptCleanupTargets(e,uR)]}}async declareOutputFiles(e){let t=[],n=this.getProjectPromptOutputProjects(e);if(!new Set(this.selectPromptScopes(e,[`project`])).has(`project`))return t;for(let[r,i]of n.entries()){let n=this.resolveProjectRootDir(e,i);if(i.rootMemoryPrompt!=null&&n!=null&&t.push({path:this.resolvePath(n,uR),scope:`project`,source:{type:`projectRootMemory`,projectIndex:r}}),i.childMemoryPrompts!=null)for(let[e,n]of i.childMemoryPrompts.entries())t.push({path:this.resolveFullPath(n.dir),scope:`project`,source:{type:`projectChildMemory`,projectIndex:r,childIndex:e}})}return t}async convertContent(e,t){let n=this.getProjectPromptOutputProjects(t),r=e.source,i=r.projectIndex??-1;if(i<0||i>=n.length)throw Error(`Invalid project index in declaration for ${this.name}`);let a=n[i];if(a==null)throw Error(`Project not found for declaration in ${this.name}`);if(r.type===`projectRootMemory`){if(a.rootMemoryPrompt==null)throw Error(`Root memory prompt missing for project index ${i}`);return a.rootMemoryPrompt.content}if(r.type===`projectChildMemory`){let e=r.childIndex??-1,t=a.childMemoryPrompts?.[e];if(t==null)throw Error(`Child memory prompt missing for project ${i}, child ${e}`);return t.content}throw Error(`Unsupported declaration source for ${this.name}`)}};const fR=`CLAUDE.md`;var pR=class extends nF{constructor(){super(`ClaudeCodeCLIOutputPlugin`,{globalConfigDir:`.claude`,outputFileName:fR,treatWorkspaceRootProjectAsProject:!0,toolPreset:`claudeCode`,commands:{subDir:`commands`,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},subagents:{subDir:`agents`,sourceScopes:[`project`],includePrefix:!0,linkSymbol:`-`,ext:`.md`},skills:{subDir:`skills`},rules:{transformFrontMatter:e=>({paths:e.globs.map(Qf)})},cleanup:{delete:{project:{files:[`.claude/settings.json`,`.claude/settings.local.json`],dirs:[`.claude/rules`,`.claude/commands`,`.claude/agents`,`.claude/skills`]},global:{files:[`.claude/CLAUDE.md`],dirs:[`.claude/rules`,`.claude/commands`,`.claude/agents`,`.claude/skills`]}}},wslMirrors:[`~/.claude/settings.json`,`~/.claude/config.json`],capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},subagents:{scopes:[`project`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:[...t.delete??[],...this.buildProjectPromptCleanupTargets(e,fR)]}}};const mR=gF.CURSOR,hR=sF.MCP_CONFIG,gR=lF.COMMANDS,_R=lF.RULES,vR=sF.CURSOR_GLOBAL_RULE,yR=lF.CURSOR_SKILLS,bR=`skills`,xR=sF.SKILL,SR=vF.CURSOR;var CR=class extends nF{constructor(){super(`CursorOutputPlugin`,{globalConfigDir:mR,outputFileName:``,treatWorkspaceRootProjectAsProject:!0,dependsOn:[aF.AgentsOutput],indexignore:_F.CURSOR,commands:{subDir:gR,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{subDir:yR},rules:{subDir:_R,prefix:`rule`,sourceScopes:[`project`,`global`]},cleanup:{delete:{project:{files:[`.cursor/mcp.json`],dirs:[`.cursor/commands`,`.cursor/rules`],globs:[`.cursor/skills/*`,`.cursor/skills-cursor/*`]},global:{files:[`.cursor/mcp.json`],dirs:[`.cursor/commands`,`.cursor/rules`],globs:[`.cursor/skills-cursor/*`]}},protect:{global:{dirs:Array.from(SR,e=>`.cursor/skills-cursor/${e}`)}},excludeScanGlobs:Array.from(SR,e=>`.cursor/skills-cursor/${e}/**`)},capabilities:{prompt:{scopes:[`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}})}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:(t.delete??[]).map(e=>e.kind!==`glob`||!e.path.replaceAll(`\\`,`/`).endsWith(`/.cursor/${yR}/*`)?e:{...e,excludeBasenames:[...SR]})}}async declareOutputFiles(e){let t=[],{globalMemory:n,commands:r,skills:i,rules:a,aiAgentIgnoreConfigFiles:o}=e.collectedOutputContext,c=this.getGlobalConfigDir(),l=this.resolvePromptSourceProjectConfig(e),u=this.getConcreteProjects(e),d=this.getProjectPromptOutputProjects(e),f=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0}),p=new Set(this.selectPromptScopes(e,[`global`])),m=new Set(a==null?[]:this.selectRuleScopes(e,a)),h=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),g=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`)),_=r==null?{items:[]}:this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),v=(e,n,r)=>{let i=n===`global`?yR:bR;for(let a of r){let r=this.getSkillName(a);if(this.isPreservedSkill(r))continue;let o=s.join(e,i,r);if(t.push({path:s.join(o,xR),scope:n,source:{kind:`skill`,skill:a}}),a.childDocs!=null)for(let e of a.childDocs)t.push({path:s.join(o,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(a.resources!=null)for(let e of a.resources)t.push({path:s.join(o,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},y=(e,n,r)=>{let i=n===`global`?yR:bR;for(let a of r){if(a.mcpConfig==null)continue;let r=s.join(e,i,this.getSkillName(a));t.push({path:s.join(r,hR),scope:n,source:{kind:`skillMcpConfig`,rawContent:a.mcpConfig.rawContent}})}},b=(e,n,r)=>{if(r.length===0)return;let i=jF(r,this.log);i.size!==0&&t.push({path:s.join(e,hR),scope:n,source:{kind:`mcpConfig`,mcpServers:MF(i,PF)}})};if(h.selectedScope===`project`||g.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectConfigDir(e,t);if(n!=null&&(h.selectedScope===`project`&&v(n,`project`,$(h.items,t.projectConfig,`skills`)),g.selectedScope===`project`)){let e=$(g.items,t.projectConfig,`skills`);y(n,`project`,e),b(n,`project`,e)}}if((h.selectedScope===`global`||g.selectedScope===`global`)&&(h.selectedScope===`global`&&v(c,`global`,$(h.items,l,`skills`)),g.selectedScope===`global`)){let e=$(g.items,l,`skills`);y(c,`global`,e),b(c,`global`,e)}if(_.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=$(_.items,n.projectConfig,`commands`);for(let e of i)t.push({path:s.join(r,gR,this.transformCommandName(e,f)),scope:`project`,source:{kind:`command`,command:e}})}if(_.selectedScope===`global`){let e=$(_.items,l,`commands`);for(let n of e)t.push({path:s.join(c,gR,this.transformCommandName(n,f)),scope:`global`,source:{kind:`command`,command:n}})}if(a!=null&&a.length>0){let n=a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`global`);if(m.has(`global`))for(let e of n)t.push({path:s.join(c,_R,this.buildRuleFileName(e)),scope:`global`,source:{kind:`ruleMdc`,rule:e}});if(m.has(`project`))for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=aN($(a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`project`),n.projectConfig,`rules`),n.projectConfig);for(let e of i)t.push({path:s.join(r,_R,this.buildRuleFileName(e)),scope:`project`,source:{kind:`ruleMdc`,rule:e}})}}if(n!=null&&p.has(`global`)){let r=this.buildGlobalRuleContent(n.content,e);for(let n of d){let i=this.resolveProjectConfigDir(e,n);i!=null&&t.push({path:s.join(i,_R,vR),scope:`project`,source:{kind:`globalRuleContent`,content:r}})}}let x=this.getIgnoreOutputPath(),S=this.indexignore==null?void 0:o?.find(e=>e.fileName===this.indexignore);if(x!=null&&S!=null)for(let e of u){let n=e.dirFromWorkspacePath;n==null||e.isPromptSourceProject===!0||t.push({path:s.join(n.basePath,n.path,x),scope:`project`,source:{kind:`ignoreFile`,content:S.content}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`command`:return this.buildCommandContent(n.command,t);case`mcpConfig`:return JSON.stringify({mcpServers:n.mcpServers},null,2);case`skill`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillMcpConfig`:return n.rawContent;case`skillChildDoc`:case`globalRuleContent`:case`ignoreFile`:return n.content;case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;case`ruleMdc`:return this.buildRuleMdcContent(n.rule,t);default:throw Error(`Unsupported declaration source for ${this.name}`)}}buildGlobalRuleContent(e,t){return this.buildMarkdownContent(e,{description:`Global prompt (synced)`,alwaysApply:!0},t)}isPreservedSkill(e){return SR.has(e)}buildRuleMdcContent(e,t){let n={alwaysApply:!1,globs:e.globs.length>0?e.globs.join(`, `):``};return this.buildMarkdownContent(e.content,n,t).split(`
406
406
  `).map(e=>{let t=/^(\s*globs:\s*)(['"])(.*)\2\s*$/.exec(e);if(t==null)return e;let n=t[1]??`globs: `,r=t[3]??``;return r.trim().length===0?e:`${n}${r}`}).join(`
407
- `)}};const _R=`AGENTS.md`;var vR=class extends xF{constructor(){super(`DroidCLIOutputPlugin`,{globalConfigDir:`.factory`,outputFileName:_R,treatWorkspaceRootProjectAsProject:!0,commands:{transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{},cleanup:{delete:{project:{files:[_R],dirs:[`.factory/commands`,`.factory/skills`]},global:{files:[`.factory/AGENTS.md`],dirs:[`.factory/commands`,`.factory/skills`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}buildSkillMainContent(e,t){let n=e.yamlFrontMatter==null?void 0:{name:this.getSkillName(e),description:e.yamlFrontMatter.description};return this.buildMarkdownContent(e.content,n,t)}};const yR=`.editorconfig`;var bR=class extends xF{constructor(){super(`EditorConfigOutputPlugin`,{cleanup:{delete:{project:{files:[yR]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{projects:n}=e.collectedOutputContext.workspace,{editorConfigFiles:r}=e.collectedOutputContext;if(r==null||r.length===0)return t;for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null)for(let e of r)t.push({path:this.resolvePath(n.basePath,n.path,yR),scope:`project`,source:{content:e.content}})}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}};const xR=`GEMINI.md`;var SR=class extends xF{constructor(){super(`GeminiCLIOutputPlugin`,{globalConfigDir:`.gemini`,outputFileName:xR,treatWorkspaceRootProjectAsProject:!0,cleanup:{delete:{global:{files:[`.gemini/GEMINI.md`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1}}})}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:[...t.delete??[],...this.buildProjectPromptCleanupTargets(e,xR)]}}},CR=class extends xF{constructor(){super(`GitExcludeOutputPlugin`,{capabilities:{}})}async declareOutputFiles(e){let t=[],{globalGitIgnore:n,shadowGitExclude:r}=e.collectedOutputContext,i=this.buildManagedContent(n,r);if(i.length===0)return t;let a=this.normalizeContent(i);for(let n of this.collectManagedExcludePaths(e))t.push({path:n,scope:`project`,source:{content:a}});return t}async declareCleanupPaths(e){let t=this.collectManagedExcludePaths(e).map(e=>({path:e,kind:`file`,scope:`project`,label:`delete.project`}));return t.length===0?{}:{delete:t}}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}buildManagedContent(e,t){let n=[];if(e!=null&&e.trim().length>0){let t=this.sanitizeContent(e);t.length>0&&n.push(t)}if(t!=null&&t.trim().length>0){let e=this.sanitizeContent(t);e.length>0&&n.push(e)}return n.length===0?``:n.join(`
407
+ `)}};const wR=`AGENTS.md`;var TR=class extends nF{constructor(){super(`DroidCLIOutputPlugin`,{globalConfigDir:`.factory`,outputFileName:wR,treatWorkspaceRootProjectAsProject:!0,commands:{transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{},cleanup:{delete:{project:{files:[wR],dirs:[`.factory/commands`,`.factory/skills`]},global:{files:[`.factory/AGENTS.md`],dirs:[`.factory/commands`,`.factory/skills`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}buildSkillMainContent(e,t){let n=e.yamlFrontMatter==null?void 0:{name:this.getSkillName(e),description:e.yamlFrontMatter.description};return this.buildMarkdownContent(e.content,n,t)}};const ER=`.editorconfig`;var DR=class extends nF{constructor(){super(`EditorConfigOutputPlugin`,{cleanup:{delete:{project:{files:[ER]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{projects:n}=e.collectedOutputContext.workspace,{editorConfigFiles:r}=e.collectedOutputContext;if(r==null||r.length===0)return t;for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null)for(let e of r)t.push({path:this.resolvePath(n.basePath,n.path,ER),scope:`project`,source:{content:e.content}})}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}};const OR=`GEMINI.md`;var kR=class extends nF{constructor(){super(`GeminiCLIOutputPlugin`,{globalConfigDir:`.gemini`,outputFileName:OR,treatWorkspaceRootProjectAsProject:!0,cleanup:{delete:{global:{files:[`.gemini/GEMINI.md`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1}}})}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:[...t.delete??[],...this.buildProjectPromptCleanupTargets(e,OR)]}}},AR=class extends nF{constructor(){super(`GitExcludeOutputPlugin`,{capabilities:{}})}async declareOutputFiles(e){let t=[],{globalGitIgnore:n,shadowGitExclude:r}=e.collectedOutputContext,i=this.buildManagedContent(n,r);if(i.length===0)return t;let a=this.normalizeContent(i);for(let n of this.collectManagedExcludePaths(e))t.push({path:n,scope:`project`,source:{content:a}});return t}async declareCleanupPaths(e){let t=this.collectManagedExcludePaths(e).map(e=>({path:e,kind:`file`,scope:`project`,label:`delete.project`}));return t.length===0?{}:{delete:t}}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}buildManagedContent(e,t){let n=[];if(e!=null&&e.trim().length>0){let t=this.sanitizeContent(e);t.length>0&&n.push(t)}if(t!=null&&t.trim().length>0){let e=this.sanitizeContent(t);e.length>0&&n.push(e)}return n.length===0?``:n.join(`
408
408
  `)}sanitizeContent(e){return e.split(/\r?\n/).filter(e=>{let t=e.trim();return t.length===0?!0:!(t.startsWith(`#`)&&!t.startsWith(`\\#`))}).join(`
409
- `).trim()}normalizeContent(e){let t=e.trim();return t.length===0?``:`${t}\n`}collectManagedExcludePaths(e){let{workspace:t}=e.collectedOutputContext,n=new Set([s.resolve(t.directory.path)]),r=new Set;for(let e of t.projects)e.dirFromWorkspacePath!=null&&n.add(e.dirFromWorkspacePath.getAbsolutePath());for(let e of n)for(let t of[e,...nP(e)]){let e=tP(t);e!=null&&r.add(s.join(e,`exclude`))}return[...r]}};const wR=`AGENTS.md`,TR=`prompts`,ER=`skills`,DR=`.aiassistant`;var OR=class extends xF{constructor(){super(`JetBrainsAIAssistantCodexOutputPlugin`,{outputFileName:wR,treatWorkspaceRootProjectAsProject:!0,commands:{subDir:TR,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{subDir:ER},dependsOn:[wF.AgentsOutput],indexignore:`.aiignore`,cleanup:{delete:{project:{dirs:[`.aiassistant/rules`,`.aiassistant/codex/prompts`,`.aiassistant/codex/skills`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{globalMemory:n,commands:r,skills:i,aiAgentIgnoreConfigFiles:a}=e.collectedOutputContext,o=this.getConcreteProjects(e),c=this.getProjectPromptOutputProjects(e),l=this.getJetBrainsCodexDirs(e),u=new Set(this.selectPromptScopes(e,[`project`,`global`])),d=this.resolvePromptSourceProjectConfig(e),f=r==null?{items:[]}:this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),p=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),m=this.getTransformOptionsFromContext(e);if(u.has(`project`))for(let n of c){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=s.join(r,DR,`rules`);if(n.rootMemoryPrompt!=null&&t.push({path:s.join(i,`always.md`),scope:`project`,source:{kind:`projectRuleContent`,content:this.buildAlwaysRuleContent(n.rootMemoryPrompt.content,e)}}),n.childMemoryPrompts!=null)for(let r of n.childMemoryPrompts)t.push({path:s.join(i,this.buildChildRuleFileName(r)),scope:`project`,source:{kind:`projectRuleContent`,content:this.buildGlobRuleContent(r,e)}})}let h=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=s.join(e,ER,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skill`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.dir.path.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillReference`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}};if(f.selectedScope===`project`||p.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=s.join(r,DR,`codex`);if(f.selectedScope===`project`){let e=$(f.items,n.projectConfig,`commands`);for(let n of e)t.push({path:s.join(i,TR,this.transformCommandName(n,m)),scope:`project`,source:{kind:`command`,command:n}})}p.selectedScope===`project`&&h(i,`project`,$(p.items,n.projectConfig,`skills`))}if(l.length>0){if(n!=null&&u.has(`global`))for(let e of l)t.push({path:s.join(e,wR),scope:`global`,source:{kind:`globalMemory`,content:n.content}});let e=f.selectedScope===`global`?$(f.items,d,`commands`):[],r=p.selectedScope===`global`?$(p.items,d,`skills`):[];for(let n of l){for(let r of e)t.push({path:s.join(n,TR,this.transformCommandName(r,m)),scope:`global`,source:{kind:`command`,command:r}});h(n,`global`,r)}}let g=this.getIgnoreOutputPath(),_=this.indexignore==null?void 0:a?.find(e=>e.fileName===this.indexignore);if(g!=null&&_!=null)for(let e of o){let n=e.dirFromWorkspacePath;n==null||e.isPromptSourceProject===!0||t.push({path:s.join(n.basePath,n.path,g),scope:`project`,source:{kind:`ignoreFile`,content:_.content}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`projectRuleContent`:case`globalMemory`:case`skillReference`:case`ignoreFile`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`skill`:return this.buildCodexSkillContent(n.skill,t);case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;default:throw Error(`Unsupported declaration source for ${this.name}`)}}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e),n=this.getJetBrainsCodexDirs(e);if(n.length===0)return t;let r=n.flatMap(e=>[{path:s.join(e,wR),kind:`file`,scope:`global`},{path:s.join(e,TR),kind:`directory`,scope:`global`},{path:s.join(e,ER),kind:`directory`,scope:`global`}]),i=t.delete??[];return{...t,delete:[...i,...r]}}getJetBrainsCodexDirs(e){return e.runtimeTargets.jetbrainsCodexDirs}buildChildRuleFileName(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`);return`glob-${t.length>0?t:`root`}.md`}buildChildRulePattern(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``);return t.length===0?`**/*`:`${t}/**`}buildAlwaysRuleContent(e,t){return this.buildMarkdownContent(e,{apply:`始终`},t)}buildGlobRuleContent(e,t){let n={apply:`按文件模式`,模式:this.buildChildRulePattern(e)};return this.buildMarkdownContent(e.content,n,t)}buildCodexSkillContent(e,t){let n=e.yamlFrontMatter,r=this.normalizeSkillName(this.getSkillName(e),64),i=this.normalizeToSingleLine(n.description,1024),a={};n.displayName!=null&&(a[`short-description`]=n.displayName),n.version!=null&&(a.version=n.version),n.author!=null&&(a.author=n.author),n.keywords!=null&&n.keywords.length>0&&(a.keywords=[...n.keywords]);let o={name:r,description:i};return Object.keys(a).length>0&&(o.metadata=a),n.allowTools!=null&&n.allowTools.length>0&&(o[`allowed-tools`]=n.allowTools.join(` `)),this.buildMarkdownContent(e.content,o,t)}normalizeSkillName(e,t){let n=e.toLowerCase().replaceAll(/[^a-z0-9-]/g,`-`).replaceAll(/-+/g,`-`).replaceAll(/^-+|-+$/g,``);return n.length>t&&(n=n.slice(0,t).replace(/-+$/,``)),n}normalizeToSingleLine(e,t){let n=e.replaceAll(/[\r\n]+/g,` `).replaceAll(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-3)}...`:n}};const kR=`.idea`;var AR=class extends xF{constructor(){super(`JetBrainsIDECodeStyleConfigOutputPlugin`,{cleanup:{delete:{project:{files:[`.editorconfig`,`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{projects:n}=e.collectedOutputContext.workspace,{jetbrainsConfigFiles:r,editorConfigFiles:i}=e.collectedOutputContext,a=[...r??[],...i??[]];for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null)for(let e of a){let r=this.getTargetRelativePath(e);t.push({path:this.resolvePath(n.basePath,n.path,r),scope:`project`,source:{content:e.content}})}}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}getTargetRelativePath(e){let t=e.dir.path;if(e.type===ig.EditorConfig)return`.editorconfig`;if(e.type!==ig.IntellijIDEA)return this.basename(t);let n=t.indexOf(kR);return n===-1?this.joinPath(kR,`codeStyles`,this.basename(t)):t.slice(Math.max(0,n))}},jR=class extends xF{constructor(){super(`KiroCLIOutputPlugin`,{treatWorkspaceRootProjectAsProject:!0,capabilities:{},cleanup:{delete:{project:{globs:[`.kiro/streening`,`.kiro/streening/**/*`,`.kiro/specs`,`.kiro/specs/**/*`,`.kiro/settings/mcp.json`,`**/.kiro/streening`,`**/.kiro/streening/**/*`,`**/.kiro/specs`,`**/.kiro/specs/**/*`,`**/.kiro/settings/mcp.json`]},global:{globs:[`.kiro/streening`,`.kiro/streening/**/*`]}}}})}};const MR=`skills`,NR=`.system`,PR=[`name`,`description`,`developer_instructions`],FR=[`scope`,`seriName`,`argumentHint`,`color`,`namingCase`,`model`];function IR(e){let t={...e};return delete t.allowTools,delete t.allowedTools,t}function LR(e,t){let n=IR(t);return n.name=e,n}const RR={globalConfigDir:`.codex`,outputFileName:`AGENTS.md`,commands:{subDir:`prompts`,scopeRemap:{project:`global`},transformFrontMatter:(e,t)=>IR(t.sourceFrontMatter)},subagents:{subDir:`agents`,sourceScopes:[`project`],scopeRemap:{global:`project`},ext:`.toml`,artifactFormat:`toml`,bodyFieldName:`developer_instructions`,excludedFrontMatterFields:FR,transformFrontMatter:(e,t)=>LR(EP(e),t.sourceFrontMatter),fieldOrder:PR},cleanup:{delete:{project:{dirs:[`.codex/agents`,`.codex/skills`,`.agents/skills`,`.skills`]},global:{files:[`.codex/AGENTS.md`],dirs:[`.codex/prompts`,`.agents/skills`,`.skills`],globs:[`.codex/skills/*`]}},protect:{global:{dirs:[`.codex/${MR}/${NR}`]}}},wslMirrors:[`~/.codex/config.toml`,`~/.codex/auth.json`],dependsOn:[wF.AgentsOutput],capabilities:{prompt:{scopes:[`global`],singleScope:!1},commands:{scopes:[`global`],singleScope:!0},subagents:{scopes:[`project`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}};var zR=class extends xF{constructor(){super(`CodexCLIOutputPlugin`,RR)}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:(t.delete??[]).map(e=>e.kind!==`glob`||!e.path.replaceAll(`\\`,`/`).endsWith(`/.codex/${MR}/*`)?e:{...e,excludeBasenames:[NR]})}}async declareOutputFiles(e){let t=await super.declareOutputFiles(e),{skills:n}=e.collectedOutputContext;if(n==null||n.length===0)return t;let r=this.selectSingleScopeItems(n,[`project`,`global`],e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),i=this.selectSingleScopeItems(n,[`project`,`global`],e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`)),a=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=s.join(e,MR,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},o=(e,n,r)=>{for(let i of r){if(i.mcpConfig==null)continue;let r=s.join(e,MR,this.getSkillName(i));t.push({path:s.join(r,`mcp.json`),scope:n,source:{kind:`skillMcpConfig`,rawContent:i.mcpConfig.rawContent}})}};if(r.selectedScope===`project`||i.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectConfigDir(e,t);n!=null&&(r.selectedScope===`project`&&a(n,`project`,$(r.items,t.projectConfig,`skills`)),i.selectedScope===`project`&&o(n,`project`,$(i.items,t.projectConfig,`skills`)))}if(r.selectedScope!==`global`&&i.selectedScope!==`global`)return t;let c=this.getGlobalConfigDir(),l=this.resolvePromptSourceProjectConfig(e);return r.selectedScope===`global`&&a(c,`global`,$(r.items,l,`skills`)),i.selectedScope===`global`&&o(c,`global`,$(i.items,l,`skills`)),t}async convertContent(e,t){let n=e.source;switch(n.kind){case`skillMain`:{let{skill:e}=n,r=this.buildSkillFrontMatter(e);return this.buildMarkdownContent(e.content,r,t)}case`skillMcpConfig`:return n.rawContent;case`skillChildDoc`:return n.content;case`skillResource`:{let e=n;return e.encoding===`base64`?m.from(e.content,`base64`):e.content}default:return super.convertContent(e,t)}}};const BR=`AGENTS.md`,VR=`.opencode`,HR=`commands`,UR=`agents`,WR=`skills`,GR=`rules`;function KR(e,t){let n={},r=t.sourceFrontMatter;if(r?.description!=null&&(n.description=r.description),r?.agent!=null&&(n.agent=r.agent),r?.model!=null&&(n.model=r.model),r?.allowTools!=null&&Array.isArray(r.allowTools)){let e={};for(let t of r.allowTools)e[String(t)]=!0;n.tools=e}for(let[e,t]of Object.entries(r??{}))[`description`,`agent`,`model`,`allowTools`,`namingCase`,`argumentHint`].includes(e)||(n[e]=t);return n}var qR=class extends xF{constructor(){super(`OpencodeCLIOutputPlugin`,{globalConfigDir:`.config/opencode`,outputFileName:BR,treatWorkspaceRootProjectAsProject:!0,commands:{subDir:HR,transformFrontMatter:KR},subagents:{subDir:UR},skills:{subDir:WR},rules:{subDir:GR,prefix:`rule`,sourceScopes:[`project`,`global`]},cleanup:{delete:{project:{files:[BR,`.opencode/opencode.json`],dirs:[`.opencode/commands`,`.opencode/agents`,`.opencode/skills`,`.opencode/rules`]},global:{files:[`.config/opencode/AGENTS.md`],dirs:[`.config/opencode/commands`,`.config/opencode/agents`,`.config/opencode/skills`,`.config/opencode/rules`]},xdgConfig:{files:[`opencode/AGENTS.md`],dirs:[`opencode/commands`,`opencode/agents`,`opencode/skills`,`opencode/rules`]}}},dependsOn:[wF.AgentsOutput],capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},subagents:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{globalMemory:n,commands:r,subAgents:i,skills:a,rules:o}=e.collectedOutputContext,c=this.getGlobalConfigDir(),l=new Set(this.selectPromptScopes(e,[`project`,`global`])),u=this.getProjectPromptOutputProjects(e),d=this.resolvePromptSourceProjectConfig(e),f=r==null?{items:[]}:this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),p=i==null?{items:[]}:this.selectSingleScopeItems(i,this.subAgentsConfig.sourceScopes,e=>this.resolveSubAgentSourceScope(e),this.getTopicScopeOverride(e,`subagents`)),m=a==null?{items:[]}:this.selectSingleScopeItems(a,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),h=a==null?{items:[]}:this.selectSingleScopeItems(a,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`));n!=null&&l.has(`global`)&&t.push({path:s.join(c,BR),scope:`global`,source:{kind:`globalMemory`,content:n.content}});let g=(e,n,r)=>{for(let i of r){let r=this.validateAndNormalizeSkillName(this.getSkillName(i)),a=s.join(e,WR,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i,normalizedSkillName:r}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.dir.path.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillReference`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},_=(e,n,r)=>{t.push({path:s.join(e,`opencode.json`),scope:n,source:{kind:`mcpConfig`,mcpServers:{}}})},v=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0});for(let n of u){let r=this.resolveProjectRootDir(e,n);if(r!=null&&(n.rootMemoryPrompt!=null&&l.has(`project`)&&t.push({path:s.join(r,BR),scope:`project`,source:{kind:`projectRootMemory`,content:n.rootMemoryPrompt.content}}),n.childMemoryPrompts!=null&&l.has(`project`)))for(let e of n.childMemoryPrompts)t.push({path:this.resolveFullPath(e.dir),scope:`project`,source:{kind:`projectChildMemory`,content:e.content}})}if(f.selectedScope===`project`||p.selectedScope===`project`||m.selectedScope===`project`||h.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=s.join(r,VR),a=$(f.items,n.projectConfig,`commands`);if(f.selectedScope===`project`)for(let e of a)t.push({path:s.join(i,HR,this.transformCommandName(e,v)),scope:`project`,source:{kind:`command`,command:e}});let o=$(p.items,n.projectConfig,`subAgents`);if(p.selectedScope===`project`)for(let e of o)t.push({path:s.join(i,UR,this.transformSubAgentName(e)),scope:`project`,source:{kind:`subAgent`,agent:e}});let c=$(m.items,n.projectConfig,`skills`);m.selectedScope===`project`&&g(i,`project`,c),h.selectedScope===`project`&&_(i,`project`,$(h.items,n.projectConfig,`skills`))}if(f.selectedScope===`global`){let e=$(f.items,d,`commands`);for(let n of e)t.push({path:s.join(c,HR,this.transformCommandName(n,v)),scope:`global`,source:{kind:`command`,command:n}})}if(p.selectedScope===`global`){let e=$(p.items,d,`subAgents`);for(let n of e)t.push({path:s.join(c,UR,this.transformSubAgentName(n)),scope:`global`,source:{kind:`subAgent`,agent:n}})}if(m.selectedScope===`global`&&g(c,`global`,$(m.items,d,`skills`)),h.selectedScope===`global`&&_(c,`global`,$(h.items,d,`skills`)),o==null||o.length===0)return t;let y=this.selectRuleScopes(e,o);for(let n of y)if(n===`global`){let e=o.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`global`);for(let n of e)t.push({path:s.join(c,GR,this.buildRuleFileName(n)),scope:`global`,source:{kind:`rule`,rule:n}})}else if(n===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=s.join(r,VR),a=eP($(o.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`project`),n.projectConfig,`rules`),n.projectConfig);for(let e of a)t.push({path:s.join(i,GR,this.buildRuleFileName(e)),scope:`project`,source:{kind:`rule`,rule:e}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`globalMemory`:case`projectRootMemory`:case`projectChildMemory`:case`skillReference`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`subAgent`:{let e=this.buildOpencodeAgentFrontMatter(n.agent);return this.buildMarkdownContent(n.agent.content,e,t)}case`skillMain`:{let e=this.buildOpencodeSkillFrontMatter(n.skill,n.normalizedSkillName);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;case`mcpConfig`:return JSON.stringify({$schema:`https://opencode.ai/config.json`,plugin:[`opencode-rules@latest`],mcp:{}},null,2);case`rule`:return this.buildRuleContent(n.rule,t);default:throw Error(`Unsupported declaration source for ${this.name}`)}}buildOpencodeAgentFrontMatter(e){let t={},n=e.yamlFrontMatter;if(n?.description!=null&&(t.description=n.description),t.mode=n?.mode??`subagent`,n?.model!=null&&(t.model=n.model),n?.temperature!=null&&(t.temperature=n.temperature),n?.maxSteps!=null&&(t.maxSteps=n.maxSteps),n?.hidden!=null&&(t.hidden=n.hidden),n?.allowTools!=null&&Array.isArray(n.allowTools)){let e={};for(let t of n.allowTools)e[String(t)]=!0;t.tools=e}n?.permission!=null&&typeof n.permission==`object`&&(t.permission=n.permission);for(let[e,r]of Object.entries(n??{}))[`description`,`mode`,`model`,`temperature`,`maxSteps`,`hidden`,`allowTools`,`permission`,`namingCase`,`name`,`color`].includes(e)||(t[e]=r);return t}buildOpencodeSkillFrontMatter(e,t){let n={},r=e.yamlFrontMatter;n.name=t,r?.description!=null&&(n.description=r.description),n.license=r?.license??`MIT`,n.compatibility=r?.compatibility??`opencode`;let i={};for(let e of[`author`,`version`,`keywords`,`category`,`repository`,`displayName`])r?.[e]!=null&&(i[e]=r[e]);let a=new Set([`name`,`description`,`license`,`compatibility`,`namingCase`,`allowTools`,`keywords`,`displayName`,`author`,`version`]);for(let[e,t]of Object.entries(r??{}))a.has(e)||(i[e]=t);return Object.keys(i).length>0&&(n.metadata=i),n}validateAndNormalizeSkillName(e){let t=e.toLowerCase();return t=t.replaceAll(/[^a-z0-9-]+/g,`-`),t=t.replaceAll(/-+/g,`-`),t=t.replaceAll(/^-|-$/g,``),t.length===0?t=`skill`:t.length>64&&(t=t.slice(0,64),t=t.replace(/-$/,``)),t}};const JR=`rules`,YR=`commands`,XR=`skills`,ZR=`glob`,QR=`glob`;function $R(e,t){let n=t.sourceFrontMatter,r={description:`Fast command`,type:`user_command`};return n?.description!=null&&(r.description=n.description),n?.argumentHint!=null&&(r.argumentHint=n.argumentHint),n?.allowTools!=null&&Array.isArray(n.allowTools)&&n.allowTools.length>0&&(r.allowTools=n.allowTools),r}var ez=class extends xF{constructor(){super(`QoderIDEPluginOutputPlugin`,{globalConfigDir:`.qoder`,treatWorkspaceRootProjectAsProject:!0,indexignore:`.qoderignore`,commands:{subDir:YR,transformFrontMatter:$R},skills:{subDir:XR},rules:{subDir:JR,sourceScopes:[`project`,`global`]},cleanup:{delete:{project:{dirs:[`.qoder/commands`,`.qoder/rules`,`.qoder/skills`]},global:{dirs:[`.qoder/commands`,`.qoder/rules`,`.qoder/skills`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{globalMemory:n,commands:r,skills:i,rules:a,aiAgentIgnoreConfigFiles:o}=e.collectedOutputContext,c=this.getGlobalConfigDir(),l=this.resolvePromptSourceProjectConfig(e),u=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0}),d=new Set(a==null?[]:this.selectRuleScopes(e,a)),f=new Set(this.selectPromptScopes(e,[`project`,`global`])),p=this.getProjectPromptOutputProjects(e),m=r==null?{items:[]}:this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),h=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),g=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`)),_=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=s.join(e,XR,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},v=(e,n,r)=>{for(let i of r){if(i.mcpConfig==null)continue;let r=s.join(e,XR,this.getSkillName(i));t.push({path:s.join(r,`mcp.json`),scope:n,source:{kind:`skillMcpConfig`,rawContent:i.mcpConfig.rawContent}})}};if(m.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=$(m.items,n.projectConfig,`commands`);for(let e of i)t.push({path:s.join(r,YR,this.transformCommandName(e,u)),scope:`project`,source:{kind:`command`,command:e}})}if(m.selectedScope===`global`){let e=$(m.items,l,`commands`);for(let n of e)t.push({path:s.join(c,YR,this.transformCommandName(n,u)),scope:`global`,source:{kind:`command`,command:n}})}if(h.selectedScope===`project`||g.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectConfigDir(e,t);n!=null&&(h.selectedScope===`project`&&_(n,`project`,$(h.items,t.projectConfig,`skills`)),g.selectedScope===`project`&&v(n,`project`,$(g.items,t.projectConfig,`skills`)))}if((h.selectedScope===`global`||g.selectedScope===`global`)&&(h.selectedScope===`global`&&_(c,`global`,$(h.items,l,`skills`)),g.selectedScope===`global`&&v(c,`global`,$(g.items,l,`skills`))),n!=null&&f.has(`global`))for(let r of p){let i=this.resolveProjectConfigDir(e,r);i!=null&&t.push({path:s.join(i,JR,`global.md`),scope:`project`,source:{kind:`ruleContent`,content:this.buildAlwaysRuleContent(n.content,e)}})}if(f.has(`project`))for(let n of p){let r=this.resolveProjectConfigDir(e,n);if(r!=null&&(n.rootMemoryPrompt!=null&&t.push({path:s.join(r,JR,`always.md`),scope:`project`,source:{kind:`ruleContent`,content:this.buildAlwaysRuleContent(n.rootMemoryPrompt.content,e)}}),n.childMemoryPrompts!=null))for(let i of n.childMemoryPrompts)t.push({path:s.join(r,JR,this.buildChildRuleFileName(i)),scope:`project`,source:{kind:`ruleContent`,content:this.buildGlobRuleContent(i,e)}})}if(a!=null&&a.length>0&&d.has(`project`))for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=eP($(a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`project`),n.projectConfig,`rules`),n.projectConfig);for(let e of i)t.push({path:s.join(r,JR,this.buildRuleFileName(e)),scope:`project`,source:{kind:`rulePrompt`,rule:e}})}if(a!=null&&a.length>0&&d.has(`global`)){let e=a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`global`);for(let n of e)t.push({path:s.join(c,JR,this.buildRuleFileName(n)),scope:`global`,source:{kind:`rulePrompt`,rule:n}})}let y=this.getIgnoreOutputPath(),b=this.indexignore==null?void 0:o?.find(e=>e.fileName===this.indexignore);if(y!=null&&b!=null)for(let n of this.getConcreteProjects(e)){let e=n.dirFromWorkspacePath;e==null||n.isPromptSourceProject===!0||t.push({path:s.join(e.basePath,e.path,y),scope:`project`,source:{kind:`ignoreFile`,content:b.content}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`command`:return this.buildCommandContent(n.command,t);case`ruleContent`:return n.content;case`rulePrompt`:return this.buildRuleContent(n.rule,t);case`skillMain`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillMcpConfig`:return n.rawContent;case`skillChildDoc`:case`ignoreFile`:return n.content;case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;default:throw Error(`Unsupported declaration source for ${this.name}`)}}buildChildRuleFileName(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`);return`glob-${t.length>0?t:`root`}.md`}buildAlwaysRuleContent(e,t){return this.buildMarkdownContent(e,{trigger:`always_on`,type:`user_command`},t)}buildGlobRuleContent(e,t){let n=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``),r=n.length===0?`**/*`:`${n}/**`;return this.buildMarkdownContent(e.content,{trigger:ZR,[QR]:r,type:`user_command`},t)}buildSkillFrontMatter(e){let t=e.yamlFrontMatter;return{name:this.getSkillName(e),description:t.description,type:`user_command`,...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}}}buildRuleFileName(e,t=`rule-`){return`${t}${e.prefix}-${e.ruleName}.md`}buildRuleContent(e,t){let n={trigger:ZR,[QR]:e.globs.length>0?e.globs.join(`, `):`**/*`,type:`user_command`};return this.buildMarkdownContent(e.content,n,t)}normalizeRuleScope(e){return e.scope??`global`}};function tz(e){return cF[e??`Readme`].out}var nz=class extends xF{constructor(){super(`ReadmeMdConfigFileOutputPlugin`,{outputFileName:`README.md`,cleanup:{delete:{project:{files:[`README.md`,`CODE_OF_CONDUCT.md`,`SECURITY.md`]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{readmePrompts:n}=e.collectedOutputContext;if(n==null||n.length===0)return t;for(let e of n){let n=tz(e.fileKind),r=s.join(e.targetDir.basePath,e.targetDir.path,n);t.push({path:r,scope:`project`,source:{content:e.content}})}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}};const rz=`GLOBAL.md`;var iz=class extends xF{constructor(){super(`TraeCNIDEOutputPlugin`,{globalConfigDir:`.trae-cn`,outputFileName:rz,dependsOn:[`TraeIDEOutputPlugin`],cleanup:{delete:{global:{dirs:[`.trae-cn/user_rules`]}}},capabilities:{prompt:{scopes:[`global`],singleScope:!1}}})}getGlobalUserRulesDir(){return this.joinPath(this.getGlobalConfigDir(),`user_rules`)}async declareOutputFiles(e){if(!new Set(this.selectPromptScopes(e,[`global`])).has(`global`))return[];let{globalMemory:t}=e.collectedOutputContext;return t==null?[]:[{path:this.joinPath(this.getGlobalUserRulesDir(),rz),scope:`global`,source:{content:t.content}}]}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}};const az=`GLOBAL.md`,oz=`.trae`,sz=`commands`,cz=`skills`;var lz=class extends xF{constructor(){super(`TraeIDEOutputPlugin`,{globalConfigDir:oz,outputFileName:az,treatWorkspaceRootProjectAsProject:!0,indexignore:`.traeignore`,commands:{subDir:sz,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{subDir:cz},cleanup:{delete:{project:{dirs:[`.trae/rules`,`.trae/commands`,`.trae/skills`]},global:{dirs:[`.trae/steering`,`.trae/commands`,`.trae/skills`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}getIgnoreOutputPath(){if(this.indexignore!=null)return s.join(`.trae`,`.ignore`)}getGlobalSteeringDir(){return this.joinPath(this.getGlobalConfigDir(),`steering`)}async declareOutputFiles(e){let t=[],{commands:n,skills:r,globalMemory:i,aiAgentIgnoreConfigFiles:a}=e.collectedOutputContext,o=this.getConcreteProjects(e),c=this.getProjectPromptOutputProjects(e),l=this.resolvePromptSourceProjectConfig(e),u=new Set(this.selectPromptScopes(e,[`project`,`global`])),d=n==null?{items:[]}:this.selectSingleScopeItems(n,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),f=r==null?{items:[]}:this.selectSingleScopeItems(r,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),p=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0});i!=null&&u.has(`global`)&&t.push({path:this.joinPath(this.getGlobalSteeringDir(),az),scope:`global`,source:{kind:`globalMemory`,content:i.content}});for(let n of c){let r=this.resolveProjectRootDir(e,n);if(r!=null&&n.childMemoryPrompts!=null&&u.has(`project`))for(let i of n.childMemoryPrompts){let n=(i.workingChildDirectoryPath?.path??i.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``),a=this.buildProjectRelativeGlobPattern(n),o=this.buildMarkdownContent([this.buildPathGuardHint(n),``,i.content].join(`
410
- `),{alwaysApply:!1,globs:a},e);t.push({path:s.join(r,oz,`rules`,this.buildSteeringFileName(i)),scope:`project`,source:{kind:`steeringRule`,content:o}})}}if(d.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=$(d.items,n.projectConfig,`commands`);for(let e of i)t.push({path:s.join(r,sz,this.transformCommandName(e,p)),scope:`project`,source:{kind:`command`,command:e}})}if(d.selectedScope===`global`){let e=this.getGlobalConfigDir(),n=$(d.items,l,`commands`);for(let r of n)t.push({path:s.join(e,sz,this.transformCommandName(r,p)),scope:`global`,source:{kind:`command`,command:r}})}let m=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=s.join(e,cz,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}};if(f.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectConfigDir(e,t);n!=null&&m(n,`project`,$(f.items,t.projectConfig,`skills`))}f.selectedScope===`global`&&m(this.getGlobalConfigDir(),`global`,$(f.items,l,`skills`));let h=this.getIgnoreOutputPath(),g=this.indexignore==null?void 0:a?.find(e=>e.fileName===this.indexignore);if(h!=null&&g!=null)for(let e of o){let n=e.dirFromWorkspacePath;n==null||e.isPromptSourceProject===!0||t.push({path:s.join(n.basePath,n.path,h),scope:`project`,source:{kind:`ignoreFile`,content:g.content}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`globalMemory`:case`steeringRule`:case`skillChildDoc`:case`ignoreFile`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`skillMain`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;default:throw Error(`Unsupported declaration source for ${this.name}`)}}buildSkillFrontMatter(e){let t={description:e.yamlFrontMatter.description??``};return e.yamlFrontMatter.displayName!=null&&(t.name=e.yamlFrontMatter.displayName),t}buildSteeringFileName(e){return`trae-${(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`)}.md`}buildPathGuardHint(e){return e.length===0?`Scope guard: apply this rule to project source files only; do not apply to generated output directories (for example dist/, build/, out/, .next/, target/).`:[`Scope guard: this rule is for the project-root path "${e}/" only.`,`Do not apply this rule to generated output paths such as "dist/${e}/", "build/${e}/", "out/${e}/", ".next/${e}/", or "target/${e}/".`].join(`
411
- `)}buildProjectRelativeGlobPattern(e){return e.length===0?`**/*`:`${e}/**`}};const uz=`.vscode`;var dz=class extends xF{constructor(){super(`VisualStudioCodeIDEConfigOutputPlugin`,{cleanup:{delete:{project:{files:[`.vscode/settings.json`,`.vscode/extensions.json`]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{projects:n}=e.collectedOutputContext.workspace,{vscodeConfigFiles:r}=e.collectedOutputContext,i=r??[];for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null)for(let e of i){let r=this.getTargetRelativePath(e);t.push({path:this.resolvePath(n.basePath,n.path,r),scope:`project`,source:{content:e.content}})}}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}getTargetRelativePath(e){let t=e.dir.path;if(e.type!==ig.VSCode)return this.basename(t);let n=t.indexOf(uz);return n===-1?this.joinPath(uz,this.basename(t)):t.slice(Math.max(0,n))}};const fz=`WARP.md`;var pz=class extends xF{constructor(){super(`WarpIDEOutputPlugin`,{outputFileName:fz,treatWorkspaceRootProjectAsProject:!0,indexignore:`.warpindexignore`,cleanup:{delete:{project:{files:[fz]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1}}})}async declareOutputFiles(e){let t=[],{globalMemory:n,aiAgentIgnoreConfigFiles:r}=e.collectedOutputContext,i=this.getConcreteProjects(e),a=this.getProjectPromptOutputProjects(e),o=this.shouldSkipDueToPlugin(e,wF.AgentsOutput),c=new Set(this.selectPromptScopes(e,[`project`,`global`])),l=this.extractGlobalMemoryContent(e);if(o){if(n!=null&&c.has(`global`))for(let r of a){let i=this.resolveProjectRootDir(e,r);i!=null&&t.push({path:s.join(i,fz),scope:`project`,source:{content:n.content}})}}else for(let n of a){let r=this.resolveProjectRootDir(e,n);if(r!=null){if(n.rootMemoryPrompt!=null&&c.has(`project`)){let e=this.combineGlobalWithContent(l,n.rootMemoryPrompt.content);t.push({path:s.join(r,fz),scope:`project`,source:{content:e}})}if(n.childMemoryPrompts!=null&&c.has(`project`))for(let e of n.childMemoryPrompts)t.push({path:this.resolveFullPath(e.dir),scope:`project`,source:{content:e.content}})}}let u=this.getIgnoreOutputPath(),d=this.indexignore==null?void 0:r?.find(e=>e.fileName===this.indexignore);if(u!=null&&d!=null)for(let e of i){let n=e.dirFromWorkspacePath;n==null||e.isPromptSourceProject===!0||t.push({path:this.resolvePath(n.basePath,n.path,u),scope:`project`,source:{content:d.content}})}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}};const mz=`.codeium/windsurf`,hz=`global_workflows`,gz=`memories`,_z=`skills`,vz=`.windsurf`,yz=[IF.WINDSURF,IF.WINDSURF_LEGACY],bz=IF.WINDSURF_LEGACY;var xz=class extends xF{constructor(){super(`WindsurfOutputPlugin`,{globalConfigDir:mz,outputFileName:``,treatWorkspaceRootProjectAsProject:!0,dependsOn:[wF.AgentsOutput],indexignore:IF.WINDSURF,commands:{subDir:hz,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{subDir:_z},rules:{sourceScopes:[`project`,`global`]},cleanup:{delete:{project:{files:[IF.WINDSURF,bz],dirs:[`.windsurf/rules`,`.windsurf/workflows`,`.windsurf/global_workflows`,`.windsurf/skills`,`.codeium/windsurf/global_workflows`,`.codeium/windsurf/skills`]},global:{dirs:[`.codeium/windsurf/global_workflows`,`.codeium/windsurf/memories`,`.codeium/windsurf/skills`]}}},capabilities:{prompt:{scopes:[`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{commands:n,skills:r,globalMemory:i,rules:a,aiAgentIgnoreConfigFiles:o}=e.collectedOutputContext,c=this.resolvePromptSourceProjectConfig(e),l=this.getCodeiumWindsurfDir(),u=new Set(this.selectPromptScopes(e,[`global`])),d=n==null?{items:[]}:this.selectSingleScopeItems(n,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),f=r==null?{items:[]}:this.selectSingleScopeItems(r,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),p=this.getConcreteProjects(e);i!=null&&u.has(`global`)&&t.push({path:s.join(l,gz,`global_rules.md`),scope:`global`,source:{kind:`globalMemory`,content:i.content}});let m=(e,n,r)=>{let i=this.getSkillName(r),a=s.join(e,_z,i);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:r}}),r.childDocs!=null)for(let e of r.childDocs)t.push({path:s.join(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(r.resources!=null)for(let e of r.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})};if(f.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectRootDir(e,t),r=n==null?void 0:s.join(n,vz);if(r==null)continue;let i=$(f.items,t.projectConfig,`skills`);for(let e of i)m(r,`project`,e)}if(f.selectedScope===`global`){let e=$(f.items,c,`skills`);for(let t of e)m(l,`global`,t)}let h=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0});if(d.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n),i=r==null?void 0:s.join(r,vz);if(i==null)continue;let a=$(d.items,n.projectConfig,`commands`);for(let e of a)t.push({path:s.join(i,`workflows`,this.transformCommandName(e,h)),scope:`project`,source:{kind:`command`,command:e}})}if(d.selectedScope===`global`){let e=$(d.items,c,`commands`);for(let n of e)t.push({path:s.join(l,hz,this.transformCommandName(n,h)),scope:`global`,source:{kind:`command`,command:n}})}if(a!=null&&a.length>0){let n=new Set(this.selectRuleScopes(e,a)),r=a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`global`);if(n.has(`global`))for(let e of r)t.push({path:s.join(l,gz,this.buildRuleFileName(e)),scope:`global`,source:{kind:`rule`,rule:e}});if(n.has(`project`))for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=eP($(a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`project`),n.projectConfig,`rules`),n.projectConfig);for(let e of i)t.push({path:s.join(r,vz,`rules`,this.buildRuleFileName(e)),scope:`project`,source:{kind:`rule`,rule:e}})}}let g=new Map((o??[]).map(e=>[e.fileName,e.content]));if(g.size<=0)return t;let _=g.get(IF.WINDSURF)??g.get(bz),v=g.get(bz)??g.get(IF.WINDSURF);for(let e of p){let n=e.dirFromWorkspacePath;if(!(n==null||e.isPromptSourceProject===!0))for(let e of yz){let r=e===IF.WINDSURF?_:v;r!=null&&t.push({path:s.join(n.basePath,n.path,e),scope:`project`,source:{kind:`ignoreFile`,content:r}})}}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`globalMemory`:case`skillChildDoc`:case`ignoreFile`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`skillMain`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;case`rule`:return this.buildRuleContent(n.rule,t);default:throw Error(`Unsupported declaration source for ${this.name}`)}}getCodeiumWindsurfDir(){return s.join(this.getHomeDir(),mz)}buildRuleFileName(e,t=`rule-`){return`${t}${e.prefix}-${e.ruleName}.md`}buildRuleContent(e,t){let n={trigger:`glob`,globs:e.globs.length>0?e.globs.join(`, `):``};return this.buildMarkdownContent(e.content,n,t).split(`
409
+ `).trim()}normalizeContent(e){let t=e.trim();return t.length===0?``:`${t}\n`}collectManagedExcludePaths(e){let{workspace:t}=e.collectedOutputContext,n=new Set([s.resolve(t.directory.path)]),r=new Set;for(let e of t.projects)e.dirFromWorkspacePath!=null&&n.add(e.dirFromWorkspacePath.getAbsolutePath());for(let e of n)for(let t of[e,...sN(e)]){let e=oN(t);e!=null&&r.add(s.join(e,`exclude`))}return[...r]}};const jR=`AGENTS.md`,MR=`prompts`,NR=`skills`,PR=`.aiassistant`;var FR=class extends nF{constructor(){super(`JetBrainsAIAssistantCodexOutputPlugin`,{outputFileName:jR,treatWorkspaceRootProjectAsProject:!0,commands:{subDir:MR,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{subDir:NR},dependsOn:[aF.AgentsOutput],indexignore:`.aiignore`,cleanup:{delete:{project:{dirs:[`.aiassistant/rules`,`.aiassistant/codex/prompts`,`.aiassistant/codex/skills`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{globalMemory:n,commands:r,skills:i,aiAgentIgnoreConfigFiles:a}=e.collectedOutputContext,o=this.getConcreteProjects(e),c=this.getProjectPromptOutputProjects(e),l=this.getJetBrainsCodexDirs(e),u=new Set(this.selectPromptScopes(e,[`project`,`global`])),d=this.resolvePromptSourceProjectConfig(e),f=r==null?{items:[]}:this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),p=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),m=this.getTransformOptionsFromContext(e);if(u.has(`project`))for(let n of c){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=s.join(r,PR,`rules`);if(n.rootMemoryPrompt!=null&&t.push({path:s.join(i,`always.md`),scope:`project`,source:{kind:`projectRuleContent`,content:this.buildAlwaysRuleContent(n.rootMemoryPrompt.content,e)}}),n.childMemoryPrompts!=null)for(let r of n.childMemoryPrompts)t.push({path:s.join(i,this.buildChildRuleFileName(r)),scope:`project`,source:{kind:`projectRuleContent`,content:this.buildGlobRuleContent(r,e)}})}let h=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=s.join(e,NR,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skill`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.dir.path.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillReference`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}};if(f.selectedScope===`project`||p.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=s.join(r,PR,`codex`);if(f.selectedScope===`project`){let e=$(f.items,n.projectConfig,`commands`);for(let n of e)t.push({path:s.join(i,MR,this.transformCommandName(n,m)),scope:`project`,source:{kind:`command`,command:n}})}p.selectedScope===`project`&&h(i,`project`,$(p.items,n.projectConfig,`skills`))}if(l.length>0){if(n!=null&&u.has(`global`))for(let e of l)t.push({path:s.join(e,jR),scope:`global`,source:{kind:`globalMemory`,content:n.content}});let e=f.selectedScope===`global`?$(f.items,d,`commands`):[],r=p.selectedScope===`global`?$(p.items,d,`skills`):[];for(let n of l){for(let r of e)t.push({path:s.join(n,MR,this.transformCommandName(r,m)),scope:`global`,source:{kind:`command`,command:r}});h(n,`global`,r)}}let g=this.getIgnoreOutputPath(),_=this.indexignore==null?void 0:a?.find(e=>e.fileName===this.indexignore);if(g!=null&&_!=null)for(let e of o){let n=e.dirFromWorkspacePath;n==null||e.isPromptSourceProject===!0||t.push({path:s.join(n.basePath,n.path,g),scope:`project`,source:{kind:`ignoreFile`,content:_.content}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`projectRuleContent`:case`globalMemory`:case`skillReference`:case`ignoreFile`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`skill`:return this.buildCodexSkillContent(n.skill,t);case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;default:throw Error(`Unsupported declaration source for ${this.name}`)}}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e),n=this.getJetBrainsCodexDirs(e);if(n.length===0)return t;let r=n.flatMap(e=>[{path:s.join(e,jR),kind:`file`,scope:`global`},{path:s.join(e,MR),kind:`directory`,scope:`global`},{path:s.join(e,NR),kind:`directory`,scope:`global`}]),i=t.delete??[];return{...t,delete:[...i,...r]}}getJetBrainsCodexDirs(e){return e.runtimeTargets.jetbrainsCodexDirs}buildChildRuleFileName(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`);return`glob-${t.length>0?t:`root`}.md`}buildChildRulePattern(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``);return t.length===0?`**/*`:`${t}/**`}buildAlwaysRuleContent(e,t){return this.buildMarkdownContent(e,{apply:`始终`},t)}buildGlobRuleContent(e,t){let n={apply:`按文件模式`,模式:this.buildChildRulePattern(e)};return this.buildMarkdownContent(e.content,n,t)}buildCodexSkillContent(e,t){let n=e.yamlFrontMatter,r=this.normalizeSkillName(this.getSkillName(e),64),i=this.normalizeToSingleLine(n.description,1024),a={};n.displayName!=null&&(a[`short-description`]=n.displayName),n.version!=null&&(a.version=n.version),n.author!=null&&(a.author=n.author),n.keywords!=null&&n.keywords.length>0&&(a.keywords=[...n.keywords]);let o={name:r,description:i};return Object.keys(a).length>0&&(o.metadata=a),n.allowTools!=null&&n.allowTools.length>0&&(o[`allowed-tools`]=n.allowTools.join(` `)),this.buildMarkdownContent(e.content,o,t)}normalizeSkillName(e,t){let n=e.toLowerCase().replaceAll(/[^a-z0-9-]/g,`-`).replaceAll(/-+/g,`-`).replaceAll(/^-+|-+$/g,``);return n.length>t&&(n=n.slice(0,t).replace(/-+$/,``)),n}normalizeToSingleLine(e,t){let n=e.replaceAll(/[\r\n]+/g,` `).replaceAll(/\s+/g,` `).trim();return n.length>t?`${n.slice(0,t-3)}...`:n}};const IR=`.idea`;var LR=class extends nF{constructor(){super(`JetBrainsIDECodeStyleConfigOutputPlugin`,{cleanup:{delete:{project:{files:[`.editorconfig`,`.idea/codeStyles/Project.xml`,`.idea/codeStyles/codeStyleConfig.xml`,`.idea/.gitignore`]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{projects:n}=e.collectedOutputContext.workspace,{jetbrainsConfigFiles:r,editorConfigFiles:i}=e.collectedOutputContext,a=[...r??[],...i??[]];for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null)for(let e of a){let r=this.getTargetRelativePath(e);t.push({path:this.resolvePath(n.basePath,n.path,r),scope:`project`,source:{content:e.content}})}}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}getTargetRelativePath(e){let t=e.dir.path;if(e.type===GM.EditorConfig)return`.editorconfig`;if(e.type!==GM.IntellijIDEA)return this.basename(t);let n=t.indexOf(IR);return n===-1?this.joinPath(IR,`codeStyles`,this.basename(t)):t.slice(Math.max(0,n))}},RR=class extends nF{constructor(){super(`KiroCLIOutputPlugin`,{treatWorkspaceRootProjectAsProject:!0,capabilities:{},cleanup:{delete:{project:{globs:[`.kiro/streening`,`.kiro/streening/**/*`,`.kiro/specs`,`.kiro/specs/**/*`,`.kiro/settings/mcp.json`,`**/.kiro/streening`,`**/.kiro/streening/**/*`,`**/.kiro/specs`,`**/.kiro/specs/**/*`,`**/.kiro/settings/mcp.json`]},global:{globs:[`.kiro/streening`,`.kiro/streening/**/*`]}}}})}};const zR=`skills`,BR=`.system`,VR=[`name`,`description`,`developer_instructions`],HR=[`scope`,`seriName`,`argumentHint`,`color`,`namingCase`,`model`];function UR(e){let t={...e};return delete t.allowTools,delete t.allowedTools,t}function WR(e,t){let n=UR(t);return n.name=e,n}const GR={globalConfigDir:`.codex`,outputFileName:`AGENTS.md`,commands:{subDir:`prompts`,scopeRemap:{project:`global`},transformFrontMatter:(e,t)=>UR(t.sourceFrontMatter)},subagents:{subDir:`agents`,sourceScopes:[`project`],scopeRemap:{global:`project`},ext:`.toml`,artifactFormat:`toml`,bodyFieldName:`developer_instructions`,excludedFrontMatterFields:HR,transformFrontMatter:(e,t)=>WR(jN(e),t.sourceFrontMatter),fieldOrder:VR},cleanup:{delete:{project:{dirs:[`.codex/agents`,`.codex/skills`,`.agents/skills`,`.skills`]},global:{files:[`.codex/AGENTS.md`],dirs:[`.codex/prompts`,`.agents/skills`,`.skills`],globs:[`.codex/skills/*`]}},protect:{global:{dirs:[`.codex/${zR}/${BR}`]}}},wslMirrors:[`~/.codex/config.toml`,`~/.codex/auth.json`],dependsOn:[aF.AgentsOutput],capabilities:{prompt:{scopes:[`global`],singleScope:!1},commands:{scopes:[`global`],singleScope:!0},subagents:{scopes:[`project`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}};var KR=class extends nF{constructor(){super(`CodexCLIOutputPlugin`,GR)}async declareCleanupPaths(e){let t=await super.declareCleanupPaths(e);return{...t,delete:(t.delete??[]).map(e=>e.kind!==`glob`||!e.path.replaceAll(`\\`,`/`).endsWith(`/.codex/${zR}/*`)?e:{...e,excludeBasenames:[BR]})}}async declareOutputFiles(e){let t=await super.declareOutputFiles(e),{skills:n}=e.collectedOutputContext;if(n==null||n.length===0)return t;let r=this.selectSingleScopeItems(n,[`project`,`global`],e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),i=this.selectSingleScopeItems(n,[`project`,`global`],e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`)),a=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=s.join(e,zR,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},o=(e,n,r)=>{for(let i of r){if(i.mcpConfig==null)continue;let r=s.join(e,zR,this.getSkillName(i));t.push({path:s.join(r,`mcp.json`),scope:n,source:{kind:`skillMcpConfig`,rawContent:i.mcpConfig.rawContent}})}};if(r.selectedScope===`project`||i.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectConfigDir(e,t);n!=null&&(r.selectedScope===`project`&&a(n,`project`,$(r.items,t.projectConfig,`skills`)),i.selectedScope===`project`&&o(n,`project`,$(i.items,t.projectConfig,`skills`)))}if(r.selectedScope!==`global`&&i.selectedScope!==`global`)return t;let c=this.getGlobalConfigDir(),l=this.resolvePromptSourceProjectConfig(e);return r.selectedScope===`global`&&a(c,`global`,$(r.items,l,`skills`)),i.selectedScope===`global`&&o(c,`global`,$(i.items,l,`skills`)),t}async convertContent(e,t){let n=e.source;switch(n.kind){case`skillMain`:{let{skill:e}=n,r=this.buildSkillFrontMatter(e);return this.buildMarkdownContent(e.content,r,t)}case`skillMcpConfig`:return n.rawContent;case`skillChildDoc`:return n.content;case`skillResource`:{let e=n;return e.encoding===`base64`?m.from(e.content,`base64`):e.content}default:return super.convertContent(e,t)}}};const qR=`AGENTS.md`,JR=`.opencode`,YR=`commands`,XR=`agents`,ZR=`skills`,QR=`rules`;function $R(e,t){let n={},r=t.sourceFrontMatter;if(r?.description!=null&&(n.description=r.description),r?.agent!=null&&(n.agent=r.agent),r?.model!=null&&(n.model=r.model),r?.allowTools!=null&&Array.isArray(r.allowTools)){let e={};for(let t of r.allowTools)e[String(t)]=!0;n.tools=e}for(let[e,t]of Object.entries(r??{}))[`description`,`agent`,`model`,`allowTools`,`namingCase`,`argumentHint`].includes(e)||(n[e]=t);return n}var ez=class extends nF{constructor(){super(`OpencodeCLIOutputPlugin`,{globalConfigDir:`.config/opencode`,outputFileName:qR,treatWorkspaceRootProjectAsProject:!0,commands:{subDir:YR,transformFrontMatter:$R},subagents:{subDir:XR},skills:{subDir:ZR},rules:{subDir:QR,prefix:`rule`,sourceScopes:[`project`,`global`]},cleanup:{delete:{project:{files:[qR,`.opencode/opencode.json`],dirs:[`.opencode/commands`,`.opencode/agents`,`.opencode/skills`,`.opencode/rules`]},global:{files:[`.config/opencode/AGENTS.md`,`.config/opencode/opencode.json`],dirs:[`.config/opencode/commands`,`.config/opencode/agents`,`.config/opencode/skills`,`.config/opencode/rules`]},xdgConfig:{files:[`opencode/AGENTS.md`,`opencode/opencode.json`],dirs:[`opencode/commands`,`opencode/agents`,`opencode/skills`,`opencode/rules`]}}},dependsOn:[aF.AgentsOutput],capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},subagents:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{globalMemory:n,commands:r,subAgents:i,skills:a,rules:o}=e.collectedOutputContext,c=this.getGlobalConfigDir(),l=new Set(this.selectPromptScopes(e,[`project`,`global`])),u=this.getProjectPromptOutputProjects(e),d=this.resolvePromptSourceProjectConfig(e),f=r==null?{items:[]}:this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),p=i==null?{items:[]}:this.selectSingleScopeItems(i,this.subAgentsConfig.sourceScopes,e=>this.resolveSubAgentSourceScope(e),this.getTopicScopeOverride(e,`subagents`)),m=a==null?{items:[]}:this.selectSingleScopeItems(a,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),h=a==null?{items:[]}:this.selectSingleScopeItems(a,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`));n!=null&&l.has(`global`)&&t.push({path:s.join(c,qR),scope:`global`,source:{kind:`globalMemory`,content:n.content}});let g=(e,n,r)=>{for(let i of r){let r=this.validateAndNormalizeSkillName(this.getSkillName(i)),a=s.join(e,ZR,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i,normalizedSkillName:r}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.dir.path.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillReference`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},_=(e,n,r)=>{t.push({path:s.join(e,`opencode.json`),scope:n,source:{kind:`mcpConfig`,mcpServers:{}}})},v=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0});for(let n of u){let r=this.resolveProjectRootDir(e,n);if(r!=null&&(n.rootMemoryPrompt!=null&&l.has(`project`)&&t.push({path:s.join(r,qR),scope:`project`,source:{kind:`projectRootMemory`,content:n.rootMemoryPrompt.content}}),n.childMemoryPrompts!=null&&l.has(`project`)))for(let e of n.childMemoryPrompts)t.push({path:this.resolveFullPath(e.dir),scope:`project`,source:{kind:`projectChildMemory`,content:e.content}})}if(f.selectedScope===`project`||p.selectedScope===`project`||m.selectedScope===`project`||h.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=s.join(r,JR),a=$(f.items,n.projectConfig,`commands`);if(f.selectedScope===`project`)for(let e of a)t.push({path:s.join(i,YR,this.transformCommandName(e,v)),scope:`project`,source:{kind:`command`,command:e}});let o=$(p.items,n.projectConfig,`subAgents`);if(p.selectedScope===`project`)for(let e of o)t.push({path:s.join(i,XR,this.transformSubAgentName(e)),scope:`project`,source:{kind:`subAgent`,agent:e}});let c=$(m.items,n.projectConfig,`skills`);m.selectedScope===`project`&&g(i,`project`,c),h.selectedScope===`project`&&_(i,`project`,$(h.items,n.projectConfig,`skills`))}if(f.selectedScope===`global`){let e=$(f.items,d,`commands`);for(let n of e)t.push({path:s.join(c,YR,this.transformCommandName(n,v)),scope:`global`,source:{kind:`command`,command:n}})}if(p.selectedScope===`global`){let e=$(p.items,d,`subAgents`);for(let n of e)t.push({path:s.join(c,XR,this.transformSubAgentName(n)),scope:`global`,source:{kind:`subAgent`,agent:n}})}if(m.selectedScope===`global`&&g(c,`global`,$(m.items,d,`skills`)),h.selectedScope===`global`&&_(c,`global`,$(h.items,d,`skills`)),o==null||o.length===0)return t;let y=this.selectRuleScopes(e,o);for(let n of y)if(n===`global`){let e=o.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`global`);for(let n of e)t.push({path:s.join(c,QR,this.buildRuleFileName(n)),scope:`global`,source:{kind:`rule`,rule:n}})}else if(n===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=s.join(r,JR),a=aN($(o.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`project`),n.projectConfig,`rules`),n.projectConfig);for(let e of a)t.push({path:s.join(i,QR,this.buildRuleFileName(e)),scope:`project`,source:{kind:`rule`,rule:e}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`globalMemory`:case`projectRootMemory`:case`projectChildMemory`:case`skillReference`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`subAgent`:{let e=this.buildOpencodeAgentFrontMatter(n.agent);return this.buildMarkdownContent(n.agent.content,e,t)}case`skillMain`:{let e=this.buildOpencodeSkillFrontMatter(n.skill,n.normalizedSkillName);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;case`mcpConfig`:return JSON.stringify({$schema:`https://opencode.ai/config.json`,plugin:[`opencode-rules@latest`],mcp:{}},null,2);case`rule`:return this.buildRuleContent(n.rule,t);default:throw Error(`Unsupported declaration source for ${this.name}`)}}buildOpencodeAgentFrontMatter(e){let t={},n=e.yamlFrontMatter;if(n?.description!=null&&(t.description=n.description),t.mode=n?.mode??`subagent`,n?.model!=null&&(t.model=n.model),n?.temperature!=null&&(t.temperature=n.temperature),n?.maxSteps!=null&&(t.maxSteps=n.maxSteps),n?.hidden!=null&&(t.hidden=n.hidden),n?.allowTools!=null&&Array.isArray(n.allowTools)){let e={};for(let t of n.allowTools)e[String(t)]=!0;t.tools=e}n?.permission!=null&&typeof n.permission==`object`&&(t.permission=n.permission);for(let[e,r]of Object.entries(n??{}))[`description`,`mode`,`model`,`temperature`,`maxSteps`,`hidden`,`allowTools`,`permission`,`namingCase`,`name`,`color`].includes(e)||(t[e]=r);return t}buildOpencodeSkillFrontMatter(e,t){let n={},r=e.yamlFrontMatter;n.name=t,r?.description!=null&&(n.description=r.description),n.license=r?.license??`MIT`,n.compatibility=r?.compatibility??`opencode`;let i={};for(let e of[`author`,`version`,`keywords`,`category`,`repository`,`displayName`])r?.[e]!=null&&(i[e]=r[e]);let a=new Set([`name`,`description`,`license`,`compatibility`,`namingCase`,`allowTools`,`keywords`,`displayName`,`author`,`version`]);for(let[e,t]of Object.entries(r??{}))a.has(e)||(i[e]=t);return Object.keys(i).length>0&&(n.metadata=i),n}validateAndNormalizeSkillName(e){let t=e.toLowerCase();return t=t.replaceAll(/[^a-z0-9-]+/g,`-`),t=t.replaceAll(/-+/g,`-`),t=t.replaceAll(/^-|-$/g,``),t.length===0?t=`skill`:t.length>64&&(t=t.slice(0,64),t=t.replace(/-$/,``)),t}};const tz=`rules`,nz=`commands`,rz=`skills`,iz=`glob`,az=`glob`;function oz(e,t){let n=t.sourceFrontMatter,r={description:`Fast command`,type:`user_command`};return n?.description!=null&&(r.description=n.description),n?.argumentHint!=null&&(r.argumentHint=n.argumentHint),n?.allowTools!=null&&Array.isArray(n.allowTools)&&n.allowTools.length>0&&(r.allowTools=n.allowTools),r}var sz=class extends nF{constructor(){super(`QoderIDEPluginOutputPlugin`,{globalConfigDir:`.qoder`,treatWorkspaceRootProjectAsProject:!0,indexignore:`.qoderignore`,commands:{subDir:nz,transformFrontMatter:oz},skills:{subDir:rz},rules:{subDir:tz,sourceScopes:[`project`,`global`]},cleanup:{delete:{project:{dirs:[`.qoder/commands`,`.qoder/rules`,`.qoder/skills`]},global:{dirs:[`.qoder/commands`,`.qoder/rules`,`.qoder/skills`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0},mcp:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{globalMemory:n,commands:r,skills:i,rules:a,aiAgentIgnoreConfigFiles:o}=e.collectedOutputContext,c=this.getGlobalConfigDir(),l=this.resolvePromptSourceProjectConfig(e),u=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0}),d=new Set(a==null?[]:this.selectRuleScopes(e,a)),f=new Set(this.selectPromptScopes(e,[`project`,`global`])),p=this.getProjectPromptOutputProjects(e),m=r==null?{items:[]}:this.selectSingleScopeItems(r,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),h=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),g=i==null?{items:[]}:this.selectSingleScopeItems(i,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`mcp`)??this.getTopicScopeOverride(e,`skills`)),_=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=s.join(e,rz,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}},v=(e,n,r)=>{for(let i of r){if(i.mcpConfig==null)continue;let r=s.join(e,rz,this.getSkillName(i));t.push({path:s.join(r,`mcp.json`),scope:n,source:{kind:`skillMcpConfig`,rawContent:i.mcpConfig.rawContent}})}};if(m.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=$(m.items,n.projectConfig,`commands`);for(let e of i)t.push({path:s.join(r,nz,this.transformCommandName(e,u)),scope:`project`,source:{kind:`command`,command:e}})}if(m.selectedScope===`global`){let e=$(m.items,l,`commands`);for(let n of e)t.push({path:s.join(c,nz,this.transformCommandName(n,u)),scope:`global`,source:{kind:`command`,command:n}})}if(h.selectedScope===`project`||g.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectConfigDir(e,t);n!=null&&(h.selectedScope===`project`&&_(n,`project`,$(h.items,t.projectConfig,`skills`)),g.selectedScope===`project`&&v(n,`project`,$(g.items,t.projectConfig,`skills`)))}if((h.selectedScope===`global`||g.selectedScope===`global`)&&(h.selectedScope===`global`&&_(c,`global`,$(h.items,l,`skills`)),g.selectedScope===`global`&&v(c,`global`,$(g.items,l,`skills`))),n!=null&&f.has(`global`))for(let r of p){let i=this.resolveProjectConfigDir(e,r);i!=null&&t.push({path:s.join(i,tz,`global.md`),scope:`project`,source:{kind:`ruleContent`,content:this.buildAlwaysRuleContent(n.content,e)}})}if(f.has(`project`))for(let n of p){let r=this.resolveProjectConfigDir(e,n);if(r!=null&&(n.rootMemoryPrompt!=null&&t.push({path:s.join(r,tz,`always.md`),scope:`project`,source:{kind:`ruleContent`,content:this.buildAlwaysRuleContent(n.rootMemoryPrompt.content,e)}}),n.childMemoryPrompts!=null))for(let i of n.childMemoryPrompts)t.push({path:s.join(r,tz,this.buildChildRuleFileName(i)),scope:`project`,source:{kind:`ruleContent`,content:this.buildGlobRuleContent(i,e)}})}if(a!=null&&a.length>0&&d.has(`project`))for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=aN($(a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`project`),n.projectConfig,`rules`),n.projectConfig);for(let e of i)t.push({path:s.join(r,tz,this.buildRuleFileName(e)),scope:`project`,source:{kind:`rulePrompt`,rule:e}})}if(a!=null&&a.length>0&&d.has(`global`)){let e=a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`global`);for(let n of e)t.push({path:s.join(c,tz,this.buildRuleFileName(n)),scope:`global`,source:{kind:`rulePrompt`,rule:n}})}let y=this.getIgnoreOutputPath(),b=this.indexignore==null?void 0:o?.find(e=>e.fileName===this.indexignore);if(y!=null&&b!=null)for(let n of this.getConcreteProjects(e)){let e=n.dirFromWorkspacePath;e==null||n.isPromptSourceProject===!0||t.push({path:s.join(e.basePath,e.path,y),scope:`project`,source:{kind:`ignoreFile`,content:b.content}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`command`:return this.buildCommandContent(n.command,t);case`ruleContent`:return n.content;case`rulePrompt`:return this.buildRuleContent(n.rule,t);case`skillMain`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillMcpConfig`:return n.rawContent;case`skillChildDoc`:case`ignoreFile`:return n.content;case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;default:throw Error(`Unsupported declaration source for ${this.name}`)}}buildChildRuleFileName(e){let t=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`);return`glob-${t.length>0?t:`root`}.md`}buildAlwaysRuleContent(e,t){return this.buildMarkdownContent(e,{trigger:`always_on`,type:`user_command`},t)}buildGlobRuleContent(e,t){let n=(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``),r=n.length===0?`**/*`:`${n}/**`;return this.buildMarkdownContent(e.content,{trigger:iz,[az]:r,type:`user_command`},t)}buildSkillFrontMatter(e){let t=e.yamlFrontMatter;return{name:this.getSkillName(e),description:t.description,type:`user_command`,...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}}}buildRuleFileName(e,t=`rule-`){return`${t}${e.prefix}-${e.ruleName}.md`}buildRuleContent(e,t){let n={trigger:iz,[az]:e.globs.length>0?e.globs.join(`, `):`**/*`,type:`user_command`};return this.buildMarkdownContent(e.content,n,t)}normalizeRuleScope(e){return e.scope??`global`}};function cz(e){return UP[e??`Readme`].out}var lz=class extends nF{constructor(){super(`ReadmeMdConfigFileOutputPlugin`,{outputFileName:`README.md`,cleanup:{delete:{project:{files:[`README.md`,`CODE_OF_CONDUCT.md`,`SECURITY.md`]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{readmePrompts:n}=e.collectedOutputContext;if(n==null||n.length===0)return t;for(let e of n){let n=cz(e.fileKind),r=s.join(e.targetDir.basePath,e.targetDir.path,n);t.push({path:r,scope:`project`,source:{content:e.content}})}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}};const uz=`GLOBAL.md`;var dz=class extends nF{constructor(){super(`TraeCNIDEOutputPlugin`,{globalConfigDir:`.trae-cn`,outputFileName:uz,dependsOn:[`TraeIDEOutputPlugin`],cleanup:{delete:{global:{dirs:[`.trae-cn/user_rules`]}}},capabilities:{prompt:{scopes:[`global`],singleScope:!1}}})}getGlobalUserRulesDir(){return this.joinPath(this.getGlobalConfigDir(),`user_rules`)}async declareOutputFiles(e){if(!new Set(this.selectPromptScopes(e,[`global`])).has(`global`))return[];let{globalMemory:t}=e.collectedOutputContext;return t==null?[]:[{path:this.joinPath(this.getGlobalUserRulesDir(),uz),scope:`global`,source:{content:t.content}}]}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}};const fz=`GLOBAL.md`,pz=`.trae`,mz=`commands`,hz=`skills`;var gz=class extends nF{constructor(){super(`TraeIDEOutputPlugin`,{globalConfigDir:pz,outputFileName:fz,treatWorkspaceRootProjectAsProject:!0,indexignore:`.traeignore`,commands:{subDir:mz,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{subDir:hz},cleanup:{delete:{project:{dirs:[`.trae/rules`,`.trae/commands`,`.trae/skills`]},global:{dirs:[`.trae/steering`,`.trae/commands`,`.trae/skills`]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}getIgnoreOutputPath(){if(this.indexignore!=null)return s.join(`.trae`,`.ignore`)}getGlobalSteeringDir(){return this.joinPath(this.getGlobalConfigDir(),`steering`)}async declareOutputFiles(e){let t=[],{commands:n,skills:r,globalMemory:i,aiAgentIgnoreConfigFiles:a}=e.collectedOutputContext,o=this.getConcreteProjects(e),c=this.getProjectPromptOutputProjects(e),l=this.resolvePromptSourceProjectConfig(e),u=new Set(this.selectPromptScopes(e,[`project`,`global`])),d=n==null?{items:[]}:this.selectSingleScopeItems(n,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),f=r==null?{items:[]}:this.selectSingleScopeItems(r,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),p=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0});i!=null&&u.has(`global`)&&t.push({path:this.joinPath(this.getGlobalSteeringDir(),fz),scope:`global`,source:{kind:`globalMemory`,content:i.content}});for(let n of c){let r=this.resolveProjectRootDir(e,n);if(r!=null&&n.childMemoryPrompts!=null&&u.has(`project`))for(let i of n.childMemoryPrompts){let n=(i.workingChildDirectoryPath?.path??i.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``),a=this.buildProjectRelativeGlobPattern(n),o=this.buildMarkdownContent([this.buildPathGuardHint(n),``,i.content].join(`
410
+ `),{alwaysApply:!1,globs:a},e);t.push({path:s.join(r,pz,`rules`,this.buildSteeringFileName(i)),scope:`project`,source:{kind:`steeringRule`,content:o}})}}if(d.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectConfigDir(e,n);if(r==null)continue;let i=$(d.items,n.projectConfig,`commands`);for(let e of i)t.push({path:s.join(r,mz,this.transformCommandName(e,p)),scope:`project`,source:{kind:`command`,command:e}})}if(d.selectedScope===`global`){let e=this.getGlobalConfigDir(),n=$(d.items,l,`commands`);for(let r of n)t.push({path:s.join(e,mz,this.transformCommandName(r,p)),scope:`global`,source:{kind:`command`,command:r}})}let m=(e,n,r)=>{for(let i of r){let r=this.getSkillName(i),a=s.join(e,hz,r);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:i}}),i.childDocs!=null)for(let e of i.childDocs)t.push({path:s.join(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(i.resources!=null)for(let e of i.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})}};if(f.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectConfigDir(e,t);n!=null&&m(n,`project`,$(f.items,t.projectConfig,`skills`))}f.selectedScope===`global`&&m(this.getGlobalConfigDir(),`global`,$(f.items,l,`skills`));let h=this.getIgnoreOutputPath(),g=this.indexignore==null?void 0:a?.find(e=>e.fileName===this.indexignore);if(h!=null&&g!=null)for(let e of o){let n=e.dirFromWorkspacePath;n==null||e.isPromptSourceProject===!0||t.push({path:s.join(n.basePath,n.path,h),scope:`project`,source:{kind:`ignoreFile`,content:g.content}})}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`globalMemory`:case`steeringRule`:case`skillChildDoc`:case`ignoreFile`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`skillMain`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;default:throw Error(`Unsupported declaration source for ${this.name}`)}}buildSkillFrontMatter(e){let t={description:e.yamlFrontMatter.description??``};return e.yamlFrontMatter.displayName!=null&&(t.name=e.yamlFrontMatter.displayName),t}buildSteeringFileName(e){return`trae-${(e.workingChildDirectoryPath?.path??e.dir.path).replaceAll(`\\`,`/`).replaceAll(/^\/+|\/+$/g,``).replaceAll(`/`,`-`)}.md`}buildPathGuardHint(e){return e.length===0?`Scope guard: apply this rule to project source files only; do not apply to generated output directories (for example dist/, build/, out/, .next/, target/).`:[`Scope guard: this rule is for the project-root path "${e}/" only.`,`Do not apply this rule to generated output paths such as "dist/${e}/", "build/${e}/", "out/${e}/", ".next/${e}/", or "target/${e}/".`].join(`
411
+ `)}buildProjectRelativeGlobPattern(e){return e.length===0?`**/*`:`${e}/**`}};const _z=`.vscode`;var vz=class extends nF{constructor(){super(`VisualStudioCodeIDEConfigOutputPlugin`,{cleanup:{delete:{project:{files:[`.vscode/settings.json`,`.vscode/extensions.json`]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{projects:n}=e.collectedOutputContext.workspace,{vscodeConfigFiles:r}=e.collectedOutputContext,i=r??[];for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null)for(let e of i){let r=this.getTargetRelativePath(e);t.push({path:this.resolvePath(n.basePath,n.path,r),scope:`project`,source:{content:e.content}})}}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}getTargetRelativePath(e){let t=e.dir.path;if(e.type!==GM.VSCode)return this.basename(t);let n=t.indexOf(_z);return n===-1?this.joinPath(_z,this.basename(t)):t.slice(Math.max(0,n))}};const yz=`WARP.md`;var bz=class extends nF{constructor(){super(`WarpIDEOutputPlugin`,{outputFileName:yz,treatWorkspaceRootProjectAsProject:!0,indexignore:`.warpindexignore`,cleanup:{delete:{project:{files:[yz]}}},capabilities:{prompt:{scopes:[`project`,`global`],singleScope:!1}}})}async declareOutputFiles(e){let t=[],{globalMemory:n,aiAgentIgnoreConfigFiles:r}=e.collectedOutputContext,i=this.getConcreteProjects(e),a=this.getProjectPromptOutputProjects(e),o=this.shouldSkipDueToPlugin(e,aF.AgentsOutput),c=new Set(this.selectPromptScopes(e,[`project`,`global`])),l=this.extractGlobalMemoryContent(e);if(o){if(n!=null&&c.has(`global`))for(let r of a){let i=this.resolveProjectRootDir(e,r);i!=null&&t.push({path:s.join(i,yz),scope:`project`,source:{content:n.content}})}}else for(let n of a){let r=this.resolveProjectRootDir(e,n);if(r!=null){if(n.rootMemoryPrompt!=null&&c.has(`project`)){let e=this.combineGlobalWithContent(l,n.rootMemoryPrompt.content);t.push({path:s.join(r,yz),scope:`project`,source:{content:e}})}if(n.childMemoryPrompts!=null&&c.has(`project`))for(let e of n.childMemoryPrompts)t.push({path:this.resolveFullPath(e.dir),scope:`project`,source:{content:e.content}})}}let u=this.getIgnoreOutputPath(),d=this.indexignore==null?void 0:r?.find(e=>e.fileName===this.indexignore);if(u!=null&&d!=null)for(let e of i){let n=e.dirFromWorkspacePath;n==null||e.isPromptSourceProject===!0||t.push({path:this.resolvePath(n.basePath,n.path,u),scope:`project`,source:{content:d.content}})}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}};const xz=`.codeium/windsurf`,Sz=`global_workflows`,Cz=`memories`,wz=`skills`,Tz=`.windsurf`,Ez=[_F.WINDSURF,_F.WINDSURF_LEGACY],Dz=_F.WINDSURF_LEGACY;var Oz=class extends nF{constructor(){super(`WindsurfOutputPlugin`,{globalConfigDir:xz,outputFileName:``,treatWorkspaceRootProjectAsProject:!0,dependsOn:[aF.AgentsOutput],indexignore:_F.WINDSURF,commands:{subDir:Sz,transformFrontMatter:(e,t)=>t.sourceFrontMatter??{}},skills:{subDir:wz},rules:{sourceScopes:[`project`,`global`]},cleanup:{delete:{project:{files:[_F.WINDSURF,Dz],dirs:[`.windsurf/rules`,`.windsurf/workflows`,`.windsurf/global_workflows`,`.windsurf/skills`,`.codeium/windsurf/global_workflows`,`.codeium/windsurf/skills`]},global:{dirs:[`.codeium/windsurf/global_workflows`,`.codeium/windsurf/memories`,`.codeium/windsurf/skills`]}}},capabilities:{prompt:{scopes:[`global`],singleScope:!1},rules:{scopes:[`project`,`global`],singleScope:!1},commands:{scopes:[`project`,`global`],singleScope:!0},skills:{scopes:[`project`,`global`],singleScope:!0}}})}async declareOutputFiles(e){let t=[],{commands:n,skills:r,globalMemory:i,rules:a,aiAgentIgnoreConfigFiles:o}=e.collectedOutputContext,c=this.resolvePromptSourceProjectConfig(e),l=this.getCodeiumWindsurfDir(),u=new Set(this.selectPromptScopes(e,[`global`])),d=n==null?{items:[]}:this.selectSingleScopeItems(n,this.commandsConfig.sourceScopes,e=>this.resolveCommandSourceScope(e),this.getTopicScopeOverride(e,`commands`)),f=r==null?{items:[]}:this.selectSingleScopeItems(r,this.skillsConfig.sourceScopes,e=>this.resolveSkillSourceScope(e),this.getTopicScopeOverride(e,`skills`)),p=this.getConcreteProjects(e);i!=null&&u.has(`global`)&&t.push({path:s.join(l,Cz,`global_rules.md`),scope:`global`,source:{kind:`globalMemory`,content:i.content}});let m=(e,n,r)=>{let i=this.getSkillName(r),a=s.join(e,wz,i);if(t.push({path:s.join(a,`SKILL.md`),scope:n,source:{kind:`skillMain`,skill:r}}),r.childDocs!=null)for(let e of r.childDocs)t.push({path:s.join(a,e.relativePath.replace(/\.mdx$/,`.md`)),scope:n,source:{kind:`skillChildDoc`,content:e.content}});if(r.resources!=null)for(let e of r.resources)t.push({path:s.join(a,e.relativePath),scope:n,source:{kind:`skillResource`,content:e.content,encoding:e.encoding}})};if(f.selectedScope===`project`)for(let t of this.getProjectOutputProjects(e)){let n=this.resolveProjectRootDir(e,t),r=n==null?void 0:s.join(n,Tz);if(r==null)continue;let i=$(f.items,t.projectConfig,`skills`);for(let e of i)m(r,`project`,e)}if(f.selectedScope===`global`){let e=$(f.items,c,`skills`);for(let t of e)m(l,`global`,t)}let h=this.getTransformOptionsFromContext(e,{includeSeriesPrefix:!0});if(d.selectedScope===`project`)for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n),i=r==null?void 0:s.join(r,Tz);if(i==null)continue;let a=$(d.items,n.projectConfig,`commands`);for(let e of a)t.push({path:s.join(i,`workflows`,this.transformCommandName(e,h)),scope:`project`,source:{kind:`command`,command:e}})}if(d.selectedScope===`global`){let e=$(d.items,c,`commands`);for(let n of e)t.push({path:s.join(l,Sz,this.transformCommandName(n,h)),scope:`global`,source:{kind:`command`,command:n}})}if(a!=null&&a.length>0){let n=new Set(this.selectRuleScopes(e,a)),r=a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`global`);if(n.has(`global`))for(let e of r)t.push({path:s.join(l,Cz,this.buildRuleFileName(e)),scope:`global`,source:{kind:`rule`,rule:e}});if(n.has(`project`))for(let n of this.getProjectOutputProjects(e)){let r=this.resolveProjectRootDir(e,n);if(r==null)continue;let i=aN($(a.filter(e=>this.normalizeSourceScope(this.normalizeRuleScope(e))===`project`),n.projectConfig,`rules`),n.projectConfig);for(let e of i)t.push({path:s.join(r,Tz,`rules`,this.buildRuleFileName(e)),scope:`project`,source:{kind:`rule`,rule:e}})}}let g=new Map((o??[]).map(e=>[e.fileName,e.content]));if(g.size<=0)return t;let _=g.get(_F.WINDSURF)??g.get(Dz),v=g.get(Dz)??g.get(_F.WINDSURF);for(let e of p){let n=e.dirFromWorkspacePath;if(!(n==null||e.isPromptSourceProject===!0))for(let e of Ez){let r=e===_F.WINDSURF?_:v;r!=null&&t.push({path:s.join(n.basePath,n.path,e),scope:`project`,source:{kind:`ignoreFile`,content:r}})}}return t}async convertContent(e,t){let n=e.source;switch(n.kind){case`globalMemory`:case`skillChildDoc`:case`ignoreFile`:return n.content;case`command`:return this.buildCommandContent(n.command,t);case`skillMain`:{let e=this.buildSkillFrontMatter(n.skill);return this.buildMarkdownContent(n.skill.content,e,t)}case`skillResource`:return n.encoding===`base64`?m.from(n.content,`base64`):n.content;case`rule`:return this.buildRuleContent(n.rule,t);default:throw Error(`Unsupported declaration source for ${this.name}`)}}getCodeiumWindsurfDir(){return s.join(this.getHomeDir(),xz)}buildRuleFileName(e,t=`rule-`){return`${t}${e.prefix}-${e.ruleName}.md`}buildRuleContent(e,t){let n={trigger:`glob`,globs:e.globs.length>0?e.globs.join(`, `):``};return this.buildMarkdownContent(e.content,n,t).split(`
412
412
  `).map(e=>{let t=/^(\s*globs:\s*)(['"])(.*)\2\s*$/.exec(e);if(t==null)return e;let n=t[1]??`globs: `,r=t[3]??``;return r.trim().length===0?e:`${n}${r}`}).join(`
413
- `)}};const Sz=`.zed`;var Cz=class extends xF{constructor(){super(`ZedIDEConfigOutputPlugin`,{cleanup:{delete:{project:{files:[`.zed/settings.json`]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{projects:n}=e.collectedOutputContext.workspace,r=e.collectedOutputContext.zedConfigFiles??[];for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null)for(let e of r){let r=this.getTargetRelativePath(e);t.push({path:this.resolvePath(n.basePath,n.path,r),scope:`project`,source:{content:e.content}})}}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}getTargetRelativePath(e){let t=e.dir.path;if(e.type!==ig.Zed)return this.basename(t);let n=t.indexOf(Sz);return n===-1?this.joinPath(Sz,`settings.json`):t.slice(Math.max(0,n))}};const wz=`.src.mdx`,Tz=`.mdx`,Ez=`skill`,Dz=new Set([`project-memory`,`project-child-memory`]);function Oz(e){return e.replaceAll(`\\`,`/`)}function kz(e,t){let n=Oz(e).trim();if(n.length===0)throw Error(`${t} cannot be empty`);let r=n.split(`/`);for(let e of r)if(e.length===0||e===`.`||e===`..`)throw Error(`${t} contains an invalid path segment`);return r.join(`/`)}function Az(e){return!Oz(e).includes(`/`)}function jz(e,t){let n=e;return n.includes(SF.WORKSPACE)&&(n=n.replace(SF.WORKSPACE,t)),r_(n)}function Mz(e={}){let{cwd:t,loadUserConfig:n=!0,pluginOptions:r={}}=e,i={};if(n){let e=pI().load(t);e.found&&(i=NL(e.config))}let a=PL(i,r),o=jz(a.workspaceDir,``);return{options:a,workspaceDir:o,aindexDir:s.join(o,a.aindex.dir)}}function Nz(e){return e.endsWith(wz)?`${e.slice(0,-8)}${Tz}`:s.extname(e)===Tz?e:`${e}${Tz}`}function Pz(e){return e.endsWith(wz)?e.slice(0,-8):e.endsWith(Tz)?e.slice(0,-4):e}function Fz(e,n){return t.existsSync(e)&&t.statSync(e).isDirectory()?Th.default.sync([...n],{cwd:e,dot:!0,onlyFiles:!0}).map(Oz):[]}function Iz(e){let t=s.join(e.aindexDir,e.options.aindex.globalPrompt.src);return{promptId:`global-memory`,kind:`global-memory`,logicalName:`global-memory`,paths:{zh:t,en:Nz(t),dist:s.join(e.aindexDir,e.options.aindex.globalPrompt.dist)}}}function Lz(e){let t=s.join(e.aindexDir,e.options.aindex.workspacePrompt.src);return{promptId:`workspace-memory`,kind:`workspace-memory`,logicalName:`workspace-memory`,paths:{zh:t,en:Nz(t),dist:s.join(e.aindexDir,e.options.aindex.workspacePrompt.dist)}}}function Rz(e,t,n,r){let i=kz(n,`projectName`);if(!Az(i))throw Error(`projectName must be a single path segment`);let a=r==null?``:kz(r,`relativeName`),o=vI(e.options,t),c=a.length===0?s.join(e.aindexDir,o.src,i):s.join(e.aindexDir,o.src,i,a),l=a.length===0?s.join(e.aindexDir,o.dist,i):s.join(e.aindexDir,o.dist,i,a),u=s.join(c,`agt${Tz}`),d=a.length===0?`${t}/${i}`:`${t}/${i}/${a}`;return{promptId:a.length===0?`project-memory:${d}`:`project-child-memory:${d}`,kind:a.length===0?`project-memory`:`project-child-memory`,logicalName:d,paths:{zh:s.join(c,`agt${wz}`),en:u,dist:s.join(l,`agt${Tz}`)},legacyZhPath:u}}function zz(e,t){let n=kz(t,`skillName`);if(!Az(n))throw Error(`skillName must be a single path segment`);let r=s.join(e.aindexDir,e.options.aindex.skills.src,n),i=s.join(e.aindexDir,e.options.aindex.skills.dist,n);return{promptId:`skill:${n}`,kind:`skill`,logicalName:n,paths:{zh:s.join(r,`${Ez}${wz}`),en:s.join(r,`${Ez}${Tz}`),dist:s.join(i,`${Ez}${Tz}`)}}}function Bz(e,t,n){let r=kz(t,`skillName`),i=kz(n,`relativeName`);if(!Az(r))throw Error(`skillName must be a single path segment`);let a=s.join(e.aindexDir,e.options.aindex.skills.src,r),o=s.join(e.aindexDir,e.options.aindex.skills.dist,r);return{promptId:`skill-child-doc:${r}/${i}`,kind:`skill-child-doc`,logicalName:`${r}/${i}`,paths:{zh:s.join(a,`${i}${wz}`),en:s.join(a,`${i}${Tz}`),dist:s.join(o,`${i}${Tz}`)}}}function Vz(e,t,n){let r=kz(n,`relativeName`),i=t===`command`?s.join(e.aindexDir,e.options.aindex.commands.src):t===`subagent`?s.join(e.aindexDir,e.options.aindex.subAgents.src):s.join(e.aindexDir,e.options.aindex.rules.src),a=t===`command`?s.join(e.aindexDir,e.options.aindex.commands.dist):t===`subagent`?s.join(e.aindexDir,e.options.aindex.subAgents.dist):s.join(e.aindexDir,e.options.aindex.rules.dist);return{promptId:`${t}:${r}`,kind:t,logicalName:r,paths:{zh:s.join(i,`${r}${wz}`),en:s.join(i,`${r}${Tz}`),dist:s.join(a,`${r}${Tz}`)}}}function Hz(e){switch(e){case`global-memory`:return{kind:`global-memory`};case`workspace-memory`:return{kind:`workspace-memory`};default:break}let t=e.indexOf(`:`);if(t===-1)throw Error(`Unsupported promptId: ${e}`);let n=e.slice(0,t),r=kz(e.slice(t+1),`promptId`);switch(n){case`project-memory`:return Uz(n,r);case`project-child-memory`:return Uz(n,r);case`skill`:if(!Az(r))throw Error(`skill promptId must include a single skill name`);return{kind:n,skillName:r};case`skill-child-doc`:{let[e,...t]=r.split(`/`),i=t.join(`/`);if(e==null||i.length===0)throw Error(`skill-child-doc promptId must include skill and child path`);return{kind:n,skillName:e,relativeName:i}}case`command`:case`subagent`:case`rule`:return{kind:n,relativeName:r};default:throw Error(`Unsupported promptId: ${e}`)}}function Uz(e,t){let n=t.split(`/`),r=n[0],i=r!=null&&gI(r);if(e===`project-memory`){if(i){let t=n[1];if(t==null||n.length!==2)throw Error(`project-memory promptId must include exactly one project name after the series`);return{kind:e,seriesName:r,projectName:t}}if(!Az(t))throw Error(`project-memory promptId must include a single project name`);return{kind:e,seriesName:`app`,projectName:t}}if(i){let t=n[1],i=n.slice(2).join(`/`);if(t==null||i.length===0)throw Error(`project-child-memory promptId must include series, project, and child path`);return{kind:e,seriesName:r,projectName:t,relativeName:i}}let[a,...o]=n,s=o.join(`/`);if(a==null||s.length===0)throw Error(`project-child-memory promptId must include project and child path`);return{kind:e,seriesName:`app`,projectName:a,relativeName:s}}function Wz(e,t){let n=Hz(e);switch(n.kind){case`global-memory`:return Iz(t);case`workspace-memory`:return Lz(t);case`project-memory`:if(n.projectName==null)throw Error(`project-memory promptId must include a project name`);return Rz(t,n.seriesName??`app`,n.projectName);case`project-child-memory`:if(n.projectName==null||n.relativeName==null)throw Error(`project-child-memory promptId must include project and child path`);return Rz(t,n.seriesName??`app`,n.projectName,n.relativeName);case`skill`:if(n.skillName==null)throw Error(`skill promptId must include a skill name`);return zz(t,n.skillName);case`skill-child-doc`:if(n.skillName==null||n.relativeName==null)throw Error(`skill-child-doc promptId must include skill and child path`);return Bz(t,n.skillName,n.relativeName);case`command`:case`subagent`:case`rule`:if(n.relativeName==null)throw Error(`${n.kind} promptId must include a relative path`);return Vz(t,n.kind,n.relativeName)}}function Gz(e,t){let n=t===`command`?s.join(e.aindexDir,e.options.aindex.commands.src):t===`subagent`?s.join(e.aindexDir,e.options.aindex.subAgents.src):s.join(e.aindexDir,e.options.aindex.rules.src),r=t===`command`?s.join(e.aindexDir,e.options.aindex.commands.dist):t===`subagent`?s.join(e.aindexDir,e.options.aindex.subAgents.dist):s.join(e.aindexDir,e.options.aindex.rules.dist),i=new Set;for(let e of Fz(n,[`**/*${wz}`,`**/*${Tz}`]))i.add(Pz(e));for(let e of Fz(r,[`**/*${Tz}`]))i.add(Pz(e));return[...i].sort().map(e=>`${t}:${e}`)}function Kz(e){let n=s.join(e.aindexDir,e.options.aindex.skills.src),r=s.join(e.aindexDir,e.options.aindex.skills.dist),i=new Set;if(t.existsSync(n)&&t.statSync(n).isDirectory())for(let e of t.readdirSync(n,{withFileTypes:!0}))e.isDirectory()&&i.add(e.name);if(t.existsSync(r)&&t.statSync(r).isDirectory())for(let e of t.readdirSync(r,{withFileTypes:!0}))e.isDirectory()&&i.add(e.name);let a=[];for(let e of[...i].sort()){a.push(`skill:${e}`);let t=s.join(n,e),i=s.join(r,e),o=new Set;for(let e of Fz(t,[`**/*${wz}`,`**/*${Tz}`])){let t=Pz(e);t!==Ez&&o.add(t)}for(let e of Fz(i,[`**/*${Tz}`])){let t=Pz(e);t!==Ez&&o.add(t)}for(let t of[...o].sort())a.push(`skill-child-doc:${e}/${t}`)}return a}function qz(e){let t=[];for(let n of _I(e.options)){let r=s.join(e.aindexDir,n.src),i=s.join(e.aindexDir,n.dist),a=new Set;for(let e of Fz(r,[`**/agt${wz}`,`**/agt${Tz}`])){let t=Oz(s.posix.dirname(Oz(e)));t!==`.`&&a.add(t)}for(let e of Fz(i,[`**/agt${Tz}`])){let t=Oz(s.posix.dirname(Oz(e)));t!==`.`&&a.add(t)}for(let e of[...a].sort()){let[r,...i]=e.split(`/`),a=i.join(`/`);r==null||r.length===0||t.push(a.length===0?`project-memory:${n.name}/${r}`:`project-child-memory:${n.name}/${r}/${a}`)}}return t}function Jz(e){let n=new Set,r=Iz(e),i=Lz(e);(t.existsSync(r.paths.zh)||t.existsSync(r.paths.en)||t.existsSync(r.paths.dist))&&n.add(r.promptId),(t.existsSync(i.paths.zh)||t.existsSync(i.paths.en)||t.existsSync(i.paths.dist))&&n.add(i.promptId);for(let t of qz(e))n.add(t);for(let t of Kz(e))n.add(t);for(let t of Gz(e,`command`))n.add(t);for(let t of Gz(e,`subagent`))n.add(t);for(let t of Gz(e,`rule`))n.add(t);return[...n].sort()}function Yz(e){try{return $f(e).yamlFrontMatter}catch{return}}function Xz(e,n,r=!1){if(!(t.existsSync(e)&&t.statSync(e).isFile()))return;let i=t.statSync(e),a=n?t.readFileSync(e,`utf8`):void 0,o={path:e,exists:!0,mtime:i.mtime.toISOString(),mtimeMs:i.mtimeMs,size:i.size,...r?{legacySource:!0}:{},...a==null?{}:{content:a}},s=a==null?void 0:Yz(a);return s!=null&&Object.assign(o,{frontMatter:s}),o}function Zz(e,t){return t==null?`missing`:e!=null&&t.mtimeMs<e.mtimeMs?`stale`:`ready`}function Qz(e,n){let r=t.existsSync(e.paths.zh),{legacyZhPath:i}=e,a=!r&&i!=null&&t.existsSync(i),o=r?e.paths.zh:a?i:void 0,s=o==null?void 0:Xz(o,n,a),c=r||i!==e.paths.en?Xz(e.paths.en,n):void 0,l=Xz(e.paths.dist,n);if(s==null&&c==null&&l==null)return null;let u=[s,c,l].filter(e=>e!=null).sort((e,t)=>t.mtimeMs-e.mtimeMs)[0]?.mtime,d={promptId:e.promptId,kind:e.kind,logicalName:e.logicalName,paths:e.paths,exists:{zh:s!=null,en:c!=null,dist:l!=null},enStatus:Zz(s,c),distStatus:Zz(s,l),...u==null?{}:{updatedAt:u},...s?.legacySource===!0?{legacyZhSource:!0}:{},src:{...s==null?{}:{zh:s},...c==null?{}:{en:c}}};l!=null&&Object.assign(d,{dist:l});let f=s?.frontMatter??c?.frontMatter??l?.frontMatter;return f!=null&&Object.assign(d,{frontMatter:f}),d}function $z(e,t){return t==null||t.length===0?!0:t.includes(e)}function eB(e,t){if(t==null||t.trim().length===0)return!0;let n=t.trim().toLowerCase();return e.promptId.toLowerCase().includes(n)||e.logicalName.toLowerCase().includes(n)}function tB(e){return{promptId:e.promptId,kind:e.kind,logicalName:e.logicalName,paths:e.paths,exists:e.exists,enStatus:e.enStatus,distStatus:e.distStatus,...e.updatedAt==null?{}:{updatedAt:e.updatedAt},...e.legacyZhSource===!0?{legacyZhSource:!0}:{}}}function nB(e){return Dz.has(e.kind)}function rB(e,n){t.mkdirSync(s.dirname(e),{recursive:!0}),t.writeFileSync(e,n,`utf8`)}function iB(e){if(!nB(e)||t.existsSync(e.paths.zh)||e.legacyZhPath==null||!t.existsSync(e.legacyZhPath))return;let n=t.readFileSync(e.legacyZhPath,`utf8`);rB(e.paths.zh,n)}function aB(e){nB(e)&&(e.legacyZhPath==null||e.legacyZhPath===e.paths.zh||t.existsSync(e.legacyZhPath)&&t.rmSync(e.legacyZhPath,{force:!0}))}async function oB(e={}){let t=Mz(e);return Jz(t).map(e=>Qz(Wz(e,t),!1)).filter(e=>e!=null).map(tB).filter(t=>$z(t.kind,e.kinds)).filter(t=>$z(t.enStatus,e.enStatus)).filter(t=>$z(t.distStatus,e.distStatus)).filter(t=>eB(t,e.query)).sort((e,t)=>e.promptId.localeCompare(t.promptId))}async function sB(e,t={}){return Qz(Wz(e,Mz(t)),!0)}async function cB(e){let t=Mz(e),n=e.locale??`zh`,r=Wz(e.promptId,t);n===`zh`?(rB(r.paths.zh,e.content),aB(r)):(iB(r),rB(r.paths.en,e.content));let i=Qz(r,!0);if(i==null)throw Error(`Failed to load prompt after write: ${e.promptId}`);return i}async function lB(e){if(e.enContent==null&&e.distContent==null)throw Error(`writePromptArtifacts requires enContent or distContent`);let t=Mz(e),n=Wz(e.promptId,t);e.enContent!=null&&(iB(n),rB(n.paths.en,e.enContent)),e.distContent!=null&&rB(n.paths.dist,e.distContent);let r=Qz(n,!0);if(r==null)throw Error(`Failed to load prompt after write: ${e.promptId}`);return r}async function uB(e,t={}){return Wz(e,Mz(t)).paths}const dB=[`aindex.config.ts`,`aindex.config.mts`,`aindex.config.cts`,`aindex.config.js`,`aindex.config.mjs`,`aindex.config.cjs`],fB={emptyDirCleanup:{exclude:[]}};var pB=class{logger;constructor(){this.logger=om(`AindexProjectConfigLoader`)}async loadFromDirectory(e){for(let n of dB){let r=s.join(e,n);if(t.existsSync(r))return this.loadFromFile(r)}return{config:fB,source:null,found:!1}}async loadFromFile(e){try{let n=s.resolve(e);if(!t.existsSync(n))return{config:fB,source:null,found:!1};let r=await import(n),i=typeof r==`object`&&r?`default`in r?r.default:`config`in r?r.config:r:r,a=this.normalizeConfig(i);return this.logger.debug(`aindex project config loaded`,{source:n}),{config:a,source:n,found:!0}}catch(t){return this.logger.warn({code:`AINDEX_CONFIG_LOAD_FAILED`,title:`aindex project config load failed`,rootCause:[t instanceof Error?t.message:String(t)],details:{path:e}}),{config:fB,source:null,found:!1}}}normalizeConfig(e){if(typeof e!=`object`||!e)return fB;let t=e.emptyDirCleanup;return t!=null&&typeof t!=`object`?{}:{emptyDirCleanup:{exclude:mB(t.exclude)}}}};function mB(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):typeof e==`string`?[e]:[]}let hB=null;function gB(){return hB??=new pB,hB}async function _B(e){return gB().loadFromDirectory(e)}let vB=null;var yB=class extends Error{conflicts;constructor(e){super(OB(e)),this.name=`CleanupProtectionConflictError`,this.conflicts=e}};function bB(){if(vB!==null)return vB;let e=GN();return vB=e?.planCleanup!=null&&e.performCleanup!=null,vB}function xB(){let e=GN();if(e==null)throw Error(`Native cleanup binding is required. Build or install the Rust NAPI package before running tnmsc.`);return e}function SB(e){return e}function CB(e){return e}function wB(e){return{path:e.path,kind:e.kind,...e.excludeBasenames!=null&&e.excludeBasenames.length>0?{excludeBasenames:[...e.excludeBasenames]}:{},...e.protectionMode==null?{}:{protectionMode:SB(e.protectionMode)},...e.scope==null?{}:{scope:e.scope},...e.label==null?{}:{label:e.label}}}async function TB(e,t){return e.declareCleanupPaths==null?{}:e.declareCleanupPaths({...t,dryRun:!0})}async function EB(e,t,n){let r=n?.get(e),[i,a]=await Promise.all([r==null?e.declareOutputFiles({...t,dryRun:!0}):Promise.resolve(r),TB(e,t)]);return{pluginName:e.name,outputs:i.map(e=>e.path),cleanup:{...a.delete!=null&&a.delete.length>0?{delete:a.delete.map(wB)}:{},...a.protect!=null&&a.protect.length>0?{protect:a.protect.map(wB)}:{},...a.excludeScanGlobs!=null&&a.excludeScanGlobs.length>0?{excludeScanGlobs:[...a.excludeScanGlobs]}:{}}}}function DB(e){return(e.pluginOptions?.cleanupProtection?.rules??[]).map(e=>({path:e.path,protectionMode:SB(e.protectionMode),reason:e.reason??`configured cleanup protection rule`,source:`configured-cleanup-protection`,matcher:CB(e.matcher??`path`)}))}function OB(e){let t=e.map(e=>e.outputPath).join(`, `);return`Cleanup protection conflict: ${e.length} output path(s) are also protected: ${t}`}function kB(e,t){let n=t[0];e.error(dp({code:`CLEANUP_PROTECTION_CONFLICT_DETECTED`,title:`Cleanup output paths conflict with protected inputs`,rootCause:q(`tnmsc found ${t.length} output path(s) that also match protected cleanup rules.`,n==null?`No conflict details were captured.`:`Example conflict: "${n.outputPath}" is protected by "${n.protectedPath}".`),exactFix:q(`Separate generated output paths from protected source or reserved workspace paths before running cleanup again.`),possibleFixes:[q(`Update cleanup protect declarations so they do not overlap generated outputs.`),q(`Move the conflicting output target to a generated-only directory.`)],details:{count:t.length,conflicts:t}}))}function AB(e,t){e.debug(`cleanup plan built`,{filesToDelete:t.filesToDelete.length,dirsToDelete:t.dirsToDelete.length+t.emptyDirsToDelete.length,emptyDirsToDelete:t.emptyDirsToDelete.length,violations:t.violations.length,conflicts:t.conflicts.length,excludedScanGlobs:t.excludedScanGlobs})}function jB(e){let t=new Set;for(let n of e.pluginSnapshots){for(let e of n.outputs)t.add(s.resolve(e));for(let e of n.cleanup.delete??[])e.kind===`file`&&t.add(s.resolve(e.path))}return t}function MB(e,t){if(t.size===0||e.violations.length===0)return e;let n=new Set(e.filesToDelete.map(e=>s.resolve(e))),r=[];for(let i of e.violations){let e=s.resolve(i.targetPath);if(t.has(e)){n.add(e);continue}r.push(i)}return{...e,filesToDelete:[...n].sort((e,t)=>e.localeCompare(t)),violations:r}}function NB(e){return{pluginCount:e.pluginSnapshots.length,outputCount:e.pluginSnapshots.reduce((e,t)=>e+t.outputs.length,0),cleanupDeleteCount:e.pluginSnapshots.reduce((e,t)=>e+(t.cleanup.delete?.length??0),0),cleanupProtectCount:e.pluginSnapshots.reduce((e,t)=>e+(t.cleanup.protect?.length??0),0),cleanupExcludeScanGlobs:e.pluginSnapshots.reduce((e,t)=>e+(t.cleanup.excludeScanGlobs?.length??0),0),protectedRuleCount:e.protectedRules.length,projectRootCount:e.projectRoots.length,emptyDirExcludeGlobs:e.emptyDirExcludeGlobs?.length??0}}function PB(e,t){return t.map(t=>{let n=t.kind===`directory`?`directory`:`file`;return e.warn(hp({code:n===`file`?`CLEANUP_FILE_DELETE_FAILED`:`CLEANUP_DIRECTORY_DELETE_FAILED`,title:n===`file`?`Cleanup could not delete a file`:`Cleanup could not delete a directory`,operation:`delete`,targetKind:n,path:t.path,error:t.error,details:{phase:`cleanup`}})),{path:t.path,type:n,error:t.error}})}async function FB(e,t,n){let r=await Promise.all(e.map(async e=>EB(e,t,n))),i=new Set;for(let e of r)if(e.cleanup.delete!=null)for(let t of e.cleanup.delete)i.add(s.resolve(t.path));let a=[];for(let e of k_(t.collectedOutputContext))i.has(s.resolve(e.path))||a.push({path:e.path,protectionMode:SB(e.protectionMode),reason:e.reason,source:e.source,...e.matcher==null?{}:{matcher:CB(e.matcher)}});if(t.collectedOutputContext.aindexDir!=null&&t.pluginOptions!=null)for(let e of O_(t.pluginOptions,t.collectedOutputContext.aindexDir,{workspaceDir:t.collectedOutputContext.workspace.directory.path}))i.has(s.resolve(e.path))||a.push({path:e.path,protectionMode:SB(e.protectionMode),reason:e.reason,source:e.source,...e.matcher==null?{}:{matcher:CB(e.matcher)}});a.push(...DB(t));let o;if(t.collectedOutputContext.aindexDir!=null){let e=await _B(t.collectedOutputContext.aindexDir);if(e.found){let t=e.config.emptyDirCleanup?.exclude;t!=null&&t.length>0&&(o=[...t])}}return{workspaceDir:t.collectedOutputContext.workspace.directory.path,...t.collectedOutputContext.aindexDir==null?{}:{aindexDir:t.collectedOutputContext.aindexDir},projectRoots:M_(t.collectedOutputContext),protectedRules:a,pluginSnapshots:r,...o!=null&&o.length>0?{emptyDirExcludeGlobs:o}:{}}}function IB(e){return JSON.parse(e)}async function LB(e){let t=xB();if(t?.planCleanup==null)throw Error(`Native cleanup planning is unavailable`);return IB(await Promise.resolve(t.planCleanup(JSON.stringify(e))))}async function RB(e){let t=xB();if(t?.performCleanup==null)throw Error(`Native cleanup execution is unavailable`);return IB(await Promise.resolve(t.performCleanup(JSON.stringify(e))))}async function zB(e,t,n){t.logger.info(`cleanup planning started`,{phase:`cleanup-plan`,dryRun:t.dryRun===!0,pluginCount:e.length,workspaceDir:t.collectedOutputContext.workspace.directory.path});let r=await FB(e,t,n);t.logger.info(`cleanup snapshot prepared`,{phase:`cleanup-plan`,...NB(r)});let i=MB(await LB(r),jB(r));if(t.logger.info(`cleanup planning complete`,{phase:`cleanup-plan`,filesToDelete:i.filesToDelete.length,dirsToDelete:i.dirsToDelete.length+i.emptyDirsToDelete.length,emptyDirsToDelete:i.emptyDirsToDelete.length,violations:i.violations.length,conflicts:i.conflicts.length}),i.conflicts.length>0)throw new yB(i.conflicts);return{filesToDelete:i.filesToDelete,dirsToDelete:i.dirsToDelete.sort((e,t)=>e.localeCompare(t)),emptyDirsToDelete:i.emptyDirsToDelete.sort((e,t)=>e.localeCompare(t)),violations:[...i.violations],conflicts:[],excludedScanGlobs:i.excludedScanGlobs}}async function BB(e,t,n,r){if(n.info(`cleanup execution started`,{phase:`cleanup-execute`,dryRun:t.dryRun===!0,pluginCount:e.length,workspaceDir:t.collectedOutputContext.workspace.directory.path}),r!=null){let i=await vF(e,t,r);n.info(`cleanup outputs collected`,{phase:`cleanup-execute`,projectDirs:i.projectDirs.length,projectFiles:i.projectFiles.length,globalDirs:i.globalDirs.length,globalFiles:i.globalFiles.length})}let i=await FB(e,t,r);n.info(`cleanup snapshot prepared`,{phase:`cleanup-execute`,...NB(i)}),n.info(`cleanup native execution started`,{phase:`cleanup-execute`,pluginCount:i.pluginSnapshots.length,outputCount:i.pluginSnapshots.reduce((e,t)=>e+t.outputs.length,0)});let a=MB(await RB(i),jB(i));if(n.info(`cleanup native execution finished`,{phase:`cleanup-execute`,deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,plannedFiles:a.filesToDelete.length,plannedDirs:a.dirsToDelete.length+a.emptyDirsToDelete.length,emptyDirsToDelete:a.emptyDirsToDelete.length,violations:a.violations.length,conflicts:a.conflicts.length,errors:a.errors.length}),AB(n,a),a.conflicts.length>0)return kB(n,a.conflicts),n.info(`cleanup execution blocked`,{phase:`cleanup-execute`,reason:`conflicts`,conflicts:a.conflicts.length}),{deletedFiles:0,deletedDirs:0,errors:[],violations:[],conflicts:a.conflicts,message:OB(a.conflicts)};if(a.violations.length>0)return L_(n,`cleanup`,a.violations),n.info(`cleanup execution blocked`,{phase:`cleanup-execute`,reason:`protected-path-violations`,violations:a.violations.length}),{deletedFiles:0,deletedDirs:0,errors:[],violations:a.violations,conflicts:[],message:`Protected deletion guard blocked cleanup for ${a.violations.length} path(s)`};n.debug(`cleanup delete execution started`,{filesToDelete:a.filesToDelete.length,dirsToDelete:a.dirsToDelete.length+a.emptyDirsToDelete.length,emptyDirsToDelete:a.emptyDirsToDelete.length});let o=PB(n,a.errors);return n.debug(`cleanup delete execution complete`,{deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,errors:o.length}),n.info(`cleanup execution complete`,{phase:`cleanup-execute`,deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,errors:o.length}),{deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,errors:o,violations:[],conflicts:[]}}var VB=class extends Error{};function HB(e){return e?.fs??t}function UB(e){return e?.spawnSync??f}function WB(e){return e?.platform??a.platform}function GB(e){return e?.effectiveHomeDir??e_()}function KB(e){return e?.nativeHomeDir??$g().nativeHomeDir}function qB(e){return e?.isWsl??$g().isWsl}function JB(e){return e===`win32`?s.win32:s.posix}function YB(e){return[...new Set(e.map(e=>e.trim()).filter(e=>e.length>0))]}function XB(e){let t=e?.windows?.wsl2?.instances;return YB(t==null?[]:Array.isArray(t)?t:[t])}function ZB(e,t){if(!t.startsWith(`/`))throw Error(`WSL instance "${e}" returned a non-absolute home path: "${t}".`);let n=t.split(`/`).filter(e=>e.length>0);return s.win32.join(`\\\\wsl$\\${e}`,...n)}function QB(e,t,n){let r=JB(n),i=r.normalize(t),a=r.normalize(e),o=r.relative(i,a);if(o.length===0||o.startsWith(`..`)||r.isAbsolute(o))throw Error(`WSL mirror source "${e}" must stay under the host home directory "${t}".`);return o.split(/[\\/]+/u).filter(e=>e.length>0)}function $B(e){if(typeof e==`string`)return e;if(!m.isBuffer(e)||e.length===0)return``;let t=e.length>=2&&e[0]===255&&e[1]===254,n=e.length>=2&&e[0]===254&&e[1]===255;if(t||n)return e.toString(`utf16le`).replace(/^\uFEFF/u,``);let r=e.toString(`utf8`);return r.includes(`\0`)?e.toString(`utf16le`).replace(/^\uFEFF/u,``):r}function eV(e){return $B(e).replaceAll(`\0`,``)}function tV(e){let{error:t}=e;if(!(typeof t!=`object`||!t))return`code`in t&&typeof t.code==`string`?t.code:void 0}function nV(e){if(tV(e)===`ENOENT`)return`wsl.exe is not available on PATH.`;let t=[e.stderr,e.stdout].map(e=>eV(e).trim()).filter(e=>e.length>0).join(`
414
- `).toLowerCase();if(t.length!==0)return[`windows subsystem for linux has no installed distributions`,`windows subsystem for linux has not been enabled`,`the windows subsystem for linux optional component is not enabled`,`wsl is not installed`,`run 'wsl.exe --install'`,`run "wsl.exe --install"`,`wslregisterdistribution failed with error: 0x8007019e`].some(e=>t.includes(e))?t:void 0}async function rV(e,t){let n=await Promise.all(e.map(async e=>e.declareWslMirrorFiles==null?[]:e.declareWslMirrorFiles(t))),r=new Map;for(let e of n)for(let t of e)r.set(t.sourcePath,t);return[...r.values()]}function iV(e){return{platform:`win32`,isWsl:!1,nativeHomeDir:e,effectiveHomeDir:e,globalConfigCandidates:[],windowsUsersRoot:``,expandedEnv:{HOME:e,USERPROFILE:e}}}function aV(e,t){return{platform:`linux`,isWsl:!0,nativeHomeDir:t,effectiveHomeDir:e,globalConfigCandidates:[],windowsUsersRoot:``,expandedEnv:{HOME:e,USERPROFILE:e}}}function oV(e){return YB(e.split(/\r?\n/u).map(e=>e.replace(/^\*/u,``).trim()).filter(e=>e.length>0))}function sV(e,t){let n=UB(t)(`wsl.exe`,[`--list`,`--quiet`],{shell:!1,windowsHide:!0}),r=nV(n);if(r!=null)throw new VB(r);if(n.status!==0){let e=eV(n.stderr).trim();throw Error(`Failed to enumerate WSL instances. ${e.length>0?e:`wsl.exe returned a non-zero exit status.`}`)}let i=oV(eV(n.stdout));return e.info(`discovered wsl instances`,{instances:i}),i}function cV(e,t,n){let r=XB(e);return r.length>0?r:sV(t,n)}function lV(e,t,n){if(e.scope!==`global`)return;let r=JB(n).normalize(e.path),i;try{i=QB(r,t,n)}catch{return}let[a]=i;if(a?.startsWith(`.`))return{kind:`generated`,sourcePath:r,relativePathSegments:i}}function uV(e,t,n){if(e==null)return[];let r=new Map;for(let i of e.values())for(let e of i){let i=lV(e,t,n);i!=null&&r.set(i.sourcePath,i)}return[...r.values()]}function dV(e,t,n,r){let i=JB(r).normalize(r_(e.sourcePath,t));return{kind:`declared`,sourcePath:i,relativePathSegments:QB(i,n,r)}}function fV(e,t,n,r,i){let a=new Map,o=[];for(let t of e)try{let e=dV(t,n,r,i);a.set(e.sourcePath,e)}catch(e){o.push(e instanceof Error?e.message:String(e))}for(let e of t)a.set(e.sourcePath,e);return{sources:[...a.values()],errors:o}}function pV(e,t,n){if(WB(n)!==`win32`)return[];let r=cV(e,t,n);if(r.length===0)return[];let i=HB(n),a=UB(n),o=[];for(let e of r){let n=a(`wsl.exe`,[`-d`,e,`sh`,`-lc`,`printf %s "$HOME"`],{shell:!1,windowsHide:!0}),r=nV(n);if(r!=null)throw new VB(r);if(n.status!==0){let t=eV(n.stderr).trim();throw Error(`Failed to probe WSL instance "${e}". ${t.length>0?t:`wsl.exe returned a non-zero exit status.`}`)}let s=eV(n.stdout).trim();if(s.length===0)throw Error(`WSL instance "${e}" returned an empty home directory.`);let c=ZB(e,s);if(!i.existsSync(c))throw Error(`WSL instance "${e}" home directory is unavailable at "${c}".`);t.info(`resolved wsl instance home`,{instance:e,linuxHomeDir:s,windowsHomeDir:c}),o.push({instance:e,linuxHomeDir:s,windowsHomeDir:c})}return o}function mV(e,t,n){let r=HB(n),i=s.posix.normalize(KB(n)),a=0,o=[],c=[];for(let n of e){if(n.kind===`declared`&&!r.existsSync(n.sourcePath)){let e=`Skipping missing WSL mirror source file: ${n.sourcePath}`;o.push(e),t.logger.warn({code:`WSL_MIRROR_SOURCE_MISSING`,title:`WSL mirror source file is missing`,rootCause:[e],exactFix:[`Create the source file on the Windows host or remove the WSL mirror declaration before retrying tnmsc.`]});continue}let e=s.posix.join(i,...n.relativePathSegments);try{if(t.dryRun===!0)t.logger.info(`would mirror host config into wsl runtime home`,{sourcePath:n.sourcePath,targetPath:e,dryRun:!0});else{let i=r.readFileSync(n.sourcePath);r.mkdirSync(s.posix.dirname(e),{recursive:!0}),r.writeFileSync(e,i),t.logger.info(`mirrored host config into wsl runtime home`,{sourcePath:n.sourcePath,targetPath:e})}a+=1}catch(t){c.push(`Failed to mirror "${n.sourcePath}" into the current WSL home at "${e}": ${t instanceof Error?t.message:String(t)}`)}}return{mirroredFiles:a,warnings:o,errors:c}}async function hV(e,t,n,r){let i=WB(n),a=i===`linux`&&qB(n);if(i!==`win32`&&!a)return{mirroredFiles:0,warnings:[],errors:[]};let o=a?s.posix.normalize(GB(n)):s.win32.normalize(GB(n)),c=await rV(e,t),l=uV(r,o,i);if(c.length===0&&l.length===0)return{mirroredFiles:0,warnings:[],errors:[]};let u=t.pluginOptions??{},d=a?s.posix.normalize(KB(n)):void 0,f=fV(c,l,a?aV(o,d??o):iV(o),o,i);if(a){if(f.sources.length===0||d==null||o===d)return{mirroredFiles:0,warnings:[],errors:[...f.errors]};let e=mV(f.sources,t,n);return{mirroredFiles:e.mirroredFiles,warnings:[...e.warnings],errors:[...f.errors,...e.errors]}}let p;try{p=pV(u,t.logger,n)}catch(e){return e instanceof VB?(t.logger.info(`wsl is unavailable, skipping WSL mirror sync`,{reason:e.message}),{mirroredFiles:0,warnings:[],errors:[]}):{mirroredFiles:0,warnings:[],errors:[e instanceof Error?e.message:String(e)]}}if(p.length===0||f.sources.length===0)return{mirroredFiles:0,warnings:[],errors:[...f.errors]};let m=HB(n),h=0,g=[],_=[...f.errors];for(let e of f.sources){if(e.kind===`declared`&&!m.existsSync(e.sourcePath)){let n=`Skipping missing WSL mirror source file: ${e.sourcePath}`;g.push(n),t.logger.warn({code:`WSL_MIRROR_SOURCE_MISSING`,title:`WSL mirror source file is missing`,rootCause:[n],exactFix:[`Create the source file on the Windows host or remove the WSL mirror declaration before retrying tnmsc.`]});continue}let{relativePathSegments:n,sourcePath:r}=e;for(let e of p){let i=s.win32.join(e.windowsHomeDir,...n);try{if(t.dryRun===!0)t.logger.info(`would mirror windows config into wsl`,{instance:e.instance,sourcePath:r,targetPath:i,dryRun:!0});else{let n=m.readFileSync(r);m.mkdirSync(s.win32.dirname(i),{recursive:!0}),m.writeFileSync(i,n),t.logger.info(`mirrored windows config into wsl`,{instance:e.instance,sourcePath:r,targetPath:i})}h+=1}catch(t){_.push(`Failed to mirror "${r}" into WSL instance "${e.instance}" at "${i}": ${t instanceof Error?t.message:String(t)}`)}}}return{mirroredFiles:h,warnings:g,errors:_}}var gV=class{name;constructor(e){this.inner=e,this.name=`json:${e.name}`}async execute(e){nI();let t=await this.inner.execute(e);return a.stdout.write(`${JSON.stringify(_V(t,iI()))}\n`),t}};function _V(e,t=iI()){let{warnings:n,errors:r}=Cp(t);return{success:e.success,filesAffected:e.filesAffected,dirsAffected:e.dirsAffected,...e.message!=null&&{message:e.message},pluginResults:[],warnings:n,errors:r}}let vV=function(e){return e[e.Flags=0]=`Flags`,e[e.Unknown=1]=`Unknown`,e[e.Subcommand=2]=`Subcommand`,e}({});var yV=class{factories=[];register(e){this.factories.push(e),this.factories.sort((e,t)=>e.priority-t.priority)}registerWithPriority(e,t){let n={priority:t,canHandle:t=>e.canHandle(t),createCommand:t=>e.createCommand(t)};this.factories.push(n),this.factories.sort((e,t)=>e.priority-t.priority)}resolve(e){for(let t of this.factories)if(t.priority<=vV.Unknown&&t.canHandle(e))return t.createCommand(e);for(let t of this.factories)if(t.priority===vV.Subcommand&&t.canHandle(e))return t.createCommand(e);for(let t of this.factories)if(t.canHandle(e))return t.createCommand(e);throw Error(`No command factory found for the given arguments`)}},bV=class{name=`clean`;async execute(e){let{logger:t,outputPlugins:n,createCleanContext:r,collectedOutputContext:i}=e;t.info(`started`,{command:`clean`,pluginCount:n.length,projectCount:i.workspace.projects.length,workspaceDir:i.workspace.directory.path}),t.info(`clean phase started`,{phase:`cleanup`});let a=await BB(n,r(!1),t);return a.violations.length>0||a.conflicts.length>0?(t.info(`clean halted`,{phase:`cleanup`,conflicts:a.conflicts.length,violations:a.violations.length,...a.message==null?{}:{message:a.message}}),{success:!1,filesAffected:0,dirsAffected:0,...a.message==null?{}:{message:a.message}}):(t.info(`clean phase complete`,{phase:`cleanup`,deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,errors:a.errors.length}),t.info(`complete`,{command:`clean`,filesAffected:a.deletedFiles,dirsAffected:a.deletedDirs}),{success:!0,filesAffected:a.deletedFiles,dirsAffected:a.deletedDirs})}},xV=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 vF(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{filesToDelete:o,dirsToDelete:c,emptyDirsToDelete:l,violations:u,excludedScanGlobs:d}=await zB(n,i),f=[...c,...l];if(u.length>0)return L_(t,`dry-run-cleanup`,u),{success:!1,filesAffected:0,dirsAffected:0,message:`Protected deletion guard blocked cleanup for ${u.length} path(s)`};for(let e of o)t.info(`would delete file`,{path:s.isAbsolute(e)?e:s.resolve(e),dryRun:!0});for(let e of[...f].sort((e,t)=>t.length-e.length))t.info(`would delete directory`,{path:s.isAbsolute(e)?e:s.resolve(e),dryRun:!0});return t.info(`clean complete`,{dryRun:!0,filesAffected:o.length,dirsAffected:f.length,violations:0,excludedScanGlobs:d}),{success:!0,filesAffected:o.length,dirsAffected:f.length,message:`Dry-run complete, no files were deleted`}}},SV=class{canHandle(e){return e.subcommand===`clean`}createCommand(e){return e.dryRun?new xV:new bV}};const CV=[`workspaceDir`,...Jh,`logLevel`];function wV(e){return CV.includes(e)}function TV(e){return[`trace`,`debug`,`info`,`warn`,`error`].includes(e)}function EV(){let e=n_();if(!t.existsSync(e))return{};try{return JSON.parse(t.readFileSync(e,`utf8`))}catch{return{}}}function DV(e){let n=n_(),r=s.dirname(n);t.existsSync(r)||t.mkdirSync(r,{recursive:!0}),t.writeFileSync(n,`${JSON.stringify(e,null,2)}\n`,`utf8`)}function OV(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length-1;e++){let t=r[e];if(t==null)continue;let n=i[t];(typeof n!=`object`||!n||Array.isArray(n))&&(i[t]={}),i=i[t]}let a=r.at(-1);a!=null&&(i[a]=n)}function kV(e,t){let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r||Array.isArray(r))return;r=r[e]}return r}var AV=class{name=`config`;constructor(e){this.options=e}async execute(e){let{logger:t}=e;if(this.options.length===0)return t.error(vp({code:`CONFIG_COMMAND_ARGUMENTS_MISSING`,title:`Config command requires at least one key=value pair`,rootCause:q(`tnmsc config was invoked without any configuration assignments.`),exactFix:q("Run `tnmsc config key=value` with at least one supported configuration key."),possibleFixes:[q(`Use one of the supported keys: ${CV.join(`, `)}`)],details:{validKeys:[...CV]}})),t.info(`Usage: tnmsc config key=value`),t.info(`Valid keys: ${CV.join(`, `)}`),{success:!1,filesAffected:0,dirsAffected:0,message:`No options provided`};let n;try{n=EV()}catch(e){return{success:!1,filesAffected:0,dirsAffected:0,message:e instanceof Error?e.message:String(e)}}let r=[],i=[];for(let[e,a]of this.options){if(!wV(e)){r.push(`Invalid key: ${e}`),t.error(vp({code:`CONFIG_COMMAND_KEY_INVALID`,title:`Unsupported config key: ${e}`,rootCause:q(`The config command received "${e}", which is not a supported configuration key.`),exactFix:q(`Use one of the supported config keys and rerun the command.`),possibleFixes:[q(`Supported keys: ${CV.join(`, `)}`)],details:{key:e,validKeys:[...CV]}}));continue}if(e===`logLevel`&&!TV(a)){r.push(`Invalid logLevel value: ${a}`),t.error(vp({code:`CONFIG_COMMAND_LOG_LEVEL_INVALID`,title:`Unsupported logLevel value: ${a}`,rootCause:q(`The config command received "${a}" for logLevel, but tnmsc does not support that level.`),exactFix:q(`Set logLevel to one of: trace, debug, info, warn, or error.`),details:{key:e,value:a,validLevels:[`trace`,`debug`,`info`,`warn`,`error`]}}));continue}let o=kV(n,e);OV(n,e,a),o!==a&&i.push(`${e}=${a}`),t.info(`configuration updated`,{key:e,value:a})}if(i.length>0){try{DV(n)}catch(e){return{success:!1,filesAffected:0,dirsAffected:0,message:e instanceof Error?e.message:String(e)}}t.info(`global config written`,{path:n_()})}let a=r.length===0;return{success:a,filesAffected:i.length>0?1:0,dirsAffected:0,message:a?`Configuration updated: ${i.join(`, `)}`:`Partial update: ${i.join(`, `)}. Errors: ${r.join(`, `)}`}}},jV=class{name=`config-show`;async execute(e){let{logger:t}=e,n=new dI,r=n.load(),i=r.sources.map(e=>({path:e,layer:`global`,config:n.loadFromFile(e).config})),o={merged:r.config,sources:i};return a.stdout.write(`${JSON.stringify(o)}\n`),t.info(`config shown`,{sources:r.sources.length}),{success:!0,filesAffected:0,dirsAffected:0,message:`Configuration displayed (${i.length} source(s))`}}},MV=class{canHandle(e){return e.subcommand===`config`}createCommand(e){if(e.showFlag)return new jV;let t=[];for(let n of e.positional){let e=n.indexOf(`=`);e>0&&t.push([n.slice(0,e),n.slice(e+1)])}return new AV([...e.setOption,...t])}},NV=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 gF(n,i),o=await _F(n,i,a),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});let l=await hV(n,i,void 0,a);return l.errors.length>0?{success:!1,filesAffected:s,dirsAffected:c,message:l.errors.join(`
415
- `)}:(s+=l.mirroredFiles,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`})}},PV=class{canHandle(e){return e.subcommand===`dry-run`}createCommand(){return new NV}},FV=class{name=`execute`;async execute(e){let{logger:t,outputPlugins:n,createCleanContext:r,createWriteContext:i,collectedOutputContext:a}=e;t.info(`started`,{command:`execute`,pluginCount:n.length,projectCount:a.workspace.projects.length,workspaceDir:a.workspace.directory.path});let o=i(!1);t.info(`execute phase started`,{phase:`collect-output-declarations`});let s=await gF(n,o),c=[...s.values()].reduce((e,t)=>e+t.length,0);t.info(`execute phase complete`,{phase:`collect-output-declarations`,pluginCount:s.size,declarationCount:c}),t.info(`execute phase started`,{phase:`cleanup-before-write`});let l=await BB(n,r(!1),t,s);if(l.violations.length>0||l.conflicts.length>0)return t.info(`execute halted`,{phase:`cleanup-before-write`,conflicts:l.conflicts.length,violations:l.violations.length,...l.message==null?{}:{message:l.message}}),{success:!1,filesAffected:0,dirsAffected:0,...l.message==null?{}:{message:l.message}};t.info(`execute phase complete`,{phase:`cleanup-before-write`,deletedFiles:l.deletedFiles,deletedDirs:l.deletedDirs}),t.info(`execute phase started`,{phase:`write-output-files`,declarationCount:c});let u=await _F(n,o,s),d=0,f=0,p=[];for(let e of u.values()){d+=e.files.length,f+=e.dirs.length;for(let t of e.files)t.success||p.push(t.error?.message??`Failed to write ${t.path}`)}if(t.info(`execute phase complete`,{phase:`write-output-files`,pluginCount:u.size,filesAffected:d,dirsAffected:f,writeErrors:p.length}),p.length>0)return t.info(`execute halted`,{phase:`write-output-files`,writeErrors:p.length}),{success:!1,filesAffected:d,dirsAffected:f,message:p.join(`
416
- `)};t.info(`execute phase started`,{phase:`sync-wsl-mirrors`});let m=await hV(n,o,void 0,s);return m.errors.length>0?(t.info(`execute halted`,{phase:`sync-wsl-mirrors`,mirroredFiles:m.mirroredFiles,errors:m.errors.length}),{success:!1,filesAffected:d,dirsAffected:f,message:m.errors.join(`
417
- `)}):(d+=m.mirroredFiles,t.info(`execute phase complete`,{phase:`sync-wsl-mirrors`,mirroredFiles:m.mirroredFiles,warnings:m.warnings.length,errors:m.errors.length}),t.info(`complete`,{command:`execute`,pluginCount:u.size,filesAffected:d,dirsAffected:f}),{success:!0,filesAffected:d,dirsAffected:f})}},IV=class{canHandle(){return!0}createCommand(){return new FV}};function LV(){return typeof __CLI_VERSION__<`u`?__CLI_VERSION__:`dev`}var RV=class{name=`version`;async execute(e){return e.logger.info(`tnmsc v${LV()}`),{success:!0,filesAffected:0,dirsAffected:0,message:`Version displayed`}}};const zV=`tnmsc`,BV=[`workspaceDir`,`logLevel`,...Jh].join(`,
418
- `),VV=`
419
- ${zV} v${LV()} - Memory Sync CLI
413
+ `)}};const kz=`.zed`;var Az=class extends nF{constructor(){super(`ZedIDEConfigOutputPlugin`,{cleanup:{delete:{project:{files:[`.zed/settings.json`]}}},capabilities:{}})}async declareOutputFiles(e){let t=[],{projects:n}=e.collectedOutputContext.workspace,r=e.collectedOutputContext.zedConfigFiles??[];for(let e of n){let n=e.dirFromWorkspacePath;if(n!=null)for(let e of r){let r=this.getTargetRelativePath(e);t.push({path:this.resolvePath(n.basePath,n.path,r),scope:`project`,source:{content:e.content}})}}return t}async convertContent(e,t){let n=e.source;if(n.content==null)throw Error(`Unsupported declaration source for ${this.name}`);return n.content}getTargetRelativePath(e){let t=e.dir.path;if(e.type!==GM.Zed)return this.basename(t);let n=t.indexOf(kz);return n===-1?this.joinPath(kz,`settings.json`):t.slice(Math.max(0,n))}};const jz=`.src.mdx`,Mz=`.mdx`,Nz=`skill`,Pz=new Set([`project-memory`,`project-child-memory`]);function Fz(e){return e.replaceAll(`\\`,`/`)}function Iz(e,t){let n=Fz(e).trim();if(n.length===0)throw Error(`${t} cannot be empty`);let r=n.split(`/`);for(let e of r)if(e.length===0||e===`.`||e===`..`)throw Error(`${t} contains an invalid path segment`);return r.join(`/`)}function Lz(e){return!Fz(e).includes(`/`)}function Rz(e,t){let n=e;return n.includes(rF.WORKSPACE)&&(n=n.replace(rF.WORKSPACE,t)),ag(n)}function zz(e={}){let{cwd:t,loadUserConfig:n=!0,pluginOptions:r={}}=e,i={};if(n){let e=JF().load(t);e.found&&(i=BL(e.config))}let a=VL(i,r),o=Rz(a.workspaceDir,``);return{options:a,workspaceDir:o,aindexDir:s.join(o,a.aindex.dir)}}function Bz(e){return e.endsWith(jz)?`${e.slice(0,-8)}${Mz}`:s.extname(e)===Mz?e:`${e}${Mz}`}function Vz(e){return e.endsWith(jz)?e.slice(0,-8):e.endsWith(Mz)?e.slice(0,-4):e}function Hz(e,n){return t.existsSync(e)&&t.statSync(e).isDirectory()?Th.default.sync([...n],{cwd:e,dot:!0,onlyFiles:!0}).map(Fz):[]}function Uz(e){let t=s.join(e.aindexDir,e.options.aindex.globalPrompt.src);return{promptId:`global-memory`,kind:`global-memory`,logicalName:`global-memory`,paths:{zh:t,en:Bz(t),dist:s.join(e.aindexDir,e.options.aindex.globalPrompt.dist)}}}function Wz(e){let t=s.join(e.aindexDir,e.options.aindex.workspacePrompt.src);return{promptId:`workspace-memory`,kind:`workspace-memory`,logicalName:`workspace-memory`,paths:{zh:t,en:Bz(t),dist:s.join(e.aindexDir,e.options.aindex.workspacePrompt.dist)}}}function Gz(e,t,n,r){let i=Iz(n,`projectName`);if(!Lz(i))throw Error(`projectName must be a single path segment`);let a=r==null?``:Iz(r,`relativeName`),o=$F(e.options,t),c=a.length===0?s.join(e.aindexDir,o.src,i):s.join(e.aindexDir,o.src,i,a),l=a.length===0?s.join(e.aindexDir,o.dist,i):s.join(e.aindexDir,o.dist,i,a),u=s.join(c,`agt${Mz}`),d=a.length===0?`${t}/${i}`:`${t}/${i}/${a}`;return{promptId:a.length===0?`project-memory:${d}`:`project-child-memory:${d}`,kind:a.length===0?`project-memory`:`project-child-memory`,logicalName:d,paths:{zh:s.join(c,`agt${jz}`),en:u,dist:s.join(l,`agt${Mz}`)},legacyZhPath:u}}function Kz(e,t){let n=Iz(t,`skillName`);if(!Lz(n))throw Error(`skillName must be a single path segment`);let r=s.join(e.aindexDir,e.options.aindex.skills.src,n),i=s.join(e.aindexDir,e.options.aindex.skills.dist,n);return{promptId:`skill:${n}`,kind:`skill`,logicalName:n,paths:{zh:s.join(r,`${Nz}${jz}`),en:s.join(r,`${Nz}${Mz}`),dist:s.join(i,`${Nz}${Mz}`)}}}function qz(e,t,n){let r=Iz(t,`skillName`),i=Iz(n,`relativeName`);if(!Lz(r))throw Error(`skillName must be a single path segment`);let a=s.join(e.aindexDir,e.options.aindex.skills.src,r),o=s.join(e.aindexDir,e.options.aindex.skills.dist,r);return{promptId:`skill-child-doc:${r}/${i}`,kind:`skill-child-doc`,logicalName:`${r}/${i}`,paths:{zh:s.join(a,`${i}${jz}`),en:s.join(a,`${i}${Mz}`),dist:s.join(o,`${i}${Mz}`)}}}function Jz(e,t,n){let r=Iz(n,`relativeName`),i=t===`command`?s.join(e.aindexDir,e.options.aindex.commands.src):t===`subagent`?s.join(e.aindexDir,e.options.aindex.subAgents.src):s.join(e.aindexDir,e.options.aindex.rules.src),a=t===`command`?s.join(e.aindexDir,e.options.aindex.commands.dist):t===`subagent`?s.join(e.aindexDir,e.options.aindex.subAgents.dist):s.join(e.aindexDir,e.options.aindex.rules.dist);return{promptId:`${t}:${r}`,kind:t,logicalName:r,paths:{zh:s.join(i,`${r}${jz}`),en:s.join(i,`${r}${Mz}`),dist:s.join(a,`${r}${Mz}`)}}}function Yz(e){switch(e){case`global-memory`:return{kind:`global-memory`};case`workspace-memory`:return{kind:`workspace-memory`};default:break}let t=e.indexOf(`:`);if(t===-1)throw Error(`Unsupported promptId: ${e}`);let n=e.slice(0,t),r=Iz(e.slice(t+1),`promptId`);switch(n){case`project-memory`:return Xz(n,r);case`project-child-memory`:return Xz(n,r);case`skill`:if(!Lz(r))throw Error(`skill promptId must include a single skill name`);return{kind:n,skillName:r};case`skill-child-doc`:{let[e,...t]=r.split(`/`),i=t.join(`/`);if(e==null||i.length===0)throw Error(`skill-child-doc promptId must include skill and child path`);return{kind:n,skillName:e,relativeName:i}}case`command`:case`subagent`:case`rule`:return{kind:n,relativeName:r};default:throw Error(`Unsupported promptId: ${e}`)}}function Xz(e,t){let n=t.split(`/`),r=n[0],i=r!=null&&ZF(r);if(e===`project-memory`){if(i){let t=n[1];if(t==null||n.length!==2)throw Error(`project-memory promptId must include exactly one project name after the series`);return{kind:e,seriesName:r,projectName:t}}if(!Lz(t))throw Error(`project-memory promptId must include a single project name`);return{kind:e,seriesName:`app`,projectName:t}}if(i){let t=n[1],i=n.slice(2).join(`/`);if(t==null||i.length===0)throw Error(`project-child-memory promptId must include series, project, and child path`);return{kind:e,seriesName:r,projectName:t,relativeName:i}}let[a,...o]=n,s=o.join(`/`);if(a==null||s.length===0)throw Error(`project-child-memory promptId must include project and child path`);return{kind:e,seriesName:`app`,projectName:a,relativeName:s}}function Zz(e,t){let n=Yz(e);switch(n.kind){case`global-memory`:return Uz(t);case`workspace-memory`:return Wz(t);case`project-memory`:if(n.projectName==null)throw Error(`project-memory promptId must include a project name`);return Gz(t,n.seriesName??`app`,n.projectName);case`project-child-memory`:if(n.projectName==null||n.relativeName==null)throw Error(`project-child-memory promptId must include project and child path`);return Gz(t,n.seriesName??`app`,n.projectName,n.relativeName);case`skill`:if(n.skillName==null)throw Error(`skill promptId must include a skill name`);return Kz(t,n.skillName);case`skill-child-doc`:if(n.skillName==null||n.relativeName==null)throw Error(`skill-child-doc promptId must include skill and child path`);return qz(t,n.skillName,n.relativeName);case`command`:case`subagent`:case`rule`:if(n.relativeName==null)throw Error(`${n.kind} promptId must include a relative path`);return Jz(t,n.kind,n.relativeName)}}function Qz(e,t){let n=t===`command`?s.join(e.aindexDir,e.options.aindex.commands.src):t===`subagent`?s.join(e.aindexDir,e.options.aindex.subAgents.src):s.join(e.aindexDir,e.options.aindex.rules.src),r=t===`command`?s.join(e.aindexDir,e.options.aindex.commands.dist):t===`subagent`?s.join(e.aindexDir,e.options.aindex.subAgents.dist):s.join(e.aindexDir,e.options.aindex.rules.dist),i=new Set;for(let e of Hz(n,[`**/*${jz}`,`**/*${Mz}`]))i.add(Vz(e));for(let e of Hz(r,[`**/*${Mz}`]))i.add(Vz(e));return[...i].sort().map(e=>`${t}:${e}`)}function $z(e){let n=s.join(e.aindexDir,e.options.aindex.skills.src),r=s.join(e.aindexDir,e.options.aindex.skills.dist),i=new Set;if(t.existsSync(n)&&t.statSync(n).isDirectory())for(let e of t.readdirSync(n,{withFileTypes:!0}))e.isDirectory()&&i.add(e.name);if(t.existsSync(r)&&t.statSync(r).isDirectory())for(let e of t.readdirSync(r,{withFileTypes:!0}))e.isDirectory()&&i.add(e.name);let a=[];for(let e of[...i].sort()){a.push(`skill:${e}`);let t=s.join(n,e),i=s.join(r,e),o=new Set;for(let e of Hz(t,[`**/*${jz}`,`**/*${Mz}`])){let t=Vz(e);t!==Nz&&o.add(t)}for(let e of Hz(i,[`**/*${Mz}`])){let t=Vz(e);t!==Nz&&o.add(t)}for(let t of[...o].sort())a.push(`skill-child-doc:${e}/${t}`)}return a}function eB(e){let t=[];for(let n of QF(e.options)){let r=s.join(e.aindexDir,n.src),i=s.join(e.aindexDir,n.dist),a=new Set;for(let e of Hz(r,[`**/agt${jz}`,`**/agt${Mz}`])){let t=Fz(s.posix.dirname(Fz(e)));t!==`.`&&a.add(t)}for(let e of Hz(i,[`**/agt${Mz}`])){let t=Fz(s.posix.dirname(Fz(e)));t!==`.`&&a.add(t)}for(let e of[...a].sort()){let[r,...i]=e.split(`/`),a=i.join(`/`);r==null||r.length===0||t.push(a.length===0?`project-memory:${n.name}/${r}`:`project-child-memory:${n.name}/${r}/${a}`)}}return t}function tB(e){let n=new Set,r=Uz(e),i=Wz(e);(t.existsSync(r.paths.zh)||t.existsSync(r.paths.en)||t.existsSync(r.paths.dist))&&n.add(r.promptId),(t.existsSync(i.paths.zh)||t.existsSync(i.paths.en)||t.existsSync(i.paths.dist))&&n.add(i.promptId);for(let t of eB(e))n.add(t);for(let t of $z(e))n.add(t);for(let t of Qz(e,`command`))n.add(t);for(let t of Qz(e,`subagent`))n.add(t);for(let t of Qz(e,`rule`))n.add(t);return[...n].sort()}function nB(e){try{return $f(e).yamlFrontMatter}catch{return}}function rB(e,n,r=!1){if(!(t.existsSync(e)&&t.statSync(e).isFile()))return;let i=t.statSync(e),a=n?t.readFileSync(e,`utf8`):void 0,o={path:e,exists:!0,mtime:i.mtime.toISOString(),mtimeMs:i.mtimeMs,size:i.size,...r?{legacySource:!0}:{},...a==null?{}:{content:a}},s=a==null?void 0:nB(a);return s!=null&&Object.assign(o,{frontMatter:s}),o}function iB(e,t){return t==null?`missing`:e!=null&&t.mtimeMs<e.mtimeMs?`stale`:`ready`}function aB(e,n){let r=t.existsSync(e.paths.zh),{legacyZhPath:i}=e,a=!r&&i!=null&&t.existsSync(i),o=r?e.paths.zh:a?i:void 0,s=o==null?void 0:rB(o,n,a),c=r||i!==e.paths.en?rB(e.paths.en,n):void 0,l=rB(e.paths.dist,n);if(s==null&&c==null&&l==null)return null;let u=[s,c,l].filter(e=>e!=null).sort((e,t)=>t.mtimeMs-e.mtimeMs)[0]?.mtime,d={promptId:e.promptId,kind:e.kind,logicalName:e.logicalName,paths:e.paths,exists:{zh:s!=null,en:c!=null,dist:l!=null},enStatus:iB(s,c),distStatus:iB(s,l),...u==null?{}:{updatedAt:u},...s?.legacySource===!0?{legacyZhSource:!0}:{},src:{...s==null?{}:{zh:s},...c==null?{}:{en:c}}};l!=null&&Object.assign(d,{dist:l});let f=s?.frontMatter??c?.frontMatter??l?.frontMatter;return f!=null&&Object.assign(d,{frontMatter:f}),d}function oB(e,t){return t==null||t.length===0?!0:t.includes(e)}function sB(e,t){if(t==null||t.trim().length===0)return!0;let n=t.trim().toLowerCase();return e.promptId.toLowerCase().includes(n)||e.logicalName.toLowerCase().includes(n)}function cB(e){return{promptId:e.promptId,kind:e.kind,logicalName:e.logicalName,paths:e.paths,exists:e.exists,enStatus:e.enStatus,distStatus:e.distStatus,...e.updatedAt==null?{}:{updatedAt:e.updatedAt},...e.legacyZhSource===!0?{legacyZhSource:!0}:{}}}function lB(e){return Pz.has(e.kind)}function uB(e,n){t.mkdirSync(s.dirname(e),{recursive:!0}),t.writeFileSync(e,n,`utf8`)}function dB(e){if(!lB(e)||t.existsSync(e.paths.zh)||e.legacyZhPath==null||!t.existsSync(e.legacyZhPath))return;let n=t.readFileSync(e.legacyZhPath,`utf8`);uB(e.paths.zh,n)}function fB(e){lB(e)&&(e.legacyZhPath==null||e.legacyZhPath===e.paths.zh||t.existsSync(e.legacyZhPath)&&t.rmSync(e.legacyZhPath,{force:!0}))}async function pB(e={}){let t=zz(e);return tB(t).map(e=>aB(Zz(e,t),!1)).filter(e=>e!=null).map(cB).filter(t=>oB(t.kind,e.kinds)).filter(t=>oB(t.enStatus,e.enStatus)).filter(t=>oB(t.distStatus,e.distStatus)).filter(t=>sB(t,e.query)).sort((e,t)=>e.promptId.localeCompare(t.promptId))}async function mB(e,t={}){return aB(Zz(e,zz(t)),!0)}async function hB(e){let t=zz(e),n=e.locale??`zh`,r=Zz(e.promptId,t);n===`zh`?(uB(r.paths.zh,e.content),fB(r)):(dB(r),uB(r.paths.en,e.content));let i=aB(r,!0);if(i==null)throw Error(`Failed to load prompt after write: ${e.promptId}`);return i}async function gB(e){if(e.enContent==null&&e.distContent==null)throw Error(`writePromptArtifacts requires enContent or distContent`);let t=zz(e),n=Zz(e.promptId,t);e.enContent!=null&&(dB(n),uB(n.paths.en,e.enContent)),e.distContent!=null&&uB(n.paths.dist,e.distContent);let r=aB(n,!0);if(r==null)throw Error(`Failed to load prompt after write: ${e.promptId}`);return r}async function _B(e,t={}){return Zz(e,zz(t)).paths}const vB=[`aindex.config.ts`,`aindex.config.mts`,`aindex.config.cts`,`aindex.config.js`,`aindex.config.mjs`,`aindex.config.cjs`],yB={emptyDirCleanup:{exclude:[]}};var bB=class{logger;constructor(){this.logger=om(`AindexProjectConfigLoader`)}async loadFromDirectory(e){for(let n of vB){let r=s.join(e,n);if(t.existsSync(r))return this.loadFromFile(r)}return{config:yB,source:null,found:!1}}async loadFromFile(e){try{let n=s.resolve(e);if(!t.existsSync(n))return{config:yB,source:null,found:!1};let r=await import(n),i=typeof r==`object`&&r?`default`in r?r.default:`config`in r?r.config:r:r,a=this.normalizeConfig(i);return this.logger.debug(`aindex project config loaded`,{source:n}),{config:a,source:n,found:!0}}catch(t){return this.logger.warn({code:`AINDEX_CONFIG_LOAD_FAILED`,title:`aindex project config load failed`,rootCause:[t instanceof Error?t.message:String(t)],details:{path:e}}),{config:yB,source:null,found:!1}}}normalizeConfig(e){if(typeof e!=`object`||!e)return yB;let t=e.emptyDirCleanup;return t!=null&&typeof t!=`object`?{}:{emptyDirCleanup:{exclude:xB(t.exclude)}}}};function xB(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):typeof e==`string`?[e]:[]}let SB=null;function CB(){return SB??=new bB,SB}async function wB(e){return CB().loadFromDirectory(e)}let TB=null;var EB=class extends Error{conflicts;constructor(e){super(FB(e)),this.name=`CleanupProtectionConflictError`,this.conflicts=e}};function DB(){if(TB!==null)return TB;let e=XM();return TB=e?.planCleanup!=null&&e.performCleanup!=null,TB}function OB(){let e=XM();if(e==null)throw Error(`Native cleanup binding is required. Build or install the Rust NAPI package before running tnmsc.`);return e}function kB(e){return e}function AB(e){return e}function jB(e){return{path:e.path,kind:e.kind,...e.excludeBasenames!=null&&e.excludeBasenames.length>0?{excludeBasenames:[...e.excludeBasenames]}:{},...e.protectionMode==null?{}:{protectionMode:kB(e.protectionMode)},...e.scope==null?{}:{scope:e.scope},...e.label==null?{}:{label:e.label}}}async function MB(e,t){if(e.declareCleanupPaths==null)return{};let n=await e.declareCleanupPaths({...t,dryRun:!0});return{...n.delete==null?{}:{delete:YN(n.delete,t.executionPlan,t.collectedOutputContext)},...n.protect==null?{}:{protect:YN(n.protect,t.executionPlan,t.collectedOutputContext)},...n.excludeScanGlobs==null?{}:{excludeScanGlobs:n.excludeScanGlobs}}}async function NB(e,t,n){let r=YN(n?.get(e)??await e.declareOutputFiles({...t,dryRun:!0}),t.executionPlan,t.collectedOutputContext),i=await MB(e,t);return{pluginName:e.name,outputs:r.map(e=>e.path),cleanup:{...i.delete!=null&&i.delete.length>0?{delete:i.delete.map(jB)}:{},...i.protect!=null&&i.protect.length>0?{protect:i.protect.map(jB)}:{},...i.excludeScanGlobs!=null&&i.excludeScanGlobs.length>0?{excludeScanGlobs:[...i.excludeScanGlobs]}:{}}}}function PB(e){return(e.pluginOptions?.cleanupProtection?.rules??[]).map(e=>({path:e.path,protectionMode:kB(e.protectionMode),reason:e.reason??`configured cleanup protection rule`,source:`configured-cleanup-protection`,matcher:AB(e.matcher??`path`)}))}function FB(e){let t=e.map(e=>e.outputPath).join(`, `);return`Cleanup protection conflict: ${e.length} output path(s) are also protected: ${t}`}function IB(e,t){let n=t[0];e.error(dp({code:`CLEANUP_PROTECTION_CONFLICT_DETECTED`,title:`Cleanup output paths conflict with protected inputs`,rootCause:q(`tnmsc found ${t.length} output path(s) that also match protected cleanup rules.`,n==null?`No conflict details were captured.`:`Example conflict: "${n.outputPath}" is protected by "${n.protectedPath}".`),exactFix:q(`Separate generated output paths from protected source or reserved workspace paths before running cleanup again.`),possibleFixes:[q(`Update cleanup protect declarations so they do not overlap generated outputs.`),q(`Move the conflicting output target to a generated-only directory.`)],details:{count:t.length,conflicts:t}}))}function LB(e,t){e.debug(`cleanup plan built`,{filesToDelete:t.filesToDelete.length,dirsToDelete:t.dirsToDelete.length+t.emptyDirsToDelete.length,emptyDirsToDelete:t.emptyDirsToDelete.length,violations:t.violations.length,conflicts:t.conflicts.length,excludedScanGlobs:t.excludedScanGlobs})}function RB(e){let t=new Set;for(let n of e.pluginSnapshots){for(let e of n.outputs)t.add(s.resolve(e));for(let e of n.cleanup.delete??[])e.kind===`file`&&t.add(s.resolve(e.path))}return t}function zB(e,t){if(t.size===0||e.violations.length===0)return e;let n=new Set(e.filesToDelete.map(e=>s.resolve(e))),r=[];for(let i of e.violations){let e=s.resolve(i.targetPath);if(t.has(e)){n.add(e);continue}r.push(i)}return{...e,filesToDelete:[...n].sort((e,t)=>e.localeCompare(t)),violations:r}}function BB(e){return{pluginCount:e.pluginSnapshots.length,outputCount:e.pluginSnapshots.reduce((e,t)=>e+t.outputs.length,0),cleanupDeleteCount:e.pluginSnapshots.reduce((e,t)=>e+(t.cleanup.delete?.length??0),0),cleanupProtectCount:e.pluginSnapshots.reduce((e,t)=>e+(t.cleanup.protect?.length??0),0),cleanupExcludeScanGlobs:e.pluginSnapshots.reduce((e,t)=>e+(t.cleanup.excludeScanGlobs?.length??0),0),protectedRuleCount:e.protectedRules.length,projectRootCount:e.projectRoots.length,emptyDirExcludeGlobs:e.emptyDirExcludeGlobs?.length??0}}function VB(e,t){return t.map(t=>{let n=t.kind===`directory`?`directory`:`file`;return e.warn(hp({code:n===`file`?`CLEANUP_FILE_DELETE_FAILED`:`CLEANUP_DIRECTORY_DELETE_FAILED`,title:n===`file`?`Cleanup could not delete a file`:`Cleanup could not delete a directory`,operation:`delete`,targetKind:n,path:t.path,error:t.error,details:{phase:`cleanup`}})),{path:t.path,type:n,error:t.error}})}async function HB(e,t,n){let r=await Promise.all(e.map(async e=>NB(e,t,n))),i=new Set;for(let e of r)if(e.cleanup.delete!=null)for(let t of e.cleanup.delete)i.add(s.resolve(t.path));let a=[];for(let e of Og(t.collectedOutputContext))i.has(s.resolve(e.path))||a.push({path:e.path,protectionMode:kB(e.protectionMode),reason:e.reason,source:e.source,...e.matcher==null?{}:{matcher:AB(e.matcher)}});a.push(...PB(t));let o;if(t.collectedOutputContext.aindexDir!=null){let e=await wB(t.collectedOutputContext.aindexDir);if(e.found){let t=e.config.emptyDirCleanup?.exclude;t!=null&&t.length>0&&(o=[...t])}}return{workspaceDir:t.collectedOutputContext.workspace.directory.path,...t.collectedOutputContext.aindexDir==null?{}:{aindexDir:t.collectedOutputContext.aindexDir},projectRoots:jg(t.collectedOutputContext),protectedRules:a,pluginSnapshots:r,...o!=null&&o.length>0?{emptyDirExcludeGlobs:o}:{}}}function UB(e){return JSON.parse(e)}async function WB(e){let t=OB();if(t?.planCleanup==null)throw Error(`Native cleanup planning is unavailable`);return UB(await Promise.resolve(t.planCleanup(JSON.stringify(e))))}async function GB(e){let t=OB();if(t?.performCleanup==null)throw Error(`Native cleanup execution is unavailable`);return UB(await Promise.resolve(t.performCleanup(JSON.stringify(e))))}async function KB(e,t,n){t.logger.info(`cleanup planning started`,{phase:`cleanup-plan`,dryRun:t.dryRun===!0,pluginCount:e.length,workspaceDir:t.collectedOutputContext.workspace.directory.path});let r=await HB(e,t,n);t.logger.info(`cleanup snapshot prepared`,{phase:`cleanup-plan`,...BB(r)});let i=zB(await WB(r),RB(r));if(t.logger.info(`cleanup planning complete`,{phase:`cleanup-plan`,filesToDelete:i.filesToDelete.length,dirsToDelete:i.dirsToDelete.length+i.emptyDirsToDelete.length,emptyDirsToDelete:i.emptyDirsToDelete.length,violations:i.violations.length,conflicts:i.conflicts.length}),i.conflicts.length>0)throw new EB(i.conflicts);return{filesToDelete:i.filesToDelete,dirsToDelete:i.dirsToDelete.sort((e,t)=>e.localeCompare(t)),emptyDirsToDelete:i.emptyDirsToDelete.sort((e,t)=>e.localeCompare(t)),violations:[...i.violations],conflicts:[],excludedScanGlobs:i.excludedScanGlobs}}async function qB(e,t,n,r){if(n.info(`cleanup execution started`,{phase:`cleanup-execute`,dryRun:t.dryRun===!0,pluginCount:e.length,workspaceDir:t.collectedOutputContext.workspace.directory.path}),r!=null){let i=await $P(e,t,r);n.info(`cleanup outputs collected`,{phase:`cleanup-execute`,projectDirs:i.projectDirs.length,projectFiles:i.projectFiles.length,globalDirs:i.globalDirs.length,globalFiles:i.globalFiles.length})}let i=await HB(e,t,r);n.info(`cleanup snapshot prepared`,{phase:`cleanup-execute`,...BB(i)}),n.info(`cleanup native execution started`,{phase:`cleanup-execute`,pluginCount:i.pluginSnapshots.length,outputCount:i.pluginSnapshots.reduce((e,t)=>e+t.outputs.length,0)});let a=zB(await GB(i),RB(i));if(n.info(`cleanup native execution finished`,{phase:`cleanup-execute`,deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,plannedFiles:a.filesToDelete.length,plannedDirs:a.dirsToDelete.length+a.emptyDirsToDelete.length,emptyDirsToDelete:a.emptyDirsToDelete.length,violations:a.violations.length,conflicts:a.conflicts.length,errors:a.errors.length}),LB(n,a),a.conflicts.length>0)return IB(n,a.conflicts),n.info(`cleanup execution blocked`,{phase:`cleanup-execute`,reason:`conflicts`,conflicts:a.conflicts.length}),{deletedFiles:0,deletedDirs:0,errors:[],violations:[],conflicts:a.conflicts,message:FB(a.conflicts)};if(a.violations.length>0)return Ig(n,`cleanup`,a.violations),n.info(`cleanup execution blocked`,{phase:`cleanup-execute`,reason:`protected-path-violations`,violations:a.violations.length}),{deletedFiles:0,deletedDirs:0,errors:[],violations:a.violations,conflicts:[],message:`Protected deletion guard blocked cleanup for ${a.violations.length} path(s)`};n.debug(`cleanup delete execution started`,{filesToDelete:a.filesToDelete.length,dirsToDelete:a.dirsToDelete.length+a.emptyDirsToDelete.length,emptyDirsToDelete:a.emptyDirsToDelete.length});let o=VB(n,a.errors);return n.debug(`cleanup delete execution complete`,{deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,errors:o.length}),n.info(`cleanup execution complete`,{phase:`cleanup-execute`,deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,errors:o.length}),{deletedFiles:a.deletedFiles,deletedDirs:a.deletedDirs,errors:o,violations:[],conflicts:[]}}var JB=class extends Error{};function YB(e){return e?.fs??t}function XB(e){return e?.spawnSync??f}function ZB(e){return e?.platform??a.platform}function QB(e){return e?.effectiveHomeDir??ng()}function $B(e){return e?.nativeHomeDir??tg().nativeHomeDir}function eV(e){return e?.isWsl??tg().isWsl}function tV(e){return e===`win32`?s.win32:s.posix}function nV(e){return[...new Set(e.map(e=>e.trim()).filter(e=>e.length>0))]}function rV(e){let t=e?.windows?.wsl2?.instances;return nV(t==null?[]:Array.isArray(t)?t:[t])}function iV(e,t){if(!t.startsWith(`/`))throw Error(`WSL instance "${e}" returned a non-absolute home path: "${t}".`);let n=t.split(`/`).filter(e=>e.length>0);return s.win32.join(`\\\\wsl$\\${e}`,...n)}function aV(e,t,n){let r=tV(n),i=r.normalize(t),a=r.normalize(e),o=r.relative(i,a);if(o.length===0||o.startsWith(`..`)||r.isAbsolute(o))throw Error(`WSL mirror source "${e}" must stay under the host home directory "${t}".`);return o.split(/[\\/]+/u).filter(e=>e.length>0)}function oV(e){if(typeof e==`string`)return e;if(!m.isBuffer(e)||e.length===0)return``;let t=e.length>=2&&e[0]===255&&e[1]===254,n=e.length>=2&&e[0]===254&&e[1]===255;if(t||n)return e.toString(`utf16le`).replace(/^\uFEFF/u,``);let r=e.toString(`utf8`);return r.includes(`\0`)?e.toString(`utf16le`).replace(/^\uFEFF/u,``):r}function sV(e){return oV(e).replaceAll(`\0`,``)}function cV(e){let{error:t}=e;if(!(typeof t!=`object`||!t))return`code`in t&&typeof t.code==`string`?t.code:void 0}function lV(e){if(cV(e)===`ENOENT`)return`wsl.exe is not available on PATH.`;let t=[e.stderr,e.stdout].map(e=>sV(e).trim()).filter(e=>e.length>0).join(`
414
+ `).toLowerCase();if(t.length!==0)return[`windows subsystem for linux has no installed distributions`,`windows subsystem for linux has not been enabled`,`the windows subsystem for linux optional component is not enabled`,`wsl is not installed`,`run 'wsl.exe --install'`,`run "wsl.exe --install"`,`wslregisterdistribution failed with error: 0x8007019e`].some(e=>t.includes(e))?t:void 0}async function uV(e,t){let n=await Promise.all(e.map(async e=>e.declareWslMirrorFiles==null?[]:e.declareWslMirrorFiles(t))),r=new Map;for(let e of n)for(let t of e)r.set(t.sourcePath,t);return[...r.values()]}function dV(e){return{platform:`win32`,isWsl:!1,nativeHomeDir:e,effectiveHomeDir:e,globalConfigCandidates:[],windowsUsersRoot:``,expandedEnv:{HOME:e,USERPROFILE:e}}}function fV(e,t){return{platform:`linux`,isWsl:!0,nativeHomeDir:t,effectiveHomeDir:e,globalConfigCandidates:[],windowsUsersRoot:``,expandedEnv:{HOME:e,USERPROFILE:e}}}function pV(e){return nV(e.split(/\r?\n/u).map(e=>e.replace(/^\*/u,``).trim()).filter(e=>e.length>0))}function mV(e,t){let n=XB(t)(`wsl.exe`,[`--list`,`--quiet`],{shell:!1,windowsHide:!0}),r=lV(n);if(r!=null)throw new JB(r);if(n.status!==0){let e=sV(n.stderr).trim();throw Error(`Failed to enumerate WSL instances. ${e.length>0?e:`wsl.exe returned a non-zero exit status.`}`)}let i=pV(sV(n.stdout));return e.info(`discovered wsl instances`,{instances:i}),i}function hV(e,t,n){let r=rV(e);return r.length>0?r:mV(t,n)}function gV(e,t,n){if(e.scope!==`global`)return;let r=tV(n).normalize(e.path),i;try{i=aV(r,t,n)}catch{return}let[a]=i;if(a?.startsWith(`.`))return{kind:`generated`,sourcePath:r,relativePathSegments:i}}function _V(e,t,n){if(e==null)return[];let r=new Map;for(let i of e.values())for(let e of i){let i=gV(e,t,n);i!=null&&r.set(i.sourcePath,i)}return[...r.values()]}function vV(e,t,n,r){let i=tV(r).normalize(ag(e.sourcePath,t));return{kind:`declared`,sourcePath:i,relativePathSegments:aV(i,n,r)}}function yV(e,t,n,r,i){let a=new Map,o=[];for(let t of e)try{let e=vV(t,n,r,i);a.set(e.sourcePath,e)}catch(e){o.push(e instanceof Error?e.message:String(e))}for(let e of t)a.set(e.sourcePath,e);return{sources:[...a.values()],errors:o}}function bV(e,t,n){if(ZB(n)!==`win32`)return[];let r=hV(e,t,n);if(r.length===0)return[];let i=YB(n),a=XB(n),o=[];for(let e of r){let n=a(`wsl.exe`,[`-d`,e,`sh`,`-lc`,`printf %s "$HOME"`],{shell:!1,windowsHide:!0}),r=lV(n);if(r!=null)throw new JB(r);if(n.status!==0){let t=sV(n.stderr).trim();throw Error(`Failed to probe WSL instance "${e}". ${t.length>0?t:`wsl.exe returned a non-zero exit status.`}`)}let s=sV(n.stdout).trim();if(s.length===0)throw Error(`WSL instance "${e}" returned an empty home directory.`);let c=iV(e,s);if(!i.existsSync(c))throw Error(`WSL instance "${e}" home directory is unavailable at "${c}".`);t.info(`resolved wsl instance home`,{instance:e,linuxHomeDir:s,windowsHomeDir:c}),o.push({instance:e,linuxHomeDir:s,windowsHomeDir:c})}return o}function xV(e,t,n){let r=YB(n),i=s.posix.normalize($B(n)),a=0,o=[],c=[];for(let n of e){if(n.kind===`declared`&&!r.existsSync(n.sourcePath)){let e=`Skipping missing WSL mirror source file: ${n.sourcePath}`;o.push(e),t.logger.warn({code:`WSL_MIRROR_SOURCE_MISSING`,title:`WSL mirror source file is missing`,rootCause:[e],exactFix:[`Create the source file on the Windows host or remove the WSL mirror declaration before retrying tnmsc.`]});continue}let e=s.posix.join(i,...n.relativePathSegments);try{if(t.dryRun===!0)t.logger.info(`would mirror host config into wsl runtime home`,{sourcePath:n.sourcePath,targetPath:e,dryRun:!0});else{let i=r.readFileSync(n.sourcePath);r.mkdirSync(s.posix.dirname(e),{recursive:!0}),r.writeFileSync(e,i),t.logger.info(`mirrored host config into wsl runtime home`,{sourcePath:n.sourcePath,targetPath:e})}a+=1}catch(t){c.push(`Failed to mirror "${n.sourcePath}" into the current WSL home at "${e}": ${t instanceof Error?t.message:String(t)}`)}}return{mirroredFiles:a,warnings:o,errors:c}}async function SV(e,t,n,r){let i=ZB(n),a=i===`linux`&&eV(n);if(i!==`win32`&&!a)return{mirroredFiles:0,warnings:[],errors:[]};let o=a?s.posix.normalize(QB(n)):s.win32.normalize(QB(n)),c=await uV(e,t),l=_V(r,o,i);if(c.length===0&&l.length===0)return{mirroredFiles:0,warnings:[],errors:[]};let u=t.pluginOptions??{},d=a?s.posix.normalize($B(n)):void 0,f=yV(c,l,a?fV(o,d??o):dV(o),o,i);if(a){if(f.sources.length===0||d==null||o===d)return{mirroredFiles:0,warnings:[],errors:[...f.errors]};let e=xV(f.sources,t,n);return{mirroredFiles:e.mirroredFiles,warnings:[...e.warnings],errors:[...f.errors,...e.errors]}}let p;try{p=bV(u,t.logger,n)}catch(e){return e instanceof JB?(t.logger.info(`wsl is unavailable, skipping WSL mirror sync`,{reason:e.message}),{mirroredFiles:0,warnings:[],errors:[]}):{mirroredFiles:0,warnings:[],errors:[e instanceof Error?e.message:String(e)]}}if(p.length===0||f.sources.length===0)return{mirroredFiles:0,warnings:[],errors:[...f.errors]};let m=YB(n),h=0,g=[],_=[...f.errors];for(let e of f.sources){if(e.kind===`declared`&&!m.existsSync(e.sourcePath)){let n=`Skipping missing WSL mirror source file: ${e.sourcePath}`;g.push(n),t.logger.warn({code:`WSL_MIRROR_SOURCE_MISSING`,title:`WSL mirror source file is missing`,rootCause:[n],exactFix:[`Create the source file on the Windows host or remove the WSL mirror declaration before retrying tnmsc.`]});continue}let{relativePathSegments:n,sourcePath:r}=e;for(let e of p){let i=s.win32.join(e.windowsHomeDir,...n);try{if(t.dryRun===!0)t.logger.info(`would mirror windows config into wsl`,{instance:e.instance,sourcePath:r,targetPath:i,dryRun:!0});else{let n=m.readFileSync(r);m.mkdirSync(s.win32.dirname(i),{recursive:!0}),m.writeFileSync(i,n),t.logger.info(`mirrored windows config into wsl`,{instance:e.instance,sourcePath:r,targetPath:i})}h+=1}catch(t){_.push(`Failed to mirror "${r}" into WSL instance "${e.instance}" at "${i}": ${t instanceof Error?t.message:String(t)}`)}}}return{mirroredFiles:h,warnings:g,errors:_}}let CV=function(e){return e[e.Flags=0]=`Flags`,e[e.Unknown=1]=`Unknown`,e[e.Subcommand=2]=`Subcommand`,e}({});var wV=class{factories=[];register(e){this.factories.push(e),this.factories.sort((e,t)=>e.priority-t.priority)}registerWithPriority(e,t){let n={priority:t,canHandle:t=>e.canHandle(t),createCommand:t=>e.createCommand(t)};this.factories.push(n),this.factories.sort((e,t)=>e.priority-t.priority)}resolve(e){for(let t of this.factories)if(t.priority<=CV.Unknown&&t.canHandle(e))return t.createCommand(e);for(let t of this.factories)if(t.priority===CV.Subcommand&&t.canHandle(e))return t.createCommand(e);for(let t of this.factories)if(t.canHandle(e))return t.createCommand(e);throw Error(`No command factory found for the given arguments`)}};const TV=[`app`,`ext`,`arch`,`softwares`];function EV(e){return[`Unsupported execution directory "${e.executionPlan.cwd}".`,`The directory is inside workspace "${e.executionPlan.workspaceDir}" but is not managed by tnmsc.`,`Run tnmsc from the workspace root, from a managed project directory, or from outside the workspace.`].join(` `)}function DV(e){for(let t of TV){let n=e.executionPlan.projectsBySeries[t];n.length!==0&&e.logger.info(`external execution project group`,{phase:`execution-scope`,scope:`external`,series:t,projectCount:n.length,projects:n.map(e=>e.name)})}}function OV(e,t,n){e.logger.info(`execution scope resolved to project`,{phase:`execution-scope`,command:t,scope:`project`,cwd:e.executionPlan.cwd,workspaceDir:e.executionPlan.workspaceDir,projectName:n.name,...n.series==null?{}:{projectSeries:n.series}}),e.logger.info(`project-scoped execution only targets the matched project and global outputs`,{phase:`execution-scope`,command:t,projectName:n.name})}function kV(e,t){switch(e.executionPlan.scope){case`workspace`:e.logger.warn(dp({code:`EXECUTION_SCOPE_WORKSPACE`,title:`Execution is limited to workspace-level outputs`,rootCause:q(`tnmsc resolved the current execution directory "${e.executionPlan.cwd}" to the workspace root.`,`This run will sync or clean only workspace-level outputs plus global outputs to improve performance.`),exactFix:q(`Run tnmsc from a managed project directory to target one project, or from outside the workspace to process every managed project.`),details:{phase:`execution-scope`,command:t,scope:`workspace`,cwd:e.executionPlan.cwd,workspaceDir:e.executionPlan.workspaceDir}}));return;case`project`:OV(e,t,e.executionPlan.matchedProject);return;case`external`:e.logger.warn(dp({code:`EXECUTION_SCOPE_EXTERNAL`,title:`Execution will process the full workspace and all managed projects`,rootCause:q(`tnmsc resolved the current execution directory "${e.executionPlan.cwd}" as external to workspace "${e.executionPlan.workspaceDir}".`,`This run may take longer because it will process workspace-level outputs, all managed projects, and global outputs.`),exactFix:q(`Run tnmsc from "${e.executionPlan.workspaceDir}" for workspace-only execution, or from a managed project directory for project-only execution.`),details:{phase:`execution-scope`,command:t,scope:`external`,cwd:e.executionPlan.cwd,workspaceDir:e.executionPlan.workspaceDir}})),DV(e);return;case`unsupported`:{let n=EV(e);return e.logger.error(dp({code:`EXECUTION_SCOPE_UNSUPPORTED`,title:`Execution directory is inside the workspace but not managed by tnmsc`,rootCause:q(`tnmsc resolved "${e.executionPlan.cwd}" inside workspace "${e.executionPlan.workspaceDir}", but the directory is not the workspace root and does not belong to any managed project.`,`Running from this location is unsupported because tnmsc cannot map the request to a workspace-level or project-level execution target.`),exactFix:q(`Run tnmsc from the workspace root, from a managed project directory, or from outside the workspace.`),details:{phase:`execution-scope`,command:t,scope:`unsupported`,cwd:e.executionPlan.cwd,workspaceDir:e.executionPlan.workspaceDir,managedProjectCount:e.executionPlan.managedProjects.length}})),{success:!1,filesAffected:0,dirsAffected:0,message:n}}}}var AV=class{name=`clean`;async execute(e){let t=kV(e,this.name);if(t!=null)return t;let{logger:n,outputPlugins:r,createCleanContext:i,collectedOutputContext:a}=e;n.info(`started`,{command:`clean`,pluginCount:r.length,projectCount:a.workspace.projects.length,workspaceDir:a.workspace.directory.path}),n.info(`clean phase started`,{phase:`cleanup`});let o=await qB(r,i(!1),n);return o.violations.length>0||o.conflicts.length>0?(n.info(`clean halted`,{phase:`cleanup`,conflicts:o.conflicts.length,violations:o.violations.length,...o.message==null?{}:{message:o.message}}),{success:!1,filesAffected:0,dirsAffected:0,...o.message==null?{}:{message:o.message}}):(n.info(`clean phase complete`,{phase:`cleanup`,deletedFiles:o.deletedFiles,deletedDirs:o.deletedDirs,errors:o.errors.length}),n.info(`complete`,{command:`clean`,filesAffected:o.deletedFiles,dirsAffected:o.deletedDirs}),{success:!0,filesAffected:o.deletedFiles,dirsAffected:o.deletedDirs})}},jV=class{name=`dry-run-clean`;async execute(e){let t=kV(e,this.name);if(t!=null)return t;let{logger:n,outputPlugins:r,createCleanContext:i}=e;n.info(`running clean pipeline`,{command:`dry-run-clean`,dryRun:!0});let a=i(!0),o=await $P(r,a);n.info(`collected outputs for cleanup`,{dryRun:!0,projectDirs:o.projectDirs.length,projectFiles:o.projectFiles.length,globalDirs:o.globalDirs.length,globalFiles:o.globalFiles.length});let{filesToDelete:c,dirsToDelete:l,emptyDirsToDelete:u,violations:d,excludedScanGlobs:f}=await KB(r,a),p=[...l,...u];if(d.length>0)return Ig(n,`dry-run-cleanup`,d),{success:!1,filesAffected:0,dirsAffected:0,message:`Protected deletion guard blocked cleanup for ${d.length} path(s)`};for(let e of c)n.info(`would delete file`,{path:s.isAbsolute(e)?e:s.resolve(e),dryRun:!0});for(let e of[...p].sort((e,t)=>t.length-e.length))n.info(`would delete directory`,{path:s.isAbsolute(e)?e:s.resolve(e),dryRun:!0});return n.info(`clean complete`,{dryRun:!0,filesAffected:c.length,dirsAffected:p.length,violations:0,excludedScanGlobs:f}),{success:!0,filesAffected:c.length,dirsAffected:p.length,message:`Dry-run complete, no files were deleted`}}},MV=class{canHandle(e){return e.subcommand===`clean`}createCommand(e){return e.dryRun?new jV:new AV}};const NV=[`workspaceDir`,...aP,`logLevel`];function PV(e){return NV.includes(e)}function FV(e){return[`trace`,`debug`,`info`,`warn`,`error`].includes(e)}function IV(){let e=ig();if(!t.existsSync(e))return{};try{return JSON.parse(t.readFileSync(e,`utf8`))}catch{return{}}}function LV(e){let n=ig(),r=s.dirname(n);t.existsSync(r)||t.mkdirSync(r,{recursive:!0}),t.writeFileSync(n,`${JSON.stringify(e,null,2)}\n`,`utf8`)}function RV(e,t,n){let r=t.split(`.`),i=e;for(let e=0;e<r.length-1;e++){let t=r[e];if(t==null)continue;let n=i[t];(typeof n!=`object`||!n||Array.isArray(n))&&(i[t]={}),i=i[t]}let a=r.at(-1);a!=null&&(i[a]=n)}function zV(e,t){let n=t.split(`.`),r=e;for(let e of n){if(typeof r!=`object`||!r||Array.isArray(r))return;r=r[e]}return r}var BV=class{name=`config`;constructor(e){this.options=e}async execute(e){let{logger:t}=e;if(this.options.length===0)return t.error(vp({code:`CONFIG_COMMAND_ARGUMENTS_MISSING`,title:`Config command requires at least one key=value pair`,rootCause:q(`tnmsc config was invoked without any configuration assignments.`),exactFix:q("Run `tnmsc config key=value` with at least one supported configuration key."),possibleFixes:[q(`Use one of the supported keys: ${NV.join(`, `)}`)],details:{validKeys:[...NV]}})),t.info(`Usage: tnmsc config key=value`),t.info(`Valid keys: ${NV.join(`, `)}`),{success:!1,filesAffected:0,dirsAffected:0,message:`No options provided`};let n;try{n=IV()}catch(e){return{success:!1,filesAffected:0,dirsAffected:0,message:e instanceof Error?e.message:String(e)}}let r=[],i=[];for(let[e,a]of this.options){if(!PV(e)){r.push(`Invalid key: ${e}`),t.error(vp({code:`CONFIG_COMMAND_KEY_INVALID`,title:`Unsupported config key: ${e}`,rootCause:q(`The config command received "${e}", which is not a supported configuration key.`),exactFix:q(`Use one of the supported config keys and rerun the command.`),possibleFixes:[q(`Supported keys: ${NV.join(`, `)}`)],details:{key:e,validKeys:[...NV]}}));continue}if(e===`logLevel`&&!FV(a)){r.push(`Invalid logLevel value: ${a}`),t.error(vp({code:`CONFIG_COMMAND_LOG_LEVEL_INVALID`,title:`Unsupported logLevel value: ${a}`,rootCause:q(`The config command received "${a}" for logLevel, but tnmsc does not support that level.`),exactFix:q(`Set logLevel to one of: trace, debug, info, warn, or error.`),details:{key:e,value:a,validLevels:[`trace`,`debug`,`info`,`warn`,`error`]}}));continue}let o=zV(n,e);RV(n,e,a),o!==a&&i.push(`${e}=${a}`),t.info(`configuration updated`,{key:e,value:a})}if(i.length>0){try{LV(n)}catch(e){return{success:!1,filesAffected:0,dirsAffected:0,message:e instanceof Error?e.message:String(e)}}t.info(`global config written`,{path:ig()})}let a=r.length===0;return{success:a,filesAffected:i.length>0?1:0,dirsAffected:0,message:a?`Configuration updated: ${i.join(`, `)}`:`Partial update: ${i.join(`, `)}. Errors: ${r.join(`, `)}`}}},VV=class{name=`config-show`;async execute(e){let{logger:t}=e,n=new KF,r=n.load(),i=r.sources.map(e=>({path:e,layer:`global`,config:n.loadFromFile(e).config})),o={merged:r.config,sources:i};return a.stdout.write(`${JSON.stringify(o)}\n`),t.info(`config shown`,{sources:r.sources.length}),{success:!0,filesAffected:0,dirsAffected:0,message:`Configuration displayed (${i.length} source(s))`}}},HV=class{canHandle(e){return e.subcommand===`config`}createCommand(e){if(e.showFlag)return new VV;let t=[];for(let n of e.positional){let e=n.indexOf(`=`);e>0&&t.push([n.slice(0,e),n.slice(e+1)])}return new BV([...e.setOption,...t])}},UV=class{name=`dry-run-output`;async execute(e){let t=kV(e,this.name);if(t!=null)return t;let{logger:n,outputPlugins:r,createWriteContext:i}=e;n.info(`started`,{command:`dry-run-output`,dryRun:!0});let a=i(!0),o=await ZP(r,a),s=await QP(r,a,o),c=0,l=0;for(let[e,t]of s)c+=t.files.length,l+=t.dirs.length,n.info(`plugin result`,{plugin:e,files:t.files.length,dirs:t.dirs.length,dryRun:!0});let u=await SV(r,a,void 0,o);return u.errors.length>0?{success:!1,filesAffected:c,dirsAffected:l,message:u.errors.join(`
415
+ `)}:(c+=u.mirroredFiles,n.info(`complete`,{command:`dry-run-output`,totalFiles:c,totalDirs:l,dryRun:!0}),{success:!0,filesAffected:c,dirsAffected:l,message:`Dry-run complete, no files were written`})}},WV=class{canHandle(e){return e.subcommand===`dry-run`}createCommand(){return new UV}},GV=class{name=`execute`;async execute(e){let t=kV(e,this.name);if(t!=null)return t;let{logger:n,outputPlugins:r,createCleanContext:i,createWriteContext:a,collectedOutputContext:o}=e;n.info(`started`,{command:`execute`,pluginCount:r.length,projectCount:o.workspace.projects.length,workspaceDir:o.workspace.directory.path});let s=a(!1);n.info(`execute phase started`,{phase:`collect-output-declarations`});let c=await ZP(r,s),l=[...c.values()].reduce((e,t)=>e+t.length,0);n.info(`execute phase complete`,{phase:`collect-output-declarations`,pluginCount:c.size,declarationCount:l}),n.info(`execute phase started`,{phase:`cleanup-before-write`});let u=await qB(r,i(!1),n,c);if(u.violations.length>0||u.conflicts.length>0)return n.info(`execute halted`,{phase:`cleanup-before-write`,conflicts:u.conflicts.length,violations:u.violations.length,...u.message==null?{}:{message:u.message}}),{success:!1,filesAffected:0,dirsAffected:0,...u.message==null?{}:{message:u.message}};n.info(`execute phase complete`,{phase:`cleanup-before-write`,deletedFiles:u.deletedFiles,deletedDirs:u.deletedDirs}),n.info(`execute phase started`,{phase:`write-output-files`,declarationCount:l});let d=await QP(r,s,c),f=0,p=0,m=[];for(let e of d.values()){f+=e.files.length,p+=e.dirs.length;for(let t of e.files)t.success||m.push(t.error?.message??`Failed to write ${t.path}`)}if(n.info(`execute phase complete`,{phase:`write-output-files`,pluginCount:d.size,filesAffected:f,dirsAffected:p,writeErrors:m.length}),m.length>0)return n.info(`execute halted`,{phase:`write-output-files`,writeErrors:m.length}),{success:!1,filesAffected:f,dirsAffected:p,message:m.join(`
416
+ `)};n.info(`execute phase started`,{phase:`sync-wsl-mirrors`});let h=await SV(r,s,void 0,c);return h.errors.length>0?(n.info(`execute halted`,{phase:`sync-wsl-mirrors`,mirroredFiles:h.mirroredFiles,errors:h.errors.length}),{success:!1,filesAffected:f,dirsAffected:p,message:h.errors.join(`
417
+ `)}):(f+=h.mirroredFiles,n.info(`execute phase complete`,{phase:`sync-wsl-mirrors`,mirroredFiles:h.mirroredFiles,warnings:h.warnings.length,errors:h.errors.length}),n.info(`complete`,{command:`execute`,pluginCount:d.size,filesAffected:f,dirsAffected:p}),{success:!0,filesAffected:f,dirsAffected:p})}},KV=class{canHandle(){return!0}createCommand(){return new GV}};function qV(){return typeof __CLI_VERSION__<`u`?__CLI_VERSION__:`dev`}var JV=class{name=`version`;async execute(e){return e.logger.info(`tnmsc v${qV()}`),{success:!0,filesAffected:0,dirsAffected:0,message:`Version displayed`}}};const YV=`tnmsc`,XV=[`workspaceDir`,`logLevel`,...aP].join(`,
418
+ `),ZV=`
419
+ ${YV} v${qV()} - Memory Sync CLI
420
420
 
421
421
  Synchronize AI memory and configuration files across projects.
422
422
 
423
423
  USAGE:
424
- ${zV} Run the sync pipeline (default)
425
- ${zV} help Show this help message
426
- ${zV} version Show version information
427
- ${zV} init Deprecated; no longer initializes aindex
428
- ${zV} dry-run Preview what would be written
429
- ${zV} clean Remove all generated files
430
- ${zV} clean --dry-run Preview what would be cleaned
431
- ${zV} config key=value Set configuration value
424
+ ${YV} Run the sync pipeline (default)
425
+ ${YV} help Show this help message
426
+ ${YV} version Show version information
427
+ ${YV} dry-run Preview what would be written
428
+ ${YV} clean Remove all generated files
429
+ ${YV} clean --dry-run Preview what would be cleaned
430
+ ${YV} config key=value Set configuration value
432
431
 
433
432
  SUBCOMMANDS:
434
433
  help Show this help message
435
434
  version Show version information
436
- init Deprecated; keep public target-relative definitions manually
437
435
  dry-run Preview changes without writing files
438
436
  clean Remove all generated output files and directories
439
437
  config Set configuration values in global config file (~/.aindex/.tnmsc.json)
440
438
 
441
439
  ALIASES:
442
- ${zV} --help, ${zV} -h Same as '${zV} help'
443
- ${zV} --version, ${zV} -v Same as '${zV} version'
444
- ${zV} clean -n Same as '${zV} clean --dry-run'
445
- ${zV} config key=value Set config value in global config file
440
+ ${YV} --help, ${YV} -h Same as '${YV} help'
441
+ ${YV} --version, ${YV} -v Same as '${YV} version'
442
+ ${YV} clean -n Same as '${YV} clean --dry-run'
443
+ ${YV} config key=value Set config value in global config file
446
444
 
447
445
  LOG LEVEL OPTIONS:
448
446
  --trace Most verbose output
@@ -456,14 +454,14 @@ CLEAN OPTIONS:
456
454
 
457
455
  CONFIG OPTIONS:
458
456
  key=value Set a configuration value in global config (~/.aindex/.tnmsc.json)
459
- Valid keys: ${BV}
457
+ Valid keys: ${XV}
460
458
 
461
459
  Examples:
462
- ${zV} config workspaceDir=~/my-project
463
- ${zV} config aindex.skills.src=skills
464
- ${zV} config logLevel=debug
460
+ ${YV} config workspaceDir=~/my-project
461
+ ${YV} config aindex.skills.src=skills
462
+ ${YV} config logLevel=debug
465
463
 
466
464
  CONFIGURATION:
467
465
  Configure via plugin.config.ts in your project root.
468
466
  See documentation for detailed configuration options.
469
- `.trim();var HV=class{name=`help`;async execute(e){return e.logger.info(VV),{success:!0,filesAffected:0,dirsAffected:0,message:`Help displayed`}}},UV=class{priority=vV.Flags;canHandle(e){return e.helpFlag||e.subcommand===`help`}createCommand(){return new HV}},WV=class{name=`init`;async execute(e){let{logger:t}=e;return t.warn(vp({code:`INIT_COMMAND_DEPRECATED`,title:`The init command is deprecated`,rootCause:q("`tnmsc init` no longer initializes aindex content or project definitions."),exactFix:q("Maintain the target-relative definitions manually under `~/workspace/aindex/public/`."),possibleFixes:[q("Run `tnmsc help` to find a supported replacement command for your workflow.")],details:{command:`init`}})),{success:!1,filesAffected:0,dirsAffected:0,message:"`tnmsc init` is deprecated and no longer initializes aindex. Maintain the public target-relative definitions manually under `~/workspace/aindex/public/`."}}},GV=class{canHandle(e){return e.subcommand===`init`}createCommand(){return new WV}},KV=class{name=`plugins`;async execute(e){let{logger:t,outputPlugins:n,userConfigOptions:r}=e,i=[];for(let e of r.plugins)i.push({name:e.name,kind:`Output`,description:e.name,dependencies:[...e.dependsOn??[]]});let o=new Set(i.map(e=>e.name));for(let e of n)o.has(e.name)||i.push({name:e.name,kind:`Output`,description:e.name,dependencies:[...e.dependsOn??[]]});return a.stdout.write(`${JSON.stringify(i)}\n`),t.info(`plugins listed`,{count:i.length}),{success:!0,filesAffected:0,dirsAffected:0,message:`Listed ${i.length} plugin(s)`}}},qV=class{canHandle(e){return e.subcommand===`plugins`}createCommand(){return new KV}},JV=class{name=`unknown`;constructor(e){this.unknownCmd=e}async execute(e){return e.logger.error(vp({code:`UNKNOWN_COMMAND`,title:`Unknown tnmsc command: ${this.unknownCmd}`,rootCause:q(`tnmsc does not recognize the "${this.unknownCmd}" subcommand.`),exactFix:q("Run `tnmsc help` and invoke one of the supported commands."),possibleFixes:[q(`Check the command spelling and remove unsupported aliases or flags.`)],details:{command:this.unknownCmd}})),e.logger.info(`run "tnmsc help" for available commands`),{success:!1,filesAffected:0,dirsAffected:0,message:`Unknown command: ${this.unknownCmd}`}}},YV=class{priority=vV.Unknown;canHandle(e){return e.unknownCommand!=null}createCommand(e){return new JV(e.unknownCommand??``)}},XV=class{priority=vV.Flags;canHandle(e){return e.versionFlag||e.subcommand===`version`}createCommand(){return new RV}};const ZV=new Set([`help`,`version`,`init`,`dry-run`,`clean`,`config`,`plugins`]),QV=new Map([[`--trace`,`trace`],[`--debug`,`debug`],[`--info`,`info`],[`--warn`,`warn`],[`--error`,`error`]]),$V=new Map([[`trace`,0],[`debug`,1],[`info`,2],[`warn`,3],[`error`,4]]);function eH(e){let t=[...e],n=t[0];n!=null&&tH(n)&&t.shift();let r=t[0];return r!=null&&nH(r)&&t.shift(),t}function tH(e){let t=[`node`,`nodejs`,`bun`,`deno`,`tsx`,`ts-node`,`npx`,`pnpx`,`yarn`,`pnpm`],n=e.toLowerCase().replaceAll(`\\`,`/`);return t.some(e=>RegExp(`(?:^|/)${e}(?:\\.exe|\\.cmd|\\.ps1)?$`,`i`).test(n)||n===e)}function nH(e){return/\.(?:m?[jt]s|cjs)$/u.test(e)||/[/\\]/u.test(e)&&!e.startsWith(`-`)?!0:/^(?:@[\w-]+\/)?[\w-]+$/u.test(e)&&!e.startsWith(`-`)}function rH(e,t){if(e==null)return t;let n=$V.get(e)??4;return($V.get(t)??4)<n?t:e}function iH(e){let t={subcommand:void 0,helpFlag:!1,versionFlag:!1,dryRun:!1,jsonFlag:!1,showFlag:!1,logLevel:void 0,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=QV.get(a);if(o!=null){t.logLevel=rH(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`--json`:t.jsonFlag=!0;break;case`--show`:t.showFlag=!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){for(let e of i.slice(1))switch(e){case`h`:t.helpFlag=!0;break;case`v`:t.versionFlag=!0;break;case`n`:t.dryRun=!0;break;case`j`:t.jsonFlag=!0;break;default:t.unknown.push(`-${e}`)}continue}if(!n){n=!0,ZV.has(i)?t.subcommand=i:t.unknownCommand=i;continue}t.positional.push(i)}}return t}let aH;function oH(){let e=new yV;return e.register(new XV),e.register(new UV),e.register(new YV),e.registerWithPriority(new GV,vV.Subcommand),e.registerWithPriority(new PV,vV.Subcommand),e.registerWithPriority(new SV,vV.Subcommand),e.registerWithPriority(new qV,vV.Subcommand),e.registerWithPriority(new MV,vV.Subcommand),e.registerWithPriority(new IV,vV.Subcommand),e}function sH(){return aH??=oH(),aH}function cH(e){return sH().resolve(e)}var lH=class{logger;args;outputPlugins=[];runtimeTargets;constructor(...e){this.args=iH(eH(e.filter(e=>e!=null))),this.args.logLevel!=null&&sI(this.args.logLevel),this.logger=rI(`PluginPipeline`,this.args.logLevel),this.logger.debug(`initialized`,{args:this.args})}registerOutputPlugins(e){return this.outputPlugins.push(...e),this}async run(e){let{context:t,outputPlugins:n,userConfigOptions:r}=e;this.registerOutputPlugins([...n]);let i=cH(this.args);return this.args.jsonFlag?(sI(`silent`),new Set([`config-show`,`plugins`]).has(i.name)||(i=new gV(i)),i.execute(this.createCommandContext(t,r))):i.execute(this.createCommandContext(t,r))}createCommandContext(e,t){return{logger:this.logger,outputPlugins:this.outputPlugins,collectedOutputContext:e,userConfigOptions:t,createCleanContext:n=>this.createCleanContext(e,t,n),createWriteContext:n=>this.createWriteContext(e,t,n)}}createCleanContext(e,t,n){return{logger:this.logger,collectedOutputContext:e,pluginOptions:t,runtimeTargets:this.getRuntimeTargets(),dryRun:n}}createWriteContext(e,t,n){return{logger:this.logger,collectedOutputContext:e,pluginOptions:t,runtimeTargets:this.getRuntimeTargets(),dryRun:n,registeredPluginNames:this.outputPlugins.map(e=>e.name)}}getRuntimeTargets(){return this.runtimeTargets??=QL(this.logger),this.runtimeTargets}};function uH(e=a.argv){let t=e.filter(e=>e!=null).slice(2),n=t.find(e=>!e.startsWith(`-`));return n===`plugins`?`plugins`:n===`clean`?`clean`:n===`dry-run`||t.includes(`--dry-run`)||t.includes(`-n`)?`dry-run`:`execute`}async function dH(e=a.argv,t=uH(e)){return JL({runtimeCommand:t,pluginOptions:{plugins:[new iR,new oR,new zR,new OR,new vR,new SR,new jR,new qR,new ez,new lz,new iz,new pz,new xz,new gR,new CR,new AR,new bR,new dz,new Cz,new nz]}})}const fH=new Set([`help`,`version`,`unknown`]);function pH(e){return e.some(e=>e===`--json`||e===`-j`||/^-[^-]*j/u.test(e))}function mH(e){rI(`main`,`silent`).error(Sp(`main`,e)),a.stdout.write(`${JSON.stringify(_V({success:!1,filesAffected:0,dirsAffected:0,message:e instanceof Error?e.message:String(e)},iI()))}\n`)}function hH(e){throw Error(`${e} context is unavailable for lightweight commands`)}function gH(e){let t=a.cwd(),n=PL({workspaceDir:t,...e==null?{}:{logLevel:e}});return{logger:rI(`PluginPipeline`,e),outputPlugins:[],collectedOutputContext:{workspace:{directory:{pathKind:rg.Absolute,path:t,getDirectoryName:()=>s.basename(t)},projects:[]}},userConfigOptions:n,createCleanContext:()=>hH(`cleanup`),createWriteContext:()=>hH(`write`)}}function _H(e){let t=iH(eH(e.filter(e=>e!=null))),n=cH(t);if(fH.has(n.name))return t.logLevel!=null&&sI(t.logLevel),t.jsonFlag?(sI(`silent`),n=new gV(n),{command:n,context:gH(t.logLevel)}):{command:n,context:gH(t.logLevel)}}async function vH(e=a.argv){try{let t=_H(e);if(t!=null){let e=await t.command.execute(t.context);return aI(),e.success?0:1}let n=new lH(...e),r=await dH(e),i=await n.run(r);return aI(),i.success?0:1}catch(t){return pH(e)?(mH(t),aI(),1):(rI(`main`,`error`).error(Sp(`main`,t)),aI(),1)}}function yH(e=a.argv){let t=e[1];if(t==null||t.length===0||!n(t))return!1;try{return i(t)===i(o(import.meta.url))}catch{return!1}}yH()&&vH(a.argv).then(e=>a.exit(e));export{Vh as AINDEX_CONFIG_DIRECTORY_PAIR_KEYS,Hh as AINDEX_CONFIG_FILE_PAIR_KEYS,Jh as AINDEX_CONFIG_KEY_PATHS,Gh as AINDEX_CONFIG_PAIR_DEFAULTS,Uh as AINDEX_CONFIG_PAIR_KEYS,zh as AINDEX_DEFAULT_DIR_NAME,Zh as AINDEX_DIR_NAMES,Qh as AINDEX_FILE_NAMES,Bh as AINDEX_PROJECT_SERIES_NAMES,Wh as AINDEX_PROMPT_TREE_DIRECTORY_PAIR_KEYS,$h as AINDEX_RELATIVE_PATHS,R_ as AbstractInputCapability,xF as AbstractOutputPlugin,HN as AbstractPlugin,iR as AgentsOutputPlugin,bF as CircularDependencyError,oR as ClaudeCodeCLIOutputPlugin,yB as CleanupProtectionConflictError,zR as CodexCLIOutputPlugin,dI as ConfigLoader,gR as CursorOutputPlugin,eg as DEFAULT_AINDEX_STRUCTURE,cI as DEFAULT_CONFIG_FILE_NAME,lI as DEFAULT_GLOBAL_CONFIG_DIR,DP as DEFAULT_SCOPE_PRIORITY,CF as DEFAULT_USER_CONFIG,vR as DroidCLIOutputPlugin,bR as EditorConfigOutputPlugin,AF as FileExtensions,rg as FilePathKind,kF as FrontMatterFields,SR as GeminiCLIOutputPlugin,nR as GenericSkillsOutputPlugin,CR as GitExcludeOutputPlugin,og as GlobalConfigDirectoryType,FF as GlobalConfigDirs,iP as GlobalScopeCollector,ig as IDEKind,IF as IgnoreFiles,OR as JetBrainsAIAssistantCodexOutputPlugin,AR as JetBrainsIDECodeStyleConfigOutputPlugin,jR as KiroCLIOutputPlugin,JF as LocalizedPromptReader,QF as McpConfigManager,yF as MissingDependencyError,ag as NamingCaseKind,lF as OUTPUT_SCOPE_TOPICS,qR as OpencodeCLIOutputPlugin,EF as OutputFileNames,DF as OutputPrefixes,OF as OutputSubdirectories,wF as PLUGIN_NAMES,SF as PathPlaceholders,tg as PluginKind,LF as PreservedSkills,ng as PromptKind,ez as QoderIDEPluginOutputPlugin,cF as README_FILE_KIND_MAP,nz as ReadmeMdConfigFileOutputPlugin,tI as RegistryWriter,aP as ScopePriority,oP as ScopeRegistry,NF as SourceLocaleExtensions,jF as SourcePromptExtensions,MF as SourcePromptFileExtensions,RF as ToolPresets,iz as TraeCNIDEOutputPlugin,lz as TraeIDEOutputPlugin,dz as VisualStudioCodeIDEConfigOutputPlugin,TF as WORKSPACE_ROOT_PROJECT_NAME,pz as WarpIDEOutputPlugin,xz as WindsurfOutputPlugin,NP as ZAindexConfig,jP as ZAindexDirPair,WP as ZCleanupProtectionOptions,UP as ZCleanupProtectionRule,FP as ZCommandSeriesOptions,PP as ZCommandSeriesPluginOverride,$P as ZConfigLoaderOptions,BP as ZFrontMatterOptions,XP as ZMcpProjectConfig,IP as ZOutputScope,zP as ZOutputScopeOptions,LP as ZOutputScopeSelection,RP as ZPluginOutputScopeTopics,QP as ZProjectConfig,VP as ZProtectionMode,HP as ZProtectionRuleMatcher,GP as ZStringOrStringArray,ZP as ZTypeSeriesConfig,YP as ZUserConfigFile,JP as ZUserProfile,qP as ZWindowsOptions,KP as ZWindowsWsl2Options,Cz as ZedIDEConfigOutputPlugin,oF as applyMetadataDefaults,eP as applySubSeriesGlobPrefix,gp as buildBatchFileOperationDiagnostic,_p as buildConfigDiagnostic,Yh as buildDefaultAindexConfig,dp as buildDiagnostic,hp as buildFileOperationDiagnostic,yp as buildPathStateDiagnostic,bp as buildPromptCompilerDiagnostic,xp as buildProtectedDeletionDiagnostic,Sp as buildUnhandledExceptionDiagnostic,vp as buildUsageDiagnostic,wp as checkVersionControl,nI as clearBufferedDiagnostics,xP as clearPromptArtifactCache,vF as collectAllPluginOutputs,rV as collectDeclaredWslMirrorFiles,zB as collectDeletionTargets,XF as collectMcpServersFromSkills,gF as collectOutputDeclarations,bP as compileRawPromptArtifact,dH as createDefaultPluginConfig,YF as createLocalizedPromptReader,rI as createLogger,JL as defineConfig,wP as deriveSubAgentIdentity,q as diagnosticLines,QL as discoverOutputRuntimeTargets,iI as drainBufferedDiagnostics,_F as executeDeclarativeWriteOutputs,$ as filterByProjectConfig,nP as findAllGitRepos,rP as findGitModuleInfoDirs,CP as flattenPromptPath,aI as flushOutput,Ep as generateAindex,pI as getConfigLoader,uI as getGlobalConfigPath,oI as getGlobalLogLevel,sB as getPrompt,n_ as getRequiredGlobalConfigPath,bB as hasNativeCleanupBinding,PF as hasSourcePromptExtension,pH as isJsonMode,oB as listPrompts,mI as loadUserConfig,L_ as logProtectedDeletionGuardError,Xh as mergeAindexConfig,PL as mergeConfig,Cp as partitionBufferedDiagnostics,BB as performCleanup,RB as performCleanupWithNative,LB as planCleanupWithNative,yP as readPromptArtifact,tP as resolveGitInfoDir,uB as resolvePromptDefinition,uH as resolveRuntimeCommandFromArgv,TP as resolveSkillName,EP as resolveSubAgentCanonicalName,AP as resolveTopicScopes,r_ as resolveUserPath,pV as resolveWslInstanceTargets,vH as runCli,sI as setGlobalLogLevel,up as splitDiagnosticText,hV as syncWindowsConfigIntoWsl,lp as toErrorMessage,sF as toOutputCollectedContext,$F as transformMcpConfigForCursor,eI as transformMcpConfigForOpencode,ZF as transformMcpServerMap,cB as upsertPromptSource,NL as userConfigToPluginOptions,rF as validateCommandMetadata,tF as validateExportMetadata,hI as validateGlobalConfig,pF as validateOutputPluginCapabilities,mF as validateOutputScopeOverridesForPlugin,hF as validateOutputScopeOverridesForPlugins,aF as validateRuleMetadata,nF as validateSkillMetadata,iF as validateSubAgentMetadata,lB as writePromptArtifacts};
467
+ `.trim();var QV=class{name=`help`;async execute(e){return e.logger.info(ZV),{success:!0,filesAffected:0,dirsAffected:0,message:`Help displayed`}}},$V=class{priority=CV.Flags;canHandle(e){return e.helpFlag||e.subcommand===`help`}createCommand(){return new QV}},eH=class{name=`plugins`;async execute(e){let{logger:t,outputPlugins:n,userConfigOptions:r}=e,i=[];for(let e of r.plugins)i.push({name:e.name,kind:`Output`,description:e.name,dependencies:[...e.dependsOn??[]]});let o=new Set(i.map(e=>e.name));for(let e of n)o.has(e.name)||i.push({name:e.name,kind:`Output`,description:e.name,dependencies:[...e.dependsOn??[]]});return a.stdout.write(`${JSON.stringify(i)}\n`),t.info(`plugins listed`,{count:i.length}),{success:!0,filesAffected:0,dirsAffected:0,message:`Listed ${i.length} plugin(s)`}}},tH=class{canHandle(e){return e.subcommand===`plugins`}createCommand(){return new eH}},nH=class{name=`unknown`;constructor(e){this.unknownCmd=e}async execute(e){return e.logger.error(vp({code:`UNKNOWN_COMMAND`,title:`Unknown tnmsc command: ${this.unknownCmd}`,rootCause:q(`tnmsc does not recognize the "${this.unknownCmd}" subcommand.`),exactFix:q("Run `tnmsc help` and invoke one of the supported commands."),possibleFixes:[q(`Check the command spelling and remove unsupported aliases or flags.`)],details:{command:this.unknownCmd}})),e.logger.info(`run "tnmsc help" for available commands`),{success:!1,filesAffected:0,dirsAffected:0,message:`Unknown command: ${this.unknownCmd}`}}},rH=class{priority=CV.Unknown;canHandle(e){return e.unknownCommand!=null}createCommand(e){return new nH(e.unknownCommand??``)}},iH=class{priority=CV.Flags;canHandle(e){return e.versionFlag||e.subcommand===`version`}createCommand(){return new JV}};const aH=new Set([`help`,`version`,`dry-run`,`clean`,`config`,`plugins`]),oH=new Map([[`--trace`,`trace`],[`--debug`,`debug`],[`--info`,`info`],[`--warn`,`warn`],[`--error`,`error`]]),sH=new Map([[`trace`,0],[`debug`,1],[`info`,2],[`warn`,3],[`error`,4]]);function cH(e){let t=[...e],n=t[0];n!=null&&lH(n)&&t.shift();let r=t[0];return r!=null&&uH(r)&&t.shift(),t}function lH(e){let t=[`node`,`nodejs`,`bun`,`deno`,`tsx`,`ts-node`,`npx`,`pnpx`,`yarn`,`pnpm`],n=e.toLowerCase().replaceAll(`\\`,`/`);return t.some(e=>RegExp(`(?:^|/)${e}(?:\\.exe|\\.cmd|\\.ps1)?$`,`i`).test(n)||n===e)}function uH(e){return/\.(?:m?[jt]s|cjs)$/u.test(e)||/[/\\]/u.test(e)&&!e.startsWith(`-`)?!0:/^(?:@[\w-]+\/)?[\w-]+$/u.test(e)&&!e.startsWith(`-`)}function dH(e,t){if(e==null)return t;let n=sH.get(e)??4;return(sH.get(t)??4)<n?t:e}function fH(e){let t={subcommand:void 0,helpFlag:!1,versionFlag:!1,dryRun:!1,showFlag:!1,logLevel:void 0,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=oH.get(a);if(o!=null){t.logLevel=dH(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`--show`:t.showFlag=!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){for(let e of i.slice(1))switch(e){case`h`:t.helpFlag=!0;break;case`v`:t.versionFlag=!0;break;case`n`:t.dryRun=!0;break;default:t.unknown.push(`-${e}`)}continue}if(!n){n=!0,aH.has(i)?t.subcommand=i:t.unknownCommand=i;continue}t.positional.push(i)}}return t}let pH;function mH(){let e=new wV;return e.register(new iH),e.register(new $V),e.register(new rH),e.registerWithPriority(new WV,CV.Subcommand),e.registerWithPriority(new MV,CV.Subcommand),e.registerWithPriority(new tH,CV.Subcommand),e.registerWithPriority(new HV,CV.Subcommand),e.registerWithPriority(new KV,CV.Subcommand),e}function hH(){return pH??=mH(),pH}function gH(e){return hH().resolve(e)}var _H=class{logger;args;outputPlugins=[];runtimeTargets;constructor(...e){this.args=fH(cH(e.filter(e=>e!=null))),this.args.logLevel!=null&&HF(this.args.logLevel),this.logger=RF(`PluginPipeline`,this.args.logLevel),this.logger.debug(`initialized`,{args:this.args})}registerOutputPlugins(e){return this.outputPlugins.push(...e),this}async run(e){let{context:t,outputPlugins:n,userConfigOptions:r,executionPlan:i}=e;return this.registerOutputPlugins([...n]),gH(this.args).execute(this.createCommandContext(t,r,i))}createCommandContext(e,t,n){return{logger:this.logger,outputPlugins:this.outputPlugins,collectedOutputContext:e,userConfigOptions:t,executionPlan:n,createCleanContext:r=>this.createCleanContext(e,t,n,r),createWriteContext:r=>this.createWriteContext(e,t,n,r)}}createCleanContext(e,t,n,r){return{logger:this.logger,collectedOutputContext:e,pluginOptions:t,runtimeTargets:this.getRuntimeTargets(),executionPlan:n,dryRun:r}}createWriteContext(e,t,n,r){return{logger:this.logger,collectedOutputContext:e,pluginOptions:t,runtimeTargets:this.getRuntimeTargets(),executionPlan:n,dryRun:r,registeredPluginNames:this.outputPlugins.map(e=>e.name)}}getRuntimeTargets(){return this.runtimeTargets??=aR(this.logger),this.runtimeTargets}};function vH(e=a.argv){let t=e.filter(e=>e!=null).slice(2),n=t.find(e=>!e.startsWith(`-`));return n===`plugins`?`plugins`:n===`clean`?`clean`:n===`dry-run`||t.includes(`--dry-run`)||t.includes(`-n`)?`dry-run`:`execute`}async function yH(e=a.argv,t=vH(e),n=a.cwd()){return tR({executionCwd:n,runtimeCommand:t,pluginOptions:{plugins:[new dR,new pR,new KR,new FR,new TR,new kR,new RR,new ez,new sz,new gz,new dz,new bz,new Oz,new CR,new AR,new LR,new DR,new vz,new Az,new lz]}})}const bH=new Set([`help`,`version`,`unknown`]);function xH(){return{app:[],ext:[],arch:[],softwares:[]}}function SH(e){throw Error(`${e} context is unavailable for lightweight commands`)}function CH(e){let t=a.cwd(),n=t,r=VL({workspaceDir:n,...e==null?{}:{logLevel:e}});return{logger:RF(`PluginPipeline`,e),outputPlugins:[],collectedOutputContext:{workspace:{directory:{pathKind:WM.Absolute,path:n,getDirectoryName:()=>s.basename(n)},projects:[]}},userConfigOptions:r,executionPlan:{scope:`workspace`,cwd:t,workspaceDir:n,projectsBySeries:xH()},createCleanContext:()=>SH(`cleanup`),createWriteContext:()=>SH(`write`)}}function wH(e){let t=fH(cH(e.filter(e=>e!=null))),n=gH(t);if(bH.has(n.name))return t.logLevel!=null&&HF(t.logLevel),{command:n,context:CH(t.logLevel)}}async function TH(e=a.argv){try{let t=wH(e);if(t!=null){let e=await t.command.execute(t.context);return BF(),e.success?0:1}let n=new _H(...e),r=await yH(e,void 0,a.cwd()),i=await n.run(r);return BF(),i.success?0:1}catch(e){return RF(`main`,`error`).error(Sp(`main`,e)),BF(),1}}function EH(e=a.argv){let t=e[1];if(t==null||t.length===0||!n(t))return!1;try{return i(t)===i(o(import.meta.url))}catch{return!1}}EH()&&TH(a.argv).then(e=>a.exit(e));export{QN as AINDEX_CONFIG_DIRECTORY_PAIR_KEYS,$N as AINDEX_CONFIG_FILE_PAIR_KEYS,aP as AINDEX_CONFIG_KEY_PATHS,nP as AINDEX_CONFIG_PAIR_DEFAULTS,eP as AINDEX_CONFIG_PAIR_KEYS,XN as AINDEX_DEFAULT_DIR_NAME,cP as AINDEX_DIR_NAMES,lP as AINDEX_FILE_NAMES,ZN as AINDEX_PROJECT_SERIES_NAMES,tP as AINDEX_PROMPT_TREE_DIRECTORY_PAIR_KEYS,uP as AINDEX_RELATIVE_PATHS,Lg as AbstractInputCapability,nF as AbstractOutputPlugin,VM as AbstractPlugin,dR as AgentsOutputPlugin,tF as CircularDependencyError,pR as ClaudeCodeCLIOutputPlugin,EB as CleanupProtectionConflictError,KR as CodexCLIOutputPlugin,KF as ConfigLoader,CR as CursorOutputPlugin,dP as DEFAULT_AINDEX_STRUCTURE,UF as DEFAULT_CONFIG_FILE_NAME,WF as DEFAULT_GLOBAL_CONFIG_DIR,MN as DEFAULT_SCOPE_PRIORITY,iF as DEFAULT_USER_CONFIG,TR as DroidCLIOutputPlugin,DR as EditorConfigOutputPlugin,dF as FileExtensions,WM as FilePathKind,uF as FrontMatterFields,kR as GeminiCLIOutputPlugin,lR as GenericSkillsOutputPlugin,AR as GitExcludeOutputPlugin,qM as GlobalConfigDirectoryType,gF as GlobalConfigDirs,lN as GlobalScopeCollector,GM as IDEKind,_F as IgnoreFiles,FR as JetBrainsAIAssistantCodexOutputPlugin,LR as JetBrainsIDECodeStyleConfigOutputPlugin,RR as KiroCLIOutputPlugin,kF as LocalizedPromptReader,NF as McpConfigManager,eF as MissingDependencyError,KM as NamingCaseKind,WP as OUTPUT_SCOPE_TOPICS,ez as OpencodeCLIOutputPlugin,sF as OutputFileNames,cF as OutputPrefixes,lF as OutputSubdirectories,aF as PLUGIN_NAMES,rF as PathPlaceholders,HM as PluginKind,vF as PreservedSkills,UM as PromptKind,sz as QoderIDEPluginOutputPlugin,UP as README_FILE_KIND_MAP,lz as ReadmeMdConfigFileOutputPlugin,IF as RegistryWriter,uN as ScopePriority,dN as ScopeRegistry,mF as SourceLocaleExtensions,fF as SourcePromptExtensions,pF as SourcePromptFileExtensions,yF as ToolPresets,dz as TraeCNIDEOutputPlugin,gz as TraeIDEOutputPlugin,vz as VisualStudioCodeIDEConfigOutputPlugin,oF as WORKSPACE_ROOT_PROJECT_NAME,bz as WarpIDEOutputPlugin,Oz as WindsurfOutputPlugin,mP as ZAindexConfig,fP as ZAindexDirPair,TP as ZCleanupProtectionOptions,wP as ZCleanupProtectionRule,gP as ZCommandSeriesOptions,hP as ZCommandSeriesPluginOverride,PP as ZConfigLoaderOptions,xP as ZFrontMatterOptions,jP as ZMcpProjectConfig,_P as ZOutputScope,bP as ZOutputScopeOptions,vP as ZOutputScopeSelection,yP as ZPluginOutputScopeTopics,NP as ZProjectConfig,SP as ZProtectionMode,CP as ZProtectionRuleMatcher,EP as ZStringOrStringArray,MP as ZTypeSeriesConfig,AP as ZUserConfigFile,kP as ZUserProfile,OP as ZWindowsOptions,DP as ZWindowsWsl2Options,Az as ZedIDEConfigOutputPlugin,VP as applyMetadataDefaults,aN as applySubSeriesGlobPrefix,gp as buildBatchFileOperationDiagnostic,_p as buildConfigDiagnostic,oP as buildDefaultAindexConfig,dp as buildDiagnostic,hp as buildFileOperationDiagnostic,yp as buildPathStateDiagnostic,bp as buildPromptCompilerDiagnostic,xp as buildProtectedDeletionDiagnostic,Sp as buildUnhandledExceptionDiagnostic,vp as buildUsageDiagnostic,wp as checkVersionControl,LF as clearBufferedDiagnostics,EN as clearPromptArtifactCache,$P as collectAllPluginOutputs,uV as collectDeclaredWslMirrorFiles,KB as collectDeletionTargets,jF as collectMcpServersFromSkills,ZP as collectOutputDeclarations,TN as compileRawPromptArtifact,yH as createDefaultPluginConfig,WN as createEmptyExecutionPlanProjectsBySeries,AF as createLocalizedPromptReader,RF as createLogger,tR as defineConfig,kN as deriveSubAgentIdentity,q as diagnosticLines,aR as discoverOutputRuntimeTargets,zF as drainBufferedDiagnostics,QP as executeDeclarativeWriteOutputs,$ as filterByProjectConfig,YN as filterPathScopedEntriesForExecutionPlan,sN as findAllGitRepos,cN as findGitModuleInfoDirs,ON as flattenPromptPath,BF as flushOutput,Ep as generateAindex,JF as getConfigLoader,GF as getGlobalConfigPath,VF as getGlobalLogLevel,mB as getPrompt,ig as getRequiredGlobalConfigPath,DB as hasNativeCleanupBinding,hF as hasSourcePromptExtension,pB as listPrompts,YF as loadUserConfig,Ig as logProtectedDeletionGuardError,sP as mergeAindexConfig,VL as mergeConfig,Cp as partitionBufferedDiagnostics,qB as performCleanup,GB as performCleanupWithNative,WB as planCleanupWithNative,wN as readPromptArtifact,GN as resolveExecutionPlan,oN as resolveGitInfoDir,_B as resolvePromptDefinition,vH as resolveRuntimeCommandFromArgv,AN as resolveSkillName,jN as resolveSubAgentCanonicalName,FN as resolveTopicScopes,ag as resolveUserPath,bV as resolveWslInstanceTargets,TH as runCli,HF as setGlobalLogLevel,up as splitDiagnosticText,SV as syncWindowsConfigIntoWsl,lp as toErrorMessage,HP as toOutputCollectedContext,PF as transformMcpConfigForCursor,FF as transformMcpConfigForOpencode,MF as transformMcpServerMap,hB as upsertPromptSource,BL as userConfigToPluginOptions,RP as validateCommandMetadata,IP as validateExportMetadata,XF as validateGlobalConfig,JP as validateOutputPluginCapabilities,YP as validateOutputScopeOverridesForPlugin,XP as validateOutputScopeOverridesForPlugins,BP as validateRuleMetadata,LP as validateSkillMetadata,zP as validateSubAgentMetadata,gB as writePromptArtifacts};