mdat 1.0.2 → 1.0.4

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/bin/cli.js CHANGED
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
- var _w=Object.create;var Xl=Object.defineProperty;var Sw=Object.getOwnPropertyDescriptor;var vw=Object.getOwnPropertyNames;var Iw=Object.getPrototypeOf,Ow=Object.prototype.hasOwnProperty;var Er=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var sa=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Dw=(t,e)=>{for(var r in e)Xl(t,r,{get:e[r],enumerable:!0})},Rw=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vw(e))!Ow.call(t,i)&&i!==r&&Xl(t,i,{get:()=>e[i],enumerable:!(n=Sw(e,i))||n.enumerable});return t};var ts=(t,e,r)=>(r=t!=null?_w(Iw(t)):{},Rw(e||!t||!t.__esModule?Xl(r,"default",{value:t,enumerable:!0}):r,t));var la=sa((HL,Jl)=>{"use strict";var ua=process||{},Rd=ua.argv||[],aa=ua.env||{},Fw=!(aa.NO_COLOR||Rd.includes("--no-color"))&&(!!aa.FORCE_COLOR||Rd.includes("--color")||ua.platform==="win32"||(ua.stdout||{}).isTTY&&aa.TERM!=="dumb"||!!aa.CI),Nw=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+Pw(i,e,r,o)+e:t+i+e},Pw=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Fd=(t=Fw)=>{let e=t?Nw:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Jl.exports=Fd();Jl.exports.createColors=Fd});var jh=sa((sj,UC)=>{UC.exports={addendum:"addenda",aircraft:"aircraft",alga:"algae",alumna:"alumnae",alumnus:"alumni",alveolus:"alveoli",amoeba:"amoebae",analysis:"analyses",antenna:"antennae",antithesis:"antitheses",apex:"apices",appendix:"appendices",automaton:"automata",axis:"axes",bacillus:"bacilli",bacterium:"bacteria",baculum:"bacula",barracks:"barracks",basis:"bases",beau:"beaux",bison:"bison",buffalo:"buffalo",bureau:"bureaus",cactus:"cacti",calf:"calves",carcinoma:"carcinomata",carp:"carp",census:"censuses",chassis:"chassis",cherub:"cherubim",child:"children",ch\u00E2teau:"ch\xE2teaus",cloaca:"cloacae",cod:"cod",codex:"codices",concerto:"concerti",consortium:"consortia",corpus:"corpora",crisis:"crises",criterion:"criteria",curriculum:"curricula",cystoma:"cystomata",datum:"data",deer:"deer",diagnosis:"diagnoses",die:"dice",dwarf:"dwarfs",echo:"echoes",elf:"elves",elk:"elk",ellipsis:"ellipses",embargo:"embargoes",emphasis:"emphases",erratum:"errata","faux pas":"faux pas",fez:"fezes",firmware:"firmware",fish:"fish",focus:"foci",foot:"feet",formula:"formulae",fungus:"fungi",gallows:"gallows",genus:"genera",glomerulus:"glomeruli",goose:"geese",graffito:"graffiti",grouse:"grouse",half:"halves",hamulus:"hamuli",hero:"heroes",hippopotamus:"hippopotami",hoof:"hooves",hovercraft:"hovercraft",hypothesis:"hypotheses",iliac:"ilia",incubus:"incubi",index:"indices",interstitium:"interstitia",kakapo:"kakapo",knife:"knives",larva:"larvae",leaf:"leaves",libretto:"libretti",life:"lives",loaf:"loaves",loculus:"loculi",locus:"loci",louse:"lice",man:"men",matrix:"matrices",means:"means",measles:"measles",media:"media",medium:"media",memorandum:"memoranda",millennium:"millennia",minutia:"minutiae",moose:"moose",mouse:"mice",nebula:"nebulae",nemesis:"nemeses",neurosis:"neuroses",news:"news",nucleolus:"nucleoli",nucleus:"nuclei",oasis:"oases",occiput:"occipita",offspring:"offspring",omphalos:"omphaloi",opus:"opera",ovum:"ova",ox:"oxen",paralysis:"paralyses",parenthesis:"parentheses",person:"people",phenomenon:"phenomena",phylum:"phyla",pike:"pike",polyhedron:"polyhedra",potato:"potatoes",primus:"primi",prognosis:"prognoses",quiz:"quizzes",radius:"radii",referendum:"referenda",salmon:"salmon",scarf:"scarves",scrotum:"scrota",self:"selves",seminoma:"seminomata",series:"series",sheep:"sheep",shelf:"shelves",shrimp:"shrimp",simulacrum:"simulacra",soliloquy:"soliloquies",spacecraft:"spacecraft",species:"species",spectrum:"spectra",squid:"squid",stimulus:"stimuli",stratum:"strata",swine:"swine",syconium:"syconia",syllabus:"syllabi",symposium:"symposia",synopsis:"synopses",synthesis:"syntheses",tableau:"tableaus",testis:"testes",that:"those",thesis:"theses",thief:"thieves",this:"these",thrombus:"thrombi",tomato:"tomatoes",tooth:"teeth",torus:"tori",trout:"trout",tuna:"tuna",umbilicus:"umbilici",uterus:"uteri",vertebra:"vertebrae",vertex:"vertices",veto:"vetoes",vita:"vitae",vortex:"vortices",watercraft:"watercraft",wharf:"wharves",wife:"wives",wolf:"wolves",woman:"women"}});var zh=sa((aj,Uh)=>{"use strict";var zC=jh();Uh.exports=new Map(Object.entries(zC))});var Sg=sa((Z9,_g)=>{"use strict";var ou=Object.prototype.hasOwnProperty,Tg=Object.prototype.toString,bg=Object.defineProperty,Eg=Object.getOwnPropertyDescriptor,Ag=function(e){return typeof Array.isArray=="function"?Array.isArray(e):Tg.call(e)==="[object Array]"},wg=function(e){if(!e||Tg.call(e)!=="[object Object]")return!1;var r=ou.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&ou.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||ou.call(e,i)},Cg=function(e,r){bg&&r.name==="__proto__"?bg(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},kg=function(e,r){if(r==="__proto__")if(ou.call(e,r)){if(Eg)return Eg(e,r).value}else return;return e[r]};_g.exports=function t(){var e,r,n,i,o,s,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<l;++u)if(e=arguments[u],e!=null)for(r in e)n=kg(a,r),i=kg(e,r),a!==i&&(c&&i&&(wg(i)||(o=Ag(i)))?(o?(o=!1,s=n&&Ag(n)?n:[]):s=n&&wg(n)?n:{},Cg(a,{name:r,newValue:t(c,s,i)})):typeof i<"u"&&Cg(a,{name:r,newValue:i}));return a}});var Jo=ts(la(),1);var Nd=t=>Number.isFinite(t)?t:0;function Lw(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Nd(t*1e3)%1e3),nanoseconds:Math.trunc(Nd(t*1e6)%1e3)}}function Mw(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Ql(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Lw(t);break}case"bigint":return Mw(t)}throw new TypeError("Expected a finite number or bigint")}var Bw=t=>t===0||t===0n,jw=(t,e)=>e===1||e===1n?t:`${t}s`,Uw=1e-7,zw=24n*60n*60n*1000n;function Vr(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(c,f)=>{let p=Math.floor(c*10**f+Uw);return(Math.round(p)/10**f).toFixed(f)},s=(c,f,p,d)=>{if(!((i.length===0||!e.colonNotation)&&Bw(c)&&!(e.colonNotation&&p==="m"))){if(d??=String(c),e.colonNotation){let m=d.includes(".")?d.split(".")[0].length:d.length,y=i.length>0?2:1;d="0".repeat(Math.max(0,y-m))+d}else d+=e.verbose?" "+jw(f,c):p;i.push(d)}},a=Ql(t),u=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(u,"day","d"):(s(u/365n,"year","y"),s(u%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){let c=Number(a.seconds),f=Number(a.milliseconds),p=Number(a.microseconds),d=Number(a.nanoseconds);if(s(c,"second","s"),e.formatSubMilliseconds)s(f,"millisecond","ms"),s(p,"microsecond","\xB5s"),s(d,"nanosecond","ns");else{let m=f+p/1e3+d/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=y?m.toFixed(y):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let c=(r?Number(t%zw):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,p=o(c,f),d=e.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");s(Number.parseFloat(d),"second","s",d)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}import{getMdatReports as GL,log as ht,reporterMdat as Yo}from"remark-mdat";import Pd from"node:fs";import Ld from"node:path";import{VFile as $w}from"vfile";function ec(t,e,r){let n=tc(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Ld.resolve(n.cwd,n.path)}catch(c){return a(c)}Pd.readFile(u,e,l);function l(c,f){c?a(c):(n.value=f,s(n))}}}function tc(t){return typeof t=="string"||t instanceof URL?t={path:t}:Vw(t)&&(t={path:new TextDecoder().decode(t)}),qw(t)?t:new $w(t)}function un(t,e,r){let n=tc(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Ld.resolve(n.cwd,n.path)}catch(c){return a(c)}Pd.writeFile(u,n.value||"",e||void 0,l);function l(c){c?a(c):s(n)}}}function qw(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Vw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}import{notStrictEqual as mC,strictEqual as gC}from"assert";var Gw={right:Zw,center:Xw},Ww=0,ca=1,Hw=2,fa=3,rc=class{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
3
- `).map(i=>i.split(" ")),n=0;return r.forEach(i=>{i.length>1&&Ht.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Ht.stringWidth(i[0])))}),r.forEach(i=>{this.div(...i.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=Ht.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
4
- `)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let o="";n.forEach((s,a)=>{let{width:u}=e[a],l=this.negatePadding(e[a]),c=s;if(l>Ht.stringWidth(s)&&(c+=" ".repeat(l-Ht.stringWidth(s))),e[a].align&&e[a].align!=="left"&&this.wrap){let p=Gw[e[a].align];c=p(c,l),Ht.stringWidth(c)<l&&(c+=" ".repeat((u||0)-Ht.stringWidth(c)-1))}let f=e[a].padding||[0,0,0,0];f[fa]&&(o+=" ".repeat(f[fa])),o+=Md(e[a],c,"| "),o+=c,o+=Md(e[a],c," |"),f[ca]&&(o+=" ".repeat(f[ca])),i===0&&r.length>0&&(o=this.renderInline(o,r[r.length-1]))}),r.push({text:o.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),i=n?n[0].length:0,o=r.text,s=Ht.stringWidth(o.trimRight());return r.span?this.wrap?i<s?e:(r.hidden=!0,o.trimRight()+" ".repeat(i-s)+e.trimLeft()):(r.hidden=!0,o+e):e}rasterize(e){let r=[],n=this.columnWidths(e),i;return e.forEach((o,s)=>{o.width=n[s],this.wrap?i=Ht.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
2
+ var wk=Object.create;var Zl=Object.defineProperty;var Ck=Object.getOwnPropertyDescriptor;var Tk=Object.getOwnPropertyNames;var _k=Object.getPrototypeOf,Sk=Object.prototype.hasOwnProperty;var Er=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var sa=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Od=(t,e)=>{for(var r in e)Zl(t,r,{get:e[r],enumerable:!0})},Ik=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Tk(e))!Sk.call(t,i)&&i!==r&&Zl(t,i,{get:()=>e[i],enumerable:!(n=Ck(e,i))||n.enumerable});return t};var ns=(t,e,r)=>(r=t!=null?wk(_k(t)):{},Ik(e||!t||!t.__esModule?Zl(r,"default",{value:t,enumerable:!0}):r,t));var la=sa((qL,Xl)=>{"use strict";var ua=process||{},vd=ua.argv||[],aa=ua.env||{},Ok=!(aa.NO_COLOR||vd.includes("--no-color"))&&(!!aa.FORCE_COLOR||vd.includes("--color")||ua.platform==="win32"||(ua.stdout||{}).isTTY&&aa.TERM!=="dumb"||!!aa.CI),vk=(t,e,r=t)=>n=>{let i=""+n,o=i.indexOf(e,t.length);return~o?t+Dk(i,e,r,o)+e:t+i+e},Dk=(t,e,r,n)=>{let i="",o=0;do i+=t.substring(o,n)+r,o=n+e.length,n=t.indexOf(e,o);while(~n);return i+t.substring(o)},Dd=(t=Ok)=>{let e=t?vk:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Xl.exports=Dd();Xl.exports.createColors=Dd});var Mh=sa((rj,Lw)=>{Lw.exports={addendum:"addenda",aircraft:"aircraft",alga:"algae",alumna:"alumnae",alumnus:"alumni",alveolus:"alveoli",amoeba:"amoebae",analysis:"analyses",antenna:"antennae",antithesis:"antitheses",apex:"apices",appendix:"appendices",automaton:"automata",axis:"axes",bacillus:"bacilli",bacterium:"bacteria",baculum:"bacula",barracks:"barracks",basis:"bases",beau:"beaux",bison:"bison",buffalo:"buffalo",bureau:"bureaus",cactus:"cacti",calf:"calves",carcinoma:"carcinomata",carp:"carp",census:"censuses",chassis:"chassis",cherub:"cherubim",child:"children",ch\u00E2teau:"ch\xE2teaus",cloaca:"cloacae",cod:"cod",codex:"codices",concerto:"concerti",consortium:"consortia",corpus:"corpora",crisis:"crises",criterion:"criteria",curriculum:"curricula",cystoma:"cystomata",datum:"data",deer:"deer",diagnosis:"diagnoses",die:"dice",dwarf:"dwarfs",echo:"echoes",elf:"elves",elk:"elk",ellipsis:"ellipses",embargo:"embargoes",emphasis:"emphases",erratum:"errata","faux pas":"faux pas",fez:"fezes",firmware:"firmware",fish:"fish",focus:"foci",foot:"feet",formula:"formulae",fungus:"fungi",gallows:"gallows",genus:"genera",glomerulus:"glomeruli",goose:"geese",graffito:"graffiti",grouse:"grouse",half:"halves",hamulus:"hamuli",hero:"heroes",hippopotamus:"hippopotami",hoof:"hooves",hovercraft:"hovercraft",hypothesis:"hypotheses",iliac:"ilia",incubus:"incubi",index:"indices",interstitium:"interstitia",kakapo:"kakapo",knife:"knives",larva:"larvae",leaf:"leaves",libretto:"libretti",life:"lives",loaf:"loaves",loculus:"loculi",locus:"loci",louse:"lice",man:"men",matrix:"matrices",means:"means",measles:"measles",media:"media",medium:"media",memorandum:"memoranda",millennium:"millennia",minutia:"minutiae",moose:"moose",mouse:"mice",nebula:"nebulae",nemesis:"nemeses",neurosis:"neuroses",news:"news",nucleolus:"nucleoli",nucleus:"nuclei",oasis:"oases",occiput:"occipita",offspring:"offspring",omphalos:"omphaloi",opus:"opera",ovum:"ova",ox:"oxen",paralysis:"paralyses",parenthesis:"parentheses",person:"people",phenomenon:"phenomena",phylum:"phyla",pike:"pike",polyhedron:"polyhedra",potato:"potatoes",primus:"primi",prognosis:"prognoses",quiz:"quizzes",radius:"radii",referendum:"referenda",salmon:"salmon",scarf:"scarves",scrotum:"scrota",self:"selves",seminoma:"seminomata",series:"series",sheep:"sheep",shelf:"shelves",shrimp:"shrimp",simulacrum:"simulacra",soliloquy:"soliloquies",spacecraft:"spacecraft",species:"species",spectrum:"spectra",squid:"squid",stimulus:"stimuli",stratum:"strata",swine:"swine",syconium:"syconia",syllabus:"syllabi",symposium:"symposia",synopsis:"synopses",synthesis:"syntheses",tableau:"tableaus",testis:"testes",that:"those",thesis:"theses",thief:"thieves",this:"these",thrombus:"thrombi",tomato:"tomatoes",tooth:"teeth",torus:"tori",trout:"trout",tuna:"tuna",umbilicus:"umbilici",uterus:"uteri",vertebra:"vertebrae",vertex:"vertices",veto:"vetoes",vita:"vitae",vortex:"vortices",watercraft:"watercraft",wharf:"wharves",wife:"wives",wolf:"wolves",woman:"women"}});var jh=sa((nj,Bh)=>{"use strict";var Mw=Mh();Bh.exports=new Map(Object.entries(Mw))});var wg=sa((b3,kg)=>{"use strict";var iu=Object.prototype.hasOwnProperty,Ag=Object.prototype.toString,mg=Object.defineProperty,gg=Object.getOwnPropertyDescriptor,xg=function(e){return typeof Array.isArray=="function"?Array.isArray(e):Ag.call(e)==="[object Array]"},yg=function(e){if(!e||Ag.call(e)!=="[object Object]")return!1;var r=iu.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&iu.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var i;for(i in e);return typeof i>"u"||iu.call(e,i)},bg=function(e,r){mg&&r.name==="__proto__"?mg(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},Eg=function(e,r){if(r==="__proto__")if(iu.call(e,r)){if(gg)return gg(e,r).value}else return;return e[r]};kg.exports=function t(){var e,r,n,i,o,s,a=arguments[0],u=1,l=arguments.length,c=!1;for(typeof a=="boolean"&&(c=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<l;++u)if(e=arguments[u],e!=null)for(r in e)n=Eg(a,r),i=Eg(e,r),a!==i&&(c&&i&&(yg(i)||(o=xg(i)))?(o?(o=!1,s=n&&xg(n)?n:[]):s=n&&yg(n)?n:{},bg(a,{name:r,newValue:t(c,s,i)})):typeof i<"u"&&bg(a,{name:r,newValue:i}));return a}});var es=ns(la(),1);var Rd=t=>Number.isFinite(t)?t:0;function Rk(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Rd(t*1e3)%1e3),nanoseconds:Math.trunc(Rd(t*1e6)%1e3)}}function Fk(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Jl(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Rk(t);break}case"bigint":return Fk(t)}throw new TypeError("Expected a finite number or bigint")}var Nk=t=>t===0||t===0n,Pk=(t,e)=>e===1||e===1n?t:`${t}s`,Lk=1e-7,Mk=24n*60n*60n*1000n;function Gr(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[],o=(c,f)=>{let p=Math.floor(c*10**f+Lk);return(Math.round(p)/10**f).toFixed(f)},s=(c,f,p,d)=>{if(!((i.length===0||!e.colonNotation)&&Nk(c)&&!(e.colonNotation&&p==="m"))){if(d??=String(c),e.colonNotation){let m=d.includes(".")?d.split(".")[0].length:d.length,y=i.length>0?2:1;d="0".repeat(Math.max(0,y-m))+d}else d+=e.verbose?" "+Pk(f,c):p;i.push(d)}},a=Jl(t),u=BigInt(a.days);if(e.hideYearAndDays?s(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?s(u,"day","d"):(s(u/365n,"year","y"),s(u%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){let c=Number(a.seconds),f=Number(a.milliseconds),p=Number(a.microseconds),d=Number(a.nanoseconds);if(s(c,"second","s"),e.formatSubMilliseconds)s(f,"millisecond","ms"),s(p,"microsecond","\xB5s"),s(d,"nanosecond","ns");else{let m=f+p/1e3+d/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,g=m>=1?Math.round(m):Math.ceil(m),b=y?m.toFixed(y):g;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let c=(r?Number(t%Mk):t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,p=o(c,f),d=e.keepDecimalsOnWholeSeconds?p:p.replace(/\.0+$/,"");s(Number.parseFloat(d),"second","s",d)}if(i.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let l=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),n+i.join(l)}import{getMdatReports as zL,log as ht,reporterMdat as Xo}from"remark-mdat";import Fd from"fs";import Nd from"path";import{VFile as Bk}from"vfile";function Ql(t,e,r){let n=ec(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Nd.resolve(n.cwd,n.path)}catch(c){return a(c)}Fd.readFile(u,e,l);function l(c,f){c?a(c):(n.value=f,s(n))}}}function ec(t){return typeof t=="string"||t instanceof URL?t={path:t}:Uk(t)&&(t={path:new TextDecoder().decode(t)}),jk(t)?t:new Bk(t)}function ln(t,e,r){let n=ec(t);if(!r&&typeof e=="function"&&(r=e,e=void 0),!r)return new Promise(o);o(i,r);function i(s){r(void 0,s)}function o(s,a){let u;try{u=Nd.resolve(n.cwd,n.path)}catch(c){return a(c)}Fd.writeFile(u,n.value||"",e||void 0,l);function l(c){c?a(c):s(n)}}}function jk(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function Uk(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}import{notStrictEqual as fw,strictEqual as pw}from"assert";var zk={right:Wk,center:Hk},$k=0,ca=1,qk=2,fa=3,tc=class{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){let r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let r=e.split(`
3
+ `).map(i=>i.split(" ")),n=0;return r.forEach(i=>{i.length>1&&Kt.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),Kt.stringWidth(i[0])))}),r.forEach(i=>{this.div(...i.map((o,s)=>({text:o.trim(),padding:this.measurePadding(o),width:s===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let r=Kt.stripAnsi(e);return[0,r.match(/\s*$/)[0].length,0,r.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(r=>{this.rowToString(r,e)}),e.filter(r=>!r.hidden).map(r=>r.text).join(`
4
+ `)}rowToString(e,r){return this.rasterize(e).forEach((n,i)=>{let o="";n.forEach((s,a)=>{let{width:u}=e[a],l=this.negatePadding(e[a]),c=s;if(l>Kt.stringWidth(s)&&(c+=" ".repeat(l-Kt.stringWidth(s))),e[a].align&&e[a].align!=="left"&&this.wrap){let p=zk[e[a].align];c=p(c,l),Kt.stringWidth(c)<l&&(c+=" ".repeat((u||0)-Kt.stringWidth(c)-1))}let f=e[a].padding||[0,0,0,0];f[fa]&&(o+=" ".repeat(f[fa])),o+=Pd(e[a],c,"| "),o+=c,o+=Pd(e[a],c," |"),f[ca]&&(o+=" ".repeat(f[ca])),i===0&&r.length>0&&(o=this.renderInline(o,r[r.length-1]))}),r.push({text:o.replace(/ +$/,""),span:e.span})}),r}renderInline(e,r){let n=e.match(/^ */),i=n?n[0].length:0,o=r.text,s=Kt.stringWidth(o.trimRight());return r.span?this.wrap?i<s?e:(r.hidden=!0,o.trimRight()+" ".repeat(i-s)+e.trimLeft()):(r.hidden=!0,o+e):e}rasterize(e){let r=[],n=this.columnWidths(e),i;return e.forEach((o,s)=>{o.width=n[s],this.wrap?i=Kt.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
5
5
  `):i=o.text.split(`
6
- `),o.border&&(i.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(i.unshift(...new Array(o.padding[Ww]||0).fill("")),i.push(...new Array(o.padding[Hw]||0).fill(""))),i.forEach((a,u)=>{r[u]||r.push([]);let l=r[u];for(let c=0;c<s;c++)l[c]===void 0&&l.push("");l.push(a)})}),r}negatePadding(e){let r=e.width||0;return e.padding&&(r-=(e.padding[fa]||0)+(e.padding[ca]||0)),e.border&&(r-=4),r}columnWidths(e){if(!this.wrap)return e.map(s=>s.width||Ht.stringWidth(s.text));let r=e.length,n=this.width,i=e.map(s=>{if(s.width)return r--,n-=s.width,s.width}),o=r?Math.floor(n/r):0;return i.map((s,a)=>s===void 0?Math.max(o,Kw(e[a])):s)}};function Md(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}function Kw(t){let e=t.padding||[],r=1+(e[fa]||0)+(e[ca]||0);return t.border?r+4:r}function Yw(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Zw(t,e){t=t.trim();let r=Ht.stringWidth(t);return r<e?" ".repeat(e-r)+t:t}function Xw(t,e){t=t.trim();let r=Ht.stringWidth(t);return r>=e?t:" ".repeat(e-r>>1)+t}var Ht;function Bd(t,e){return Ht=e,new rc({width:t?.width||Yw(),wrap:t?.wrap})}var jd=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function nc(t){return t.replace(jd,"")}function Ud(t,e){let[r,n]=t.match(jd)||["",""];t=nc(t);let i="";for(let o=0;o<t.length;o++)o!==0&&o%e===0&&(i+=`
7
- `),i+=t.charAt(o);return r&&n&&(i=`${r}${i}${n}`),i}function ic(t){return Bd(t,{stringWidth:e=>[...e].length,stripAnsi:nc,wrap:Ud})}import{dirname as zd,resolve as $d}from"path";import{readdirSync as Jw,statSync as Qw}from"fs";function qd(t,e){let r=$d(".",t),n;for(Qw(r).isDirectory()||(r=zd(r));;){if(n=e(r,Jw(r)),n)return $d(r,n);if(r=zd(n=r),n===r)break}}import{inspect as xC}from"util";import{readFileSync as yC}from"fs";import{fileURLToPath as bC}from"url";import{format as rC}from"util";import{normalize as nC,resolve as iC}from"path";function $n(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,i=t.match(/^-+/);for(let o=i?i[0].length:0;o<t.length;o++){let s=t.charAt(o);n&&(n=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?n=!0:s!=="-"&&s!=="_"&&(r+=s)}return r}}function pa(t,e){let r=t.toLowerCase();e=e||"-";let n="";for(let i=0;i<t.length;i++){let o=r.charAt(i),s=t.charAt(i);o!==s&&i>0?n+=`${e}${r.charAt(i)}`:n+=s}return n}function da(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function Vd(t){if(Array.isArray(t))return t.map(s=>typeof s!="string"?s+"":s);t=t.trim();let e=0,r=null,n=null,i=null,o=[];for(let s=0;s<t.length;s++){if(r=n,n=t.charAt(s),n===" "&&!i){r!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),o[e]||(o[e]=""),o[e]+=n}return o}var rr;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(rr||(rr={}));var Gr,ha=class{constructor(e){Gr=e}parse(e,r){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=Vd(e),o=typeof e=="string",s=eC(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],c=n.envPrefix,f=a["populate--"],p=f?"--":"_",d=Object.create(null),m=Object.create(null),y=n.__||Gr.format,g={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},b=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(A){let k=typeof A=="object"?A.key:A,M=Object.keys(A).map(function(I){return{boolean:"bools",string:"strings",number:"numbers"}[I]}).filter(Boolean).pop();M&&(g[M][k]=!0),g.arrays[k]=!0,g.keys.push(k)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(A){g.bools[A]=!0,g.keys.push(A)}),[].concat(n.string||[]).filter(Boolean).forEach(function(A){g.strings[A]=!0,g.keys.push(A)}),[].concat(n.number||[]).filter(Boolean).forEach(function(A){g.numbers[A]=!0,g.keys.push(A)}),[].concat(n.count||[]).filter(Boolean).forEach(function(A){g.counts[A]=!0,g.keys.push(A)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(A){g.normalize[A]=!0,g.keys.push(A)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([A,k])=>{typeof k=="number"&&(g.nargs[A]=k,g.keys.push(A))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([A,k])=>{typeof k=="function"&&(g.coercions[A]=k,g.keys.push(A))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(A){g.configs[A]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([A,k])=>{(typeof k=="boolean"||typeof k=="function")&&(g.configs[A]=k)})),E(n.key,s,n.default,g.arrays),Object.keys(u).forEach(function(A){(g.aliases[A]||[]).forEach(function(k){u[k]=u[A]})});let w=null;Ut();let D=[],R=Object.assign(Object.create(null),{_:[]}),S={};for(let A=0;A<i.length;A++){let k=i[A],M=k.replace(/^-{3,}/,"---"),I,T,K,$,te,lt;if(k!=="--"&&/^-/.test(k)&&oe(k))de(k);else if(M.match(/^---+(=|$)/)){de(k);continue}else if(k.match(/^--.+=/)||!a["short-option-groups"]&&k.match(/^-.+=/))$=k.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(W($[1],g.arrays)?A=be(A,$[1],i,$[2]):W($[1],g.nargs)!==!1?A=ye(A,$[1],i,$[2]):_($[1],$[2],!0));else if(k.match(C)&&a["boolean-negation"])$=k.match(C),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],_(T,W(T,g.arrays)?[!1]:!1));else if(k.match(/^--.+/)||!a["short-option-groups"]&&k.match(/^-[^-]+/))$=k.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!te.match(/^-/)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))));else if(k.match(/^-.\..+=/))$=k.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&_($[1],$[2]);else if(k.match(/^-.\..+/)&&!k.match(b))te=i[A+1],$=k.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],te!==void 0&&!te.match(/^-/)&&!W(T,g.bools)&&!W(T,g.counts)?(_(T,te),A++):_(T,me(T)));else if(k.match(/^-[^-]+/)&&!k.match(b)){K=k.slice(1,-1).split(""),I=!1;for(let Ct=0;Ct<K.length;Ct++){if(te=k.slice(Ct+2),K[Ct+1]&&K[Ct+1]==="="){lt=k.slice(Ct+3),T=K[Ct],W(T,g.arrays)?A=be(A,T,i,lt):W(T,g.nargs)!==!1?A=ye(A,T,i,lt):_(T,lt),I=!0;break}if(te==="-"){_(K[Ct],te);continue}if(/[A-Za-z]/.test(K[Ct])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(te)&&W(te,g.bools)===!1){_(K[Ct],te),I=!0;break}if(K[Ct+1]&&K[Ct+1].match(/\W/)){_(K[Ct],te),I=!0;break}else _(K[Ct],me(K[Ct]))}T=k.slice(-1)[0],!I&&T!=="-"&&(W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!/^(-|--)[^-]/.test(te)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))))}else if(k.match(/^-[0-9]$/)&&k.match(b)&&W(k.slice(1),g.bools))T=k.slice(1),_(T,me(T));else if(k==="--"){D=i.slice(A+1);break}else if(a["halt-at-non-option"]){D=i.slice(A);break}else de(k)}ee(R,!0),ee(R,!1),P(R),ae(),x(R,g.aliases,u,!0),_e(R),a["set-placeholder-key"]&&rt(R),Object.keys(g.counts).forEach(function(A){Ue(R,A.split("."))||_(A,0)}),f&&D.length&&(R[p]=[]),D.forEach(function(A){R[p].push(A)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(R).filter(A=>A!=="--"&&A.includes("-")).forEach(A=>{delete R[A]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(A=>s[A])).forEach(A=>{a["camel-case-expansion"]&&A.includes("-")&&delete R[A.split(".").map(k=>$n(k)).join(".")],delete R[A]});function de(A){let k=v("_",A);(typeof k=="string"||typeof k=="number")&&R._.push(k)}function ye(A,k,M,I){let T,K=W(k,g.nargs);if(K=typeof K!="number"||isNaN(K)?1:K,K===0)return ze(I)||(w=Error(y("Argument unexpected for: %s",k))),_(k,me(k)),A;let $=ze(I)?0:1;if(a["nargs-eats-options"])M.length-(A+1)+$<K&&(w=Error(y("Not enough arguments following: %s",k))),$=K;else{for(T=A+1;T<M.length&&(!M[T].match(/^-[^0-9]/)||M[T].match(b)||oe(M[T]));T++)$++;$<K&&(w=Error(y("Not enough arguments following: %s",k)))}let te=Math.min($,K);for(!ze(I)&&te>0&&(_(k,I),te--),T=A+1;T<te+A+1;T++)_(k,M[T]);return A+te}function be(A,k,M,I){let T=[],K=I||M[A+1],$=W(k,g.nargs);if(W(k,g.bools)&&!/^(true|false)$/.test(K))T.push(!0);else if(ze(K)||ze(I)&&/^-/.test(K)&&!b.test(K)&&!oe(K)){if(u[k]!==void 0){let te=u[k];T=Array.isArray(te)?te:[te]}}else{ze(I)||T.push(F(k,I,!0));for(let te=A+1;te<M.length&&!(!a["greedy-arrays"]&&T.length>0||$&&typeof $=="number"&&T.length>=$||(K=M[te],/^-/.test(K)&&!b.test(K)&&!oe(K)));te++)A=te,T.push(F(k,K,o))}return typeof $=="number"&&($&&T.length<$||isNaN($)&&T.length===0)&&(w=Error(y("Not enough arguments following: %s",k))),_(k,T),A}function _(A,k,M=o){if(/-/.test(A)&&a["camel-case-expansion"]){let K=A.split(".").map(function($){return $n($)}).join(".");L(A,K)}let I=F(A,k,M),T=A.split(".");Je(R,T,I),g.aliases[A]&&g.aliases[A].forEach(function(K){let $=K.split(".");Je(R,$,I)}),T.length>1&&a["dot-notation"]&&(g.aliases[T[0]]||[]).forEach(function(K){let $=K.split("."),te=[].concat(T);te.shift(),$=$.concat(te),(g.aliases[A]||[]).includes($.join("."))||Je(R,$,I)}),W(A,g.normalize)&&!W(A,g.arrays)&&[A].concat(g.aliases[A]||[]).forEach(function($){Object.defineProperty(S,$,{enumerable:!0,get(){return k},set(te){k=typeof te=="string"?Gr.normalize(te):te}})})}function L(A,k){g.aliases[A]&&g.aliases[A].length||(g.aliases[A]=[k],d[k]=!0),g.aliases[k]&&g.aliases[k].length||L(k,A)}function F(A,k,M){M&&(k=tC(k)),(W(A,g.bools)||W(A,g.counts))&&typeof k=="string"&&(k=k==="true");let I=Array.isArray(k)?k.map(function(T){return v(A,T)}):v(A,k);return W(A,g.counts)&&(ze(I)||typeof I=="boolean")&&(I=oc()),W(A,g.normalize)&&W(A,g.arrays)&&(Array.isArray(k)?I=k.map(T=>Gr.normalize(T)):I=Gr.normalize(k)),I}function v(A,k){return!a["parse-positional-numbers"]&&A==="_"||!W(A,g.strings)&&!W(A,g.bools)&&!Array.isArray(k)&&(da(k)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${k}`)))||!ze(k)&&W(A,g.numbers))&&(k=Number(k)),k}function P(A){let k=Object.create(null);x(k,g.aliases,u),Object.keys(g.configs).forEach(function(M){let I=A[M]||k[M];if(I)try{let T=null,K=Gr.resolve(Gr.cwd(),I),$=g.configs[M];if(typeof $=="function"){try{T=$(K)}catch(te){T=te}if(T instanceof Error){w=T;return}}else T=Gr.require(K);j(T)}catch(T){T.name==="PermissionDenied"?w=T:A[M]&&(w=Error(y("Invalid JSON config file: %s",I)))}})}function j(A,k){Object.keys(A).forEach(function(M){let I=A[M],T=k?k+"."+M:M;typeof I=="object"&&I!==null&&!Array.isArray(I)&&a["dot-notation"]?j(I,T):(!Ue(R,T.split("."))||W(T,g.arrays)&&a["combine-arrays"])&&_(T,I)})}function ae(){typeof l<"u"&&l.forEach(function(A){j(A)})}function ee(A,k){if(typeof c>"u")return;let M=typeof c=="string"?c:"",I=Gr.env();Object.keys(I).forEach(function(T){if(M===""||T.lastIndexOf(M,0)===0){let K=T.split("__").map(function($,te){return te===0&&($=$.substring(M.length)),$n($)});(k&&g.configs[K.join(".")]||!k)&&!Ue(A,K)&&_(K.join("."),I[T])}})}function _e(A){let k,M=new Set;Object.keys(A).forEach(function(I){if(!M.has(I)&&(k=W(I,g.coercions),typeof k=="function"))try{let T=v(I,k(A[I]));[].concat(g.aliases[I]||[],I).forEach(K=>{M.add(K),A[K]=T})}catch(T){w=T}})}function rt(A){return g.keys.forEach(k=>{~k.indexOf(".")||typeof A[k]>"u"&&(A[k]=void 0)}),A}function x(A,k,M,I=!1){Object.keys(M).forEach(function(T){Ue(A,T.split("."))||(Je(A,T.split("."),M[T]),I&&(m[T]=!0),(k[T]||[]).forEach(function(K){Ue(A,K.split("."))||Je(A,K.split("."),M[T])}))})}function Ue(A,k){let M=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(T){M=M[T]||{}});let I=k[k.length-1];return typeof M!="object"?!1:I in M}function Je(A,k,M){let I=A;a["dot-notation"]||(k=[k.join(".")]),k.slice(0,-1).forEach(function(lt){lt=Gd(lt),typeof I=="object"&&I[lt]===void 0&&(I[lt]={}),typeof I[lt]!="object"||Array.isArray(I[lt])?(Array.isArray(I[lt])?I[lt].push({}):I[lt]=[I[lt],{}],I=I[lt][I[lt].length-1]):I=I[lt]});let T=Gd(k[k.length-1]),K=W(k.join("."),g.arrays),$=Array.isArray(M),te=a["duplicate-arguments-array"];!te&&W(T,g.nargs)&&(te=!0,(!ze(I[T])&&g.nargs[T]===1||Array.isArray(I[T])&&I[T].length===g.nargs[T])&&(I[T]=void 0)),M===oc()?I[T]=oc(I[T]):Array.isArray(I[T])?te&&K&&$?I[T]=a["flatten-duplicate-arrays"]?I[T].concat(M):(Array.isArray(I[T][0])?I[T]:[I[T]]).concat([M]):!te&&!!K==!!$?I[T]=M:I[T]=I[T].concat([M]):I[T]===void 0&&K?I[T]=$?M:[M]:te&&!(I[T]===void 0||W(T,g.counts)||W(T,g.bools))?I[T]=[I[T],M]:I[T]=M}function E(...A){A.forEach(function(k){Object.keys(k||{}).forEach(function(M){g.aliases[M]||(g.aliases[M]=[].concat(s[M]||[]),g.aliases[M].concat(M).forEach(function(I){if(/-/.test(I)&&a["camel-case-expansion"]){let T=$n(I);T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].concat(M).forEach(function(I){if(I.length>1&&/[A-Z]/.test(I)&&a["camel-case-expansion"]){let T=pa(I,"-");T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].forEach(function(I){g.aliases[I]=[M].concat(g.aliases[M].filter(function(T){return I!==T}))}))})})}function W(A,k){let M=[].concat(g.aliases[A]||[],A),I=Object.keys(k),T=M.find(K=>I.includes(K));return T?k[T]:!1}function Ke(A){let k=Object.keys(g);return[].concat(k.map(I=>g[I])).some(function(I){return Array.isArray(I)?I.includes(A):I[A]})}function ne(A,...k){return[].concat(...k).some(function(I){let T=A.match(I);return T&&Ke(T[1])})}function he(A){if(A.match(b)||!A.match(/^-[^-]+/))return!1;let k=!0,M,I=A.slice(1).split("");for(let T=0;T<I.length;T++){if(M=A.slice(T+2),!Ke(I[T])){k=!1;break}if(I[T+1]&&I[T+1]==="="||M==="-"||/[A-Za-z]/.test(I[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(M)||I[T+1]&&I[T+1].match(/\W/))break}return k}function oe(A){return a["unknown-options-as-args"]&&ce(A)}function ce(A){return A=A.replace(/^-{3,}/,"--"),A.match(b)||he(A)?!1:!ne(A,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function me(A){return!W(A,g.bools)&&!W(A,g.counts)&&`${A}`in u?u[A]:Ce(Fe(A))}function Ce(A){return{[rr.BOOLEAN]:!0,[rr.STRING]:"",[rr.NUMBER]:void 0,[rr.ARRAY]:[]}[A]}function Fe(A){let k=rr.BOOLEAN;return W(A,g.strings)?k=rr.STRING:W(A,g.numbers)?k=rr.NUMBER:W(A,g.bools)?k=rr.BOOLEAN:W(A,g.arrays)&&(k=rr.ARRAY),k}function ze(A){return A===void 0}function Ut(){Object.keys(g.counts).find(A=>W(A,g.arrays)?(w=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",A)),!0):W(A,g.nargs)?(w=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",A)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(S,R),configuration:a,defaulted:Object.assign({},m),error:w,newAliases:Object.assign({},d)}}};function eC(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let o=i+1;o<e.length;o++)if(e[i].filter(function(a){return e[o].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[o]),e.splice(o,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(s,a,u){return u.indexOf(s)===a});let o=i.pop();o!==void 0&&typeof o=="string"&&(r[o]=i)}),r}function oc(t){return t!==void 0?t+1:1}function Gd(t){return t==="__proto__"?"___proto___":t}function tC(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}import{readFileSync as oC}from"fs";var sc,ac,uc,Wd=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Hd=(ac=(sc=process==null?void 0:process.versions)===null||sc===void 0?void 0:sc.node)!==null&&ac!==void 0?ac:(uc=process==null?void 0:process.version)===null||uc===void 0?void 0:uc.slice(1);if(Hd&&Number(Hd.match(/^([^.]+)/)[1])<Wd)throw Error(`yargs parser supports a minimum Node.js version of ${Wd}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var sC=process?process.env:{},Kd=new ha({cwd:process.cwd,env:()=>sC,format:rC,normalize:nC,resolve:iC,require:t=>{if(typeof Er<"u")return Er(t);if(t.match(/\.json$/))return JSON.parse(oC(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),rs=function(e,r){return Kd.parse(e.slice(),r).argv};rs.detailed=function(t,e){return Kd.parse(t.slice(),e)};rs.camelCase=$n;rs.decamelize=pa;rs.looksLikeNumber=da;var lc=rs;import{basename as EC,dirname as AC,extname as wC,relative as CC,resolve as eh}from"path";function Yd(){return aC()?0:1}function aC(){return uC()&&!process.defaultApp}function uC(){return!!process.versions.electron}function cc(t){return t.slice(Yd()+1)}function Zd(){return process.argv[Yd()]}var $e=class t extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};import{readFileSync as lC,statSync as cC,writeFile as fC}from"fs";import{format as pC}from"util";import{resolve as dC}from"path";var Xd={fs:{readFileSync:lC,writeFile:fC},format:pC,resolve:dC,exists:t=>{try{return cC(t).isFile()}catch{return!1}}};var hr,fc=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),hr.format.apply(hr.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),i=e.shift(),o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let s=i===1?r:n;this.cache[this.locale][r]&&(s=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(i),hr.format.apply(hr.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(i,o){let s=r[o+1];n+=i,typeof s<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,i=r.locale,o=r.cb,s=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);hr.fs.writeFile(s,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{hr.fs.readFileSync&&(e=JSON.parse(hr.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=hr.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let i=hr.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return hr.exists(e)}};function Jd(t,e){hr=e;let r=new fc(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}var hC=t=>Jd(t,Xd),Qd=hC;var kC="require is not supported by ESM",th="loading a directory of commands is not supported yet for ESM",ns;try{ns=bC(import.meta.url)}catch{ns=process.cwd()}var TC=ns.substring(0,ns.lastIndexOf("node_modules")),pc={assert:{notStrictEqual:mC,strictEqual:gC},cliui:ic,findUp:qd,getEnv:t=>process.env[t],inspect:xC,getCallerFile:()=>{throw new $e(th)},getProcessArgvBin:Zd,mainFilename:TC||process.cwd(),Parser:lc,path:{basename:EC,dirname:AC,extname:wC,relative:CC,resolve:eh},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:yC,require:()=>{throw new $e(kC)},requireDirectory:()=>{throw new $e(th)},stringWidth:t=>[...t].length,y18n:Qd({directory:eh(ns,"../../../locales"),updateFiles:!1})};function Dt(t,e,r,n){r.assert.notStrictEqual(t,e,n)}function dc(t,e){e.assert.strictEqual(typeof t,"string")}function $i(t){return Object.keys(t)}function qe(t){return!!t&&!!t.then&&typeof t.then=="function"}function ln(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=r.shift();if(!i)throw new Error(`No command found in: ${t}`);let o={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((s,a)=>{let u=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===r.length-1&&(u=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(n,"").split("|"),variadic:u}):o.demanded.push({cmd:s.replace(n,"").split("|"),variadic:u})}),o}var _C=["first","second","third","fourth","fifth","sixth"];function H(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[ln(`cmd ${t}`),e,r]}try{let i=0,[o,s,a]=n(),u=[].slice.call(s);for(;u.length&&u[u.length-1]===void 0;)u.pop();let l=a||u.length;if(l<o.demanded.length)throw new $e(`Not enough arguments provided. Expected ${o.demanded.length} but received ${u.length}.`);let c=o.demanded.length+o.optional.length;if(l>c)throw new $e(`Too many arguments provided. Expected max ${c} but received ${l}.`);o.demanded.forEach(f=>{let p=u.shift(),d=rh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&nh(d,f.cmd,i),i+=1}),o.optional.forEach(f=>{if(u.length===0)return;let p=u.shift(),d=rh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&nh(d,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function rh(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function nh(t,e,r){throw new $e(`Invalid ${_C[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}var ma=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,i=!1){if(H("<array|function> [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");let s=e[o];s.applyBeforeValidation=r,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let o=e;o.applyBeforeValidation=r,o.global=n,o.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let o=[...n[r]||[],r];return i.option?!o.includes(i.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function ih(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}function qn(t,e,r,n){return r.reduce((i,o)=>{if(o.applyBeforeValidation!==n)return i;if(o.mutates){if(o.applied)return i;o.applied=!0}if(qe(i))return i.then(s=>Promise.all([s,o(s,e)])).then(([s,a])=>Object.assign(s,a));{let s=o(i,e);return qe(s)?s.then(a=>Object.assign(i,a)):Object.assign(i,s)}},t)}function Vn(t,e,r=n=>{throw n}){try{let n=SC(t)?t():t;return qe(n)?n.then(i=>e(i)):e(n)}catch(n){return r(n)}}function SC(t){return typeof t=="function"}function hc(t){if(typeof Er>"u")return null;for(let e=0,r=Object.keys(Er.cache),n;e<r.length;e++)if(n=Er.cache[r[e]],n.exports===t)return n;return null}var qi=/(^\*)|(^\$0)/,mc=class{constructor(e,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let o=typeof i.visit=="function"?i.visit:s=>s;i.visit=(s,a,u)=>{let l=o(s,a,u);if(l){if(this.requireCache.has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},e,i)}addHandler(e,r,n,i,o,s){let a=[],u=ih(o);if(i=i||(()=>{}),Array.isArray(e))if(vC(e))[e,...a]=e;else for(let l of e)this.addHandler(l);else if(OC(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(oh(n)){this.addHandler([e].concat(a),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let l=ln(e);a=a.map(p=>ln(p).cmd);let c=!1,f=[l.cmd].concat(a).filter(p=>qi.test(p)?(c=!0,!1):!0);f.length===0&&c&&f.push("$0"),c&&(l.cmd=f[0],a=f.slice(1),e=e.replace(qi,l.cmd)),a.forEach(p=>{this.aliasMap[p]=l.cmd}),r!==!1&&this.usage.command(e,r,c,a,s),this.handlers[l.cmd]={original:e,description:r,handler:i,builder:n||{},middlewares:u,deprecated:s,demanded:l.demanded,optional:l.optional},c&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,i,o,s){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),c=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(c,a,r,n.aliases,l,i,o,s);return qe(f)?f.then(p=>this.applyMiddlewareAndGetResult(c,a,p.innerArgv,u,o,p.aliases,r)):this.applyMiddlewareAndGetResult(c,a,f.innerArgv,u,o,f.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,i,o,s,a,u){let l=r.builder,c=n;if(ga(l)){n.getInternalMethods().getUsageInstance().freeze();let f=l(n.getInternalMethods().reset(i),u);if(qe(f))return f.then(p=>(c=ah(p)?p:n,this.parseAndUpdateUsage(e,r,c,o,s,a)))}else IC(l)&&(n.getInternalMethods().getUsageInstance().freeze(),c=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(f=>{c.option(f,l[f])}));return this.parseAndUpdateUsage(e,r,c,o,s,a)}parseAndUpdateUsage(e,r,n,i,o,s){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);let a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return qe(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=qi.test(r.original)?r.original.replace(qi,"").trim():r.original,i=e.filter(o=>!qi.test(o));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(e,r,n,i,o,s,a,u){if(!s.getInternalMethods().getHasOutput()){let l=s.getInternalMethods().runValidation(o,u,s.parsed.error,e);n=Vn(n,c=>(l(c),c))}if(r.handler&&!s.getInternalMethods().getHasOutput()){s.getInternalMethods().setHasOutput();let l=!!s.getOptions().configuration["populate--"];s.getInternalMethods().postProcess(n,l,!1,!1),n=qn(n,s,a,!1),n=Vn(n,c=>{let f=r.handler(c);return qe(f)?f.then(()=>c):c}),e||s.getInternalMethods().getUsageInstance().cacheHelpMessage(),qe(n)&&!s.getInternalMethods().hasParseCallback()&&n.catch(c=>{try{s.getInternalMethods().getUsageInstance().fail(null,c)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,i,o,s,a){let u={};if(o)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,i,a));let l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),c=qn(n,a,l,!0);return qe(c)?c.then(f=>this.handleValidationAndGetResult(e,r,f,i,s,a,l,u)):this.handleValidationAndGetResult(e,r,c,i,s,a,l,u)}populatePositionals(e,r,n,i){r._=r._.slice(n.commands.length);let o=e.demanded.slice(0),s=e.optional.slice(0),a={};for(this.validation.positionalCount(o.length,r._.length);o.length;){let u=o.shift();this.populatePositional(u,r,a)}for(;s.length;){let u=s.shift();this.populatePositional(u,r,a)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,r,n){let i=e.cmd[0];e.variadic?n[i]=r._.splice(0).map(String):r._.length&&(n[i]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=ln(e);return n.demanded.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s,r.demand[o]=!0}),n.optional.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s}),r}postProcessPositionals(e,r,n,i){let o=Object.assign({},i.getOptions());o.default=Object.assign(n.default,o.default);for(let l of Object.keys(n.alias))o.alias[l]=(o.alias[l]||[]).concat(n.alias[l]);o.array=o.array.concat(n.array),o.config={};let s=[];if(Object.keys(r).forEach(l=>{r[l].map(c=>{o.configuration["unknown-options-as-args"]&&(o.key[l]=!0),s.push(`--${l}`),s.push(c)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let l=Object.keys(r);Object.keys(r).forEach(c=>{l.push(...u.aliases[c])}),Object.keys(u.argv).forEach(c=>{l.includes(c)&&(r[c]||(r[c]=u.argv[c]),!this.isInConfigs(i,c)&&!this.isDefaulted(i,c)&&Object.prototype.hasOwnProperty.call(e,c)&&Object.prototype.hasOwnProperty.call(u.argv,c)&&(Array.isArray(e[c])||Array.isArray(u.argv[c]))?e[c]=[].concat(e[c],u.argv[c]):e[c]=u.argv[c])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=qi.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(ga(r))return r(e,!0);oh(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}moduleName(e){let r=hc(e);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(r.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:r,desc:n}){for(let i of[e,r,n]){if(typeof i=="string"||i===!1)return i;Dt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Dt(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function sh(t,e,r,n){return new mc(t,e,r,n)}function oh(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}function vC(t){return t.every(e=>typeof e=="string")}function ga(t){return typeof t=="function"}function IC(t){return typeof t=="object"}function OC(t){return typeof t=="object"&&!Array.isArray(t)}function cn(t={},e=()=>!0){let r={};return $i(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function fn(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function DC(t){return typeof t=="boolean"}function lh(t,e){let r=e.y18n.__,n={},i=[];n.failFn=function(F){i.push(F)};let o=null,s=null,a=!0;n.showHelpOnFail=function(F=!0,v){let[P,j]=typeof F=="string"?[!0,F]:[F,v];return t.getInternalMethods().isGlobalContext()&&(s=j),o=j,a=P,n};let u=!1;n.fail=function(F,v){let P=t.getInternalMethods().getLoggerInstance();if(i.length)for(let j=i.length-1;j>=0;--j){let ae=i[j];if(DC(ae)){if(v)throw v;if(F)throw Error(F)}else ae(F,v,n)}else{if(t.getExitProcess()&&fn(!0),!u){u=!0,a&&(t.showHelp("error"),P.error()),(F||v)&&P.error(F||v);let j=o||s;j&&((F||v)&&P.error(""),P.error(j))}if(v=v||new $e(F),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,v);throw v}};let l=[],c=!1;n.usage=(L,F)=>L===null?(c=!0,l=[],n):(c=!1,l.push([L,F||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(L,F)=>{f.push([L,F||""])};let p=[];n.command=function(F,v,P,j,ae=!1){P&&(p=p.map(ee=>(ee[2]=!1,ee))),p.push([F,v||"",P,j,ae])},n.getCommands=()=>p;let d={};n.describe=function(F,v){Array.isArray(F)?F.forEach(P=>{n.describe(P,v)}):typeof F=="object"?Object.keys(F).forEach(P=>{n.describe(P,F[P])}):d[F]=v},n.getDescriptions=()=>d;let m=[];n.epilog=L=>{m.push(L)};let y=!1,g;n.wrap=L=>{y=!0,g=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(g=ye(),y=!0),g);let b="__yargsString__:";n.deferY18nLookup=L=>b+L,n.help=function(){if(D)return D;w();let F=t.customScriptName?t.$0:e.path.basename(t.$0),v=t.getDemandedOptions(),P=t.getDemandedCommands(),j=t.getDeprecatedOptions(),ae=t.getGroups(),ee=t.getOptions(),_e=[];_e=_e.concat(Object.keys(d)),_e=_e.concat(Object.keys(v)),_e=_e.concat(Object.keys(P)),_e=_e.concat(Object.keys(ee.default)),_e=_e.filter(S),_e=Object.keys(_e.reduce((ne,he)=>(he!=="_"&&(ne[he]=!0),ne),{}));let rt=n.getWrap(),x=e.cliui({width:rt,wrap:!!rt});if(!c){if(l.length)l.forEach(ne=>{x.div({text:`${ne[0].replace(/\$0/g,F)}`}),ne[1]&&x.div({text:`${ne[1]}`,padding:[1,0,0,0]})}),x.div();else if(p.length){let ne=null;P._?ne=`${F} <${r("command")}>
6
+ `),o.border&&(i.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(i.unshift(...new Array(o.padding[$k]||0).fill("")),i.push(...new Array(o.padding[qk]||0).fill(""))),i.forEach((a,u)=>{r[u]||r.push([]);let l=r[u];for(let c=0;c<s;c++)l[c]===void 0&&l.push("");l.push(a)})}),r}negatePadding(e){let r=e.width||0;return e.padding&&(r-=(e.padding[fa]||0)+(e.padding[ca]||0)),e.border&&(r-=4),r}columnWidths(e){if(!this.wrap)return e.map(s=>s.width||Kt.stringWidth(s.text));let r=e.length,n=this.width,i=e.map(s=>{if(s.width)return r--,n-=s.width,s.width}),o=r?Math.floor(n/r):0;return i.map((s,a)=>s===void 0?Math.max(o,Vk(e[a])):s)}};function Pd(t,e,r){return t.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?r:" ":""}function Vk(t){let e=t.padding||[],r=1+(e[fa]||0)+(e[ca]||0);return t.border?r+4:r}function Gk(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Wk(t,e){t=t.trim();let r=Kt.stringWidth(t);return r<e?" ".repeat(e-r)+t:t}function Hk(t,e){t=t.trim();let r=Kt.stringWidth(t);return r>=e?t:" ".repeat(e-r>>1)+t}var Kt;function Ld(t,e){return Kt=e,new tc({width:t?.width||Gk(),wrap:t?.wrap})}var Md=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function rc(t){return t.replace(Md,"")}function Bd(t,e){let[r,n]=t.match(Md)||["",""];t=rc(t);let i="";for(let o=0;o<t.length;o++)o!==0&&o%e===0&&(i+=`
7
+ `),i+=t.charAt(o);return r&&n&&(i=`${r}${i}${n}`),i}function nc(t){return Ld(t,{stringWidth:e=>[...e].length,stripAnsi:rc,wrap:Bd})}import{dirname as jd,resolve as Ud}from"path";import{readdirSync as Kk,statSync as Yk}from"fs";function zd(t,e){let r=Ud(".",t),n;for(Yk(r).isDirectory()||(r=jd(r));;){if(n=e(r,Kk(r)),n)return Ud(r,n);if(r=jd(n=r),n===r)break}}import{inspect as dw}from"util";import{readFileSync as hw}from"fs";import{fileURLToPath as mw}from"url";import{format as Jk}from"util";import{normalize as Qk,resolve as ew}from"path";function Vn(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),t.indexOf("-")===-1&&t.indexOf("_")===-1)return t;{let r="",n=!1,i=t.match(/^-+/);for(let o=i?i[0].length:0;o<t.length;o++){let s=t.charAt(o);n&&(n=!1,s=s.toUpperCase()),o!==0&&(s==="-"||s==="_")?n=!0:s!=="-"&&s!=="_"&&(r+=s)}return r}}function pa(t,e){let r=t.toLowerCase();e=e||"-";let n="";for(let i=0;i<t.length;i++){let o=r.charAt(i),s=t.charAt(i);o!==s&&i>0?n+=`${e}${r.charAt(i)}`:n+=s}return n}function da(t){return t==null?!1:typeof t=="number"||/^0x[0-9a-f]+$/i.test(t)?!0:/^0[^.]/.test(t)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)}function $d(t){if(Array.isArray(t))return t.map(s=>typeof s!="string"?s+"":s);t=t.trim();let e=0,r=null,n=null,i=null,o=[];for(let s=0;s<t.length;s++){if(r=n,n=t.charAt(s),n===" "&&!i){r!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),o[e]||(o[e]=""),o[e]+=n}return o}var tr;(function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"})(tr||(tr={}));var Wr,ha=class{constructor(e){Wr=e}parse(e,r){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},r),i=$d(e),o=typeof e=="string",s=Zk(Object.assign(Object.create(null),n.alias)),a=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),u=Object.assign(Object.create(null),n.default),l=n.configObjects||[],c=n.envPrefix,f=a["populate--"],p=f?"--":"_",d=Object.create(null),m=Object.create(null),y=n.__||Wr.format,g={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},b=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,w=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(A){let C=typeof A=="object"?A.key:A,M=Object.keys(A).map(function(O){return{boolean:"bools",string:"strings",number:"numbers"}[O]}).filter(Boolean).pop();M&&(g[M][C]=!0),g.arrays[C]=!0,g.keys.push(C)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(A){g.bools[A]=!0,g.keys.push(A)}),[].concat(n.string||[]).filter(Boolean).forEach(function(A){g.strings[A]=!0,g.keys.push(A)}),[].concat(n.number||[]).filter(Boolean).forEach(function(A){g.numbers[A]=!0,g.keys.push(A)}),[].concat(n.count||[]).filter(Boolean).forEach(function(A){g.counts[A]=!0,g.keys.push(A)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(A){g.normalize[A]=!0,g.keys.push(A)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([A,C])=>{typeof C=="number"&&(g.nargs[A]=C,g.keys.push(A))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([A,C])=>{typeof C=="function"&&(g.coercions[A]=C,g.keys.push(A))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(A){g.configs[A]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([A,C])=>{(typeof C=="boolean"||typeof C=="function")&&(g.configs[A]=C)})),E(n.key,s,n.default,g.arrays),Object.keys(u).forEach(function(A){(g.aliases[A]||[]).forEach(function(C){u[C]=u[A]})});let k=null;Ut();let D=[],R=Object.assign(Object.create(null),{_:[]}),S={};for(let A=0;A<i.length;A++){let C=i[A],M=C.replace(/^-{3,}/,"---"),O,T,Y,$,te,lt;if(C!=="--"&&/^-/.test(C)&&oe(C))de(C);else if(M.match(/^---+(=|$)/)){de(C);continue}else if(C.match(/^--.+=/)||!a["short-option-groups"]&&C.match(/^-.+=/))$=C.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(W($[1],g.arrays)?A=be(A,$[1],i,$[2]):W($[1],g.nargs)!==!1?A=ye(A,$[1],i,$[2]):_($[1],$[2],!0));else if(C.match(w)&&a["boolean-negation"])$=C.match(w),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],_(T,W(T,g.arrays)?[!1]:!1));else if(C.match(/^--.+/)||!a["short-option-groups"]&&C.match(/^-[^-]+/))$=C.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!te.match(/^-/)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))));else if(C.match(/^-.\..+=/))$=C.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&_($[1],$[2]);else if(C.match(/^-.\..+/)&&!C.match(b))te=i[A+1],$=C.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(T=$[1],te!==void 0&&!te.match(/^-/)&&!W(T,g.bools)&&!W(T,g.counts)?(_(T,te),A++):_(T,me(T)));else if(C.match(/^-[^-]+/)&&!C.match(b)){Y=C.slice(1,-1).split(""),O=!1;for(let wt=0;wt<Y.length;wt++){if(te=C.slice(wt+2),Y[wt+1]&&Y[wt+1]==="="){lt=C.slice(wt+3),T=Y[wt],W(T,g.arrays)?A=be(A,T,i,lt):W(T,g.nargs)!==!1?A=ye(A,T,i,lt):_(T,lt),O=!0;break}if(te==="-"){_(Y[wt],te);continue}if(/[A-Za-z]/.test(Y[wt])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(te)&&W(te,g.bools)===!1){_(Y[wt],te),O=!0;break}if(Y[wt+1]&&Y[wt+1].match(/\W/)){_(Y[wt],te),O=!0;break}else _(Y[wt],me(Y[wt]))}T=C.slice(-1)[0],!O&&T!=="-"&&(W(T,g.arrays)?A=be(A,T,i):W(T,g.nargs)!==!1?A=ye(A,T,i):(te=i[A+1],te!==void 0&&(!/^(-|--)[^-]/.test(te)||te.match(b))&&!W(T,g.bools)&&!W(T,g.counts)||/^(true|false)$/.test(te)?(_(T,te),A++):_(T,me(T))))}else if(C.match(/^-[0-9]$/)&&C.match(b)&&W(C.slice(1),g.bools))T=C.slice(1),_(T,me(T));else if(C==="--"){D=i.slice(A+1);break}else if(a["halt-at-non-option"]){D=i.slice(A);break}else de(C)}ee(R,!0),ee(R,!1),P(R),ae(),x(R,g.aliases,u,!0),Se(R),a["set-placeholder-key"]&&rt(R),Object.keys(g.counts).forEach(function(A){Ue(R,A.split("."))||_(A,0)}),f&&D.length&&(R[p]=[]),D.forEach(function(A){R[p].push(A)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(R).filter(A=>A!=="--"&&A.includes("-")).forEach(A=>{delete R[A]}),a["strip-aliased"]&&[].concat(...Object.keys(s).map(A=>s[A])).forEach(A=>{a["camel-case-expansion"]&&A.includes("-")&&delete R[A.split(".").map(C=>Vn(C)).join(".")],delete R[A]});function de(A){let C=I("_",A);(typeof C=="string"||typeof C=="number")&&R._.push(C)}function ye(A,C,M,O){let T,Y=W(C,g.nargs);if(Y=typeof Y!="number"||isNaN(Y)?1:Y,Y===0)return ze(O)||(k=Error(y("Argument unexpected for: %s",C))),_(C,me(C)),A;let $=ze(O)?0:1;if(a["nargs-eats-options"])M.length-(A+1)+$<Y&&(k=Error(y("Not enough arguments following: %s",C))),$=Y;else{for(T=A+1;T<M.length&&(!M[T].match(/^-[^0-9]/)||M[T].match(b)||oe(M[T]));T++)$++;$<Y&&(k=Error(y("Not enough arguments following: %s",C)))}let te=Math.min($,Y);for(!ze(O)&&te>0&&(_(C,O),te--),T=A+1;T<te+A+1;T++)_(C,M[T]);return A+te}function be(A,C,M,O){let T=[],Y=O||M[A+1],$=W(C,g.nargs);if(W(C,g.bools)&&!/^(true|false)$/.test(Y))T.push(!0);else if(ze(Y)||ze(O)&&/^-/.test(Y)&&!b.test(Y)&&!oe(Y)){if(u[C]!==void 0){let te=u[C];T=Array.isArray(te)?te:[te]}}else{ze(O)||T.push(F(C,O,!0));for(let te=A+1;te<M.length&&!(!a["greedy-arrays"]&&T.length>0||$&&typeof $=="number"&&T.length>=$||(Y=M[te],/^-/.test(Y)&&!b.test(Y)&&!oe(Y)));te++)A=te,T.push(F(C,Y,o))}return typeof $=="number"&&($&&T.length<$||isNaN($)&&T.length===0)&&(k=Error(y("Not enough arguments following: %s",C))),_(C,T),A}function _(A,C,M=o){if(/-/.test(A)&&a["camel-case-expansion"]){let Y=A.split(".").map(function($){return Vn($)}).join(".");L(A,Y)}let O=F(A,C,M),T=A.split(".");Je(R,T,O),g.aliases[A]&&g.aliases[A].forEach(function(Y){let $=Y.split(".");Je(R,$,O)}),T.length>1&&a["dot-notation"]&&(g.aliases[T[0]]||[]).forEach(function(Y){let $=Y.split("."),te=[].concat(T);te.shift(),$=$.concat(te),(g.aliases[A]||[]).includes($.join("."))||Je(R,$,O)}),W(A,g.normalize)&&!W(A,g.arrays)&&[A].concat(g.aliases[A]||[]).forEach(function($){Object.defineProperty(S,$,{enumerable:!0,get(){return C},set(te){C=typeof te=="string"?Wr.normalize(te):te}})})}function L(A,C){g.aliases[A]&&g.aliases[A].length||(g.aliases[A]=[C],d[C]=!0),g.aliases[C]&&g.aliases[C].length||L(C,A)}function F(A,C,M){M&&(C=Xk(C)),(W(A,g.bools)||W(A,g.counts))&&typeof C=="string"&&(C=C==="true");let O=Array.isArray(C)?C.map(function(T){return I(A,T)}):I(A,C);return W(A,g.counts)&&(ze(O)||typeof O=="boolean")&&(O=ic()),W(A,g.normalize)&&W(A,g.arrays)&&(Array.isArray(C)?O=C.map(T=>Wr.normalize(T)):O=Wr.normalize(C)),O}function I(A,C){return!a["parse-positional-numbers"]&&A==="_"||!W(A,g.strings)&&!W(A,g.bools)&&!Array.isArray(C)&&(da(C)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${C}`)))||!ze(C)&&W(A,g.numbers))&&(C=Number(C)),C}function P(A){let C=Object.create(null);x(C,g.aliases,u),Object.keys(g.configs).forEach(function(M){let O=A[M]||C[M];if(O)try{let T=null,Y=Wr.resolve(Wr.cwd(),O),$=g.configs[M];if(typeof $=="function"){try{T=$(Y)}catch(te){T=te}if(T instanceof Error){k=T;return}}else T=Wr.require(Y);j(T)}catch(T){T.name==="PermissionDenied"?k=T:A[M]&&(k=Error(y("Invalid JSON config file: %s",O)))}})}function j(A,C){Object.keys(A).forEach(function(M){let O=A[M],T=C?C+"."+M:M;typeof O=="object"&&O!==null&&!Array.isArray(O)&&a["dot-notation"]?j(O,T):(!Ue(R,T.split("."))||W(T,g.arrays)&&a["combine-arrays"])&&_(T,O)})}function ae(){typeof l<"u"&&l.forEach(function(A){j(A)})}function ee(A,C){if(typeof c>"u")return;let M=typeof c=="string"?c:"",O=Wr.env();Object.keys(O).forEach(function(T){if(M===""||T.lastIndexOf(M,0)===0){let Y=T.split("__").map(function($,te){return te===0&&($=$.substring(M.length)),Vn($)});(C&&g.configs[Y.join(".")]||!C)&&!Ue(A,Y)&&_(Y.join("."),O[T])}})}function Se(A){let C,M=new Set;Object.keys(A).forEach(function(O){if(!M.has(O)&&(C=W(O,g.coercions),typeof C=="function"))try{let T=I(O,C(A[O]));[].concat(g.aliases[O]||[],O).forEach(Y=>{M.add(Y),A[Y]=T})}catch(T){k=T}})}function rt(A){return g.keys.forEach(C=>{~C.indexOf(".")||typeof A[C]>"u"&&(A[C]=void 0)}),A}function x(A,C,M,O=!1){Object.keys(M).forEach(function(T){Ue(A,T.split("."))||(Je(A,T.split("."),M[T]),O&&(m[T]=!0),(C[T]||[]).forEach(function(Y){Ue(A,Y.split("."))||Je(A,Y.split("."),M[T])}))})}function Ue(A,C){let M=A;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(T){M=M[T]||{}});let O=C[C.length-1];return typeof M!="object"?!1:O in M}function Je(A,C,M){let O=A;a["dot-notation"]||(C=[C.join(".")]),C.slice(0,-1).forEach(function(lt){lt=qd(lt),typeof O=="object"&&O[lt]===void 0&&(O[lt]={}),typeof O[lt]!="object"||Array.isArray(O[lt])?(Array.isArray(O[lt])?O[lt].push({}):O[lt]=[O[lt],{}],O=O[lt][O[lt].length-1]):O=O[lt]});let T=qd(C[C.length-1]),Y=W(C.join("."),g.arrays),$=Array.isArray(M),te=a["duplicate-arguments-array"];!te&&W(T,g.nargs)&&(te=!0,(!ze(O[T])&&g.nargs[T]===1||Array.isArray(O[T])&&O[T].length===g.nargs[T])&&(O[T]=void 0)),M===ic()?O[T]=ic(O[T]):Array.isArray(O[T])?te&&Y&&$?O[T]=a["flatten-duplicate-arrays"]?O[T].concat(M):(Array.isArray(O[T][0])?O[T]:[O[T]]).concat([M]):!te&&!!Y==!!$?O[T]=M:O[T]=O[T].concat([M]):O[T]===void 0&&Y?O[T]=$?M:[M]:te&&!(O[T]===void 0||W(T,g.counts)||W(T,g.bools))?O[T]=[O[T],M]:O[T]=M}function E(...A){A.forEach(function(C){Object.keys(C||{}).forEach(function(M){g.aliases[M]||(g.aliases[M]=[].concat(s[M]||[]),g.aliases[M].concat(M).forEach(function(O){if(/-/.test(O)&&a["camel-case-expansion"]){let T=Vn(O);T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].concat(M).forEach(function(O){if(O.length>1&&/[A-Z]/.test(O)&&a["camel-case-expansion"]){let T=pa(O,"-");T!==M&&g.aliases[M].indexOf(T)===-1&&(g.aliases[M].push(T),d[T]=!0)}}),g.aliases[M].forEach(function(O){g.aliases[O]=[M].concat(g.aliases[M].filter(function(T){return O!==T}))}))})})}function W(A,C){let M=[].concat(g.aliases[A]||[],A),O=Object.keys(C),T=M.find(Y=>O.includes(Y));return T?C[T]:!1}function Ke(A){let C=Object.keys(g);return[].concat(C.map(O=>g[O])).some(function(O){return Array.isArray(O)?O.includes(A):O[A]})}function ne(A,...C){return[].concat(...C).some(function(O){let T=A.match(O);return T&&Ke(T[1])})}function he(A){if(A.match(b)||!A.match(/^-[^-]+/))return!1;let C=!0,M,O=A.slice(1).split("");for(let T=0;T<O.length;T++){if(M=A.slice(T+2),!Ke(O[T])){C=!1;break}if(O[T+1]&&O[T+1]==="="||M==="-"||/[A-Za-z]/.test(O[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(M)||O[T+1]&&O[T+1].match(/\W/))break}return C}function oe(A){return a["unknown-options-as-args"]&&fe(A)}function fe(A){return A=A.replace(/^-{3,}/,"--"),A.match(b)||he(A)?!1:!ne(A,/^-+([^=]+?)=[\s\S]*$/,w,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function me(A){return!W(A,g.bools)&&!W(A,g.counts)&&`${A}`in u?u[A]:we(Fe(A))}function we(A){return{[tr.BOOLEAN]:!0,[tr.STRING]:"",[tr.NUMBER]:void 0,[tr.ARRAY]:[]}[A]}function Fe(A){let C=tr.BOOLEAN;return W(A,g.strings)?C=tr.STRING:W(A,g.numbers)?C=tr.NUMBER:W(A,g.bools)?C=tr.BOOLEAN:W(A,g.arrays)&&(C=tr.ARRAY),C}function ze(A){return A===void 0}function Ut(){Object.keys(g.counts).find(A=>W(A,g.arrays)?(k=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",A)),!0):W(A,g.nargs)?(k=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",A)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(S,R),configuration:a,defaulted:Object.assign({},m),error:k,newAliases:Object.assign({},d)}}};function Zk(t){let e=[],r=Object.create(null),n=!0;for(Object.keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let o=i+1;o<e.length;o++)if(e[i].filter(function(a){return e[o].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[o]),e.splice(o,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(s,a,u){return u.indexOf(s)===a});let o=i.pop();o!==void 0&&typeof o=="string"&&(r[o]=i)}),r}function ic(t){return t!==void 0?t+1:1}function qd(t){return t==="__proto__"?"___proto___":t}function Xk(t){return typeof t=="string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}import{readFileSync as tw}from"fs";var oc,sc,ac,Vd=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Gd=(sc=(oc=process==null?void 0:process.versions)===null||oc===void 0?void 0:oc.node)!==null&&sc!==void 0?sc:(ac=process==null?void 0:process.version)===null||ac===void 0?void 0:ac.slice(1);if(Gd&&Number(Gd.match(/^([^.]+)/)[1])<Vd)throw Error(`yargs parser supports a minimum Node.js version of ${Vd}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var rw=process?process.env:{},Wd=new ha({cwd:process.cwd,env:()=>rw,format:Jk,normalize:Qk,resolve:ew,require:t=>{if(typeof Er<"u")return Er(t);if(t.match(/\.json$/))return JSON.parse(tw(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),is=function(e,r){return Wd.parse(e.slice(),r).argv};is.detailed=function(t,e){return Wd.parse(t.slice(),e)};is.camelCase=Vn;is.decamelize=pa;is.looksLikeNumber=da;var uc=is;import{basename as gw,dirname as xw,extname as yw,relative as bw,resolve as Jd}from"path";function Hd(){return nw()?0:1}function nw(){return iw()&&!process.defaultApp}function iw(){return!!process.versions.electron}function lc(t){return t.slice(Hd()+1)}function Kd(){return process.argv[Hd()]}var $e=class t extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}};import{readFileSync as ow,statSync as sw,writeFile as aw}from"fs";import{format as uw}from"util";import{resolve as lw}from"path";var Yd={fs:{readFileSync:ow,writeFile:aw},format:uw,resolve:lw,exists:t=>{try{return sw(t).isFile()}catch{return!1}}};var hr,cc=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let r=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),hr.format.apply(hr.format,[this.cache[this.locale][r]||r].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),i=e.shift(),o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let s=i===1?r:n;this.cache[this.locale][r]&&(s=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[s];return~s.indexOf("%d")&&a.push(i),hr.format.apply(hr.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(this.cache[this.locale][r]=e[r])}_taggedLiteral(e,...r){let n="";return e.forEach(function(i,o){let s=r[o+1];n+=i,typeof s<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(r,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,r=this.writeQueue[0],n=r.directory,i=r.locale,o=r.cb,s=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);hr.fs.writeFile(s,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(u)})}_readLocaleFile(){let e={},r=this._resolveLocaleFile(this.directory,this.locale);try{hr.fs.readFileSync&&(e=JSON.parse(hr.fs.readFileSync(r,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+r),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,r){let n=hr.resolve(e,"./",r+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~r.lastIndexOf("_")){let i=hr.resolve(e,"./",r.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return hr.exists(e)}};function Zd(t,e){hr=e;let r=new cc(t);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}var cw=t=>Zd(t,Yd),Xd=cw;var Ew="require is not supported by ESM",Qd="loading a directory of commands is not supported yet for ESM",os;try{os=mw(import.meta.url)}catch{os=process.cwd()}var Aw=os.substring(0,os.lastIndexOf("node_modules")),fc={assert:{notStrictEqual:fw,strictEqual:pw},cliui:nc,findUp:zd,getEnv:t=>process.env[t],inspect:dw,getCallerFile:()=>{throw new $e(Qd)},getProcessArgvBin:Kd,mainFilename:Aw||process.cwd(),Parser:uc,path:{basename:gw,dirname:xw,extname:yw,relative:bw,resolve:Jd},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:hw,require:()=>{throw new $e(Ew)},requireDirectory:()=>{throw new $e(Qd)},stringWidth:t=>[...t].length,y18n:Xd({directory:Jd(os,"../../../locales"),updateFiles:!1})};function Rt(t,e,r,n){r.assert.notStrictEqual(t,e,n)}function pc(t,e){e.assert.strictEqual(typeof t,"string")}function Vi(t){return Object.keys(t)}function qe(t){return!!t&&!!t.then&&typeof t.then=="function"}function cn(t){let r=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=r.shift();if(!i)throw new Error(`No command found in: ${t}`);let o={cmd:i.replace(n,""),demanded:[],optional:[]};return r.forEach((s,a)=>{let u=!1;s=s.replace(/\s/g,""),/\.+[\]>]/.test(s)&&a===r.length-1&&(u=!0),/^\[/.test(s)?o.optional.push({cmd:s.replace(n,"").split("|"),variadic:u}):o.demanded.push({cmd:s.replace(n,"").split("|"),variadic:u})}),o}var kw=["first","second","third","fourth","fifth","sixth"];function H(t,e,r){function n(){return typeof t=="object"?[{demanded:[],optional:[]},t,e]:[cn(`cmd ${t}`),e,r]}try{let i=0,[o,s,a]=n(),u=[].slice.call(s);for(;u.length&&u[u.length-1]===void 0;)u.pop();let l=a||u.length;if(l<o.demanded.length)throw new $e(`Not enough arguments provided. Expected ${o.demanded.length} but received ${u.length}.`);let c=o.demanded.length+o.optional.length;if(l>c)throw new $e(`Too many arguments provided. Expected max ${c} but received ${l}.`);o.demanded.forEach(f=>{let p=u.shift(),d=eh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&th(d,f.cmd,i),i+=1}),o.optional.forEach(f=>{if(u.length===0)return;let p=u.shift(),d=eh(p);f.cmd.filter(y=>y===d||y==="*").length===0&&th(d,f.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function eh(t){return Array.isArray(t)?"array":t===null?"null":typeof t}function th(t,e,r){throw new $e(`Invalid ${kw[r]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}var ma=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,r,n=!0,i=!1){if(H("<array|function> [boolean] [boolean] [boolean]",[e,r,n],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");let s=e[o];s.applyBeforeValidation=r,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let o=e;o.applyBeforeValidation=r,o.global=n,o.mutates=i,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,r){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let o=[...n[r]||[],r];return i.option?!o.includes(i.option):!0}),e.option=r,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function rh(t){return t?t.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Gn(t,e,r,n){return r.reduce((i,o)=>{if(o.applyBeforeValidation!==n)return i;if(o.mutates){if(o.applied)return i;o.applied=!0}if(qe(i))return i.then(s=>Promise.all([s,o(s,e)])).then(([s,a])=>Object.assign(s,a));{let s=o(i,e);return qe(s)?s.then(a=>Object.assign(i,a)):Object.assign(i,s)}},t)}function Wn(t,e,r=n=>{throw n}){try{let n=ww(t)?t():t;return qe(n)?n.then(i=>e(i)):e(n)}catch(n){return r(n)}}function ww(t){return typeof t=="function"}function dc(t){if(typeof Er>"u")return null;for(let e=0,r=Object.keys(Er.cache),n;e<r.length;e++)if(n=Er.cache[r[e]],n.exports===t)return n;return null}var Gi=/(^\*)|(^\$0)/,hc=class{constructor(e,r,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=r}addDirectory(e,r,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let o=typeof i.visit=="function"?i.visit:s=>s;i.visit=(s,a,u)=>{let l=o(s,a,u);if(l){if(this.requireCache.has(a))return l;this.requireCache.add(a),this.addHandler(l)}return l},this.shim.requireDirectory({require:r,filename:n},e,i)}addHandler(e,r,n,i,o,s){let a=[],u=rh(o);if(i=i||(()=>{}),Array.isArray(e))if(Cw(e))[e,...a]=e;else for(let l of e)this.addHandler(l);else if(_w(e)){let l=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(l=[].concat(l).concat(e.aliases)),this.addHandler(l,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(nh(n)){this.addHandler([e].concat(a),r,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let l=cn(e);a=a.map(p=>cn(p).cmd);let c=!1,f=[l.cmd].concat(a).filter(p=>Gi.test(p)?(c=!0,!1):!0);f.length===0&&c&&f.push("$0"),c&&(l.cmd=f[0],a=f.slice(1),e=e.replace(Gi,l.cmd)),a.forEach(p=>{this.aliasMap[p]=l.cmd}),r!==!1&&this.usage.command(e,r,c,a,s),this.handlers[l.cmd]={original:e,description:r,handler:i,builder:n||{},middlewares:u,deprecated:s,demanded:l.demanded,optional:l.optional},c&&(this.defaultCommand=this.handlers[l.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,r,n,i,o,s){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=r.getInternalMethods().getContext(),l=u.commands.slice(),c=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));let f=this.applyBuilderUpdateUsageAndParse(c,a,r,n.aliases,l,i,o,s);return qe(f)?f.then(p=>this.applyMiddlewareAndGetResult(c,a,p.innerArgv,u,o,p.aliases,r)):this.applyMiddlewareAndGetResult(c,a,f.innerArgv,u,o,f.aliases,r)}applyBuilderUpdateUsageAndParse(e,r,n,i,o,s,a,u){let l=r.builder,c=n;if(ga(l)){n.getInternalMethods().getUsageInstance().freeze();let f=l(n.getInternalMethods().reset(i),u);if(qe(f))return f.then(p=>(c=oh(p)?p:n,this.parseAndUpdateUsage(e,r,c,o,s,a)))}else Tw(l)&&(n.getInternalMethods().getUsageInstance().freeze(),c=n.getInternalMethods().reset(i),Object.keys(r.builder).forEach(f=>{c.option(f,l[f])}));return this.parseAndUpdateUsage(e,r,c,o,s,a)}parseAndUpdateUsage(e,r,n,i,o,s){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,r),r.description);let a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,s);return qe(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,r){let n=Gi.test(r.original)?r.original.replace(Gi,"").trim():r.original,i=e.filter(o=>!Gi.test(o));return i.push(n),`$0 ${i.join(" ")}`}handleValidationAndGetResult(e,r,n,i,o,s,a,u){if(!s.getInternalMethods().getHasOutput()){let l=s.getInternalMethods().runValidation(o,u,s.parsed.error,e);n=Wn(n,c=>(l(c),c))}if(r.handler&&!s.getInternalMethods().getHasOutput()){s.getInternalMethods().setHasOutput();let l=!!s.getOptions().configuration["populate--"];s.getInternalMethods().postProcess(n,l,!1,!1),n=Gn(n,s,a,!1),n=Wn(n,c=>{let f=r.handler(c);return qe(f)?f.then(()=>c):c}),e||s.getInternalMethods().getUsageInstance().cacheHelpMessage(),qe(n)&&!s.getInternalMethods().hasParseCallback()&&n.catch(c=>{try{s.getInternalMethods().getUsageInstance().fail(null,c)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,r,n,i,o,s,a){let u={};if(o)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(r,n,i,a));let l=this.globalMiddleware.getMiddleware().slice(0).concat(r.middlewares),c=Gn(n,a,l,!0);return qe(c)?c.then(f=>this.handleValidationAndGetResult(e,r,f,i,s,a,l,u)):this.handleValidationAndGetResult(e,r,c,i,s,a,l,u)}populatePositionals(e,r,n,i){r._=r._.slice(n.commands.length);let o=e.demanded.slice(0),s=e.optional.slice(0),a={};for(this.validation.positionalCount(o.length,r._.length);o.length;){let u=o.shift();this.populatePositional(u,r,a)}for(;s.length;){let u=s.shift();this.populatePositional(u,r,a)}return r._=n.commands.concat(r._.map(u=>""+u)),this.postProcessPositionals(r,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,r,n){let i=e.cmd[0];e.variadic?n[i]=r._.splice(0).map(String):r._.length&&(n[i]=[String(r._.shift())])}cmdToParseOptions(e){let r={array:[],default:{},alias:{},demand:{}},n=cn(e);return n.demanded.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s,r.demand[o]=!0}),n.optional.forEach(i=>{let[o,...s]=i.cmd;i.variadic&&(r.array.push(o),r.default[o]=[]),r.alias[o]=s}),r}postProcessPositionals(e,r,n,i){let o=Object.assign({},i.getOptions());o.default=Object.assign(n.default,o.default);for(let l of Object.keys(n.alias))o.alias[l]=(o.alias[l]||[]).concat(n.alias[l]);o.array=o.array.concat(n.array),o.config={};let s=[];if(Object.keys(r).forEach(l=>{r[l].map(c=>{o.configuration["unknown-options-as-args"]&&(o.key[l]=!0),s.push(`--${l}`),s.push(c)})}),!s.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(s,Object.assign({},o,{configuration:a}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let l=Object.keys(r);Object.keys(r).forEach(c=>{l.push(...u.aliases[c])}),Object.keys(u.argv).forEach(c=>{l.includes(c)&&(r[c]||(r[c]=u.argv[c]),!this.isInConfigs(i,c)&&!this.isDefaulted(i,c)&&Object.prototype.hasOwnProperty.call(e,c)&&Object.prototype.hasOwnProperty.call(u.argv,c)&&(Array.isArray(e[c])||Array.isArray(u.argv[c]))?e[c]=[].concat(e[c],u.argv[c]):e[c]=u.argv[c])})}}isDefaulted(e,r){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,r)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(r))}isInConfigs(e,r){let{configObjects:n}=e.getOptions();return n.some(i=>Object.prototype.hasOwnProperty.call(i,r))||n.some(i=>Object.prototype.hasOwnProperty.call(i,this.shim.Parser.camelCase(r)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=Gi.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let r=this.defaultCommand.builder;if(ga(r))return r(e,!0);nh(r)||Object.keys(r).forEach(n=>{e.option(n,r[n])})}moduleName(e){let r=dc(e);if(!r)throw new Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(r.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:r,desc:n}){for(let i of[e,r,n]){if(typeof i=="string"||i===!1)return i;Rt(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Rt(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function ih(t,e,r,n){return new hc(t,e,r,n)}function nh(t){return typeof t=="object"&&!!t.builder&&typeof t.handler=="function"}function Cw(t){return t.every(e=>typeof e=="string")}function ga(t){return typeof t=="function"}function Tw(t){return typeof t=="object"}function _w(t){return typeof t=="object"&&!Array.isArray(t)}function fn(t={},e=()=>!0){let r={};return Vi(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function pn(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function Sw(t){return typeof t=="boolean"}function ah(t,e){let r=e.y18n.__,n={},i=[];n.failFn=function(F){i.push(F)};let o=null,s=null,a=!0;n.showHelpOnFail=function(F=!0,I){let[P,j]=typeof F=="string"?[!0,F]:[F,I];return t.getInternalMethods().isGlobalContext()&&(s=j),o=j,a=P,n};let u=!1;n.fail=function(F,I){let P=t.getInternalMethods().getLoggerInstance();if(i.length)for(let j=i.length-1;j>=0;--j){let ae=i[j];if(Sw(ae)){if(I)throw I;if(F)throw Error(F)}else ae(F,I,n)}else{if(t.getExitProcess()&&pn(!0),!u){u=!0,a&&(t.showHelp("error"),P.error()),(F||I)&&P.error(F||I);let j=o||s;j&&((F||I)&&P.error(""),P.error(j))}if(I=I||new $e(F),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,I);throw I}};let l=[],c=!1;n.usage=(L,F)=>L===null?(c=!0,l=[],n):(c=!1,l.push([L,F||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(L,F)=>{f.push([L,F||""])};let p=[];n.command=function(F,I,P,j,ae=!1){P&&(p=p.map(ee=>(ee[2]=!1,ee))),p.push([F,I||"",P,j,ae])},n.getCommands=()=>p;let d={};n.describe=function(F,I){Array.isArray(F)?F.forEach(P=>{n.describe(P,I)}):typeof F=="object"?Object.keys(F).forEach(P=>{n.describe(P,F[P])}):d[F]=I},n.getDescriptions=()=>d;let m=[];n.epilog=L=>{m.push(L)};let y=!1,g;n.wrap=L=>{y=!0,g=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(g=ye(),y=!0),g);let b="__yargsString__:";n.deferY18nLookup=L=>b+L,n.help=function(){if(D)return D;k();let F=t.customScriptName?t.$0:e.path.basename(t.$0),I=t.getDemandedOptions(),P=t.getDemandedCommands(),j=t.getDeprecatedOptions(),ae=t.getGroups(),ee=t.getOptions(),Se=[];Se=Se.concat(Object.keys(d)),Se=Se.concat(Object.keys(I)),Se=Se.concat(Object.keys(P)),Se=Se.concat(Object.keys(ee.default)),Se=Se.filter(S),Se=Object.keys(Se.reduce((ne,he)=>(he!=="_"&&(ne[he]=!0),ne),{}));let rt=n.getWrap(),x=e.cliui({width:rt,wrap:!!rt});if(!c){if(l.length)l.forEach(ne=>{x.div({text:`${ne[0].replace(/\$0/g,F)}`}),ne[1]&&x.div({text:`${ne[1]}`,padding:[1,0,0,0]})}),x.div();else if(p.length){let ne=null;P._?ne=`${F} <${r("command")}>
8
8
  `:ne=`${F} [${r("command")}]
9
- `,x.div(`${ne}`)}}if(p.length>1||p.length===1&&!p[0][2]){x.div(r("Commands:"));let ne=t.getInternalMethods().getContext(),he=ne.commands.length?`${ne.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((ce,me)=>ce[0].localeCompare(me[0])));let oe=F?`${F} `:"";p.forEach(ce=>{let me=`${oe}${he}${ce[0].replace(/^\$0 ?/,"")}`;x.span({text:me,padding:[0,2,0,2],width:C(p,rt,`${F}${he}`)+4},{text:ce[1]});let Ce=[];ce[2]&&Ce.push(`[${r("default")}]`),ce[3]&&ce[3].length&&Ce.push(`[${r("aliases:")} ${ce[3].join(", ")}]`),ce[4]&&(typeof ce[4]=="string"?Ce.push(`[${r("deprecated: %s",ce[4])}]`):Ce.push(`[${r("deprecated")}]`)),Ce.length?x.div({text:Ce.join(" "),padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}let Ue=(Object.keys(ee.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);_e=_e.filter(ne=>!t.parsed.newAliases[ne]&&Ue.every(he=>(ee.alias[he]||[]).indexOf(ne)===-1));let Je=r("Options:");ae[Je]||(ae[Je]=[]),R(_e,ee.alias,ae,Je);let E=ne=>/^--/.test(xa(ne)),W=Object.keys(ae).filter(ne=>ae[ne].length>0).map(ne=>{let he=ae[ne].filter(S).map(oe=>{if(Ue.includes(oe))return oe;for(let ce=0,me;(me=Ue[ce])!==void 0;ce++)if((ee.alias[me]||[]).includes(oe))return me;return oe});return{groupName:ne,normalizedKeys:he}}).filter(({normalizedKeys:ne})=>ne.length>0).map(({groupName:ne,normalizedKeys:he})=>{let oe=he.reduce((ce,me)=>(ce[me]=[me].concat(ee.alias[me]||[]).map(Ce=>ne===n.getPositionalGroupName()?Ce:(/^[0-9]$/.test(Ce)?ee.boolean.includes(me)?"-":"--":Ce.length>1?"--":"-")+Ce).sort((Ce,Fe)=>E(Ce)===E(Fe)?0:E(Ce)?1:-1).join(", "),ce),{});return{groupName:ne,normalizedKeys:he,switches:oe}});if(W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).some(({normalizedKeys:ne,switches:he})=>!ne.every(oe=>E(he[oe])))&&W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).forEach(({normalizedKeys:ne,switches:he})=>{ne.forEach(oe=>{E(he[oe])&&(he[oe]=RC(he[oe],4))})}),W.forEach(({groupName:ne,normalizedKeys:he,switches:oe})=>{x.div(ne),he.forEach(ce=>{let me=oe[ce],Ce=d[ce]||"",Fe=null;Ce.includes(b)&&(Ce=r(Ce.substring(b.length))),ee.boolean.includes(ce)&&(Fe=`[${r("boolean")}]`),ee.count.includes(ce)&&(Fe=`[${r("count")}]`),ee.string.includes(ce)&&(Fe=`[${r("string")}]`),ee.normalize.includes(ce)&&(Fe=`[${r("string")}]`),ee.array.includes(ce)&&(Fe=`[${r("array")}]`),ee.number.includes(ce)&&(Fe=`[${r("number")}]`);let ze=k=>typeof k=="string"?`[${r("deprecated: %s",k)}]`:`[${r("deprecated")}]`,Ut=[ce in j?ze(j[ce]):null,Fe,ce in v?`[${r("required")}]`:null,ee.choices&&ee.choices[ce]?`[${r("choices:")} ${n.stringifiedValues(ee.choices[ce])}]`:null,de(ee.default[ce],ee.defaultDescription[ce])].filter(Boolean).join(" ");x.span({text:xa(me),padding:[0,2,0,2+uh(me)],width:C(oe,rt)+4},Ce);let A=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Ut&&!A?x.div({text:Ut,padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}),f.length&&(x.div(r("Examples:")),f.forEach(ne=>{ne[0]=ne[0].replace(/\$0/g,F)}),f.forEach(ne=>{ne[1]===""?x.div({text:ne[0],padding:[0,2,0,2]}):x.div({text:ne[0],padding:[0,2,0,2],width:C(f,rt)+4},{text:ne[1]})}),x.div()),m.length>0){let ne=m.map(he=>he.replace(/\$0/g,F)).join(`
9
+ `,x.div(`${ne}`)}}if(p.length>1||p.length===1&&!p[0][2]){x.div(r("Commands:"));let ne=t.getInternalMethods().getContext(),he=ne.commands.length?`${ne.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(p=p.sort((fe,me)=>fe[0].localeCompare(me[0])));let oe=F?`${F} `:"";p.forEach(fe=>{let me=`${oe}${he}${fe[0].replace(/^\$0 ?/,"")}`;x.span({text:me,padding:[0,2,0,2],width:w(p,rt,`${F}${he}`)+4},{text:fe[1]});let we=[];fe[2]&&we.push(`[${r("default")}]`),fe[3]&&fe[3].length&&we.push(`[${r("aliases:")} ${fe[3].join(", ")}]`),fe[4]&&(typeof fe[4]=="string"?we.push(`[${r("deprecated: %s",fe[4])}]`):we.push(`[${r("deprecated")}]`)),we.length?x.div({text:we.join(" "),padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}let Ue=(Object.keys(ee.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);Se=Se.filter(ne=>!t.parsed.newAliases[ne]&&Ue.every(he=>(ee.alias[he]||[]).indexOf(ne)===-1));let Je=r("Options:");ae[Je]||(ae[Je]=[]),R(Se,ee.alias,ae,Je);let E=ne=>/^--/.test(xa(ne)),W=Object.keys(ae).filter(ne=>ae[ne].length>0).map(ne=>{let he=ae[ne].filter(S).map(oe=>{if(Ue.includes(oe))return oe;for(let fe=0,me;(me=Ue[fe])!==void 0;fe++)if((ee.alias[me]||[]).includes(oe))return me;return oe});return{groupName:ne,normalizedKeys:he}}).filter(({normalizedKeys:ne})=>ne.length>0).map(({groupName:ne,normalizedKeys:he})=>{let oe=he.reduce((fe,me)=>(fe[me]=[me].concat(ee.alias[me]||[]).map(we=>ne===n.getPositionalGroupName()?we:(/^[0-9]$/.test(we)?ee.boolean.includes(me)?"-":"--":we.length>1?"--":"-")+we).sort((we,Fe)=>E(we)===E(Fe)?0:E(we)?1:-1).join(", "),fe),{});return{groupName:ne,normalizedKeys:he,switches:oe}});if(W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).some(({normalizedKeys:ne,switches:he})=>!ne.every(oe=>E(he[oe])))&&W.filter(({groupName:ne})=>ne!==n.getPositionalGroupName()).forEach(({normalizedKeys:ne,switches:he})=>{ne.forEach(oe=>{E(he[oe])&&(he[oe]=Iw(he[oe],4))})}),W.forEach(({groupName:ne,normalizedKeys:he,switches:oe})=>{x.div(ne),he.forEach(fe=>{let me=oe[fe],we=d[fe]||"",Fe=null;we.includes(b)&&(we=r(we.substring(b.length))),ee.boolean.includes(fe)&&(Fe=`[${r("boolean")}]`),ee.count.includes(fe)&&(Fe=`[${r("count")}]`),ee.string.includes(fe)&&(Fe=`[${r("string")}]`),ee.normalize.includes(fe)&&(Fe=`[${r("string")}]`),ee.array.includes(fe)&&(Fe=`[${r("array")}]`),ee.number.includes(fe)&&(Fe=`[${r("number")}]`);let ze=C=>typeof C=="string"?`[${r("deprecated: %s",C)}]`:`[${r("deprecated")}]`,Ut=[fe in j?ze(j[fe]):null,Fe,fe in I?`[${r("required")}]`:null,ee.choices&&ee.choices[fe]?`[${r("choices:")} ${n.stringifiedValues(ee.choices[fe])}]`:null,de(ee.default[fe],ee.defaultDescription[fe])].filter(Boolean).join(" ");x.span({text:xa(me),padding:[0,2,0,2+sh(me)],width:w(oe,rt)+4},we);let A=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Ut&&!A?x.div({text:Ut,padding:[0,0,0,2],align:"right"}):x.div()}),x.div()}),f.length&&(x.div(r("Examples:")),f.forEach(ne=>{ne[0]=ne[0].replace(/\$0/g,F)}),f.forEach(ne=>{ne[1]===""?x.div({text:ne[0],padding:[0,2,0,2]}):x.div({text:ne[0],padding:[0,2,0,2],width:w(f,rt)+4},{text:ne[1]})}),x.div()),m.length>0){let ne=m.map(he=>he.replace(/\$0/g,F)).join(`
10
10
  `);x.div(`${ne}
11
- `)}return x.toString().replace(/\s*$/,"")};function C(L,F,v){let P=0;return Array.isArray(L)||(L=Object.values(L).map(j=>[j])),L.forEach(j=>{P=Math.max(e.stringWidth(v?`${v} ${xa(j[0])}`:xa(j[0]))+uh(j[0]),P)}),F&&(P=Math.min(P,parseInt((F*.5).toString(),10))),P}function w(){let L=t.getDemandedOptions(),F=t.getOptions();(Object.keys(F.alias)||[]).forEach(v=>{F.alias[v].forEach(P=>{d[P]&&n.describe(v,d[P]),P in L&&t.demandOption(v,L[P]),F.boolean.includes(P)&&t.boolean(v),F.count.includes(P)&&t.count(v),F.string.includes(P)&&t.string(v),F.normalize.includes(P)&&t.normalize(v),F.array.includes(P)&&t.array(v),F.number.includes(P)&&t.number(v)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function R(L,F,v,P){let j=[],ae=null;return Object.keys(v).forEach(ee=>{j=j.concat(v[ee])}),L.forEach(ee=>{ae=[ee].concat(F[ee]),ae.some(_e=>j.indexOf(_e)!==-1)||v[P].push(ee)}),j}function S(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(F,v){let P="",j=v||", ",ae=[].concat(F);return!F||!ae.length||ae.forEach(ee=>{P.length&&(P+=j),P+=JSON.stringify(ee)}),P};function de(L,F){let v=`[${r("default:")} `;if(L===void 0&&!F)return null;if(F)v+=F;else switch(typeof L){case"string":v+=`"${L}"`;break;case"object":v+=JSON.stringify(L);break;default:v+=L}return`${v}]`}function ye(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let be=null;n.version=L=>{be=L},n.showVersion=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(be)},n.reset=function(F){return o=null,u=!1,l=[],c=!1,m=[],f=[],p=[],d=cn(d,v=>!F[v]),n};let _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d})},n.unfreeze=function(F=!1){let v=_.pop();v&&(F?(d={...v.descriptions,...d},p=[...v.commands,...p],l=[...v.usages,...l],f=[...v.examples,...f],m=[...v.epilogs,...m]):{failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d}=v)},n}function gc(t){return typeof t=="object"}function RC(t,e){return gc(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}function uh(t){return gc(t)?t.indentation:0}function xa(t){return gc(t)?t.text:t}var ch=`###-begin-{{app_name}}-completions-###
11
+ `)}return x.toString().replace(/\s*$/,"")};function w(L,F,I){let P=0;return Array.isArray(L)||(L=Object.values(L).map(j=>[j])),L.forEach(j=>{P=Math.max(e.stringWidth(I?`${I} ${xa(j[0])}`:xa(j[0]))+sh(j[0]),P)}),F&&(P=Math.min(P,parseInt((F*.5).toString(),10))),P}function k(){let L=t.getDemandedOptions(),F=t.getOptions();(Object.keys(F.alias)||[]).forEach(I=>{F.alias[I].forEach(P=>{d[P]&&n.describe(I,d[P]),P in L&&t.demandOption(I,L[P]),F.boolean.includes(P)&&t.boolean(I),F.count.includes(P)&&t.count(I),F.string.includes(P)&&t.string(I),F.normalize.includes(P)&&t.normalize(I),F.array.includes(P)&&t.array(I),F.number.includes(P)&&t.number(I)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function R(L,F,I,P){let j=[],ae=null;return Object.keys(I).forEach(ee=>{j=j.concat(I[ee])}),L.forEach(ee=>{ae=[ee].concat(F[ee]),ae.some(Se=>j.indexOf(Se)!==-1)||I[P].push(ee)}),j}function S(L){return t.getOptions().hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(F,I){let P="",j=I||", ",ae=[].concat(F);return!F||!ae.length||ae.forEach(ee=>{P.length&&(P+=j),P+=JSON.stringify(ee)}),P};function de(L,F){let I=`[${r("default:")} `;if(L===void 0&&!F)return null;if(F)I+=F;else switch(typeof L){case"string":I+=`"${L}"`;break;case"object":I+=JSON.stringify(L);break;default:I+=L}return`${I}]`}function ye(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let be=null;n.version=L=>{be=L},n.showVersion=L=>{let F=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:F[L])(be)},n.reset=function(F){return o=null,u=!1,l=[],c=!1,m=[],f=[],p=[],d=fn(d,I=>!F[I]),n};let _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d})},n.unfreeze=function(F=!1){let I=_.pop();I&&(F?(d={...I.descriptions,...d},p=[...I.commands,...p],l=[...I.usages,...l],f=[...I.examples,...f],m=[...I.epilogs,...m]):{failMessage:o,failureOutput:u,usages:l,usageDisabled:c,epilogs:m,examples:f,commands:p,descriptions:d}=I)},n}function mc(t){return typeof t=="object"}function Iw(t,e){return mc(t)?{text:t.text,indentation:t.indentation+e}:{text:t,indentation:e}}function sh(t){return mc(t)?t.indentation:0}function xa(t){return mc(t)?t.text:t}var uh=`###-begin-{{app_name}}-completions-###
12
12
  #
13
13
  # yargs command completion script
14
14
  #
@@ -36,7 +36,7 @@ _{{app_name}}_yargs_completions()
36
36
  }
37
37
  complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
38
38
  ###-end-{{app_name}}-completions-###
39
- `,fh=`#compdef {{app_name}}
39
+ `,lh=`#compdef {{app_name}}
40
40
  ###-begin-{{app_name}}-completions-###
41
41
  #
42
42
  # yargs command completion script
@@ -55,122 +55,122 @@ _{{app_name}}_yargs_completions()
55
55
  }
56
56
  compdef _{{app_name}}_yargs_completions {{app_name}}
57
57
  ###-end-{{app_name}}-completions-###
58
- `;var xc=class{constructor(e,r,n,i){var o,s,a;this.yargs=e,this.usage=r,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((s=this.shim.getEnv("ZSH_NAME"))===null||s===void 0?void 0:s.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,r,n,i){let o=this.command.getCommandHandlers();for(let a=0,u=e.length;a<u;++a)if(o[e[a]]&&o[e[a]].builder){let l=o[e[a]].builder;if(ga(l)){this.indexAfterLastReset=a+1;let c=this.yargs.getInternalMethods().reset();return l(c,!0),c.argv}}let s=[];this.commandCompletions(s,e,n),this.optionCompletions(s,e,r,n),this.choicesFromOptionsCompletions(s,e,r,n),this.choicesFromPositionalsCompletions(s,e,r,n),i(null,s)}commandCompletions(e,r,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&!this.previousArgHasChoices(r)&&this.usage.getCommands().forEach(o=>{let s=ln(o[0]).cmd;if(r.indexOf(s)===-1)if(!this.zshShell)e.push(s);else{let a=o[1]||"";e.push(s.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,r,n,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(r)){let o=this.yargs.getOptions(),s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(a=>{let u=!!o.configuration["boolean-negation"]&&o.boolean.includes(a);!s.includes(a)&&!o.hiddenOptions.includes(a)&&!this.argsContainKey(r,a,u)&&this.completeOptionKey(a,e,i,u&&!!o.default[a])})}}choicesFromOptionsCompletions(e,r,n,i){if(this.previousArgHasChoices(r)){let o=this.getPreviousArgChoices(r);o&&o.length>0&&e.push(...o.map(s=>s.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,i){if(i===""&&e.length>0&&this.previousArgHasChoices(r))return;let o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],s=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=o[n._.length-s-1];if(!a)return;let u=this.yargs.getOptions().choices[a]||[];for(let l of u)l.startsWith(i)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let i=r.replace(/^-+/,""),o=this.yargs.getOptions(),s=[i,...this.yargs.getAliases()[i]||[]],a;for(let u of s)if(Object.prototype.hasOwnProperty.call(o.key,u)&&Array.isArray(o.choices[u])){a=o.choices[u];break}if(a)return a.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let i=o=>e.indexOf((/^[^0-9]$/.test(o)?"-":"--")+o)!==-1;if(i(r)||n&&i(`no-${r}`))return!0;if(this.aliases){for(let o of this.aliases[r])if(i(o))return!0}return!1}completeOptionKey(e,r,n,i){var o,s,a,u;let l=e;if(this.zshShell){let d=this.usage.getDescriptions(),m=(s=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||s===void 0?void 0:s.find(b=>{let C=d[b];return typeof C=="string"&&C.length>0}),y=m?d[m]:void 0,g=(u=(a=d[e])!==null&&a!==void 0?a:y)!==null&&u!==void 0?u:"";l=`${e.replace(/:/g,"\\:")}:${g.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let c=d=>/^--/.test(d),f=d=>/^[^0-9]$/.test(d),p=!c(n)&&f(e)?"-":"--";r.push(p+l),i&&r.push(p+"no-"+l)}customCompletion(e,r,n,i){if(Dt(this.customCompletionFunction,null,this.shim),NC(this.customCompletionFunction)){let o=this.customCompletionFunction(n,r);return qe(o)?o.then(s=>{this.shim.process.nextTick(()=>{i(null,s)})}).catch(s=>{this.shim.process.nextTick(()=>{i(s,void 0)})}):i(null,o)}else return PC(this.customCompletionFunction)?this.customCompletionFunction(n,r,(o=i)=>this.defaultCompletion(e,r,n,o),o=>{i(null,o)}):this.customCompletionFunction(n,r,o=>{i(null,o)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),o=this.customCompletionFunction?s=>this.customCompletion(e,s,n,r):s=>this.defaultCompletion(e,s,n,r);return qe(i)?i.then(o):o(i)}generateCompletionScript(e,r){let n=this.zshShell?fh:ch,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function ph(t,e,r,n){return new xc(t,e,r,n)}function NC(t){return t.length<3}function PC(t){return t.length>3}function dh(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:n>1&&i>1&&e.charAt(n-2)===t.charAt(i-1)&&e.charAt(n-1)===t.charAt(i-2)?r[n][i]=r[n-2][i-2]+1:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}var hh=["$0","--","_"];function mh(t,e,r){let n=r.y18n.__,i=r.y18n.__n,o={};o.nonOptionCount=function(f){let p=t.getDemandedCommands(),m=f._.length+(f["--"]?f["--"].length:0)-t.getInternalMethods().getContext().commands.length;p._&&(m<p._.min||m>p._.max)&&(m<p._.min?p._.minMsg!==void 0?e.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",m,m.toString(),p._.min.toString())):m>p._.max&&(p._.maxMsg!==void 0?e.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",m,m.toString(),p._.max.toString()))))},o.positionalCount=function(f,p){p<f&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",f+""))},o.requiredArguments=function(f,p){let d=null;for(let m of Object.keys(p))(!Object.prototype.hasOwnProperty.call(f,m)||typeof f[m]>"u")&&(d=d||{},d[m]=p[m]);if(d){let m=[];for(let g of Object.keys(d)){let b=d[g];b&&m.indexOf(b)<0&&m.push(b)}let y=m.length?`
58
+ `;var gc=class{constructor(e,r,n,i){var o,s,a;this.yargs=e,this.usage=r,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((s=this.shim.getEnv("ZSH_NAME"))===null||s===void 0?void 0:s.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,r,n,i){let o=this.command.getCommandHandlers();for(let a=0,u=e.length;a<u;++a)if(o[e[a]]&&o[e[a]].builder){let l=o[e[a]].builder;if(ga(l)){this.indexAfterLastReset=a+1;let c=this.yargs.getInternalMethods().reset();return l(c,!0),c.argv}}let s=[];this.commandCompletions(s,e,n),this.optionCompletions(s,e,r,n),this.choicesFromOptionsCompletions(s,e,r,n),this.choicesFromPositionalsCompletions(s,e,r,n),i(null,s)}commandCompletions(e,r,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&!this.previousArgHasChoices(r)&&this.usage.getCommands().forEach(o=>{let s=cn(o[0]).cmd;if(r.indexOf(s)===-1)if(!this.zshShell)e.push(s);else{let a=o[1]||"";e.push(s.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,r,n,i){if((i.match(/^-/)||i===""&&e.length===0)&&!this.previousArgHasChoices(r)){let o=this.yargs.getOptions(),s=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(a=>{let u=!!o.configuration["boolean-negation"]&&o.boolean.includes(a);!s.includes(a)&&!o.hiddenOptions.includes(a)&&!this.argsContainKey(r,a,u)&&this.completeOptionKey(a,e,i,u&&!!o.default[a])})}}choicesFromOptionsCompletions(e,r,n,i){if(this.previousArgHasChoices(r)){let o=this.getPreviousArgChoices(r);o&&o.length>0&&e.push(...o.map(s=>s.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,r,n,i){if(i===""&&e.length>0&&this.previousArgHasChoices(r))return;let o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],s=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=o[n._.length-s-1];if(!a)return;let u=this.yargs.getOptions().choices[a]||[];for(let l of u)l.startsWith(i)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;let i=r.replace(/^-+/,""),o=this.yargs.getOptions(),s=[i,...this.yargs.getAliases()[i]||[]],a;for(let u of s)if(Object.prototype.hasOwnProperty.call(o.key,u)&&Array.isArray(o.choices[u])){a=o.choices[u];break}if(a)return a.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){let r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){let i=o=>e.indexOf((/^[^0-9]$/.test(o)?"-":"--")+o)!==-1;if(i(r)||n&&i(`no-${r}`))return!0;if(this.aliases){for(let o of this.aliases[r])if(i(o))return!0}return!1}completeOptionKey(e,r,n,i){var o,s,a,u;let l=e;if(this.zshShell){let d=this.usage.getDescriptions(),m=(s=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||s===void 0?void 0:s.find(b=>{let w=d[b];return typeof w=="string"&&w.length>0}),y=m?d[m]:void 0,g=(u=(a=d[e])!==null&&a!==void 0?a:y)!==null&&u!==void 0?u:"";l=`${e.replace(/:/g,"\\:")}:${g.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let c=d=>/^--/.test(d),f=d=>/^[^0-9]$/.test(d),p=!c(n)&&f(e)?"-":"--";r.push(p+l),i&&r.push(p+"no-"+l)}customCompletion(e,r,n,i){if(Rt(this.customCompletionFunction,null,this.shim),vw(this.customCompletionFunction)){let o=this.customCompletionFunction(n,r);return qe(o)?o.then(s=>{this.shim.process.nextTick(()=>{i(null,s)})}).catch(s=>{this.shim.process.nextTick(()=>{i(s,void 0)})}):i(null,o)}else return Dw(this.customCompletionFunction)?this.customCompletionFunction(n,r,(o=i)=>this.defaultCompletion(e,r,n,o),o=>{i(null,o)}):this.customCompletionFunction(n,r,o=>{i(null,o)})}getCompletion(e,r){let n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),o=this.customCompletionFunction?s=>this.customCompletion(e,s,n,r):s=>this.defaultCompletion(e,s,n,r);return qe(i)?i.then(o):o(i)}generateCompletionScript(e,r){let n=this.zshShell?lh:uh,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function ch(t,e,r,n){return new gc(t,e,r,n)}function vw(t){return t.length<3}function Dw(t){return t.length>3}function fh(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;let r=[],n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:n>1&&i>1&&e.charAt(n-2)===t.charAt(i-1)&&e.charAt(n-1)===t.charAt(i-2)?r[n][i]=r[n-2][i-2]+1:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}var ph=["$0","--","_"];function dh(t,e,r){let n=r.y18n.__,i=r.y18n.__n,o={};o.nonOptionCount=function(f){let p=t.getDemandedCommands(),m=f._.length+(f["--"]?f["--"].length:0)-t.getInternalMethods().getContext().commands.length;p._&&(m<p._.min||m>p._.max)&&(m<p._.min?p._.minMsg!==void 0?e.fail(p._.minMsg?p._.minMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",m,m.toString(),p._.min.toString())):m>p._.max&&(p._.maxMsg!==void 0?e.fail(p._.maxMsg?p._.maxMsg.replace(/\$0/g,m.toString()).replace(/\$1/,p._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",m,m.toString(),p._.max.toString()))))},o.positionalCount=function(f,p){p<f&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",p,p+"",f+""))},o.requiredArguments=function(f,p){let d=null;for(let m of Object.keys(p))(!Object.prototype.hasOwnProperty.call(f,m)||typeof f[m]>"u")&&(d=d||{},d[m]=p[m]);if(d){let m=[];for(let g of Object.keys(d)){let b=d[g];b&&m.indexOf(b)<0&&m.push(b)}let y=m.length?`
59
59
  ${m.join(`
60
- `)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(d).length,Object.keys(d).join(", ")+y))}},o.unknownArguments=function(f,p,d,m,y=!0){var g;let b=t.getInternalMethods().getCommandInstance().getCommands(),C=[],w=t.getInternalMethods().getContext();if(Object.keys(f).forEach(D=>{!hh.includes(D)&&!Object.prototype.hasOwnProperty.call(d,D)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),D)&&!o.isValidAndSomeAliasIsNotNew(D,p)&&C.push(D)}),y&&(w.commands.length>0||b.length>0||m)&&f._.slice(w.commands.length).forEach(D=>{b.includes(""+D)||C.push(""+D)}),y){let R=((g=t.getDemandedCommands()._)===null||g===void 0?void 0:g.max)||0,S=w.commands.length+R;S<f._.length&&f._.slice(S).forEach(de=>{de=String(de),!w.commands.includes(de)&&!C.includes(de)&&C.push(de)})}C.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",C.length,C.map(D=>D.trim()?D:`"${D}"`).join(", ")))},o.unknownCommands=function(f){let p=t.getInternalMethods().getCommandInstance().getCommands(),d=[],m=t.getInternalMethods().getContext();return(m.commands.length>0||p.length>0)&&f._.slice(m.commands.length).forEach(y=>{p.includes(""+y)||d.push(""+y)}),d.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",d.length,d.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(f,p){if(!Object.prototype.hasOwnProperty.call(p,f))return!1;let d=t.parsed.newAliases;return[f,...p[f]].some(m=>!Object.prototype.hasOwnProperty.call(d,m)||!d[f])},o.limitedChoices=function(f){let p=t.getOptions(),d={};if(!Object.keys(p.choices).length)return;Object.keys(f).forEach(g=>{hh.indexOf(g)===-1&&Object.prototype.hasOwnProperty.call(p.choices,g)&&[].concat(f[g]).forEach(b=>{p.choices[g].indexOf(b)===-1&&b!==void 0&&(d[g]=(d[g]||[]).concat(b))})});let m=Object.keys(d);if(!m.length)return;let y=n("Invalid values:");m.forEach(g=>{y+=`
61
- ${n("Argument: %s, Given: %s, Choices: %s",g,e.stringifiedValues(d[g]),e.stringifiedValues(p.choices[g]))}`}),e.fail(y)};let s={};o.implies=function(f,p){H("<string|object> [array|number|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.implies(d,f[d])}):(t.global(f),s[f]||(s[f]=[]),Array.isArray(p)?p.forEach(d=>o.implies(f,d)):(Dt(p,void 0,r),s[f].push(p)))},o.getImplied=function(){return s};function a(c,f){let p=Number(f);return f=isNaN(p)?f:p,typeof f=="number"?f=c._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(c,f)):f=Object.prototype.hasOwnProperty.call(c,f),f}o.implications=function(f){let p=[];if(Object.keys(s).forEach(d=>{let m=d;(s[d]||[]).forEach(y=>{let g=m,b=y;g=a(f,g),y=a(f,y),g&&!y&&p.push(` ${m} -> ${b}`)})}),p.length){let d=`${n("Implications failed:")}
62
- `;p.forEach(m=>{d+=m}),e.fail(d)}};let u={};o.conflicts=function(f,p){H("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.conflicts(d,f[d])}):(t.global(f),u[f]||(u[f]=[]),Array.isArray(p)?p.forEach(d=>o.conflicts(f,d)):u[f].push(p))},o.getConflicting=()=>u,o.conflicting=function(f){Object.keys(f).forEach(p=>{u[p]&&u[p].forEach(d=>{d&&f[p]!==void 0&&f[d]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(p=>{u[p].forEach(d=>{d&&f[r.Parser.camelCase(p)]!==void 0&&f[r.Parser.camelCase(d)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})})},o.recommendCommands=function(f,p){p=p.sort((g,b)=>b.length-g.length);let m=null,y=1/0;for(let g=0,b;(b=p[g])!==void 0;g++){let C=dh(f,b);C<=3&&C<y&&(y=C,m=b)}m&&e.fail(n("Did you mean %s?",m))},o.reset=function(f){return s=cn(s,p=>!f[p]),u=cn(u,p=>!f[p]),o};let l=[];return o.freeze=function(){l.push({implied:s,conflicting:u})},o.unfreeze=function(){let f=l.pop();Dt(f,void 0,r),{implied:s,conflicting:u}=f},o}var yc=[],is;function os(t,e,r,n){is=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let o=/\.json|\..*rc$/.test(t.extends),s=null;if(o)s=MC(e,t.extends);else try{s=Er.resolve(t.extends)}catch{return t}LC(s),yc.push(s),i=o?JSON.parse(is.readFileSync(s,"utf8")):Er(t.extends),delete t.extends,i=os(i,is.path.dirname(s),r,is)}return yc=[],r?gh(i,t):Object.assign({},i,t)}function LC(t){if(yc.indexOf(t)>-1)throw new $e(`Circular extended configurations: '${t}'.`)}function MC(t,e){return is.path.resolve(t,e)}function gh(t,e){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(let i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=gh(t[i],e[i]):r[i]=e[i];return r}var Y=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},h=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},nt,Gn,ss,nr,Kt,ya,pn,Wn,ba,ir,Ea,or,Ar,Yt,sr,Aa,Vi,Et,re,wa,Ca,Zt,Hn,Gi,Kn,dn,ka,fe,Yn,Zn,Xn,ge,Ta,wr,Qe;function Lh(t){return(e=[],r=t.process.cwd(),n)=>{let i=new Ic(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var xh=Symbol("copyDoubleDash"),yh=Symbol("copyDoubleDash"),bc=Symbol("deleteFromParserHintObject"),bh=Symbol("emitWarning"),Eh=Symbol("freeze"),Ah=Symbol("getDollarZero"),Jn=Symbol("getParserConfiguration"),wh=Symbol("getUsageConfiguration"),Ec=Symbol("guessLocale"),Ch=Symbol("guessVersion"),kh=Symbol("parsePositionalNumbers"),Ac=Symbol("pkgUp"),hn=Symbol("populateParserHintArray"),Wi=Symbol("populateParserHintSingleValueDictionary"),wc=Symbol("populateParserHintArrayDictionary"),Cc=Symbol("populateParserHintDictionary"),kc=Symbol("sanitizeKey"),Tc=Symbol("setKey"),_c=Symbol("unfreeze"),Th=Symbol("validateAsync"),_h=Symbol("getCommandInstance"),Sh=Symbol("getContext"),vh=Symbol("getHasOutput"),Ih=Symbol("getLoggerInstance"),Oh=Symbol("getParseContext"),Dh=Symbol("getUsageInstance"),Rh=Symbol("getValidationInstance"),_a=Symbol("hasParseCallback"),Fh=Symbol("isGlobalContext"),Qn=Symbol("postProcess"),Nh=Symbol("rebase"),Sc=Symbol("reset"),as=Symbol("runYargsParserAndExecuteCommands"),vc=Symbol("runValidation"),Ph=Symbol("setHasOutput"),ei=Symbol("kTrackManuallySetKeys"),Ic=class{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,nt.set(this,void 0),Gn.set(this,void 0),ss.set(this,{commands:[],fullCommands:[]}),nr.set(this,null),Kt.set(this,null),ya.set(this,"show-hidden"),pn.set(this,null),Wn.set(this,!0),ba.set(this,{}),ir.set(this,!0),Ea.set(this,[]),or.set(this,void 0),Ar.set(this,{}),Yt.set(this,!1),sr.set(this,null),Aa.set(this,!0),Vi.set(this,void 0),Et.set(this,""),re.set(this,void 0),wa.set(this,void 0),Ca.set(this,{}),Zt.set(this,null),Hn.set(this,null),Gi.set(this,{}),Kn.set(this,{}),dn.set(this,void 0),ka.set(this,!1),fe.set(this,void 0),Yn.set(this,!1),Zn.set(this,!1),Xn.set(this,!1),ge.set(this,void 0),Ta.set(this,{}),wr.set(this,null),Qe.set(this,void 0),Y(this,fe,i,"f"),Y(this,dn,e,"f"),Y(this,Gn,r,"f"),Y(this,wa,n,"f"),Y(this,or,new ma(this),"f"),this.$0=this[Ah](),this[Sc](),Y(this,nt,h(this,nt,"f"),"f"),Y(this,ge,h(this,ge,"f"),"f"),Y(this,Qe,h(this,Qe,"f"),"f"),Y(this,re,h(this,re,"f"),"f"),h(this,re,"f").showHiddenOpt=h(this,ya,"f"),Y(this,Vi,this[yh](),"f")}addHelpOpt(e,r){let n="help";return H("[string|boolean] [string]",[e,r],arguments.length),h(this,sr,"f")&&(this[bc](h(this,sr,"f")),Y(this,sr,null,"f")),e===!1&&r===void 0?this:(Y(this,sr,typeof e=="string"?e:n,"f"),this.boolean(h(this,sr,"f")),this.describe(h(this,sr,"f"),r||h(this,ge,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(H("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:h(this,ya,"f");return this.boolean(n),this.describe(n,r||h(this,ge,"f").deferY18nLookup("Show hidden options")),h(this,re,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[wc](this.alias.bind(this),"alias",e,r),this}array(e){return H("<array|string>",[e],arguments.length),this[hn]("array",e),this[ei](e),this}boolean(e){return H("<array|string>",[e],arguments.length),this[hn]("boolean",e),this[ei](e),this}check(e,r){return H("<function> [boolean]",[e,r],arguments.length),this.middleware((n,i)=>Vn(()=>e(n,i.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&h(this,ge,"f").fail(o.toString(),o):h(this,ge,"f").fail(h(this,fe,"f").y18n.__("Argument check failed: %s",e.toString())),n),o=>(h(this,ge,"f").fail(o.message?o.message:o.toString(),o),n)),!1,r),this}choices(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[wc](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(H("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new $e("coerce callback must be provided");for(let n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new $e("coerce callback must be provided");return h(this,re,"f").key[e]=!0,h(this,or,"f").addCoerceMiddleware((n,i)=>{let o;return Object.prototype.hasOwnProperty.call(n,e)?Vn(()=>(o=i.getAliases(),r(n[e])),a=>{n[e]=a;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&u!==!0)for(let l of o[e])n[l]=a;return n},a=>{throw new $e(a.message)}):n},e),this}conflicts(e,r){return H("<string|object> [string|array]",[e,r],arguments.length),h(this,Qe,"f").conflicts(e,r),this}config(e="config",r,n){return H("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=os(e,h(this,Gn,"f"),this[Jn]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||h(this,ge,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{h(this,re,"f").config[i]=n||!0}),this)}completion(e,r,n){return H("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Y(this,Kt,e||h(this,Kt,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(h(this,Kt,"f"),r),n&&h(this,nr,"f").registerFunction(n),this}command(e,r,n,i,o,s){return H("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,o,s],arguments.length),h(this,nt,"f").addHandler(e,r,n,i,o,s),this}commands(e,r,n,i,o,s){return this.command(e,r,n,i,o,s)}commandDir(e,r){H("<string> [object]",[e,r],arguments.length);let n=h(this,wa,"f")||h(this,fe,"f").require;return h(this,nt,"f").addDirectory(e,n,h(this,fe,"f").getCallerFile(),r),this}count(e){return H("<array|string>",[e],arguments.length),this[hn]("count",e),this[ei](e),this}default(e,r,n){return H("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(dc(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]=n),typeof r=="function"&&(dc(e,h(this,fe,"f")),h(this,re,"f").defaultDescription[e]||(h(this,re,"f").defaultDescription[e]=h(this,ge,"f").functionDescription(r)),r=r.call()),this[Wi](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,i){return H("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),h(this,re,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{Dt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(Dt(n,!0,h(this,fe,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(i=>{Dt(n,!0,h(this,fe,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Wi](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return H("<string> [string|boolean]",[e,r],arguments.length),h(this,re,"f").deprecatedOptions[e]=r,this}describe(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Tc](e,!0),h(this,ge,"f").describe(e,r),this}detectLocale(e){return H("<boolean>",[e],arguments.length),Y(this,Wn,e,"f"),this}env(e){return H("[string|boolean]",[e],arguments.length),e===!1?delete h(this,re,"f").envPrefix:h(this,re,"f").envPrefix=e||"",this}epilogue(e){return H("<string>",[e],arguments.length),h(this,ge,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return H("<string|array> [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):h(this,ge,"f").example(e,r),this}exit(e,r){Y(this,Yt,!0,"f"),Y(this,pn,r,"f"),h(this,ir,"f")&&h(this,fe,"f").process.exit(e)}exitProcess(e=!0){return H("[boolean]",[e],arguments.length),Y(this,ir,e,"f"),this}fail(e){if(H("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new $e("Invalid first argument. Expected function or boolean 'false'");return h(this,ge,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return H("<array> [function]",[e,r],arguments.length),r?h(this,nr,"f").getCompletion(e,r):new Promise((n,i)=>{h(this,nr,"f").getCompletion(e,(o,s)=>{o?i(o):n(s)})})}getDemandedOptions(){return H([],0),h(this,re,"f").demandedOptions}getDemandedCommands(){return H([],0),h(this,re,"f").demandedCommands}getDeprecatedOptions(){return H([],0),h(this,re,"f").deprecatedOptions}getDetectLocale(){return h(this,Wn,"f")}getExitProcess(){return h(this,ir,"f")}getGroups(){return Object.assign({},h(this,Ar,"f"),h(this,Kn,"f"))}getHelp(){if(Y(this,Yt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[as](h(this,dn,"f"),void 0,void 0,0,!0);if(qe(r))return r.then(()=>h(this,ge,"f").help())}let e=h(this,nt,"f").runDefaultBuilderOn(this);if(qe(e))return e.then(()=>h(this,ge,"f").help())}return Promise.resolve(h(this,ge,"f").help())}getOptions(){return h(this,re,"f")}getStrict(){return h(this,Yn,"f")}getStrictCommands(){return h(this,Zn,"f")}getStrictOptions(){return h(this,Xn,"f")}global(e,r){return H("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?h(this,re,"f").local=h(this,re,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{h(this,re,"f").local.includes(n)||h(this,re,"f").local.push(n)}),this}group(e,r){H("<string|array> <string>",[e,r],arguments.length);let n=h(this,Kn,"f")[r]||h(this,Ar,"f")[r];h(this,Kn,"f")[r]&&delete h(this,Kn,"f")[r];let i={};return h(this,Ar,"f")[r]=(n||[]).concat(e).filter(o=>i[o]?!1:i[o]=!0),this}hide(e){return H("<string>",[e],arguments.length),h(this,re,"f").hiddenOptions.push(e),this}implies(e,r){return H("<string|object> [number|string|array]",[e,r],arguments.length),h(this,Qe,"f").implies(e,r),this}locale(e){return H("[string]",[e],arguments.length),e===void 0?(this[Ec](),h(this,fe,"f").y18n.getLocale()):(Y(this,Wn,!1,"f"),h(this,fe,"f").y18n.setLocale(e),this)}middleware(e,r,n){return h(this,or,"f").addMiddleware(e,!!r,n)}nargs(e,r){return H("<string|object|array> [number]",[e,r],arguments.length),this[Wi](this.nargs.bind(this),"narg",e,r),this}normalize(e){return H("<array|string>",[e],arguments.length),this[hn]("normalize",e),this}number(e){return H("<array|string>",[e],arguments.length),this[hn]("number",e),this[ei](e),this}option(e,r){if(H("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[ei](e),h(this,wr,"f")&&(e==="version"||r?.alias==="version")&&this[bh](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
63
- `),void 0,"versionWarning"),h(this,re,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(h(this,re,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let o=r.describe||r.description||r.desc,s=h(this,ge,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(s,e)||typeof o=="string")&&this.describe(e,o),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){H("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[Eh](),typeof e>"u"&&(e=h(this,dn,"f")),typeof r=="object"&&(Y(this,Hn,r,"f"),r=n),typeof r=="function"&&(Y(this,Zt,r,"f"),r=!1),r||Y(this,dn,e,"f"),h(this,Zt,"f")&&Y(this,ir,!1,"f");let i=this[as](e,!!r),o=this.parsed;return h(this,nr,"f").setParsed(this.parsed),qe(i)?i.then(s=>(h(this,Zt,"f")&&h(this,Zt,"f").call(this,h(this,pn,"f"),s,h(this,Et,"f")),s)).catch(s=>{throw h(this,Zt,"f")&&h(this,Zt,"f")(s,this.parsed.argv,h(this,Et,"f")),s}).finally(()=>{this[_c](),this.parsed=o}):(h(this,Zt,"f")&&h(this,Zt,"f").call(this,h(this,pn,"f"),i,h(this,Et,"f")),this[_c](),this.parsed=o,i)}parseAsync(e,r,n){let i=this.parse(e,r,n);return qe(i)?i:Promise.resolve(i)}parseSync(e,r,n){let i=this.parse(e,r,n);if(qe(i))throw new $e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return H("<object>",[e],arguments.length),Y(this,Ca,e,"f"),this}pkgConf(e,r){H("<string> [string]",[e,r],arguments.length);let n=null,i=this[Ac](r||h(this,Gn,"f"));return i[e]&&typeof i[e]=="object"&&(n=os(i[e],r||h(this,Gn,"f"),this[Jn]()["deep-merge-config"]||!1,h(this,fe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(n)),this}positional(e,r){H("<string> <object>",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=cn(r,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:n.includes(s));let i=h(this,ss,"f").fullCommands[h(this,ss,"f").fullCommands.length-1],o=i?h(this,nt,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return $i(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(e)!==-1&&(r[s]=!0):a[e]&&!(s in r)&&(r[s]=a[e])}),this.group(e,h(this,ge,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return H("[boolean]",[e],arguments.length),Y(this,ka,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return H("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&h(this,re,"f").narg[e]?this:(this[Wi](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return H("[string] [string]",[e,r],arguments.length),e=e||this.$0,h(this,Vi,"f").log(h(this,nr,"f").generateCompletionScript(e,r||h(this,Kt,"f")||"completion")),this}showHelp(e){if(H("[string|function]",[e],arguments.length),Y(this,Yt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[as](h(this,dn,"f"),void 0,void 0,0,!0);if(qe(n))return n.then(()=>{h(this,ge,"f").showHelp(e)}),this}let r=h(this,nt,"f").runDefaultBuilderOn(this);if(qe(r))return r.then(()=>{h(this,ge,"f").showHelp(e)}),this}return h(this,ge,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return H("[boolean|string] [string]",[e,r],arguments.length),h(this,ge,"f").showHelpOnFail(e,r),this}showVersion(e){return H("[string|function]",[e],arguments.length),h(this,ge,"f").showVersion(e),this}skipValidation(e){return H("<array|string>",[e],arguments.length),this[hn]("skipValidation",e),this}strict(e){return H("[boolean]",[e],arguments.length),Y(this,Yn,e!==!1,"f"),this}strictCommands(e){return H("[boolean]",[e],arguments.length),Y(this,Zn,e!==!1,"f"),this}strictOptions(e){return H("[boolean]",[e],arguments.length),Y(this,Xn,e!==!1,"f"),this}string(e){return H("<array|string>",[e],arguments.length),this[hn]("string",e),this[ei](e),this}terminalWidth(){return H([],0),h(this,fe,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return H("<object>",[e],arguments.length),Y(this,Wn,!1,"f"),h(this,fe,"f").y18n.updateLocale(e),this}usage(e,r,n,i){if(H("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,i],arguments.length),r!==void 0){if(Dt(e,null,h(this,fe,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,i);throw new $e(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,ge,"f").usage(e),this}usageConfiguration(e){return H("<object>",[e],arguments.length),Y(this,Ta,e,"f"),this}version(e,r,n){let i="version";if(H("[boolean|string] [string] [string]",[e,r,n],arguments.length),h(this,wr,"f")&&(this[bc](h(this,wr,"f")),h(this,ge,"f").version(void 0),Y(this,wr,null,"f")),arguments.length===0)n=this[Ch](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return Y(this,wr,typeof e=="string"?e:i,"f"),r=r||h(this,ge,"f").deferY18nLookup("Show version number"),h(this,ge,"f").version(n||void 0),this.boolean(h(this,wr,"f")),this.describe(h(this,wr,"f"),r),this}wrap(e){return H("<number|null|undefined>",[e],arguments.length),h(this,ge,"f").wrap(e),this}[(nt=new WeakMap,Gn=new WeakMap,ss=new WeakMap,nr=new WeakMap,Kt=new WeakMap,ya=new WeakMap,pn=new WeakMap,Wn=new WeakMap,ba=new WeakMap,ir=new WeakMap,Ea=new WeakMap,or=new WeakMap,Ar=new WeakMap,Yt=new WeakMap,sr=new WeakMap,Aa=new WeakMap,Vi=new WeakMap,Et=new WeakMap,re=new WeakMap,wa=new WeakMap,Ca=new WeakMap,Zt=new WeakMap,Hn=new WeakMap,Gi=new WeakMap,Kn=new WeakMap,dn=new WeakMap,ka=new WeakMap,fe=new WeakMap,Yn=new WeakMap,Zn=new WeakMap,Xn=new WeakMap,ge=new WeakMap,Ta=new WeakMap,wr=new WeakMap,Qe=new WeakMap,xh)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[yh](){return{log:(...e)=>{this[_a]()||console.log(...e),Y(this,Yt,!0,"f"),h(this,Et,"f").length&&Y(this,Et,h(this,Et,"f")+`
64
- `,"f"),Y(this,Et,h(this,Et,"f")+e.join(" "),"f")},error:(...e)=>{this[_a]()||console.error(...e),Y(this,Yt,!0,"f"),h(this,Et,"f").length&&Y(this,Et,h(this,Et,"f")+`
65
- `,"f"),Y(this,Et,h(this,Et,"f")+e.join(" "),"f")}}}[bc](e){$i(h(this,re,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=h(this,re,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete h(this,ge,"f").getDescriptions()[e]}[bh](e,r,n){h(this,ba,"f")[n]||(h(this,fe,"f").process.emitWarning(e,r),h(this,ba,"f")[n]=!0)}[Eh](){h(this,Ea,"f").push({options:h(this,re,"f"),configObjects:h(this,re,"f").configObjects.slice(0),exitProcess:h(this,ir,"f"),groups:h(this,Ar,"f"),strict:h(this,Yn,"f"),strictCommands:h(this,Zn,"f"),strictOptions:h(this,Xn,"f"),completionCommand:h(this,Kt,"f"),output:h(this,Et,"f"),exitError:h(this,pn,"f"),hasOutput:h(this,Yt,"f"),parsed:this.parsed,parseFn:h(this,Zt,"f"),parseContext:h(this,Hn,"f")}),h(this,ge,"f").freeze(),h(this,Qe,"f").freeze(),h(this,nt,"f").freeze(),h(this,or,"f").freeze()}[Ah](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,fe,"f").process.argv()[0])?r=h(this,fe,"f").process.argv().slice(1,2):r=h(this,fe,"f").process.argv().slice(0,1),e=r.map(n=>{let i=this[Nh](h(this,Gn,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),h(this,fe,"f").getEnv("_")&&h(this,fe,"f").getProcessArgvBin()===h(this,fe,"f").getEnv("_")&&(e=h(this,fe,"f").getEnv("_").replace(`${h(this,fe,"f").path.dirname(h(this,fe,"f").process.execPath())}/`,"")),e}[Jn](){return h(this,Ca,"f")}[wh](){return h(this,Ta,"f")}[Ec](){if(!h(this,Wn,"f"))return;let e=h(this,fe,"f").getEnv("LC_ALL")||h(this,fe,"f").getEnv("LC_MESSAGES")||h(this,fe,"f").getEnv("LANG")||h(this,fe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Ch](){return this[Ac]().version||"unknown"}[kh](e){let r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)h(this,fe,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[Ac](e){let r=e||"*";if(h(this,Gi,"f")[r])return h(this,Gi,"f")[r];let n={};try{let i=e||h(this,fe,"f").mainFilename;!e&&h(this,fe,"f").path.extname(i)&&(i=h(this,fe,"f").path.dirname(i));let o=h(this,fe,"f").findUp(i,(s,a)=>{if(a.includes("package.json"))return"package.json"});Dt(o,void 0,h(this,fe,"f")),n=JSON.parse(h(this,fe,"f").readFileSync(o,"utf8"))}catch{}return h(this,Gi,"f")[r]=n||{},h(this,Gi,"f")[r]}[hn](e,r){r=[].concat(r),r.forEach(n=>{n=this[kc](n),h(this,re,"f")[e].push(n)})}[Wi](e,r,n,i){this[Cc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=a})}[wc](e,r,n,i){this[Cc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=(h(this,re,"f")[o][s]||[]).concat(a)})}[Cc](e,r,n,i,o){if(Array.isArray(n))n.forEach(s=>{e(s,i)});else if((s=>typeof s=="object")(n))for(let s of $i(n))e(s,n[s]);else o(r,this[kc](n),i)}[kc](e){return e==="__proto__"?"___proto___":e}[Tc](e,r){return this[Wi](this[Tc].bind(this),"key",e,r),this}[_c](){var e,r,n,i,o,s,a,u,l,c,f,p;let d=h(this,Ea,"f").pop();Dt(d,void 0,h(this,fe,"f"));let m;e=this,r=this,n=this,i=this,o=this,s=this,a=this,u=this,l=this,c=this,f=this,p=this,{options:{set value(y){Y(e,re,y,"f")}}.value,configObjects:m,exitProcess:{set value(y){Y(r,ir,y,"f")}}.value,groups:{set value(y){Y(n,Ar,y,"f")}}.value,output:{set value(y){Y(i,Et,y,"f")}}.value,exitError:{set value(y){Y(o,pn,y,"f")}}.value,hasOutput:{set value(y){Y(s,Yt,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Y(a,Yn,y,"f")}}.value,strictCommands:{set value(y){Y(u,Zn,y,"f")}}.value,strictOptions:{set value(y){Y(l,Xn,y,"f")}}.value,completionCommand:{set value(y){Y(c,Kt,y,"f")}}.value,parseFn:{set value(y){Y(f,Zt,y,"f")}}.value,parseContext:{set value(y){Y(p,Hn,y,"f")}}.value}=d,h(this,re,"f").configObjects=m,h(this,ge,"f").unfreeze(),h(this,Qe,"f").unfreeze(),h(this,nt,"f").unfreeze(),h(this,or,"f").unfreeze()}[Th](e,r){return Vn(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[_h].bind(this),getContext:this[Sh].bind(this),getHasOutput:this[vh].bind(this),getLoggerInstance:this[Ih].bind(this),getParseContext:this[Oh].bind(this),getParserConfiguration:this[Jn].bind(this),getUsageConfiguration:this[wh].bind(this),getUsageInstance:this[Dh].bind(this),getValidationInstance:this[Rh].bind(this),hasParseCallback:this[_a].bind(this),isGlobalContext:this[Fh].bind(this),postProcess:this[Qn].bind(this),reset:this[Sc].bind(this),runValidation:this[vc].bind(this),runYargsParserAndExecuteCommands:this[as].bind(this),setHasOutput:this[Ph].bind(this)}}[_h](){return h(this,nt,"f")}[Sh](){return h(this,ss,"f")}[vh](){return h(this,Yt,"f")}[Ih](){return h(this,Vi,"f")}[Oh](){return h(this,Hn,"f")||{}}[Dh](){return h(this,ge,"f")}[Rh](){return h(this,Qe,"f")}[_a](){return!!h(this,Zt,"f")}[Fh](){return h(this,Aa,"f")}[Qn](e,r,n,i){return n||qe(e)||(r||(e=this[xh](e)),(this[Jn]()["parse-positional-numbers"]||this[Jn]()["parse-positional-numbers"]===void 0)&&(e=this[kh](e)),i&&(e=qn(e,this,h(this,or,"f").getMiddleware(),!1))),e}[Sc](e={}){Y(this,re,h(this,re,"f")||{},"f");let r={};r.local=h(this,re,"f").local||[],r.configObjects=h(this,re,"f").configObjects||[];let n={};r.local.forEach(s=>{n[s]=!0,(e[s]||[]).forEach(a=>{n[a]=!0})}),Object.assign(h(this,Kn,"f"),Object.keys(h(this,Ar,"f")).reduce((s,a)=>{let u=h(this,Ar,"f")[a].filter(l=>!(l in n));return u.length>0&&(s[a]=u),s},{})),Y(this,Ar,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(s=>{r[s]=(h(this,re,"f")[s]||[]).filter(a=>!n[a])}),o.forEach(s=>{r[s]=cn(h(this,re,"f")[s],a=>!n[a])}),r.envPrefix=h(this,re,"f").envPrefix,Y(this,re,r,"f"),Y(this,ge,h(this,ge,"f")?h(this,ge,"f").reset(n):lh(this,h(this,fe,"f")),"f"),Y(this,Qe,h(this,Qe,"f")?h(this,Qe,"f").reset(n):mh(this,h(this,ge,"f"),h(this,fe,"f")),"f"),Y(this,nt,h(this,nt,"f")?h(this,nt,"f").reset():sh(h(this,ge,"f"),h(this,Qe,"f"),h(this,or,"f"),h(this,fe,"f")),"f"),h(this,nr,"f")||Y(this,nr,ph(this,h(this,ge,"f"),h(this,nt,"f"),h(this,fe,"f")),"f"),h(this,or,"f").reset(),Y(this,Kt,null,"f"),Y(this,Et,"","f"),Y(this,pn,null,"f"),Y(this,Yt,!1,"f"),this.parsed=!1,this}[Nh](e,r){return h(this,fe,"f").path.relative(e,r)}[as](e,r,n,i=0,o=!1){let s=!!n||o;e=e||h(this,dn,"f"),h(this,re,"f").__=h(this,fe,"f").y18n.__,h(this,re,"f").configuration=this[Jn]();let a=!!h(this,re,"f").configuration["populate--"],u=Object.assign({},h(this,re,"f").configuration,{"populate--":!0}),l=h(this,fe,"f").Parser.detailed(e,Object.assign({},h(this,re,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,h(this,Hn,"f")),f,p=l.aliases,d=!1,m=!1;Object.keys(c).forEach(y=>{y===h(this,sr,"f")&&c[y]?d=!0:y===h(this,wr,"f")&&c[y]&&(m=!0)}),c.$0=this.$0,this.parsed=l,i===0&&h(this,ge,"f").clearCachedHelpMessage();try{if(this[Ec](),r)return this[Qn](c,a,!!n,!1);h(this,sr,"f")&&[h(this,sr,"f")].concat(p[h(this,sr,"f")]||[]).filter(w=>w.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),d=!0),Y(this,Aa,!1,"f");let y=h(this,nt,"f").getCommands(),g=h(this,nr,"f").completionKey in c,b=d||g||o;if(c._.length){if(y.length){let C;for(let w=i||0,D;c._[w]!==void 0;w++)if(D=String(c._[w]),y.includes(D)&&D!==h(this,Kt,"f")){let R=h(this,nt,"f").runCommand(D,this,l,w+1,o,d||m||o);return this[Qn](R,a,!!n,!1)}else if(!C&&D!==h(this,Kt,"f")){C=D;break}!h(this,nt,"f").hasDefaultCommand()&&h(this,ka,"f")&&C&&!b&&h(this,Qe,"f").recommendCommands(C,y)}h(this,Kt,"f")&&c._.includes(h(this,Kt,"f"))&&!g&&(h(this,ir,"f")&&fn(!0),this.showCompletionScript(),this.exit(0))}if(h(this,nt,"f").hasDefaultCommand()&&!b){let C=h(this,nt,"f").runCommand(null,this,l,0,o,d||m||o);return this[Qn](C,a,!!n,!1)}if(g){h(this,ir,"f")&&fn(!0),e=[].concat(e);let C=e.slice(e.indexOf(`--${h(this,nr,"f").completionKey}`)+1);return h(this,nr,"f").getCompletion(C,(w,D)=>{if(w)throw new $e(w.message);(D||[]).forEach(R=>{h(this,Vi,"f").log(R)}),this.exit(0)}),this[Qn](c,!a,!!n,!1)}if(h(this,Yt,"f")||(d?(h(this,ir,"f")&&fn(!0),s=!0,this.showHelp("log"),this.exit(0)):m&&(h(this,ir,"f")&&fn(!0),s=!0,h(this,ge,"f").showVersion("log"),this.exit(0))),!s&&h(this,re,"f").skipValidation.length>0&&(s=Object.keys(c).some(C=>h(this,re,"f").skipValidation.indexOf(C)>=0&&c[C]===!0)),!s){if(l.error)throw new $e(l.error.message);if(!g){let C=this[vc](p,{},l.error);n||(f=qn(c,this,h(this,or,"f").getMiddleware(),!0)),f=this[Th](C,f??c),qe(f)&&!n&&(f=f.then(()=>qn(c,this,h(this,or,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof $e)h(this,ge,"f").fail(y.message,y);else throw y}return this[Qn](f??c,a,!!n,!0)}[vc](e,r,n,i){let o={...this.getDemandedOptions()};return s=>{if(n)throw new $e(n.message);h(this,Qe,"f").nonOptionCount(s),h(this,Qe,"f").requiredArguments(s,o);let a=!1;h(this,Zn,"f")&&(a=h(this,Qe,"f").unknownCommands(s)),h(this,Yn,"f")&&!a?h(this,Qe,"f").unknownArguments(s,e,r,!!i):h(this,Xn,"f")&&h(this,Qe,"f").unknownArguments(s,e,{},!1,!1),h(this,Qe,"f").limitedChoices(s),h(this,Qe,"f").implications(s),h(this,Qe,"f").conflicting(s)}}[Ph](){Y(this,Yt,!0,"f")}[ei](e){if(typeof e=="string")h(this,re,"f").key[e]=!0;else for(let r of e)h(this,re,"f").key[r]=!0}};function ah(t){return!!t&&typeof t.getInternalMethods=="function"}var BC=Lh(pc),Mh=BC;var Bh="1.0.2";var La=ts(la(),1);import{cosmiconfig as lm}from"cosmiconfig";import{TypeScriptLoader as cm}from"cosmiconfig-typescript-loader";import lT from"node:fs/promises";import dm from"node:path";var Oc=ts(zh(),1);function Dc(t,e,r){if(typeof e=="number"&&(r=e),Oc.default.has(t.toLowerCase())){e=Oc.default.get(t.toLowerCase());let n=t.charAt(0);n===n.toUpperCase()&&(e=n+e.slice(1)),t===t.toUpperCase()&&(e=e.toUpperCase())}else typeof e!="string"&&(e=(t.replace(/(?:s|x|z|ch|sh)$/i,"$&e").replace(/([^aeiou])y$/i,"$1ie")+"s").replace(/i?e?s$/i,n=>t.slice(-1)===t.slice(-1).toLowerCase()?n.toLowerCase():n.toUpperCase()));return Math.abs(r)===1?t:e}import{readPackage as cT}from"read-pkg";import{deepMergeDefined as $c,log as lr,optionsSchema as fT,rulesSchema as pT}from"remark-mdat";var Oe;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Oe||(Oe={}));var Fc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Fc||(Fc={}));var V=Oe.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hr=t=>{switch(typeof t){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(t)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(t)?V.array:t===null?V.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?V.promise:typeof Map<"u"&&t instanceof Map?V.map:typeof Set<"u"&&t instanceof Set?V.set:typeof Date<"u"&&t instanceof Date?V.date:V.object;default:return V.unknown}},N=Oe.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$C=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Xt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,u=0;for(;u<s.path.length;){let l=s.path[u];u===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Oe.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Xt.create=t=>new Xt(t);var Yi=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===V.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Oe.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${Oe.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Oe.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${Oe.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Oe.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,Oe.assertNever(t)}return{message:r}},Gh=Yi;function qC(t){Gh=t}function Sa(){return Gh}var va=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},VC=[];function U(t,e){let r=Sa(),n=va({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Yi?void 0:Yi].filter(i=>!!i)});t.common.issues.push(n)}var Tt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return pe;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},pe=Object.freeze({status:"aborted"}),Ki=t=>({status:"dirty",value:t}),Rt=t=>({status:"valid",value:t}),Nc=t=>t.status==="aborted",Pc=t=>t.status==="dirty",ti=t=>t.status==="valid",cs=t=>typeof Promise<"u"&&t instanceof Promise;function Ia(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Wh(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var Q;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Q||(Q={}));var us,ls,ur=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},$h=(t,e)=>{if(ti(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Xt(t.common.issues);return this._error=r,this._error}}};function Ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{var u,l;let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}},description:i}}var we=class{get description(){return this._def.description}_getType(e){return Hr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Tt,ctx:{common:e.parent.common,data:e.data,parsedType:Hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(cs(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let i={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hr(e)},o=this._parseSync({data:e,path:i.path,parent:i});return $h(i,o)}"~validate"(e){var r,n;let i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hr(e)};if(!this["~standard"].async)try{let o=this._parseSync({data:e,path:[],parent:i});return ti(o)?{value:o.value}:{issues:i.common.issues}}catch(o){!((n=(r=o?.message)===null||r===void 0?void 0:r.toLowerCase())===null||n===void 0)&&n.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:i}).then(o=>ti(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Hr(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(cs(i)?i:Promise.resolve(i));return $h(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new Jt({schema:this,typeName:le.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ar.create(this,this._def)}nullable(){return kr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Yr.create(this)}promise(){return xn.create(this,this._def)}or(e){return ui.create([this,e],this._def)}and(e){return li.create(this,e,this._def)}transform(e){return new Jt({...Ae(this._def),schema:this,typeName:le.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new hi({...Ae(this._def),innerType:this,defaultValue:r,typeName:le.ZodDefault})}brand(){return new fs({typeName:le.ZodBranded,type:this,...Ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new mi({...Ae(this._def),innerType:this,catchValue:r,typeName:le.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ps.create(this,e)}readonly(){return gi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},GC=/^c[^\s-]{8,}$/i,WC=/^[0-9a-z]+$/,HC=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KC=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,YC=/^[a-z0-9_-]{21}$/i,ZC=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,XC=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,JC=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,QC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rc,ek=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,tk=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,rk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nk=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ik=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ok=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Hh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sk=new RegExp(`^${Hh}$`);function Kh(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ak(t){return new RegExp(`^${Kh(t)}$`)}function Yh(t){let e=`${Hh}T${Kh(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function uk(t,e){return!!((e==="v4"||!e)&&ek.test(t)||(e==="v6"||!e)&&rk.test(t))}function lk(t,e){if(!ZC.test(t))return!1;try{let[r]=t.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function ck(t,e){return!!((e==="v4"||!e)&&tk.test(t)||(e==="v6"||!e)&&nk.test(t))}var mn=class t extends we{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==V.string){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.string,received:o.parsedType}),pe}let n=new Tt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")JC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Rc||(Rc=new RegExp(QC,"u")),Rc.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")KC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")YC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")GC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")WC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")HC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:N.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:N.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Yh(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?sk.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?ak(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?XC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?uk(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?lk(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?ck(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?ik.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?ok.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:N.invalid_string,message:o.message}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...Q.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Q.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Q.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Q.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Q.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Q.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Q.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Q.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Q.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Q.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Q.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Q.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Q.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Q.errToObj(e)})}datetime(e){var r,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(n=e?.local)!==null&&n!==void 0?n:!1,...Q.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...Q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Q.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Q.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Q.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Q.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Q.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Q.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Q.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Q.errToObj(r)})}nonempty(e){return this.min(1,Q.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};mn.create=t=>{var e;return new mn({checks:[],typeName:le.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};function fk(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=parseInt(t.toFixed(i).replace(".","")),s=parseInt(e.toFixed(i).replace(".",""));return o%s/Math.pow(10,i)}var ri=class t extends we{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==V.number){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.number,received:o.parsedType}),pe}let n,i=new Tt;for(let o of this._def.checks)o.kind==="int"?Oe.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?fk(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_finite,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Q.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Q.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Oe.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ri.create=t=>new ri({checks:[],typeName:le.ZodNumber,coerce:t?.coerce||!1,...Ae(t)});var ni=class t extends we{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==V.bigint)return this._getInvalidInput(e);let n,i=new Tt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Oe.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.bigint,received:r.parsedType}),pe}gte(e,r){return this.setLimit("min",e,!0,Q.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Q.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Q.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Q.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Q.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Q.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ni.create=t=>{var e;return new ni({checks:[],typeName:le.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Ae(t)})};var ii=class extends we{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==V.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.boolean,received:n.parsedType}),pe}return Rt(e.data)}};ii.create=t=>new ii({typeName:le.ZodBoolean,coerce:t?.coerce||!1,...Ae(t)});var oi=class t extends we{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==V.date){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:V.date,received:o.parsedType}),pe}if(isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_date}),pe}let n=new Tt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Oe.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Q.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Q.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};oi.create=t=>new oi({checks:[],coerce:t?.coerce||!1,typeName:le.ZodDate,...Ae(t)});var Zi=class extends we{_parse(e){if(this._getType(e)!==V.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.symbol,received:n.parsedType}),pe}return Rt(e.data)}};Zi.create=t=>new Zi({typeName:le.ZodSymbol,...Ae(t)});var si=class extends we{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.undefined,received:n.parsedType}),pe}return Rt(e.data)}};si.create=t=>new si({typeName:le.ZodUndefined,...Ae(t)});var ai=class extends we{_parse(e){if(this._getType(e)!==V.null){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.null,received:n.parsedType}),pe}return Rt(e.data)}};ai.create=t=>new ai({typeName:le.ZodNull,...Ae(t)});var gn=class extends we{constructor(){super(...arguments),this._any=!0}_parse(e){return Rt(e.data)}};gn.create=t=>new gn({typeName:le.ZodAny,...Ae(t)});var Kr=class extends we{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rt(e.data)}};Kr.create=t=>new Kr({typeName:le.ZodUnknown,...Ae(t)});var mr=class extends we{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:V.never,received:r.parsedType}),pe}};mr.create=t=>new mr({typeName:le.ZodNever,...Ae(t)});var Xi=class extends we{_parse(e){if(this._getType(e)!==V.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.void,received:n.parsedType}),pe}return Rt(e.data)}};Xi.create=t=>new Xi({typeName:le.ZodVoid,...Ae(t)});var Yr=class t extends we{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==V.array)return U(r,{code:N.invalid_type,expected:V.array,received:r.parsedType}),pe;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(U(r,{code:s?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new ur(r,s,r.path,a)))).then(s=>Tt.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new ur(r,s,r.path,a)));return Tt.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Q.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Q.toString(r)}})}nonempty(e){return this.min(1,e)}};Yr.create=(t,e)=>new Yr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:le.ZodArray,...Ae(e)});function Hi(t){if(t instanceof zt){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ar.create(Hi(n))}return new zt({...t._def,shape:()=>e})}else return t instanceof Yr?new Yr({...t._def,type:Hi(t.element)}):t instanceof ar?ar.create(Hi(t.unwrap())):t instanceof kr?kr.create(Hi(t.unwrap())):t instanceof Cr?Cr.create(t.items.map(e=>Hi(e))):t}var zt=class t extends we{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Oe.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==V.object){let l=this._getOrReturnCtx(e);return U(l,{code:N.invalid_type,expected:V.object,received:l.parsedType}),pe}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof mr&&this._def.unknownKeys==="strip"))for(let l in i.data)s.includes(l)||a.push(l);let u=[];for(let l of s){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new ur(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof mr){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(U(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new ur(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,p=await c.value;l.push({key:f,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>Tt.mergeObjectSync(n,l)):Tt.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return Q.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o,s,a;let u=(s=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,r,n).message)!==null&&s!==void 0?s:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=Q.errToObj(e).message)!==null&&a!==void 0?a:u}:{message:u}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:le.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return Oe.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Hi(this)}partial(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return Oe.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof ar;)o=o._def.innerType;r[n]=o}}),new t({...this._def,shape:()=>r})}keyof(){return Zh(Oe.objectKeys(this.shape))}};zt.create=(t,e)=>new zt({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:le.ZodObject,...Ae(e)});zt.strictCreate=(t,e)=>new zt({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:le.ZodObject,...Ae(e)});zt.lazycreate=(t,e)=>new zt({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:le.ZodObject,...Ae(e)});var ui=class extends we{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Xt(a.ctx.common.issues));return U(r,{code:N.invalid_union,unionErrors:s}),pe}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(u=>new Xt(u));return U(r,{code:N.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};ui.create=(t,e)=>new ui({options:t,typeName:le.ZodUnion,...Ae(e)});var Wr=t=>t instanceof ci?Wr(t.schema):t instanceof Jt?Wr(t.innerType()):t instanceof fi?[t.value]:t instanceof pi?t.options:t instanceof di?Oe.objectValues(t.enum):t instanceof hi?Wr(t._def.innerType):t instanceof si?[void 0]:t instanceof ai?[null]:t instanceof ar?[void 0,...Wr(t.unwrap())]:t instanceof kr?[null,...Wr(t.unwrap())]:t instanceof fs||t instanceof gi?Wr(t.unwrap()):t instanceof mi?Wr(t._def.innerType):[],Oa=class t extends we{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.object)return U(r,{code:N.invalid_type,expected:V.object,received:r.parsedType}),pe;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=Wr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:le.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Ae(n)})}};function Lc(t,e){let r=Hr(t),n=Hr(e);if(t===e)return{valid:!0,data:t};if(r===V.object&&n===V.object){let i=Oe.objectKeys(e),o=Oe.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let u=Lc(t[a],e[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(r===V.array&&n===V.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],u=Lc(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===V.date&&n===V.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var li=class extends we{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(Nc(o)||Nc(s))return pe;let a=Lc(o.value,s.value);return a.valid?((Pc(o)||Pc(s))&&r.dirty(),{status:r.value,value:a.data}):(U(n,{code:N.invalid_intersection_types}),pe)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};li.create=(t,e,r)=>new li({left:t,right:e,typeName:le.ZodIntersection,...Ae(r)});var Cr=class t extends we{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.array)return U(n,{code:N.invalid_type,expected:V.array,received:n.parsedType}),pe;if(n.data.length<this._def.items.length)return U(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new ur(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Tt.mergeArray(r,s)):Tt.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Cr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:t,typeName:le.ZodTuple,rest:null,...Ae(e)})};var Da=class t extends we{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.object)return U(n,{code:N.invalid_type,expected:V.object,received:n.parsedType}),pe;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new ur(n,a,n.path,a)),value:s._parse(new ur(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Tt.mergeObjectAsync(r,i):Tt.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof we?new t({keyType:e,valueType:r,typeName:le.ZodRecord,...Ae(n)}):new t({keyType:mn.create(),valueType:e,typeName:le.ZodRecord,...Ae(r)})}},Ji=class extends we{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.map)return U(n,{code:N.invalid_type,expected:V.map,received:n.parsedType}),pe;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new ur(n,a,n.path,[l,"key"])),value:o._parse(new ur(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of s){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return pe;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}}}};Ji.create=(t,e,r)=>new Ji({valueType:e,keyType:t,typeName:le.ZodMap,...Ae(r)});var Qi=class t extends we{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==V.set)return U(n,{code:N.invalid_type,expected:V.set,received:n.parsedType}),pe;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(U(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(u){let l=new Set;for(let c of u){if(c.status==="aborted")return pe;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((u,l)=>o._parse(new ur(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:Q.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Q.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};Qi.create=(t,e)=>new Qi({valueType:t,minSize:null,maxSize:null,typeName:le.ZodSet,...Ae(e)});var Ra=class t extends we{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.function)return U(r,{code:N.invalid_type,expected:V.function,received:r.parsedType}),pe;function n(a,u){return va({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sa(),Yi].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:u}})}function i(a,u){return va({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Sa(),Yi].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:u}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof xn){let a=this;return Rt(async function(...u){let l=new Xt([]),c=await a._def.args.parseAsync(u,o).catch(d=>{throw l.addIssue(n(u,d)),l}),f=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(f,o).catch(d=>{throw l.addIssue(i(f,d)),l})})}else{let a=this;return Rt(function(...u){let l=a._def.args.safeParse(u,o);if(!l.success)throw new Xt([n(u,l.error)]);let c=Reflect.apply(s,this,l.data),f=a._def.returns.safeParse(c,o);if(!f.success)throw new Xt([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Cr.create(e).rest(Kr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Cr.create([]).rest(Kr.create()),returns:r||Kr.create(),typeName:le.ZodFunction,...Ae(n)})}},ci=class extends we{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};ci.create=(t,e)=>new ci({getter:t,typeName:le.ZodLazy,...Ae(e)});var fi=class extends we{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};fi.create=(t,e)=>new fi({value:t,typeName:le.ZodLiteral,...Ae(e)});function Zh(t,e){return new pi({values:t,typeName:le.ZodEnum,...Ae(e)})}var pi=class t extends we{constructor(){super(...arguments),us.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:Oe.joinValues(n),received:r.parsedType,code:N.invalid_type}),pe}if(Ia(this,us,"f")||Wh(this,us,new Set(this._def.values),"f"),!Ia(this,us,"f").has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{received:r.data,code:N.invalid_enum_value,options:n}),pe}return Rt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};us=new WeakMap;pi.create=Zh;var di=class extends we{constructor(){super(...arguments),ls.set(this,void 0)}_parse(e){let r=Oe.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==V.string&&n.parsedType!==V.number){let i=Oe.objectValues(r);return U(n,{expected:Oe.joinValues(i),received:n.parsedType,code:N.invalid_type}),pe}if(Ia(this,ls,"f")||Wh(this,ls,new Set(Oe.getValidEnumValues(this._def.values)),"f"),!Ia(this,ls,"f").has(e.data)){let i=Oe.objectValues(r);return U(n,{received:n.data,code:N.invalid_enum_value,options:i}),pe}return Rt(e.data)}get enum(){return this._def.values}};ls=new WeakMap;di.create=(t,e)=>new di({values:t,typeName:le.ZodNativeEnum,...Ae(e)});var xn=class extends we{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==V.promise&&r.common.async===!1)return U(r,{code:N.invalid_type,expected:V.promise,received:r.parsedType}),pe;let n=r.parsedType===V.promise?r.data:Promise.resolve(r.data);return Rt(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};xn.create=(t,e)=>new xn({type:t,typeName:le.ZodPromise,...Ae(e)});var Jt=class extends we{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===le.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{U(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return pe;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?pe:u.status==="dirty"||r.value==="dirty"?Ki(u.value):u});{if(r.value==="aborted")return pe;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?pe:a.status==="dirty"||r.value==="dirty"?Ki(a.value):a}}if(i.type==="refinement"){let s=a=>{let u=i.refinement(a,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ti(s))return s;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>ti(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):s);Oe.assertNever(i)}};Jt.create=(t,e,r)=>new Jt({schema:t,typeName:le.ZodEffects,effect:e,...Ae(r)});Jt.createWithPreprocess=(t,e,r)=>new Jt({schema:e,effect:{type:"preprocess",transform:t},typeName:le.ZodEffects,...Ae(r)});var ar=class extends we{_parse(e){return this._getType(e)===V.undefined?Rt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ar.create=(t,e)=>new ar({innerType:t,typeName:le.ZodOptional,...Ae(e)});var kr=class extends we{_parse(e){return this._getType(e)===V.null?Rt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};kr.create=(t,e)=>new kr({innerType:t,typeName:le.ZodNullable,...Ae(e)});var hi=class extends we{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===V.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};hi.create=(t,e)=>new hi({innerType:t,typeName:le.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});var mi=class extends we{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return cs(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Xt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};mi.create=(t,e)=>new mi({innerType:t,typeName:le.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});var eo=class extends we{_parse(e){if(this._getType(e)!==V.nan){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:V.nan,received:n.parsedType}),pe}return{status:"valid",value:e.data}}};eo.create=t=>new eo({typeName:le.ZodNaN,...Ae(t)});var pk=Symbol("zod_brand"),fs=class extends we{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ps=class t extends we{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?pe:o.status==="dirty"?(r.dirty(),Ki(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?pe:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:le.ZodPipeline})}},gi=class extends we{_parse(e){let r=this._def.innerType._parse(e),n=i=>(ti(i)&&(i.value=Object.freeze(i.value)),i);return cs(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};gi.create=(t,e)=>new gi({innerType:t,typeName:le.ZodReadonly,...Ae(e)});function qh(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Xh(t,e={},r){return t?gn.create().superRefine((n,i)=>{var o,s;let a=t(n);if(a instanceof Promise)return a.then(u=>{var l,c;if(!u){let f=qh(e,n),p=(c=(l=f.fatal)!==null&&l!==void 0?l:r)!==null&&c!==void 0?c:!0;i.addIssue({code:"custom",...f,fatal:p})}});if(!a){let u=qh(e,n),l=(s=(o=u.fatal)!==null&&o!==void 0?o:r)!==null&&s!==void 0?s:!0;i.addIssue({code:"custom",...u,fatal:l})}}):gn.create()}var dk={object:zt.lazycreate},le;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(le||(le={}));var hk=(t,e={message:`Input not instance of ${t.name}`})=>Xh(r=>r instanceof t,e),Jh=mn.create,Qh=ri.create,mk=eo.create,gk=ni.create,em=ii.create,xk=oi.create,yk=Zi.create,bk=si.create,Ek=ai.create,Ak=gn.create,wk=Kr.create,Ck=mr.create,kk=Xi.create,Tk=Yr.create,_k=zt.create,Sk=zt.strictCreate,vk=ui.create,Ik=Oa.create,Ok=li.create,Dk=Cr.create,Rk=Da.create,Fk=Ji.create,Nk=Qi.create,Pk=Ra.create,Lk=ci.create,Mk=fi.create,Bk=pi.create,jk=di.create,Uk=xn.create,Vh=Jt.create,zk=ar.create,$k=kr.create,qk=Jt.createWithPreprocess,Vk=ps.create,Gk=()=>Jh().optional(),Wk=()=>Qh().optional(),Hk=()=>em().optional(),Kk={string:t=>mn.create({...t,coerce:!0}),number:t=>ri.create({...t,coerce:!0}),boolean:t=>ii.create({...t,coerce:!0}),bigint:t=>ni.create({...t,coerce:!0}),date:t=>oi.create({...t,coerce:!0})},Yk=pe,X=Object.freeze({__proto__:null,defaultErrorMap:Yi,setErrorMap:qC,getErrorMap:Sa,makeIssue:va,EMPTY_PATH:VC,addIssueToContext:U,ParseStatus:Tt,INVALID:pe,DIRTY:Ki,OK:Rt,isAborted:Nc,isDirty:Pc,isValid:ti,isAsync:cs,get util(){return Oe},get objectUtil(){return Fc},ZodParsedType:V,getParsedType:Hr,ZodType:we,datetimeRegex:Yh,ZodString:mn,ZodNumber:ri,ZodBigInt:ni,ZodBoolean:ii,ZodDate:oi,ZodSymbol:Zi,ZodUndefined:si,ZodNull:ai,ZodAny:gn,ZodUnknown:Kr,ZodNever:mr,ZodVoid:Xi,ZodArray:Yr,ZodObject:zt,ZodUnion:ui,ZodDiscriminatedUnion:Oa,ZodIntersection:li,ZodTuple:Cr,ZodRecord:Da,ZodMap:Ji,ZodSet:Qi,ZodFunction:Ra,ZodLazy:ci,ZodLiteral:fi,ZodEnum:pi,ZodNativeEnum:di,ZodPromise:xn,ZodEffects:Jt,ZodTransformer:Jt,ZodOptional:ar,ZodNullable:kr,ZodDefault:hi,ZodCatch:mi,ZodNaN:eo,BRAND:pk,ZodBranded:fs,ZodPipeline:ps,ZodReadonly:gi,custom:Xh,Schema:we,ZodSchema:we,late:dk,get ZodFirstPartyTypeKind(){return le},coerce:Kk,any:Ak,array:Tk,bigint:gk,boolean:em,date:xk,discriminatedUnion:Ik,effect:Vh,enum:Bk,function:Pk,instanceof:hk,intersection:Ok,lazy:Lk,literal:Mk,map:Fk,nan:mk,nativeEnum:jk,never:Ck,null:Ek,nullable:$k,number:Qh,object:_k,oboolean:Hk,onumber:Wk,optional:zk,ostring:Gk,pipeline:Vk,preprocess:qk,promise:Uk,record:Rk,set:Nk,strictObject:Sk,string:Jh,symbol:yk,transformer:Vh,tuple:Dk,undefined:bk,union:vk,unknown:wk,void:kk,NEVER:Yk,ZodIssueCode:N,quotelessJson:$C,ZodError:Xt});import{defaultLoaders as Zk}from"cosmiconfig";function Mc(t,e){let r=Zk[".json"],n=r(t,e);return tm(n)}function tm(t,e="",r={}){for(let[n,i]of Object.entries(t)){let o=e?`${e}.${n}`:n;typeof i=="object"&&i!==null&&!Array.isArray(i)?tm(i,o,r):i===null?r[o]="null":r[o]=i.toString()}return r}import oT from"node:fs";import Zr from"node:path";import tT from"node:process";import Xk from"node:process";import Jk from"node:fs/promises";import{fileURLToPath as Qk}from"node:url";import to from"node:path";var rm=t=>t instanceof URL?Qk(t):t;async function Fa(t,{cwd:e=Xk.cwd(),type:r="file",stopAt:n}={}){let i=to.resolve(rm(e)??""),{root:o}=to.parse(i);n=to.resolve(i,rm(n??o));let s=to.isAbsolute(t);for(;i;){let a=s?t:to.join(i,t);try{let u=await Jk.stat(a);if(r==="file"&&u.isFile()||r==="directory"&&u.isDirectory())return a}catch{}if(i===n||i===o)break;i=to.dirname(i)}}async function nm({cwd:t=tT.cwd()}={}){return Fa("package.json",{cwd:t})}import rT from"node:fs";import nT from"node:fs/promises";async function Bc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await nT[t](r))[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function jc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return rT[t](r)[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var ro=Bc.bind(void 0,"stat","isFile"),wj=Bc.bind(void 0,"stat","isDirectory"),Cj=Bc.bind(void 0,"lstat","isSymbolicLink"),Uc=jc.bind(void 0,"statSync","isFile"),kj=jc.bind(void 0,"statSync","isDirectory"),Tj=jc.bind(void 0,"lstatSync","isSymbolicLink");import{log as om}from"remark-mdat";import{Configuration as sT}from"unified-engine";import iT from"node:os";var im=iT.homedir();function zc(t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return im?t.replace(/^~(?=$|\/|\\)/,im):t}function aT(t,e){let r=e===0?1:Math.floor(Math.log10(Math.abs(e))+1);return t.toString().padStart(r,"0")}function am(t,e,r,n){let i=[];for(let[o,s]of t.entries()){let a=r&&t.length>1?`-${aT(o+1,t.length+1)}`:"",u=uT(s,e,r,n,a);i.push(u)}return i}function uT(t,e,r,n,i=""){let o=sm(t),s=e?sm(e):void 0;if(!Uc(o))throw new Error(`Input file not found: "${o}"`);if(s){if(Uc(s))throw new Error(`Output path must be a directory, received a file path: "${s}"`);oT.mkdirSync(s,{recursive:!0})}let a=r?Zr.basename(r,Zr.extname(r)):Zr.basename(o,Zr.extname(o)),u=`.${n??(r&&Zr.extname(r)!==""?Zr.extname(r):Zr.extname(t)===""?"":Zr.extname(t))}`,l=`${a}${i}${u}`,c=s??Zr.dirname(o);return{input:o,name:l,output:c}}function sm(t){return zc(t)}async function Na(){return nm()}function Pa(t){return t==null?[]:Array.isArray(t)?t:[t]}async function um(){let t=new sT({cwd:process.cwd(),detectConfig:!0,packageField:"remarkConfig",rcName:".remarkrc"}),e=await new Promise(r=>{t.load("",(n,i)=>{if(n){console.error(n),r();return}r(i)})});if(e){let{filePath:r}=e;return r===void 0?om.info('No ambient Remark configuration file found"'):om.info(`Found and loaded ambient Remark configuration from "${r}"`),e}throw new Error("Failed to load ambient remark configuration")}var fm=fT.merge(X.object({assetsPath:X.string().optional(),packageFile:X.string().optional()})).describe("Config Extension");async function xi(t){let{additionalConfig:e,additionalRules:r,searchFrom:n}=t??{},i={addMetaComment:!1,assetsPath:"./assets",closingPrefix:"/",keywordPrefix:"",metaCommentIdentifier:"+",packageFile:await Na(),rules:{mdat:"Powered by the Markdown Autophagic Template system: [mdat](https://github.com/kitschpatrol/mdat)."}},o=lm("mdat",{loaders:{".ts":cm()}}),s=await o.search(n);if(s){let{config:a,filepath:u}=s,l=a;if(lr.info(`Using config from "${u}"`),u.endsWith("package.json")&&typeof a=="string"){lr.info(`Detected shared config string: "${a}"`);let{default:f}=await import(a);l=f}let c=pm(l,fm);c&&(i=$c(i,c))}if(e!==void 0){let a=Array.isArray(e)?e:[e];for(let u of a){let l;if(typeof u=="string"){let f=await o.load(u);if(f==null)continue;let{config:p,filepath:d}=f;lr.info(`Loaded additional config from "${d}"`),l=p}else l=u;if(l===void 0)continue;lr.info("Merging configuration object");let c=pm(l,fm);c!==void 0&&(i=$c(i,c))}}if(r!==void 0){let a=Array.isArray(r)?r:[r],u=lm("mdat",{loaders:{".json":Mc,".ts":cm()}});for(let l of a){let c;if(typeof l=="string"){let p;if(dm.basename(l).endsWith("package.json")){let y=await lT.readFile(l,"utf8");p={config:Mc(l,y),filepath:l}}else p=await u.load(l);if(p==null)continue;let{config:d,filepath:m}=p;lr.info(`Loaded additional config from "${m}"`),c=d}else c=l;if(c===void 0)continue;lr.info("Merging rules into configuration object");let f=dT(c,pT);f!==void 0&&(i=$c(i,f))}}if(i.rules){let a=Object.keys(i.rules).sort().map(u=>`"${La.default.green(La.default.bold(u))}"`);lr.info(`Loaded ${La.default.bold(a.length)} mdat comment expansion ${Dc("rule",a.length)}:`);for(let u of a)lr.info(` ${u}`)}else lr.error("No rules loaded from additional configurations or rules, using default.");return Ma=i,i}function dT(t,e){if(e.safeParse(t).success)return{rules:t};lr.error(`Rules object has the wrong shape. Ignoring and using default configuration:
66
- ${JSON.stringify(t,void 0,2)}`)}function pm(t,e){if(e.safeParse(t).success)return t;lr.error(`Config object has the wrong shape. Ignoring and using default configuration:
67
- ${JSON.stringify(t,void 0,2)}`)}var Ma;async function Tr(){return Ma===void 0&&(lr.warn("getConfig(): config was undefined"),Ma??=await xi()),Ma}var qc;async function Qt(){let{packageFile:t}=await Tr();if(t===void 0)throw new Error("No packageFile found or set in config");if(qc??=await cT({cwd:dm.dirname(t)}),qc===void 0)throw new Error("No package.json found");return qc}var hT={};function Xr(t,e){let r=e||hT,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return mm(t,n,i)}function mm(t,e,r){if(mT(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return hm(t.children,e,r)}return Array.isArray(t)?hm(t,e,r):""}function hm(t,e,r){let n=[],i=-1;for(;++i<t.length;)n[i]=mm(t[i],e,r);return n.join("")}function mT(t){return!!(t&&typeof t=="object")}var Vc={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
68
- `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var gT={}.hasOwnProperty;function no(t){return gT.call(Vc,t)?Vc[t]:!1}function it(t,e,r,n){let i=t.length,o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(e,r),t.splice(...s);else for(r&&t.splice(e,r);o<n.length;)s=n.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function Ft(t,e){return t.length>0?(it(t,t.length,0,e),t):e}var gm={}.hasOwnProperty;function Ba(t){let e={},r=-1;for(;++r<t.length;)xT(e,t[r]);return e}function xT(t,e){let r;for(r in e){let i=(gm.call(t,r)?t[r]:void 0)||(t[r]={}),o=e[r],s;if(o)for(s in o){gm.call(i,s)||(i[s]=[]);let a=o[s];yT(i[s],Array.isArray(a)?a:a?[a]:[])}}}function yT(t,e){let r=-1,n=[];for(;++r<e.length;)(e[r].add==="after"?t:n).push(e[r]);it(t,0,0,n)}function ja(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function _t(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var mt=yn(/[A-Za-z]/),gt=yn(/[\dA-Za-z]/),xm=yn(/[#-'*+\--9=?A-Z^-~]/);function yi(t){return t!==null&&(t<32||t===127)}var ds=yn(/\d/),ym=yn(/[\dA-Fa-f]/),bm=yn(/[!-/:-@[-`{-~]/);function z(t){return t!==null&&t<-2}function ke(t){return t!==null&&(t<0||t===32)}function se(t){return t===-2||t===-1||t===32}var bi=yn(new RegExp("\\p{P}|\\p{S}","u")),_r=yn(/\s/);function yn(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function ie(t,e,r,n){let i=n?n-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return se(u)?(t.enter(r),a(u)):e(u)}function a(u){return se(u)&&o++<i?(t.consume(u),a):(t.exit(r),e(u))}}var Em={tokenize:bT};function bT(t){let e=t.attempt(this.parser.constructs.contentInitial,n,i),r;return e;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ie(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),o(a)}function o(a){let u=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(a)}function s(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return z(a)?(t.consume(a),t.exit("chunkText"),o):(t.consume(a),s)}}var wm={tokenize:ET},Am={tokenize:AT};function ET(t){let e=this,r=[],n=0,i,o,s;return a;function a(w){if(n<r.length){let D=r[n];return e.containerState=D[1],t.attempt(D[0].continuation,u,l)(w)}return l(w)}function u(w){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&C();let D=e.events.length,R=D,S;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){S=e.events[R][1].end;break}b(n);let de=D;for(;de<e.events.length;)e.events[de][1].end={...S},de++;return it(e.events,R+1,0,e.events.slice(D)),e.events.length=de,l(w)}return a(w)}function l(w){if(n===r.length){if(!i)return p(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(Am,c,f)(w)}function c(w){return i&&C(),b(n),p(w)}function f(w){return e.parser.lazy[e.now().line]=n!==r.length,s=e.now().offset,m(w)}function p(w){return e.containerState={},t.attempt(Am,d,m)(w)}function d(w){return n++,r.push([e.currentConstruct,e.containerState]),p(w)}function m(w){if(w===null){i&&C(),b(0),t.consume(w);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),y(w)}function y(w){if(w===null){g(t.exit("chunkFlow"),!0),b(0),t.consume(w);return}return z(w)?(t.consume(w),g(t.exit("chunkFlow")),n=0,e.interrupt=void 0,a):(t.consume(w),y)}function g(w,D){let R=e.sliceStream(w);if(D&&R.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(R),e.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;let de=e.events.length,ye=de,be,_;for(;ye--;)if(e.events[ye][0]==="exit"&&e.events[ye][1].type==="chunkFlow"){if(be){_=e.events[ye][1].end;break}be=!0}for(b(n),S=de;S<e.events.length;)e.events[S][1].end={..._},S++;it(e.events,ye+1,0,e.events.slice(de)),e.events.length=S}}function b(w){let D=r.length;for(;D-- >w;){let R=r[D];e.containerState=R[1],R[0].exit.call(e,t)}r.length=w}function C(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function AT(t,e,r){return ie(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Jr(t){if(t===null||ke(t)||_r(t))return 1;if(bi(t))return 2}function bn(t,e,r){let n=[],i=-1;for(;++i<t.length;){let o=t[i].resolveAll;o&&!n.includes(o)&&(e=o(e,r),n.push(o))}return e}var hs={name:"attention",resolveAll:wT,tokenize:CT};function wT(t,e){let r=-1,n,i,o,s,a,u,l,c;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(n=r;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[n][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;u=t[n][1].end.offset-t[n][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let f={...t[n][1].end},p={...t[r][1].start};Cm(f,-u),Cm(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...t[n][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[n][1].end={...s.start},t[r][1].start={...a.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Ft(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Ft(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),l=Ft(l,bn(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),l=Ft(l,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(c=2,l=Ft(l,[["enter",t[r][1],e],["exit",t[r][1],e]])):c=0,it(t,n-1,r-n+3,l),r=n+l.length-c-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function CT(t,e){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=Jr(n),o;return s;function s(u){return o=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===o)return t.consume(u),a;let l=t.exit("attentionSequence"),c=Jr(u),f=!c||c===2&&i||r.includes(u),p=!i||i===2&&c||r.includes(n);return l._open=!!(o===42?f:f&&(i||!p)),l._close=!!(o===42?p:p&&(c||!f)),e(u)}}function Cm(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var Gc={name:"autolink",tokenize:kT};function kT(t,e,r){let n=0;return i;function i(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(d){return mt(d)?(t.consume(d),s):d===64?r(d):l(d)}function s(d){return d===43||d===45||d===46||gt(d)?(n=1,a(d)):l(d)}function a(d){return d===58?(t.consume(d),n=0,u):(d===43||d===45||d===46||gt(d))&&n++<32?(t.consume(d),a):(n=0,l(d))}function u(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||yi(d)?r(d):(t.consume(d),u)}function l(d){return d===64?(t.consume(d),c):xm(d)?(t.consume(d),l):r(d)}function c(d){return gt(d)?f(d):r(d)}function f(d){return d===46?(t.consume(d),n=0,c):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):p(d)}function p(d){if((d===45||gt(d))&&n++<63){let m=d===45?p:f;return t.consume(d),m}return r(d)}}var Sr={partial:!0,tokenize:TT};function TT(t,e,r){return n;function n(o){return se(o)?ie(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?e(o):r(o)}}var Ua={continuation:{tokenize:ST},exit:vT,name:"blockQuote",tokenize:_T};function _T(t,e,r){let n=this;return i;function i(s){if(s===62){let a=n.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return r(s)}function o(s){return se(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function ST(t,e,r){let n=this;return i;function i(s){return se(s)?ie(t,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(Ua,e,r)(s)}}function vT(t){t.exit("blockQuote")}var za={name:"characterEscape",tokenize:IT};function IT(t,e,r){return n;function n(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return bm(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(o)}}var $a={name:"characterReference",tokenize:OT};function OT(t,e,r){let n=this,i=0,o,s;return a;function a(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),u}function u(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),o=31,s=gt,c(f))}function l(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=ym,c):(t.enter("characterReferenceValue"),o=7,s=ds,c(f))}function c(f){if(f===59&&i){let p=t.exit("characterReferenceValue");return s===gt&&!no(n.sliceSerialize(p))?r(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<o?(t.consume(f),c):r(f)}}var km={partial:!0,tokenize:RT},qa={concrete:!0,name:"codeFenced",tokenize:DT};function DT(t,e,r){let n=this,i={partial:!0,tokenize:R},o=0,s=0,a;return u;function u(S){return l(S)}function l(S){let de=n.events[n.events.length-1];return o=de&&de[1].type==="linePrefix"?de[2].sliceSerialize(de[1],!0).length:0,a=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===a?(s++,t.consume(S),c):s<3?r(S):(t.exit("codeFencedFenceSequence"),se(S)?ie(t,f,"whitespace")(S):f(S))}function f(S){return S===null||z(S)?(t.exit("codeFencedFence"),n.interrupt?e(S):t.check(km,y,D)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):se(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ie(t,d,"whitespace")(S)):S===96&&S===a?r(S):(t.consume(S),p)}function d(S){return S===null||z(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?r(S):(t.consume(S),m)}function y(S){return t.attempt(i,D,g)(S)}function g(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),b}function b(S){return o>0&&se(S)?ie(t,C,"linePrefix",o+1)(S):C(S)}function C(S){return S===null||z(S)?t.check(km,y,D)(S):(t.enter("codeFlowValue"),w(S))}function w(S){return S===null||z(S)?(t.exit("codeFlowValue"),C(S)):(t.consume(S),w)}function D(S){return t.exit("codeFenced"),e(S)}function R(S,de,ye){let be=0;return _;function _(j){return S.enter("lineEnding"),S.consume(j),S.exit("lineEnding"),L}function L(j){return S.enter("codeFencedFence"),se(j)?ie(S,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return j===a?(S.enter("codeFencedFenceSequence"),v(j)):ye(j)}function v(j){return j===a?(be++,S.consume(j),v):be>=s?(S.exit("codeFencedFenceSequence"),se(j)?ie(S,P,"whitespace")(j):P(j)):ye(j)}function P(j){return j===null||z(j)?(S.exit("codeFencedFence"),de(j)):ye(j)}}}function RT(t,e,r){let n=this;return i;function i(s){return s===null?r(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}var ms={name:"codeIndented",tokenize:NT},FT={partial:!0,tokenize:PT};function NT(t,e,r){let n=this;return i;function i(l){return t.enter("codeIndented"),ie(t,o,"linePrefix",5)(l)}function o(l){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):r(l)}function s(l){return l===null?u(l):z(l)?t.attempt(FT,s,u)(l):(t.enter("codeFlowValue"),a(l))}function a(l){return l===null||z(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),a)}function u(l){return t.exit("codeIndented"),e(l)}}function PT(t,e,r){let n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):ie(t,o,"linePrefix",5)(s)}function o(s){let a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):z(s)?i(s):r(s)}}var Wc={name:"codeText",previous:MT,resolve:LT,tokenize:BT};function LT(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)i===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(i=n):(n===e||t[n][1].type==="lineEnding")&&(t[i][1].type="codeTextData",n!==i+2&&(t[i][1].end=t[n-1][1].end,t.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return t}function MT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BT(t,e,r){let n=this,i=0,o,s;return a;function a(p){return t.enter("codeText"),t.enter("codeTextSequence"),u(p)}function u(p){return p===96?(t.consume(p),i++,u):(t.exit("codeTextSequence"),l(p))}function l(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),l):p===96?(s=t.enter("codeTextSequence"),o=0,f(p)):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||z(p)?(t.exit("codeTextData"),l(p)):(t.consume(p),c)}function f(p){return p===96?(t.consume(p),o++,f):o===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",c(p))}}var Va=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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,r){let n=r??Number.POSITIVE_INFINITY;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,r,n){let i=r||0;this.setCursor(Math.trunc(e));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&gs(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),gs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),gs(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 r=this.left.splice(e,Number.POSITIVE_INFINITY);gs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);gs(this.left,r.reverse())}}};function gs(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function Ga(t){let e={},r=-1,n,i,o,s,a,u,l,c=new Va(t);for(;++r<c.length;){for(;r in e;)r=e[r];if(n=c.get(r),r&&n[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,jT(c,r)),r=e[r],l=!0);else if(n[1]._container){for(o=r,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(n[1].end={...c.get(i)[1].start},a=c.slice(i,r),a.unshift(n),c.splice(i,r-i+1,a))}}return it(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function jT(t,e){let r=t.get(e)[1],n=t.get(e)[2],i=e-1,o=[],s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},c,f,p=-1,d=r,m=0,y=0,g=[y];for(;d;){for(;t.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=n.sliceStream(d),d.next||c.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=r;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,g.push(y),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){let b=a.slice(g[p],g[p+1]),C=o.pop();u.push([C,C+b.length-1]),t.splice(C,2,b)}for(u.reverse(),p=-1;++p<u.length;)l[m+u[p][0]]=m+u[p][1],m+=u[p][1]-u[p][0]-1;return l}var Hc={resolve:zT,tokenize:$T},UT={partial:!0,tokenize:qT};function zT(t){return Ga(t),t}function $T(t,e){let r;return n;function n(a){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?t.check(UT,s,o)(a):(t.consume(a),i)}function o(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function s(a){return t.consume(a),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function qT(t,e,r){let n=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),ie(t,o,"linePrefix")}function o(s){if(s===null||z(s))return r(s);let a=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):t.interrupt(n.parser.constructs.flow,r,e)(s)}}function Wa(t,e,r,n,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return f;function f(b){return b===60?(t.enter(n),t.enter(i),t.enter(o),t.consume(b),t.exit(o),p):b===null||b===32||b===41||yi(b)?r(b):(t.enter(n),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),y(b))}function p(b){return b===62?(t.enter(o),t.consume(b),t.exit(o),t.exit(i),t.exit(n),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(t.exit("chunkString"),t.exit(a),p(b)):b===null||b===60||z(b)?r(b):(t.consume(b),b===92?m:d)}function m(b){return b===60||b===62||b===92?(t.consume(b),d):d(b)}function y(b){return!c&&(b===null||b===41||ke(b))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(n),e(b)):c<l&&b===40?(t.consume(b),c++,y):b===41?(t.consume(b),c--,y):b===null||b===32||b===40||yi(b)?r(b):(t.consume(b),b===92?g:y)}function g(b){return b===40||b===41||b===92?(t.consume(b),y):y(b)}}function Ha(t,e,r,n,i,o){let s=this,a=0,u;return l;function l(d){return t.enter(n),t.enter(i),t.consume(d),t.exit(i),t.enter(o),c}function c(d){return a>999||d===null||d===91||d===93&&!u||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):z(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||z(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),u||(u=!se(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function Ka(t,e,r,n,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(n),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,u):r(p)}function u(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):(t.enter(o),l(p))}function l(p){return p===s?(t.exit(o),u(s)):p===null?r(p):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),ie(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||z(p)?(t.exit("chunkString"),l(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function Ei(t,e){let r;return n;function n(i){return z(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):se(i)?ie(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}var Kc={name:"definition",tokenize:GT},VT={partial:!0,tokenize:WT};function GT(t,e,r){let n=this,i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return Ha.call(n,t,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=_t(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),u):r(d)}function u(d){return ke(d)?Ei(t,l)(d):l(d)}function l(d){return Wa(t,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt(VT,f,f)(d)}function f(d){return se(d)?ie(t,p,"whitespace")(d):p(d)}function p(d){return d===null||z(d)?(t.exit("definition"),n.parser.defined.push(i),e(d)):r(d)}}function WT(t,e,r){return n;function n(a){return ke(a)?Ei(t,i)(a):r(a)}function i(a){return Ka(t,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return se(a)?ie(t,s,"whitespace")(a):s(a)}function s(a){return a===null||z(a)?e(a):r(a)}}var Yc={name:"hardBreakEscape",tokenize:HT};function HT(t,e,r){return n;function n(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return z(o)?(t.exit("hardBreakEscape"),e(o)):r(o)}}var Zc={name:"headingAtx",resolve:KT,tokenize:YT};function KT(t,e){let r=t.length-2,n=3,i,o;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},o={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},it(t,n,r-n+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function YT(t,e,r){let n=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&n++<6?(t.consume(c),s):c===null||ke(c)?(t.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),u(c)):c===null||z(c)?(t.exit("atxHeading"),e(c)):se(c)?ie(t,a,"whitespace")(c):(t.enter("atxHeadingText"),l(c))}function u(c){return c===35?(t.consume(c),u):(t.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||ke(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),l)}}var Tm=["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"],Xc=["pre","script","style","textarea"];var Jc={concrete:!0,name:"htmlFlow",resolveTo:JT,tokenize:QT},ZT={partial:!0,tokenize:t_},XT={partial:!0,tokenize:e_};function JT(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function QT(t,e,r){let n=this,i,o,s,a,u;return l;function l(E){return c(E)}function c(E){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(E),f}function f(E){return E===33?(t.consume(E),p):E===47?(t.consume(E),o=!0,y):E===63?(t.consume(E),i=3,n.interrupt?e:x):mt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function p(E){return E===45?(t.consume(E),i=2,d):E===91?(t.consume(E),i=5,a=0,m):mt(E)?(t.consume(E),i=4,n.interrupt?e:x):r(E)}function d(E){return E===45?(t.consume(E),n.interrupt?e:x):r(E)}function m(E){let W="CDATA[";return E===W.charCodeAt(a++)?(t.consume(E),a===W.length?n.interrupt?e:F:m):r(E)}function y(E){return mt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function g(E){if(E===null||E===47||E===62||ke(E)){let W=E===47,Ke=s.toLowerCase();return!W&&!o&&Xc.includes(Ke)?(i=1,n.interrupt?e(E):F(E)):Tm.includes(s.toLowerCase())?(i=6,W?(t.consume(E),b):n.interrupt?e(E):F(E)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(E):o?C(E):w(E))}return E===45||gt(E)?(t.consume(E),s+=String.fromCharCode(E),g):r(E)}function b(E){return E===62?(t.consume(E),n.interrupt?e:F):r(E)}function C(E){return se(E)?(t.consume(E),C):_(E)}function w(E){return E===47?(t.consume(E),_):E===58||E===95||mt(E)?(t.consume(E),D):se(E)?(t.consume(E),w):_(E)}function D(E){return E===45||E===46||E===58||E===95||gt(E)?(t.consume(E),D):R(E)}function R(E){return E===61?(t.consume(E),S):se(E)?(t.consume(E),R):w(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(t.consume(E),u=E,de):se(E)?(t.consume(E),S):ye(E)}function de(E){return E===u?(t.consume(E),u=null,be):E===null||z(E)?r(E):(t.consume(E),de)}function ye(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||ke(E)?R(E):(t.consume(E),ye)}function be(E){return E===47||E===62||se(E)?w(E):r(E)}function _(E){return E===62?(t.consume(E),L):r(E)}function L(E){return E===null||z(E)?F(E):se(E)?(t.consume(E),L):r(E)}function F(E){return E===45&&i===2?(t.consume(E),ae):E===60&&i===1?(t.consume(E),ee):E===62&&i===4?(t.consume(E),Ue):E===63&&i===3?(t.consume(E),x):E===93&&i===5?(t.consume(E),rt):z(E)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(ZT,Je,v)(E)):E===null||z(E)?(t.exit("htmlFlowData"),v(E)):(t.consume(E),F)}function v(E){return t.check(XT,P,Je)(E)}function P(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),j}function j(E){return E===null||z(E)?v(E):(t.enter("htmlFlowData"),F(E))}function ae(E){return E===45?(t.consume(E),x):F(E)}function ee(E){return E===47?(t.consume(E),s="",_e):F(E)}function _e(E){if(E===62){let W=s.toLowerCase();return Xc.includes(W)?(t.consume(E),Ue):F(E)}return mt(E)&&s.length<8?(t.consume(E),s+=String.fromCharCode(E),_e):F(E)}function rt(E){return E===93?(t.consume(E),x):F(E)}function x(E){return E===62?(t.consume(E),Ue):E===45&&i===2?(t.consume(E),x):F(E)}function Ue(E){return E===null||z(E)?(t.exit("htmlFlowData"),Je(E)):(t.consume(E),Ue)}function Je(E){return t.exit("htmlFlow"),e(E)}}function e_(t,e,r){let n=this;return i;function i(s){return z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):r(s)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function t_(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Sr,e,r)}}var Qc={name:"htmlText",tokenize:r_};function r_(t,e,r){let n=this,i,o,s;return a;function a(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),u}function u(x){return x===33?(t.consume(x),l):x===47?(t.consume(x),R):x===63?(t.consume(x),w):mt(x)?(t.consume(x),ye):r(x)}function l(x){return x===45?(t.consume(x),c):x===91?(t.consume(x),o=0,m):mt(x)?(t.consume(x),C):r(x)}function c(x){return x===45?(t.consume(x),d):r(x)}function f(x){return x===null?r(x):x===45?(t.consume(x),p):z(x)?(s=f,ee(x)):(t.consume(x),f)}function p(x){return x===45?(t.consume(x),d):f(x)}function d(x){return x===62?ae(x):x===45?p(x):f(x)}function m(x){let Ue="CDATA[";return x===Ue.charCodeAt(o++)?(t.consume(x),o===Ue.length?y:m):r(x)}function y(x){return x===null?r(x):x===93?(t.consume(x),g):z(x)?(s=y,ee(x)):(t.consume(x),y)}function g(x){return x===93?(t.consume(x),b):y(x)}function b(x){return x===62?ae(x):x===93?(t.consume(x),b):y(x)}function C(x){return x===null||x===62?ae(x):z(x)?(s=C,ee(x)):(t.consume(x),C)}function w(x){return x===null?r(x):x===63?(t.consume(x),D):z(x)?(s=w,ee(x)):(t.consume(x),w)}function D(x){return x===62?ae(x):w(x)}function R(x){return mt(x)?(t.consume(x),S):r(x)}function S(x){return x===45||gt(x)?(t.consume(x),S):de(x)}function de(x){return z(x)?(s=de,ee(x)):se(x)?(t.consume(x),de):ae(x)}function ye(x){return x===45||gt(x)?(t.consume(x),ye):x===47||x===62||ke(x)?be(x):r(x)}function be(x){return x===47?(t.consume(x),ae):x===58||x===95||mt(x)?(t.consume(x),_):z(x)?(s=be,ee(x)):se(x)?(t.consume(x),be):ae(x)}function _(x){return x===45||x===46||x===58||x===95||gt(x)?(t.consume(x),_):L(x)}function L(x){return x===61?(t.consume(x),F):z(x)?(s=L,ee(x)):se(x)?(t.consume(x),L):be(x)}function F(x){return x===null||x===60||x===61||x===62||x===96?r(x):x===34||x===39?(t.consume(x),i=x,v):z(x)?(s=F,ee(x)):se(x)?(t.consume(x),F):(t.consume(x),P)}function v(x){return x===i?(t.consume(x),i=void 0,j):x===null?r(x):z(x)?(s=v,ee(x)):(t.consume(x),v)}function P(x){return x===null||x===34||x===39||x===60||x===61||x===96?r(x):x===47||x===62||ke(x)?be(x):(t.consume(x),P)}function j(x){return x===47||x===62||ke(x)?be(x):r(x)}function ae(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):r(x)}function ee(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),_e}function _e(x){return se(x)?ie(t,rt,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):rt(x)}function rt(x){return t.enter("htmlTextData"),s(x)}}var Ai={name:"labelEnd",resolveAll:s_,resolveTo:a_,tokenize:u_},n_={tokenize:l_},i_={tokenize:c_},o_={tokenize:f_};function s_(t){let e=-1,r=[];for(;++e<t.length;){let n=t[e][1];if(r.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return t.length!==r.length&&it(t,0,t.length,r),t}function a_(t,e){let r=t.length,n=0,i,o,s,a;for(;r--;)if(i=t[r][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=r);let u={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[o][1].start},end:{...t[s][1].end}},c={type:"labelText",start:{...t[o+n+2][1].end},end:{...t[s-2][1].start}};return a=[["enter",u,e],["enter",l,e]],a=Ft(a,t.slice(o+1,o+n+3)),a=Ft(a,[["enter",c,e]]),a=Ft(a,bn(e.parser.constructs.insideSpan.null,t.slice(o+n+4,s-3),e)),a=Ft(a,[["exit",c,e],t[s-2],t[s-1],["exit",l,e]]),a=Ft(a,t.slice(s+1)),a=Ft(a,[["exit",u,e]]),it(t,o,t.length,a),t}function u_(t,e,r){let n=this,i=n.events.length,o,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){o=n.events[i][1];break}return a;function a(p){return o?o._inactive?f(p):(s=n.parser.defined.includes(_t(n.sliceSerialize({start:o.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),u):r(p)}function u(p){return p===40?t.attempt(n_,c,s?c:f)(p):p===91?t.attempt(i_,c,s?l:f)(p):s?c(p):f(p)}function l(p){return t.attempt(o_,c,f)(p)}function c(p){return e(p)}function f(p){return o._balanced=!0,r(p)}}function l_(t,e,r){return n;function n(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return ke(f)?Ei(t,o)(f):o(f)}function o(f){return f===41?c(f):Wa(t,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return ke(f)?Ei(t,u)(f):c(f)}function a(f){return r(f)}function u(f){return f===34||f===39||f===40?Ka(t,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return ke(f)?Ei(t,c)(f):c(f)}function c(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):r(f)}}function c_(t,e,r){let n=this;return i;function i(a){return Ha.call(n,t,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return n.parser.defined.includes(_t(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(a):r(a)}function s(a){return r(a)}}function f_(t,e,r){return n;function n(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):r(o)}}var ef={name:"labelStartImage",resolveAll:Ai.resolveAll,tokenize:p_};function p_(t,e,r){let n=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),o}function o(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),s):r(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):e(a)}}var tf={name:"labelStartLink",resolveAll:Ai.resolveAll,tokenize:d_};function d_(t,e,r){let n=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):e(s)}}var xs={name:"lineEnding",tokenize:h_};function h_(t,e){return r;function r(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),ie(t,e,"linePrefix")}}var wi={name:"thematicBreak",tokenize:m_};function m_(t,e,r){let n=0,i;return o;function o(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):n>=3&&(l===null||z(l))?(t.exit("thematicBreak"),e(l)):r(l)}function u(l){return l===i?(t.consume(l),n++,u):(t.exit("thematicBreakSequence"),se(l)?ie(t,a,"whitespace")(l):a(l))}}var St={continuation:{tokenize:b_},exit:A_,name:"list",tokenize:y_},g_={partial:!0,tokenize:w_},x_={partial:!0,tokenize:E_};function y_(t,e,r){let n=this,i=n.events[n.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){let m=n.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||d===n.containerState.marker:ds(d)){if(n.containerState.type||(n.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(wi,r,l)(d):l(d);if(!n.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(d)}return r(d)}function u(d){return ds(d)&&++s<10?(t.consume(d),u):(!n.interrupt||s<2)&&(n.containerState.marker?d===n.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),l(d)):r(d)}function l(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||d,t.check(Sr,n.interrupt?r:c,t.attempt(g_,p,f))}function c(d){return n.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return se(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):r(d)}function p(d){return n.containerState.size=o+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function b_(t,e,r){let n=this;return n.containerState._closeFlow=void 0,t.check(Sr,i,o);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ie(t,e,"listItemIndent",n.containerState.size+1)(a)}function o(a){return n.containerState.furtherBlankLines||!se(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(x_,e,s)(a))}function s(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(t,t.attempt(St,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function E_(t,e,r){let n=this;return ie(t,i,"listItemIndent",n.containerState.size+1);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(o):r(o)}}function A_(t){t.exit(this.containerState.type)}function w_(t,e,r){let n=this;return ie(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=n.events[n.events.length-1];return!se(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):r(o)}}var Ya={name:"setextUnderline",resolveTo:C_,tokenize:k_};function C_(t,e){let r=t.length,n,i,o;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!o&&t[r][1].type==="definition"&&(o=r);let s={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[n][1],e]),t[n][1].end={...t[o][1].end}):t[n][1]=s,t.push(["exit",s,e]),t}function k_(t,e,r){let n=this,i;return o;function o(l){let c=n.events.length,f;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(t.enter("setextHeadingLine"),i=l,s(l)):r(l)}function s(l){return t.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(t.consume(l),a):(t.exit("setextHeadingLineSequence"),se(l)?ie(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||z(l)?(t.exit("setextHeadingLine"),e(l)):r(l)}}var _m={tokenize:T_};function T_(t){let e=this,r=t.attempt(Sr,n,t.attempt(this.parser.constructs.flowInitial,i,ie(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Hc,i)),"linePrefix")));return r;function n(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var Sm={resolveAll:Dm()},vm=Om("string"),Im=Om("text");function Om(t){return{resolveAll:Dm(t==="text"?__:void 0),tokenize:e};function e(r){let n=this,i=this.parser.constructs[t],o=r.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),u}function u(c){return l(c)?(r.exit("data"),o(c)):(r.consume(c),u)}function l(c){if(c===null)return!0;let f=i[c],p=-1;if(f)for(;++p<f.length;){let d=f[p];if(!d.previous||d.previous.call(n,n.previous))return!0}return!1}}}function Dm(t){return e;function e(r,n){let i=-1,o;for(;++i<=r.length;)o===void 0?r[i]&&r[i][1].type==="data"&&(o=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==o+2&&(r[o][1].end=r[i-1][1].end,r.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(r,n):r}}function __(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let n=t[r-1][1],i=e.sliceStream(n),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(e._contentTypeTextTrailing&&r===t.length&&(a=0),a){let l={type:r===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:n.start._bufferIndex+s,_index:n.start._index+o,line:n.end.line,column:n.end.column-a,offset:n.end.offset-a},end:{...n.end}};n.end={...l.start},n.start.offset===n.end.offset?Object.assign(n,l):(t.splice(r,0,["enter",l,e],["exit",l,e]),r+=2)}r++}return t}var rf={};Dw(rf,{attentionMarkers:()=>N_,contentInitial:()=>v_,disable:()=>P_,document:()=>S_,flow:()=>O_,flowInitial:()=>I_,insideSpan:()=>F_,string:()=>D_,text:()=>R_});var S_={42:St,43:St,45:St,48:St,49:St,50:St,51:St,52:St,53:St,54:St,55:St,56:St,57:St,62:Ua},v_={91:Kc},I_={[-2]:ms,[-1]:ms,32:ms},O_={35:Zc,42:wi,45:[Ya,wi],60:Jc,61:Ya,95:wi,96:qa,126:qa},D_={38:$a,92:za},R_={[-5]:xs,[-4]:xs,[-3]:xs,33:ef,38:$a,42:hs,60:[Gc,Qc],91:tf,92:[Yc,za],93:Ai,95:hs,96:Wc},F_={null:[hs,Sm]},N_={null:[42,95]},P_={null:[]};function Rm(t,e,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:be(de),check:be(ye),consume:D,enter:R,exit:S,interrupt:be(ye,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:m,sliceStream:y,write:d},f=e.tokenize.call(c,l),p;return e.resolveAll&&o.push(e),c;function d(v){return s=Ft(s,v),C(),s[s.length-1]!==null?[]:(_(e,0),c.events=bn(o,c.events,c),c.events)}function m(v,P){return M_(y(v),P)}function y(v){return L_(s,v)}function g(){let{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}=n;return{_bufferIndex:v,_index:P,line:j,column:ae,offset:ee}}function b(v){i[v.line]=v.column,F()}function C(){let v;for(;n._index<s.length;){let P=s[n._index];if(typeof P=="string")for(v=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===v&&n._bufferIndex<P.length;)w(P.charCodeAt(n._bufferIndex));else w(P)}}function w(v){u=void 0,p=v,f=f(v)}function D(v){z(v)?(n.line++,n.column=1,n.offset+=v===-3?2:1,F()):v!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=v,u=!0}function R(v,P){let j=P||{};return j.type=v,j.start=g(),c.events.push(["enter",j,c]),a.push(j),j}function S(v){let P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function de(v,P){_(v,P.from)}function ye(v,P){P.restore()}function be(v,P){return j;function j(ae,ee,_e){let rt,x,Ue,Je;return Array.isArray(ae)?W(ae):"tokenize"in ae?W([ae]):E(ae);function E(oe){return ce;function ce(me){let Ce=me!==null&&oe[me],Fe=me!==null&&oe.null,ze=[...Array.isArray(Ce)?Ce:Ce?[Ce]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return W(ze)(me)}}function W(oe){return rt=oe,x=0,oe.length===0?_e:Ke(oe[x])}function Ke(oe){return ce;function ce(me){return Je=L(),Ue=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?he(me):oe.tokenize.call(P?Object.assign(Object.create(c),P):c,l,ne,he)(me)}}function ne(oe){return u=!0,v(Ue,Je),ee}function he(oe){return u=!0,Je.restore(),++x<rt.length?Ke(rt[x]):_e}}}function _(v,P){v.resolveAll&&!o.includes(v)&&o.push(v),v.resolve&&it(c.events,P,c.events.length-P,v.resolve(c.events.slice(P),c)),v.resolveTo&&(c.events=v.resolveTo(c.events,c))}function L(){let v=g(),P=c.previous,j=c.currentConstruct,ae=c.events.length,ee=Array.from(a);return{from:ae,restore:_e};function _e(){n=v,c.previous=P,c.currentConstruct=j,c.events.length=ae,a=ee,F()}}function F(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function L_(t,e){let r=e.start._index,n=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex,s;if(r===i)s=[t[r].slice(n,o)];else{if(s=t.slice(r,i),n>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(n):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function M_(t,e){let r=-1,n=[],i;for(;++r<t.length;){let o=t[r],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
60
+ `)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(d).length,Object.keys(d).join(", ")+y))}},o.unknownArguments=function(f,p,d,m,y=!0){var g;let b=t.getInternalMethods().getCommandInstance().getCommands(),w=[],k=t.getInternalMethods().getContext();if(Object.keys(f).forEach(D=>{!ph.includes(D)&&!Object.prototype.hasOwnProperty.call(d,D)&&!Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),D)&&!o.isValidAndSomeAliasIsNotNew(D,p)&&w.push(D)}),y&&(k.commands.length>0||b.length>0||m)&&f._.slice(k.commands.length).forEach(D=>{b.includes(""+D)||w.push(""+D)}),y){let R=((g=t.getDemandedCommands()._)===null||g===void 0?void 0:g.max)||0,S=k.commands.length+R;S<f._.length&&f._.slice(S).forEach(de=>{de=String(de),!k.commands.includes(de)&&!w.includes(de)&&w.push(de)})}w.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",w.length,w.map(D=>D.trim()?D:`"${D}"`).join(", ")))},o.unknownCommands=function(f){let p=t.getInternalMethods().getCommandInstance().getCommands(),d=[],m=t.getInternalMethods().getContext();return(m.commands.length>0||p.length>0)&&f._.slice(m.commands.length).forEach(y=>{p.includes(""+y)||d.push(""+y)}),d.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",d.length,d.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(f,p){if(!Object.prototype.hasOwnProperty.call(p,f))return!1;let d=t.parsed.newAliases;return[f,...p[f]].some(m=>!Object.prototype.hasOwnProperty.call(d,m)||!d[f])},o.limitedChoices=function(f){let p=t.getOptions(),d={};if(!Object.keys(p.choices).length)return;Object.keys(f).forEach(g=>{ph.indexOf(g)===-1&&Object.prototype.hasOwnProperty.call(p.choices,g)&&[].concat(f[g]).forEach(b=>{p.choices[g].indexOf(b)===-1&&b!==void 0&&(d[g]=(d[g]||[]).concat(b))})});let m=Object.keys(d);if(!m.length)return;let y=n("Invalid values:");m.forEach(g=>{y+=`
61
+ ${n("Argument: %s, Given: %s, Choices: %s",g,e.stringifiedValues(d[g]),e.stringifiedValues(p.choices[g]))}`}),e.fail(y)};let s={};o.implies=function(f,p){H("<string|object> [array|number|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.implies(d,f[d])}):(t.global(f),s[f]||(s[f]=[]),Array.isArray(p)?p.forEach(d=>o.implies(f,d)):(Rt(p,void 0,r),s[f].push(p)))},o.getImplied=function(){return s};function a(c,f){let p=Number(f);return f=isNaN(p)?f:p,typeof f=="number"?f=c._.length>=f:f.match(/^--no-.+/)?(f=f.match(/^--no-(.+)/)[1],f=!Object.prototype.hasOwnProperty.call(c,f)):f=Object.prototype.hasOwnProperty.call(c,f),f}o.implications=function(f){let p=[];if(Object.keys(s).forEach(d=>{let m=d;(s[d]||[]).forEach(y=>{let g=m,b=y;g=a(f,g),y=a(f,y),g&&!y&&p.push(` ${m} -> ${b}`)})}),p.length){let d=`${n("Implications failed:")}
62
+ `;p.forEach(m=>{d+=m}),e.fail(d)}};let u={};o.conflicts=function(f,p){H("<string|object> [array|string]",[f,p],arguments.length),typeof f=="object"?Object.keys(f).forEach(d=>{o.conflicts(d,f[d])}):(t.global(f),u[f]||(u[f]=[]),Array.isArray(p)?p.forEach(d=>o.conflicts(f,d)):u[f].push(p))},o.getConflicting=()=>u,o.conflicting=function(f){Object.keys(f).forEach(p=>{u[p]&&u[p].forEach(d=>{d&&f[p]!==void 0&&f[d]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})}),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(p=>{u[p].forEach(d=>{d&&f[r.Parser.camelCase(p)]!==void 0&&f[r.Parser.camelCase(d)]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",p,d))})})},o.recommendCommands=function(f,p){p=p.sort((g,b)=>b.length-g.length);let m=null,y=1/0;for(let g=0,b;(b=p[g])!==void 0;g++){let w=fh(f,b);w<=3&&w<y&&(y=w,m=b)}m&&e.fail(n("Did you mean %s?",m))},o.reset=function(f){return s=fn(s,p=>!f[p]),u=fn(u,p=>!f[p]),o};let l=[];return o.freeze=function(){l.push({implied:s,conflicting:u})},o.unfreeze=function(){let f=l.pop();Rt(f,void 0,r),{implied:s,conflicting:u}=f},o}var xc=[],ss;function as(t,e,r,n){ss=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;let o=/\.json|\..*rc$/.test(t.extends),s=null;if(o)s=Fw(e,t.extends);else try{s=Er.resolve(t.extends)}catch{return t}Rw(s),xc.push(s),i=o?JSON.parse(ss.readFileSync(s,"utf8")):Er(t.extends),delete t.extends,i=as(i,ss.path.dirname(s),r,ss)}return xc=[],r?hh(i,t):Object.assign({},i,t)}function Rw(t){if(xc.indexOf(t)>-1)throw new $e(`Circular extended configurations: '${t}'.`)}function Fw(t,e){return ss.path.resolve(t,e)}function hh(t,e){let r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(let i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=hh(t[i],e[i]):r[i]=e[i];return r}var Z=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},h=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},nt,Hn,us,rr,Yt,ya,dn,Kn,ba,nr,Ea,ir,Ar,Zt,or,Aa,Wi,Et,re,ka,wa,Xt,Yn,Hi,Zn,hn,Ca,pe,Xn,Jn,Qn,ge,Ta,kr,Qe;function Nh(t){return(e=[],r=t.process.cwd(),n)=>{let i=new Ic(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var mh=Symbol("copyDoubleDash"),gh=Symbol("copyDoubleDash"),yc=Symbol("deleteFromParserHintObject"),xh=Symbol("emitWarning"),yh=Symbol("freeze"),bh=Symbol("getDollarZero"),ei=Symbol("getParserConfiguration"),Eh=Symbol("getUsageConfiguration"),bc=Symbol("guessLocale"),Ah=Symbol("guessVersion"),kh=Symbol("parsePositionalNumbers"),Ec=Symbol("pkgUp"),mn=Symbol("populateParserHintArray"),Ki=Symbol("populateParserHintSingleValueDictionary"),Ac=Symbol("populateParserHintArrayDictionary"),kc=Symbol("populateParserHintDictionary"),wc=Symbol("sanitizeKey"),Cc=Symbol("setKey"),Tc=Symbol("unfreeze"),wh=Symbol("validateAsync"),Ch=Symbol("getCommandInstance"),Th=Symbol("getContext"),_h=Symbol("getHasOutput"),Sh=Symbol("getLoggerInstance"),Ih=Symbol("getParseContext"),Oh=Symbol("getUsageInstance"),vh=Symbol("getValidationInstance"),_a=Symbol("hasParseCallback"),Dh=Symbol("isGlobalContext"),ti=Symbol("postProcess"),Rh=Symbol("rebase"),_c=Symbol("reset"),ls=Symbol("runYargsParserAndExecuteCommands"),Sc=Symbol("runValidation"),Fh=Symbol("setHasOutput"),ri=Symbol("kTrackManuallySetKeys"),Ic=class{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,nt.set(this,void 0),Hn.set(this,void 0),us.set(this,{commands:[],fullCommands:[]}),rr.set(this,null),Yt.set(this,null),ya.set(this,"show-hidden"),dn.set(this,null),Kn.set(this,!0),ba.set(this,{}),nr.set(this,!0),Ea.set(this,[]),ir.set(this,void 0),Ar.set(this,{}),Zt.set(this,!1),or.set(this,null),Aa.set(this,!0),Wi.set(this,void 0),Et.set(this,""),re.set(this,void 0),ka.set(this,void 0),wa.set(this,{}),Xt.set(this,null),Yn.set(this,null),Hi.set(this,{}),Zn.set(this,{}),hn.set(this,void 0),Ca.set(this,!1),pe.set(this,void 0),Xn.set(this,!1),Jn.set(this,!1),Qn.set(this,!1),ge.set(this,void 0),Ta.set(this,{}),kr.set(this,null),Qe.set(this,void 0),Z(this,pe,i,"f"),Z(this,hn,e,"f"),Z(this,Hn,r,"f"),Z(this,ka,n,"f"),Z(this,ir,new ma(this),"f"),this.$0=this[bh](),this[_c](),Z(this,nt,h(this,nt,"f"),"f"),Z(this,ge,h(this,ge,"f"),"f"),Z(this,Qe,h(this,Qe,"f"),"f"),Z(this,re,h(this,re,"f"),"f"),h(this,re,"f").showHiddenOpt=h(this,ya,"f"),Z(this,Wi,this[gh](),"f")}addHelpOpt(e,r){let n="help";return H("[string|boolean] [string]",[e,r],arguments.length),h(this,or,"f")&&(this[yc](h(this,or,"f")),Z(this,or,null,"f")),e===!1&&r===void 0?this:(Z(this,or,typeof e=="string"?e:n,"f"),this.boolean(h(this,or,"f")),this.describe(h(this,or,"f"),r||h(this,ge,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(H("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;let n=typeof e=="string"?e:h(this,ya,"f");return this.boolean(n),this.describe(n,r||h(this,ge,"f").deferY18nLookup("Show hidden options")),h(this,re,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[Ac](this.alias.bind(this),"alias",e,r),this}array(e){return H("<array|string>",[e],arguments.length),this[mn]("array",e),this[ri](e),this}boolean(e){return H("<array|string>",[e],arguments.length),this[mn]("boolean",e),this[ri](e),this}check(e,r){return H("<function> [boolean]",[e,r],arguments.length),this.middleware((n,i)=>Wn(()=>e(n,i.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&h(this,ge,"f").fail(o.toString(),o):h(this,ge,"f").fail(h(this,pe,"f").y18n.__("Argument check failed: %s",e.toString())),n),o=>(h(this,ge,"f").fail(o.message?o.message:o.toString(),o),n)),!1,r),this}choices(e,r){return H("<object|string|array> [string|array]",[e,r],arguments.length),this[Ac](this.choices.bind(this),"choices",e,r),this}coerce(e,r){if(H("<object|string|array> [function]",[e,r],arguments.length),Array.isArray(e)){if(!r)throw new $e("coerce callback must be provided");for(let n of e)this.coerce(n,r);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!r)throw new $e("coerce callback must be provided");return h(this,re,"f").key[e]=!0,h(this,ir,"f").addCoerceMiddleware((n,i)=>{let o;return Object.prototype.hasOwnProperty.call(n,e)?Wn(()=>(o=i.getAliases(),r(n[e])),a=>{n[e]=a;let u=i.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&u!==!0)for(let l of o[e])n[l]=a;return n},a=>{throw new $e(a.message)}):n},e),this}conflicts(e,r){return H("<string|object> [string|array]",[e,r],arguments.length),h(this,Qe,"f").conflicts(e,r),this}config(e="config",r,n){return H("[object|string] [string|function] [function]",[e,r,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=as(e,h(this,Hn,"f"),this[ei]()["deep-merge-config"]||!1,h(this,pe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(e),this):(typeof r=="function"&&(n=r,r=void 0),this.describe(e,r||h(this,ge,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{h(this,re,"f").config[i]=n||!0}),this)}completion(e,r,n){return H("[string] [string|boolean|function] [function]",[e,r,n],arguments.length),typeof r=="function"&&(n=r,r=void 0),Z(this,Yt,e||h(this,Yt,"f")||"completion","f"),!r&&r!==!1&&(r="generate completion script"),this.command(h(this,Yt,"f"),r),n&&h(this,rr,"f").registerFunction(n),this}command(e,r,n,i,o,s){return H("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,r,n,i,o,s],arguments.length),h(this,nt,"f").addHandler(e,r,n,i,o,s),this}commands(e,r,n,i,o,s){return this.command(e,r,n,i,o,s)}commandDir(e,r){H("<string> [object]",[e,r],arguments.length);let n=h(this,ka,"f")||h(this,pe,"f").require;return h(this,nt,"f").addDirectory(e,n,h(this,pe,"f").getCallerFile(),r),this}count(e){return H("<array|string>",[e],arguments.length),this[mn]("count",e),this[ri](e),this}default(e,r,n){return H("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(pc(e,h(this,pe,"f")),h(this,re,"f").defaultDescription[e]=n),typeof r=="function"&&(pc(e,h(this,pe,"f")),h(this,re,"f").defaultDescription[e]||(h(this,re,"f").defaultDescription[e]=h(this,ge,"f").functionDescription(r)),r=r.call()),this[Ki](this.default.bind(this),"default",e,r),this}defaults(e,r,n){return this.default(e,r,n)}demandCommand(e=1,r,n,i){return H("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),h(this,re,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{Rt(n,!0,h(this,pe,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(Rt(n,!0,h(this,pe,"f")),this.demandCommand(e,r,n,n)):Array.isArray(e)?e.forEach(i=>{Rt(n,!0,h(this,pe,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Ki](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return H("<string> [string|boolean]",[e,r],arguments.length),h(this,re,"f").deprecatedOptions[e]=r,this}describe(e,r){return H("<object|string|array> [string]",[e,r],arguments.length),this[Cc](e,!0),h(this,ge,"f").describe(e,r),this}detectLocale(e){return H("<boolean>",[e],arguments.length),Z(this,Kn,e,"f"),this}env(e){return H("[string|boolean]",[e],arguments.length),e===!1?delete h(this,re,"f").envPrefix:h(this,re,"f").envPrefix=e||"",this}epilogue(e){return H("<string>",[e],arguments.length),h(this,ge,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return H("<string|array> [string]",[e,r],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):h(this,ge,"f").example(e,r),this}exit(e,r){Z(this,Zt,!0,"f"),Z(this,dn,r,"f"),h(this,nr,"f")&&h(this,pe,"f").process.exit(e)}exitProcess(e=!0){return H("[boolean]",[e],arguments.length),Z(this,nr,e,"f"),this}fail(e){if(H("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new $e("Invalid first argument. Expected function or boolean 'false'");return h(this,ge,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){return H("<array> [function]",[e,r],arguments.length),r?h(this,rr,"f").getCompletion(e,r):new Promise((n,i)=>{h(this,rr,"f").getCompletion(e,(o,s)=>{o?i(o):n(s)})})}getDemandedOptions(){return H([],0),h(this,re,"f").demandedOptions}getDemandedCommands(){return H([],0),h(this,re,"f").demandedCommands}getDeprecatedOptions(){return H([],0),h(this,re,"f").deprecatedOptions}getDetectLocale(){return h(this,Kn,"f")}getExitProcess(){return h(this,nr,"f")}getGroups(){return Object.assign({},h(this,Ar,"f"),h(this,Zn,"f"))}getHelp(){if(Z(this,Zt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let r=this[ls](h(this,hn,"f"),void 0,void 0,0,!0);if(qe(r))return r.then(()=>h(this,ge,"f").help())}let e=h(this,nt,"f").runDefaultBuilderOn(this);if(qe(e))return e.then(()=>h(this,ge,"f").help())}return Promise.resolve(h(this,ge,"f").help())}getOptions(){return h(this,re,"f")}getStrict(){return h(this,Xn,"f")}getStrictCommands(){return h(this,Jn,"f")}getStrictOptions(){return h(this,Qn,"f")}global(e,r){return H("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?h(this,re,"f").local=h(this,re,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{h(this,re,"f").local.includes(n)||h(this,re,"f").local.push(n)}),this}group(e,r){H("<string|array> <string>",[e,r],arguments.length);let n=h(this,Zn,"f")[r]||h(this,Ar,"f")[r];h(this,Zn,"f")[r]&&delete h(this,Zn,"f")[r];let i={};return h(this,Ar,"f")[r]=(n||[]).concat(e).filter(o=>i[o]?!1:i[o]=!0),this}hide(e){return H("<string>",[e],arguments.length),h(this,re,"f").hiddenOptions.push(e),this}implies(e,r){return H("<string|object> [number|string|array]",[e,r],arguments.length),h(this,Qe,"f").implies(e,r),this}locale(e){return H("[string]",[e],arguments.length),e===void 0?(this[bc](),h(this,pe,"f").y18n.getLocale()):(Z(this,Kn,!1,"f"),h(this,pe,"f").y18n.setLocale(e),this)}middleware(e,r,n){return h(this,ir,"f").addMiddleware(e,!!r,n)}nargs(e,r){return H("<string|object|array> [number]",[e,r],arguments.length),this[Ki](this.nargs.bind(this),"narg",e,r),this}normalize(e){return H("<array|string>",[e],arguments.length),this[mn]("normalize",e),this}number(e){return H("<array|string>",[e],arguments.length),this[mn]("number",e),this[ri](e),this}option(e,r){if(H("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[ri](e),h(this,kr,"f")&&(e==="version"||r?.alias==="version")&&this[xh](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
63
+ `),void 0,"versionWarning"),h(this,re,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);let n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);let i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global=="boolean"&&this.global(e,r.global),r.defaultDescription&&(h(this,re,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);let o=r.describe||r.description||r.desc,s=h(this,ge,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(s,e)||typeof o=="string")&&this.describe(e,o),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){H("[string|array] [function|boolean|object] [function]",[e,r,n],arguments.length),this[yh](),typeof e>"u"&&(e=h(this,hn,"f")),typeof r=="object"&&(Z(this,Yn,r,"f"),r=n),typeof r=="function"&&(Z(this,Xt,r,"f"),r=!1),r||Z(this,hn,e,"f"),h(this,Xt,"f")&&Z(this,nr,!1,"f");let i=this[ls](e,!!r),o=this.parsed;return h(this,rr,"f").setParsed(this.parsed),qe(i)?i.then(s=>(h(this,Xt,"f")&&h(this,Xt,"f").call(this,h(this,dn,"f"),s,h(this,Et,"f")),s)).catch(s=>{throw h(this,Xt,"f")&&h(this,Xt,"f")(s,this.parsed.argv,h(this,Et,"f")),s}).finally(()=>{this[Tc](),this.parsed=o}):(h(this,Xt,"f")&&h(this,Xt,"f").call(this,h(this,dn,"f"),i,h(this,Et,"f")),this[Tc](),this.parsed=o,i)}parseAsync(e,r,n){let i=this.parse(e,r,n);return qe(i)?i:Promise.resolve(i)}parseSync(e,r,n){let i=this.parse(e,r,n);if(qe(i))throw new $e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return H("<object>",[e],arguments.length),Z(this,wa,e,"f"),this}pkgConf(e,r){H("<string> [string]",[e,r],arguments.length);let n=null,i=this[Ec](r||h(this,Hn,"f"));return i[e]&&typeof i[e]=="object"&&(n=as(i[e],r||h(this,Hn,"f"),this[ei]()["deep-merge-config"]||!1,h(this,pe,"f")),h(this,re,"f").configObjects=(h(this,re,"f").configObjects||[]).concat(n)),this}positional(e,r){H("<string> <object>",[e,r],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=fn(r,(s,a)=>s==="type"&&!["string","number","boolean"].includes(a)?!1:n.includes(s));let i=h(this,us,"f").fullCommands[h(this,us,"f").fullCommands.length-1],o=i?h(this,nt,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Vi(o).forEach(s=>{let a=o[s];Array.isArray(a)?a.indexOf(e)!==-1&&(r[s]=!0):a[e]&&!(s in r)&&(r[s]=a[e])}),this.group(e,h(this,ge,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return H("[boolean]",[e],arguments.length),Z(this,Ca,e,"f"),this}required(e,r,n){return this.demand(e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return H("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&h(this,re,"f").narg[e]?this:(this[Ki](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return H("[string] [string]",[e,r],arguments.length),e=e||this.$0,h(this,Wi,"f").log(h(this,rr,"f").generateCompletionScript(e,r||h(this,Yt,"f")||"completion")),this}showHelp(e){if(H("[string|function]",[e],arguments.length),Z(this,Zt,!0,"f"),!h(this,ge,"f").hasCachedHelpMessage()){if(!this.parsed){let n=this[ls](h(this,hn,"f"),void 0,void 0,0,!0);if(qe(n))return n.then(()=>{h(this,ge,"f").showHelp(e)}),this}let r=h(this,nt,"f").runDefaultBuilderOn(this);if(qe(r))return r.then(()=>{h(this,ge,"f").showHelp(e)}),this}return h(this,ge,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return H("[boolean|string] [string]",[e,r],arguments.length),h(this,ge,"f").showHelpOnFail(e,r),this}showVersion(e){return H("[string|function]",[e],arguments.length),h(this,ge,"f").showVersion(e),this}skipValidation(e){return H("<array|string>",[e],arguments.length),this[mn]("skipValidation",e),this}strict(e){return H("[boolean]",[e],arguments.length),Z(this,Xn,e!==!1,"f"),this}strictCommands(e){return H("[boolean]",[e],arguments.length),Z(this,Jn,e!==!1,"f"),this}strictOptions(e){return H("[boolean]",[e],arguments.length),Z(this,Qn,e!==!1,"f"),this}string(e){return H("<array|string>",[e],arguments.length),this[mn]("string",e),this[ri](e),this}terminalWidth(){return H([],0),h(this,pe,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return H("<object>",[e],arguments.length),Z(this,Kn,!1,"f"),h(this,pe,"f").y18n.updateLocale(e),this}usage(e,r,n,i){if(H("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,i],arguments.length),r!==void 0){if(Rt(e,null,h(this,pe,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,r,n,i);throw new $e(".usage() description must start with $0 if being used as alias for .command()")}else return h(this,ge,"f").usage(e),this}usageConfiguration(e){return H("<object>",[e],arguments.length),Z(this,Ta,e,"f"),this}version(e,r,n){let i="version";if(H("[boolean|string] [string] [string]",[e,r,n],arguments.length),h(this,kr,"f")&&(this[yc](h(this,kr,"f")),h(this,ge,"f").version(void 0),Z(this,kr,null,"f")),arguments.length===0)n=this[Ah](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return Z(this,kr,typeof e=="string"?e:i,"f"),r=r||h(this,ge,"f").deferY18nLookup("Show version number"),h(this,ge,"f").version(n||void 0),this.boolean(h(this,kr,"f")),this.describe(h(this,kr,"f"),r),this}wrap(e){return H("<number|null|undefined>",[e],arguments.length),h(this,ge,"f").wrap(e),this}[(nt=new WeakMap,Hn=new WeakMap,us=new WeakMap,rr=new WeakMap,Yt=new WeakMap,ya=new WeakMap,dn=new WeakMap,Kn=new WeakMap,ba=new WeakMap,nr=new WeakMap,Ea=new WeakMap,ir=new WeakMap,Ar=new WeakMap,Zt=new WeakMap,or=new WeakMap,Aa=new WeakMap,Wi=new WeakMap,Et=new WeakMap,re=new WeakMap,ka=new WeakMap,wa=new WeakMap,Xt=new WeakMap,Yn=new WeakMap,Hi=new WeakMap,Zn=new WeakMap,hn=new WeakMap,Ca=new WeakMap,pe=new WeakMap,Xn=new WeakMap,Jn=new WeakMap,Qn=new WeakMap,ge=new WeakMap,Ta=new WeakMap,kr=new WeakMap,Qe=new WeakMap,mh)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[gh](){return{log:(...e)=>{this[_a]()||console.log(...e),Z(this,Zt,!0,"f"),h(this,Et,"f").length&&Z(this,Et,h(this,Et,"f")+`
64
+ `,"f"),Z(this,Et,h(this,Et,"f")+e.join(" "),"f")},error:(...e)=>{this[_a]()||console.error(...e),Z(this,Zt,!0,"f"),h(this,Et,"f").length&&Z(this,Et,h(this,Et,"f")+`
65
+ `,"f"),Z(this,Et,h(this,Et,"f")+e.join(" "),"f")}}}[yc](e){Vi(h(this,re,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;let n=h(this,re,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete h(this,ge,"f").getDescriptions()[e]}[xh](e,r,n){h(this,ba,"f")[n]||(h(this,pe,"f").process.emitWarning(e,r),h(this,ba,"f")[n]=!0)}[yh](){h(this,Ea,"f").push({options:h(this,re,"f"),configObjects:h(this,re,"f").configObjects.slice(0),exitProcess:h(this,nr,"f"),groups:h(this,Ar,"f"),strict:h(this,Xn,"f"),strictCommands:h(this,Jn,"f"),strictOptions:h(this,Qn,"f"),completionCommand:h(this,Yt,"f"),output:h(this,Et,"f"),exitError:h(this,dn,"f"),hasOutput:h(this,Zt,"f"),parsed:this.parsed,parseFn:h(this,Xt,"f"),parseContext:h(this,Yn,"f")}),h(this,ge,"f").freeze(),h(this,Qe,"f").freeze(),h(this,nt,"f").freeze(),h(this,ir,"f").freeze()}[bh](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(h(this,pe,"f").process.argv()[0])?r=h(this,pe,"f").process.argv().slice(1,2):r=h(this,pe,"f").process.argv().slice(0,1),e=r.map(n=>{let i=this[Rh](h(this,Hn,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),h(this,pe,"f").getEnv("_")&&h(this,pe,"f").getProcessArgvBin()===h(this,pe,"f").getEnv("_")&&(e=h(this,pe,"f").getEnv("_").replace(`${h(this,pe,"f").path.dirname(h(this,pe,"f").process.execPath())}/`,"")),e}[ei](){return h(this,wa,"f")}[Eh](){return h(this,Ta,"f")}[bc](){if(!h(this,Kn,"f"))return;let e=h(this,pe,"f").getEnv("LC_ALL")||h(this,pe,"f").getEnv("LC_MESSAGES")||h(this,pe,"f").getEnv("LANG")||h(this,pe,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Ah](){return this[Ec]().version||"unknown"}[kh](e){let r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)h(this,pe,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[Ec](e){let r=e||"*";if(h(this,Hi,"f")[r])return h(this,Hi,"f")[r];let n={};try{let i=e||h(this,pe,"f").mainFilename;!e&&h(this,pe,"f").path.extname(i)&&(i=h(this,pe,"f").path.dirname(i));let o=h(this,pe,"f").findUp(i,(s,a)=>{if(a.includes("package.json"))return"package.json"});Rt(o,void 0,h(this,pe,"f")),n=JSON.parse(h(this,pe,"f").readFileSync(o,"utf8"))}catch{}return h(this,Hi,"f")[r]=n||{},h(this,Hi,"f")[r]}[mn](e,r){r=[].concat(r),r.forEach(n=>{n=this[wc](n),h(this,re,"f")[e].push(n)})}[Ki](e,r,n,i){this[kc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=a})}[Ac](e,r,n,i){this[kc](e,r,n,i,(o,s,a)=>{h(this,re,"f")[o][s]=(h(this,re,"f")[o][s]||[]).concat(a)})}[kc](e,r,n,i,o){if(Array.isArray(n))n.forEach(s=>{e(s,i)});else if((s=>typeof s=="object")(n))for(let s of Vi(n))e(s,n[s]);else o(r,this[wc](n),i)}[wc](e){return e==="__proto__"?"___proto___":e}[Cc](e,r){return this[Ki](this[Cc].bind(this),"key",e,r),this}[Tc](){var e,r,n,i,o,s,a,u,l,c,f,p;let d=h(this,Ea,"f").pop();Rt(d,void 0,h(this,pe,"f"));let m;e=this,r=this,n=this,i=this,o=this,s=this,a=this,u=this,l=this,c=this,f=this,p=this,{options:{set value(y){Z(e,re,y,"f")}}.value,configObjects:m,exitProcess:{set value(y){Z(r,nr,y,"f")}}.value,groups:{set value(y){Z(n,Ar,y,"f")}}.value,output:{set value(y){Z(i,Et,y,"f")}}.value,exitError:{set value(y){Z(o,dn,y,"f")}}.value,hasOutput:{set value(y){Z(s,Zt,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){Z(a,Xn,y,"f")}}.value,strictCommands:{set value(y){Z(u,Jn,y,"f")}}.value,strictOptions:{set value(y){Z(l,Qn,y,"f")}}.value,completionCommand:{set value(y){Z(c,Yt,y,"f")}}.value,parseFn:{set value(y){Z(f,Xt,y,"f")}}.value,parseContext:{set value(y){Z(p,Yn,y,"f")}}.value}=d,h(this,re,"f").configObjects=m,h(this,ge,"f").unfreeze(),h(this,Qe,"f").unfreeze(),h(this,nt,"f").unfreeze(),h(this,ir,"f").unfreeze()}[wh](e,r){return Wn(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Ch].bind(this),getContext:this[Th].bind(this),getHasOutput:this[_h].bind(this),getLoggerInstance:this[Sh].bind(this),getParseContext:this[Ih].bind(this),getParserConfiguration:this[ei].bind(this),getUsageConfiguration:this[Eh].bind(this),getUsageInstance:this[Oh].bind(this),getValidationInstance:this[vh].bind(this),hasParseCallback:this[_a].bind(this),isGlobalContext:this[Dh].bind(this),postProcess:this[ti].bind(this),reset:this[_c].bind(this),runValidation:this[Sc].bind(this),runYargsParserAndExecuteCommands:this[ls].bind(this),setHasOutput:this[Fh].bind(this)}}[Ch](){return h(this,nt,"f")}[Th](){return h(this,us,"f")}[_h](){return h(this,Zt,"f")}[Sh](){return h(this,Wi,"f")}[Ih](){return h(this,Yn,"f")||{}}[Oh](){return h(this,ge,"f")}[vh](){return h(this,Qe,"f")}[_a](){return!!h(this,Xt,"f")}[Dh](){return h(this,Aa,"f")}[ti](e,r,n,i){return n||qe(e)||(r||(e=this[mh](e)),(this[ei]()["parse-positional-numbers"]||this[ei]()["parse-positional-numbers"]===void 0)&&(e=this[kh](e)),i&&(e=Gn(e,this,h(this,ir,"f").getMiddleware(),!1))),e}[_c](e={}){Z(this,re,h(this,re,"f")||{},"f");let r={};r.local=h(this,re,"f").local||[],r.configObjects=h(this,re,"f").configObjects||[];let n={};r.local.forEach(s=>{n[s]=!0,(e[s]||[]).forEach(a=>{n[a]=!0})}),Object.assign(h(this,Zn,"f"),Object.keys(h(this,Ar,"f")).reduce((s,a)=>{let u=h(this,Ar,"f")[a].filter(l=>!(l in n));return u.length>0&&(s[a]=u),s},{})),Z(this,Ar,{},"f");let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(s=>{r[s]=(h(this,re,"f")[s]||[]).filter(a=>!n[a])}),o.forEach(s=>{r[s]=fn(h(this,re,"f")[s],a=>!n[a])}),r.envPrefix=h(this,re,"f").envPrefix,Z(this,re,r,"f"),Z(this,ge,h(this,ge,"f")?h(this,ge,"f").reset(n):ah(this,h(this,pe,"f")),"f"),Z(this,Qe,h(this,Qe,"f")?h(this,Qe,"f").reset(n):dh(this,h(this,ge,"f"),h(this,pe,"f")),"f"),Z(this,nt,h(this,nt,"f")?h(this,nt,"f").reset():ih(h(this,ge,"f"),h(this,Qe,"f"),h(this,ir,"f"),h(this,pe,"f")),"f"),h(this,rr,"f")||Z(this,rr,ch(this,h(this,ge,"f"),h(this,nt,"f"),h(this,pe,"f")),"f"),h(this,ir,"f").reset(),Z(this,Yt,null,"f"),Z(this,Et,"","f"),Z(this,dn,null,"f"),Z(this,Zt,!1,"f"),this.parsed=!1,this}[Rh](e,r){return h(this,pe,"f").path.relative(e,r)}[ls](e,r,n,i=0,o=!1){let s=!!n||o;e=e||h(this,hn,"f"),h(this,re,"f").__=h(this,pe,"f").y18n.__,h(this,re,"f").configuration=this[ei]();let a=!!h(this,re,"f").configuration["populate--"],u=Object.assign({},h(this,re,"f").configuration,{"populate--":!0}),l=h(this,pe,"f").Parser.detailed(e,Object.assign({},h(this,re,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,h(this,Yn,"f")),f,p=l.aliases,d=!1,m=!1;Object.keys(c).forEach(y=>{y===h(this,or,"f")&&c[y]?d=!0:y===h(this,kr,"f")&&c[y]&&(m=!0)}),c.$0=this.$0,this.parsed=l,i===0&&h(this,ge,"f").clearCachedHelpMessage();try{if(this[bc](),r)return this[ti](c,a,!!n,!1);h(this,or,"f")&&[h(this,or,"f")].concat(p[h(this,or,"f")]||[]).filter(k=>k.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),d=!0),Z(this,Aa,!1,"f");let y=h(this,nt,"f").getCommands(),g=h(this,rr,"f").completionKey in c,b=d||g||o;if(c._.length){if(y.length){let w;for(let k=i||0,D;c._[k]!==void 0;k++)if(D=String(c._[k]),y.includes(D)&&D!==h(this,Yt,"f")){let R=h(this,nt,"f").runCommand(D,this,l,k+1,o,d||m||o);return this[ti](R,a,!!n,!1)}else if(!w&&D!==h(this,Yt,"f")){w=D;break}!h(this,nt,"f").hasDefaultCommand()&&h(this,Ca,"f")&&w&&!b&&h(this,Qe,"f").recommendCommands(w,y)}h(this,Yt,"f")&&c._.includes(h(this,Yt,"f"))&&!g&&(h(this,nr,"f")&&pn(!0),this.showCompletionScript(),this.exit(0))}if(h(this,nt,"f").hasDefaultCommand()&&!b){let w=h(this,nt,"f").runCommand(null,this,l,0,o,d||m||o);return this[ti](w,a,!!n,!1)}if(g){h(this,nr,"f")&&pn(!0),e=[].concat(e);let w=e.slice(e.indexOf(`--${h(this,rr,"f").completionKey}`)+1);return h(this,rr,"f").getCompletion(w,(k,D)=>{if(k)throw new $e(k.message);(D||[]).forEach(R=>{h(this,Wi,"f").log(R)}),this.exit(0)}),this[ti](c,!a,!!n,!1)}if(h(this,Zt,"f")||(d?(h(this,nr,"f")&&pn(!0),s=!0,this.showHelp("log"),this.exit(0)):m&&(h(this,nr,"f")&&pn(!0),s=!0,h(this,ge,"f").showVersion("log"),this.exit(0))),!s&&h(this,re,"f").skipValidation.length>0&&(s=Object.keys(c).some(w=>h(this,re,"f").skipValidation.indexOf(w)>=0&&c[w]===!0)),!s){if(l.error)throw new $e(l.error.message);if(!g){let w=this[Sc](p,{},l.error);n||(f=Gn(c,this,h(this,ir,"f").getMiddleware(),!0)),f=this[wh](w,f??c),qe(f)&&!n&&(f=f.then(()=>Gn(c,this,h(this,ir,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof $e)h(this,ge,"f").fail(y.message,y);else throw y}return this[ti](f??c,a,!!n,!0)}[Sc](e,r,n,i){let o={...this.getDemandedOptions()};return s=>{if(n)throw new $e(n.message);h(this,Qe,"f").nonOptionCount(s),h(this,Qe,"f").requiredArguments(s,o);let a=!1;h(this,Jn,"f")&&(a=h(this,Qe,"f").unknownCommands(s)),h(this,Xn,"f")&&!a?h(this,Qe,"f").unknownArguments(s,e,r,!!i):h(this,Qn,"f")&&h(this,Qe,"f").unknownArguments(s,e,{},!1,!1),h(this,Qe,"f").limitedChoices(s),h(this,Qe,"f").implications(s),h(this,Qe,"f").conflicting(s)}}[Fh](){Z(this,Zt,!0,"f")}[ri](e){if(typeof e=="string")h(this,re,"f").key[e]=!0;else for(let r of e)h(this,re,"f").key[r]=!0}};function oh(t){return!!t&&typeof t.getInternalMethods=="function"}var Nw=Nh(fc),Ph=Nw;var Lh="1.0.4";var Pa=ns(la(),1);import{cosmiconfig as om}from"cosmiconfig";import{TypeScriptLoader as sm}from"cosmiconfig-typescript-loader";import aT from"fs/promises";import lm from"path";var Oc=ns(jh(),1);function vc(t,e,r){if(typeof e=="number"&&(r=e),Oc.default.has(t.toLowerCase())){e=Oc.default.get(t.toLowerCase());let n=t.charAt(0);n===n.toUpperCase()&&(e=n+e.slice(1)),t===t.toUpperCase()&&(e=e.toUpperCase())}else typeof e!="string"&&(e=(t.replace(/(?:s|x|z|ch|sh)$/i,"$&e").replace(/([^aeiou])y$/i,"$1ie")+"s").replace(/i?e?s$/i,n=>t.slice(-1)===t.slice(-1).toLowerCase()?n.toLowerCase():n.toUpperCase()));return Math.abs(r)===1?t:e}import{readPackage as uT}from"read-pkg";import{deepMergeDefined as jc,log as lr,optionsSchema as lT,rulesSchema as cT}from"remark-mdat";var K={};Od(K,{BRAND:()=>lC,DIRTY:()=>ni,EMPTY_PATH:()=>zw,INVALID:()=>ue,NEVER:()=>HC,OK:()=>_t,ParseStatus:()=>Ct,Schema:()=>ke,ZodAny:()=>yn,ZodArray:()=>Zr,ZodBigInt:()=>oi,ZodBoolean:()=>si,ZodBranded:()=>fs,ZodCatch:()=>xi,ZodDate:()=>ai,ZodDefault:()=>gi,ZodDiscriminatedUnion:()=>Oa,ZodEffects:()=>ur,ZodEnum:()=>hi,ZodError:()=>zt,ZodFirstPartyTypeKind:()=>ce,ZodFunction:()=>Da,ZodIntersection:()=>fi,ZodIssueCode:()=>N,ZodLazy:()=>pi,ZodLiteral:()=>di,ZodMap:()=>eo,ZodNaN:()=>ro,ZodNativeEnum:()=>mi,ZodNever:()=>mr,ZodNull:()=>li,ZodNullable:()=>Tr,ZodNumber:()=>ii,ZodObject:()=>$t,ZodOptional:()=>sr,ZodParsedType:()=>q,ZodPipeline:()=>ps,ZodPromise:()=>bn,ZodReadonly:()=>yi,ZodRecord:()=>va,ZodSchema:()=>ke,ZodSet:()=>to,ZodString:()=>xn,ZodSymbol:()=>Ji,ZodTransformer:()=>ur,ZodTuple:()=>Cr,ZodType:()=>ke,ZodUndefined:()=>ui,ZodUnion:()=>ci,ZodUnknown:()=>Yr,ZodVoid:()=>Qi,addIssueToContext:()=>U,any:()=>yC,array:()=>kC,bigint:()=>dC,boolean:()=>Zh,coerce:()=>WC,custom:()=>Hh,date:()=>hC,datetimeRegex:()=>Gh,defaultErrorMap:()=>Hr,discriminatedUnion:()=>_C,effect:()=>BC,enum:()=>PC,function:()=>RC,getErrorMap:()=>Yi,getParsedType:()=>wr,instanceof:()=>fC,intersection:()=>SC,isAborted:()=>Sa,isAsync:()=>Zi,isDirty:()=>Ia,isValid:()=>gn,late:()=>cC,lazy:()=>FC,literal:()=>NC,makeIssue:()=>cs,map:()=>vC,nan:()=>pC,nativeEnum:()=>LC,never:()=>EC,null:()=>xC,nullable:()=>UC,number:()=>Yh,object:()=>wC,objectUtil:()=>Dc,oboolean:()=>GC,onumber:()=>VC,optional:()=>jC,ostring:()=>qC,pipeline:()=>$C,preprocess:()=>zC,promise:()=>MC,quotelessJson:()=>Bw,record:()=>OC,set:()=>DC,setErrorMap:()=>Uw,strictObject:()=>CC,string:()=>Kh,symbol:()=>mC,transformer:()=>BC,tuple:()=>IC,undefined:()=>gC,union:()=>TC,unknown:()=>bC,util:()=>_e,void:()=>AC});var _e;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(_e||(_e={}));var Dc;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Dc||(Dc={}));var q=_e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),wr=t=>{switch(typeof t){case"undefined":return q.undefined;case"string":return q.string;case"number":return Number.isNaN(t)?q.nan:q.number;case"boolean":return q.boolean;case"function":return q.function;case"bigint":return q.bigint;case"symbol":return q.symbol;case"object":return Array.isArray(t)?q.array:t===null?q.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?q.promise:typeof Map<"u"&&t instanceof Map?q.map:typeof Set<"u"&&t instanceof Set?q.set:typeof Date<"u"&&t instanceof Date?q.date:q.object;default:return q.unknown}};var N=_e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Bw=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),zt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,u=0;for(;u<s.path.length;){let l=s.path[u];u===s.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(r(s))):a[l]=a[l]||{_errors:[]},a=a[l],u++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,_e.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};zt.create=t=>new zt(t);var jw=(t,e)=>{let r;switch(t.code){case N.invalid_type:t.received===q.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case N.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,_e.jsonStringifyReplacer)}`;break;case N.unrecognized_keys:r=`Unrecognized key(s) in object: ${_e.joinValues(t.keys,", ")}`;break;case N.invalid_union:r="Invalid input";break;case N.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${_e.joinValues(t.options)}`;break;case N.invalid_enum_value:r=`Invalid enum value. Expected ${_e.joinValues(t.options)}, received '${t.received}'`;break;case N.invalid_arguments:r="Invalid function arguments";break;case N.invalid_return_type:r="Invalid function return type";break;case N.invalid_date:r="Invalid date";break;case N.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:_e.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case N.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case N.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case N.custom:r="Invalid input";break;case N.invalid_intersection_types:r="Intersection results could not be merged";break;case N.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case N.not_finite:r="Number must be finite";break;default:r=e.defaultError,_e.assertNever(t)}return{message:r}},Hr=jw;var Uh=Hr;function Uw(t){Uh=t}function Yi(){return Uh}var cs=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)a=l(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},zw=[];function U(t,e){let r=Yi(),n=cs({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Hr?void 0:Hr].filter(i=>!!i)});t.common.issues.push(n)}var Ct=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return ue;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return ue;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},ue=Object.freeze({status:"aborted"}),ni=t=>({status:"dirty",value:t}),_t=t=>({status:"valid",value:t}),Sa=t=>t.status==="aborted",Ia=t=>t.status==="dirty",gn=t=>t.status==="valid",Zi=t=>typeof Promise<"u"&&t instanceof Promise;var J;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(J||(J={}));var ar=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},zh=(t,e)=>{if(gn(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new zt(t.common.issues);return this._error=r,this._error}}};function Ae(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:u}=t;return s.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:u??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:u??r??a.defaultError}},description:i}}var ke=class{get description(){return this._def.description}_getType(e){return wr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ct,ctx:{common:e.parent.common,data:e.data,parsedType:wr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Zi(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)},i=this._parseSync({data:e,path:n.path,parent:n});return zh(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return gn(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>gn(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:wr(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(Zi(i)?i:Promise.resolve(i));return zh(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:N.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(u=>u?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new ur({schema:this,typeName:ce.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return sr.create(this,this._def)}nullable(){return Tr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Zr.create(this)}promise(){return bn.create(this,this._def)}or(e){return ci.create([this,e],this._def)}and(e){return fi.create(this,e,this._def)}transform(e){return new ur({...Ae(this._def),schema:this,typeName:ce.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new gi({...Ae(this._def),innerType:this,defaultValue:r,typeName:ce.ZodDefault})}brand(){return new fs({typeName:ce.ZodBranded,type:this,...Ae(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new xi({...Ae(this._def),innerType:this,catchValue:r,typeName:ce.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return ps.create(this,e)}readonly(){return yi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},$w=/^c[^\s-]{8,}$/i,qw=/^[0-9a-z]+$/,Vw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Gw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ww=/^[a-z0-9_-]{21}$/i,Hw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Kw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Yw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Rc,Xw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Jw=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Qw=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,eC=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,qh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",nC=new RegExp(`^${qh}$`);function Vh(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function iC(t){return new RegExp(`^${Vh(t)}$`)}function Gh(t){let e=`${qh}T${Vh(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function oC(t,e){return!!((e==="v4"||!e)&&Xw.test(t)||(e==="v6"||!e)&&Qw.test(t))}function sC(t,e){if(!Hw.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function aC(t,e){return!!((e==="v4"||!e)&&Jw.test(t)||(e==="v6"||!e)&&eC.test(t))}var xn=class t extends ke{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==q.string){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:q.string,received:o.parsedType}),ue}let n=new Ct,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?U(i,{code:N.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&U(i,{code:N.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Yw.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"email",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Rc||(Rc=new RegExp(Zw,"u")),Rc.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"emoji",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")Gw.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"uuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Ww.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"nanoid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")$w.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")qw.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cuid2",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")Vw.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ulid",code:N.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),U(i,{validation:"url",code:N.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"regex",code:N.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Gh(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?nC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?iC(o).test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{code:N.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?Kw.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"duration",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?oC(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"ip",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?sC(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"jwt",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?aC(e.data,o.version)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"cidr",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?tC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64",code:N.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?rC.test(e.data)||(i=this._getOrReturnCtx(e,i),U(i,{validation:"base64url",code:N.invalid_string,message:o.message}),n.dirty()):_e.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:N.invalid_string,...J.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...J.errToObj(e)})}url(e){return this._addCheck({kind:"url",...J.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...J.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...J.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...J.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...J.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...J.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...J.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...J.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...J.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...J.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...J.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...J.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...J.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...J.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...J.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...J.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...J.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...J.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...J.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...J.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...J.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...J.errToObj(r)})}nonempty(e){return this.min(1,J.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};xn.create=t=>new xn({checks:[],typeName:ce.ZodString,coerce:t?.coerce??!1,...Ae(t)});function uC(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}var ii=class t extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==q.number){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:q.number,received:o.parsedType}),ue}let n,i=new Ct;for(let o of this._def.checks)o.kind==="int"?_e.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?uC(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_finite,message:o.message}),i.dirty()):_e.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,J.toString(r))}gt(e,r){return this.setLimit("min",e,!1,J.toString(r))}lte(e,r){return this.setLimit("max",e,!0,J.toString(r))}lt(e,r){return this.setLimit("max",e,!1,J.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:J.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:J.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:J.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:J.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:J.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:J.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_e.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};ii.create=t=>new ii({checks:[],typeName:ce.ZodNumber,coerce:t?.coerce||!1,...Ae(t)});var oi=class t extends ke{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==q.bigint)return this._getInvalidInput(e);let n,i=new Ct;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),U(n,{code:N.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):_e.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:q.bigint,received:r.parsedType}),ue}gte(e,r){return this.setLimit("min",e,!0,J.toString(r))}gt(e,r){return this.setLimit("min",e,!1,J.toString(r))}lte(e,r){return this.setLimit("max",e,!0,J.toString(r))}lt(e,r){return this.setLimit("max",e,!1,J.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:J.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:J.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:J.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:J.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:J.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:J.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};oi.create=t=>new oi({checks:[],typeName:ce.ZodBigInt,coerce:t?.coerce??!1,...Ae(t)});var si=class extends ke{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==q.boolean){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.boolean,received:n.parsedType}),ue}return _t(e.data)}};si.create=t=>new si({typeName:ce.ZodBoolean,coerce:t?.coerce||!1,...Ae(t)});var ai=class t extends ke{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==q.date){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_type,expected:q.date,received:o.parsedType}),ue}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return U(o,{code:N.invalid_date}),ue}let n=new Ct,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),U(i,{code:N.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):_e.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:J.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:J.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ai.create=t=>new ai({checks:[],coerce:t?.coerce||!1,typeName:ce.ZodDate,...Ae(t)});var Ji=class extends ke{_parse(e){if(this._getType(e)!==q.symbol){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.symbol,received:n.parsedType}),ue}return _t(e.data)}};Ji.create=t=>new Ji({typeName:ce.ZodSymbol,...Ae(t)});var ui=class extends ke{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.undefined,received:n.parsedType}),ue}return _t(e.data)}};ui.create=t=>new ui({typeName:ce.ZodUndefined,...Ae(t)});var li=class extends ke{_parse(e){if(this._getType(e)!==q.null){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.null,received:n.parsedType}),ue}return _t(e.data)}};li.create=t=>new li({typeName:ce.ZodNull,...Ae(t)});var yn=class extends ke{constructor(){super(...arguments),this._any=!0}_parse(e){return _t(e.data)}};yn.create=t=>new yn({typeName:ce.ZodAny,...Ae(t)});var Yr=class extends ke{constructor(){super(...arguments),this._unknown=!0}_parse(e){return _t(e.data)}};Yr.create=t=>new Yr({typeName:ce.ZodUnknown,...Ae(t)});var mr=class extends ke{_parse(e){let r=this._getOrReturnCtx(e);return U(r,{code:N.invalid_type,expected:q.never,received:r.parsedType}),ue}};mr.create=t=>new mr({typeName:ce.ZodNever,...Ae(t)});var Qi=class extends ke{_parse(e){if(this._getType(e)!==q.undefined){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.void,received:n.parsedType}),ue}return _t(e.data)}};Qi.create=t=>new Qi({typeName:ce.ZodVoid,...Ae(t)});var Zr=class t extends ke{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==q.array)return U(r,{code:N.invalid_type,expected:q.array,received:r.parsedType}),ue;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(U(r,{code:s?N.too_big:N.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(U(r,{code:N.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(U(r,{code:N.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new ar(r,s,r.path,a)))).then(s=>Ct.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new ar(r,s,r.path,a)));return Ct.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:J.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:J.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:J.toString(r)}})}nonempty(e){return this.min(1,e)}};Zr.create=(t,e)=>new Zr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ce.ZodArray,...Ae(e)});function Xi(t){if(t instanceof $t){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=sr.create(Xi(n))}return new $t({...t._def,shape:()=>e})}else return t instanceof Zr?new Zr({...t._def,type:Xi(t.element)}):t instanceof sr?sr.create(Xi(t.unwrap())):t instanceof Tr?Tr.create(Xi(t.unwrap())):t instanceof Cr?Cr.create(t.items.map(e=>Xi(e))):t}var $t=class t extends ke{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=_e.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==q.object){let l=this._getOrReturnCtx(e);return U(l,{code:N.invalid_type,expected:q.object,received:l.parsedType}),ue}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof mr&&this._def.unknownKeys==="strip"))for(let l in i.data)s.includes(l)||a.push(l);let u=[];for(let l of s){let c=o[l],f=i.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new ar(i,f,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof mr){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of a)u.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(l==="strict")a.length>0&&(U(i,{code:N.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of a){let f=i.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new ar(i,f,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let f=await c.key,p=await c.value;l.push({key:f,value:p,alwaysSet:c.alwaysSet})}return l}).then(l=>Ct.mergeObjectSync(n,l)):Ct.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return J.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:J.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ce.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of _e.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of _e.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return Xi(this)}partial(e){let r={};for(let n of _e.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of _e.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof sr;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:()=>r})}keyof(){return Wh(_e.objectKeys(this.shape))}};$t.create=(t,e)=>new $t({shape:()=>t,unknownKeys:"strip",catchall:mr.create(),typeName:ce.ZodObject,...Ae(e)});$t.strictCreate=(t,e)=>new $t({shape:()=>t,unknownKeys:"strict",catchall:mr.create(),typeName:ce.ZodObject,...Ae(e)});$t.lazycreate=(t,e)=>new $t({shape:t,unknownKeys:"strip",catchall:mr.create(),typeName:ce.ZodObject,...Ae(e)});var ci=class extends ke{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new zt(a.ctx.common.issues));return U(r,{code:N.invalid_union,unionErrors:s}),ue}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:l}),l.common.issues.length&&s.push(l.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(u=>new zt(u));return U(r,{code:N.invalid_union,unionErrors:a}),ue}}get options(){return this._def.options}};ci.create=(t,e)=>new ci({options:t,typeName:ce.ZodUnion,...Ae(e)});var Kr=t=>t instanceof pi?Kr(t.schema):t instanceof ur?Kr(t.innerType()):t instanceof di?[t.value]:t instanceof hi?t.options:t instanceof mi?_e.objectValues(t.enum):t instanceof gi?Kr(t._def.innerType):t instanceof ui?[void 0]:t instanceof li?[null]:t instanceof sr?[void 0,...Kr(t.unwrap())]:t instanceof Tr?[null,...Kr(t.unwrap())]:t instanceof fs||t instanceof yi?Kr(t.unwrap()):t instanceof xi?Kr(t._def.innerType):[],Oa=class t extends ke{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.object)return U(r,{code:N.invalid_type,expected:q.object,received:r.parsedType}),ue;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(U(r,{code:N.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),ue)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=Kr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:ce.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Ae(n)})}};function Fc(t,e){let r=wr(t),n=wr(e);if(t===e)return{valid:!0,data:t};if(r===q.object&&n===q.object){let i=_e.objectKeys(e),o=_e.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let u=Fc(t[a],e[a]);if(!u.valid)return{valid:!1};s[a]=u.data}return{valid:!0,data:s}}else if(r===q.array&&n===q.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],u=Fc(s,a);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return r===q.date&&n===q.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var fi=class extends ke{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(Sa(o)||Sa(s))return ue;let a=Fc(o.value,s.value);return a.valid?((Ia(o)||Ia(s))&&r.dirty(),{status:r.value,value:a.data}):(U(n,{code:N.invalid_intersection_types}),ue)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};fi.create=(t,e,r)=>new fi({left:t,right:e,typeName:ce.ZodIntersection,...Ae(r)});var Cr=class t extends ke{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.array)return U(n,{code:N.invalid_type,expected:q.array,received:n.parsedType}),ue;if(n.data.length<this._def.items.length)return U(n,{code:N.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ue;!this._def.rest&&n.data.length>this._def.items.length&&(U(n,{code:N.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let u=this._def.items[a]||this._def.rest;return u?u._parse(new ar(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Ct.mergeArray(r,s)):Ct.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Cr.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Cr({items:t,typeName:ce.ZodTuple,rest:null,...Ae(e)})};var va=class t extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.object)return U(n,{code:N.invalid_type,expected:q.object,received:n.parsedType}),ue;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new ar(n,a,n.path,a)),value:s._parse(new ar(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Ct.mergeObjectAsync(r,i):Ct.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof ke?new t({keyType:e,valueType:r,typeName:ce.ZodRecord,...Ae(n)}):new t({keyType:xn.create(),valueType:e,typeName:ce.ZodRecord,...Ae(r)})}},eo=class extends ke{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.map)return U(n,{code:N.invalid_type,expected:q.map,received:n.parsedType}),ue;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,u],l)=>({key:i._parse(new ar(n,a,n.path,[l,"key"])),value:o._parse(new ar(n,u,n.path,[l,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let u of s){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return ue;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let u of s){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return ue;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(l.value,c.value)}return{status:r.value,value:a}}}};eo.create=(t,e,r)=>new eo({valueType:e,keyType:t,typeName:ce.ZodMap,...Ae(r)});var to=class t extends ke{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==q.set)return U(n,{code:N.invalid_type,expected:q.set,received:n.parsedType}),ue;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(U(n,{code:N.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(U(n,{code:N.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(u){let l=new Set;for(let c of u){if(c.status==="aborted")return ue;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let a=[...n.data.values()].map((u,l)=>o._parse(new ar(n,u,n.path,l)));return n.common.async?Promise.all(a).then(u=>s(u)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:J.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:J.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};to.create=(t,e)=>new to({valueType:t,minSize:null,maxSize:null,typeName:ce.ZodSet,...Ae(e)});var Da=class t extends ke{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.function)return U(r,{code:N.invalid_type,expected:q.function,received:r.parsedType}),ue;function n(a,u){return cs({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Yi(),Hr].filter(l=>!!l),issueData:{code:N.invalid_arguments,argumentsError:u}})}function i(a,u){return cs({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,Yi(),Hr].filter(l=>!!l),issueData:{code:N.invalid_return_type,returnTypeError:u}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof bn){let a=this;return _t(async function(...u){let l=new zt([]),c=await a._def.args.parseAsync(u,o).catch(d=>{throw l.addIssue(n(u,d)),l}),f=await Reflect.apply(s,this,c);return await a._def.returns._def.type.parseAsync(f,o).catch(d=>{throw l.addIssue(i(f,d)),l})})}else{let a=this;return _t(function(...u){let l=a._def.args.safeParse(u,o);if(!l.success)throw new zt([n(u,l.error)]);let c=Reflect.apply(s,this,l.data),f=a._def.returns.safeParse(c,o);if(!f.success)throw new zt([i(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Cr.create(e).rest(Yr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||Cr.create([]).rest(Yr.create()),returns:r||Yr.create(),typeName:ce.ZodFunction,...Ae(n)})}},pi=class extends ke{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};pi.create=(t,e)=>new pi({getter:t,typeName:ce.ZodLazy,...Ae(e)});var di=class extends ke{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return U(r,{received:r.data,code:N.invalid_literal,expected:this._def.value}),ue}return{status:"valid",value:e.data}}get value(){return this._def.value}};di.create=(t,e)=>new di({value:t,typeName:ce.ZodLiteral,...Ae(e)});function Wh(t,e){return new hi({values:t,typeName:ce.ZodEnum,...Ae(e)})}var hi=class t extends ke{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{expected:_e.joinValues(n),received:r.parsedType,code:N.invalid_type}),ue}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return U(r,{received:r.data,code:N.invalid_enum_value,options:n}),ue}return _t(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};hi.create=Wh;var mi=class extends ke{_parse(e){let r=_e.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==q.string&&n.parsedType!==q.number){let i=_e.objectValues(r);return U(n,{expected:_e.joinValues(i),received:n.parsedType,code:N.invalid_type}),ue}if(this._cache||(this._cache=new Set(_e.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=_e.objectValues(r);return U(n,{received:n.data,code:N.invalid_enum_value,options:i}),ue}return _t(e.data)}get enum(){return this._def.values}};mi.create=(t,e)=>new mi({values:t,typeName:ce.ZodNativeEnum,...Ae(e)});var bn=class extends ke{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==q.promise&&r.common.async===!1)return U(r,{code:N.invalid_type,expected:q.promise,received:r.parsedType}),ue;let n=r.parsedType===q.promise?r.data:Promise.resolve(r.data);return _t(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};bn.create=(t,e)=>new bn({type:t,typeName:ce.ZodPromise,...Ae(e)});var ur=class extends ke{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ce.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{U(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return ue;let u=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return u.status==="aborted"?ue:u.status==="dirty"?ni(u.value):r.value==="dirty"?ni(u.value):u});{if(r.value==="aborted")return ue;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?ue:a.status==="dirty"?ni(a.value):r.value==="dirty"?ni(a.value):a}}if(i.type==="refinement"){let s=a=>{let u=i.refinement(a,o);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?ue:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?ue:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!gn(s))return ue;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>gn(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):ue);_e.assertNever(i)}};ur.create=(t,e,r)=>new ur({schema:t,typeName:ce.ZodEffects,effect:e,...Ae(r)});ur.createWithPreprocess=(t,e,r)=>new ur({schema:e,effect:{type:"preprocess",transform:t},typeName:ce.ZodEffects,...Ae(r)});var sr=class extends ke{_parse(e){return this._getType(e)===q.undefined?_t(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};sr.create=(t,e)=>new sr({innerType:t,typeName:ce.ZodOptional,...Ae(e)});var Tr=class extends ke{_parse(e){return this._getType(e)===q.null?_t(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Tr.create=(t,e)=>new Tr({innerType:t,typeName:ce.ZodNullable,...Ae(e)});var gi=class extends ke{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===q.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};gi.create=(t,e)=>new gi({innerType:t,typeName:ce.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Ae(e)});var xi=class extends ke{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Zi(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new zt(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new zt(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};xi.create=(t,e)=>new xi({innerType:t,typeName:ce.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Ae(e)});var ro=class extends ke{_parse(e){if(this._getType(e)!==q.nan){let n=this._getOrReturnCtx(e);return U(n,{code:N.invalid_type,expected:q.nan,received:n.parsedType}),ue}return{status:"valid",value:e.data}}};ro.create=t=>new ro({typeName:ce.ZodNaN,...Ae(t)});var lC=Symbol("zod_brand"),fs=class extends ke{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},ps=class t extends ke{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ue:o.status==="dirty"?(r.dirty(),ni(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ue:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:ce.ZodPipeline})}},yi=class extends ke{_parse(e){let r=this._def.innerType._parse(e),n=i=>(gn(i)&&(i.value=Object.freeze(i.value)),i);return Zi(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};yi.create=(t,e)=>new yi({innerType:t,typeName:ce.ZodReadonly,...Ae(e)});function $h(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function Hh(t,e={},r){return t?yn.create().superRefine((n,i)=>{let o=t(n);if(o instanceof Promise)return o.then(s=>{if(!s){let a=$h(e,n),u=a.fatal??r??!0;i.addIssue({code:"custom",...a,fatal:u})}});if(!o){let s=$h(e,n),a=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:a})}}):yn.create()}var cC={object:$t.lazycreate},ce;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ce||(ce={}));var fC=(t,e={message:`Input not instance of ${t.name}`})=>Hh(r=>r instanceof t,e),Kh=xn.create,Yh=ii.create,pC=ro.create,dC=oi.create,Zh=si.create,hC=ai.create,mC=Ji.create,gC=ui.create,xC=li.create,yC=yn.create,bC=Yr.create,EC=mr.create,AC=Qi.create,kC=Zr.create,wC=$t.create,CC=$t.strictCreate,TC=ci.create,_C=Oa.create,SC=fi.create,IC=Cr.create,OC=va.create,vC=eo.create,DC=to.create,RC=Da.create,FC=pi.create,NC=di.create,PC=hi.create,LC=mi.create,MC=bn.create,BC=ur.create,jC=sr.create,UC=Tr.create,zC=ur.createWithPreprocess,$C=ps.create,qC=()=>Kh().optional(),VC=()=>Yh().optional(),GC=()=>Zh().optional(),WC={string:(t=>xn.create({...t,coerce:!0})),number:(t=>ii.create({...t,coerce:!0})),boolean:(t=>si.create({...t,coerce:!0})),bigint:(t=>oi.create({...t,coerce:!0})),date:(t=>ai.create({...t,coerce:!0}))};var HC=ue;import{defaultLoaders as KC}from"cosmiconfig";function Nc(t,e){let r=KC[".json"],n=r(t,e);return Xh(n)}function Xh(t,e="",r={}){for(let[n,i]of Object.entries(t)){let o=e?`${e}.${n}`:n;typeof i=="object"&&i!==null&&!Array.isArray(i)?Xh(i,o,r):i===null?r[o]="null":r[o]=i.toString()}return r}import nT from"fs";import Xr from"path";import QC from"process";import YC from"process";import ZC from"fs/promises";import{fileURLToPath as XC}from"url";import Mj from"fs";import no from"path";var Jh=t=>t instanceof URL?XC(t):t;async function Ra(t,{cwd:e=YC.cwd(),type:r="file",stopAt:n}={}){let i=no.resolve(Jh(e)??""),{root:o}=no.parse(i);n=no.resolve(i,Jh(n??o));let s=no.isAbsolute(t);for(;i;){let a=s?t:no.join(i,t);try{let u=await ZC.stat(a);if(r==="file"&&u.isFile()||r==="directory"&&u.isDirectory())return a}catch{}if(i===n||i===o)break;i=no.dirname(i)}}async function Qh({cwd:t=QC.cwd()}={}){return Ra("package.json",{cwd:t})}import eT from"fs";import tT from"fs/promises";async function Pc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return(await tT[t](r))[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}function Lc(t,e,r){if(typeof r!="string")throw new TypeError(`Expected a string, got ${typeof r}`);try{return eT[t](r)[e]()}catch(n){if(n.code==="ENOENT")return!1;throw n}}var io=Pc.bind(void 0,"stat","isFile"),Gj=Pc.bind(void 0,"stat","isDirectory"),Wj=Pc.bind(void 0,"lstat","isSymbolicLink"),Mc=Lc.bind(void 0,"statSync","isFile"),Hj=Lc.bind(void 0,"statSync","isDirectory"),Kj=Lc.bind(void 0,"lstatSync","isSymbolicLink");import{log as tm}from"remark-mdat";import{Configuration as iT}from"unified-engine";import rT from"os";var em=rT.homedir();function Bc(t){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return em?t.replace(/^~(?=$|\/|\\)/,em):t}function oT(t,e){let r=e===0?1:Math.floor(Math.log10(Math.abs(e))+1);return t.toString().padStart(r,"0")}function nm(t,e,r,n){let i=[];for(let[o,s]of t.entries()){let a=r&&t.length>1?`-${oT(o+1,t.length+1)}`:"",u=sT(s,e,r,n,a);i.push(u)}return i}function sT(t,e,r,n,i=""){let o=rm(t),s=e?rm(e):void 0;if(!Mc(o))throw new Error(`Input file not found: "${o}"`);if(s){if(Mc(s))throw new Error(`Output path must be a directory, received a file path: "${s}"`);nT.mkdirSync(s,{recursive:!0})}let a=r?Xr.basename(r,Xr.extname(r)):Xr.basename(o,Xr.extname(o)),u=`.${n??(r&&Xr.extname(r)!==""?Xr.extname(r):Xr.extname(t)===""?"":Xr.extname(t))}`,l=`${a}${i}${u}`,c=s??Xr.dirname(o);return{input:o,name:l,output:c}}function rm(t){return Bc(t)}async function Fa(){return Qh()}function Na(t){return t==null?[]:Array.isArray(t)?t:[t]}async function im(){let t=new iT({cwd:process.cwd(),detectConfig:!0,packageField:"remarkConfig",rcName:".remarkrc"}),e=await new Promise(r=>{t.load("",(n,i)=>{if(n){console.error(n),r();return}r(i)})});if(e){let{filePath:r}=e;return r===void 0?tm.info('No ambient Remark configuration file found"'):tm.info(`Found and loaded ambient Remark configuration from "${r}"`),e}throw new Error("Failed to load ambient remark configuration")}var am=lT.merge(K.object({assetsPath:K.string().optional(),packageFile:K.string().optional()})).describe("Config Extension");async function bi(t){let{additionalConfig:e,additionalRules:r,searchFrom:n}=t??{},i={addMetaComment:!1,assetsPath:"./assets",closingPrefix:"/",keywordPrefix:"",metaCommentIdentifier:"+",packageFile:await Fa(),rules:{mdat:"Powered by the Markdown Autophagic Template system: [mdat](https://github.com/kitschpatrol/mdat)."}},o=om("mdat",{loaders:{".ts":sm()}}),s=await o.search(n);if(s){let{config:a,filepath:u}=s,l=a;if(lr.info(`Using config from "${u}"`),u.endsWith("package.json")&&typeof a=="string"){lr.info(`Detected shared config string: "${a}"`);let{default:f}=await import(a);l=f}let c=um(l,am);c&&(i=jc(i,c))}if(e!==void 0){let a=Array.isArray(e)?e:[e];for(let u of a){let l;if(typeof u=="string"){let f=await o.load(u);if(f==null)continue;let{config:p,filepath:d}=f;lr.info(`Loaded additional config from "${d}"`),l=p}else l=u;if(l===void 0)continue;lr.info("Merging configuration object");let c=um(l,am);c!==void 0&&(i=jc(i,c))}}if(r!==void 0){let a=Array.isArray(r)?r:[r],u=om("mdat",{loaders:{".json":Nc,".ts":sm()}});for(let l of a){let c;if(typeof l=="string"){let p;if(lm.basename(l).endsWith("package.json")){let y=await aT.readFile(l,"utf8");p={config:Nc(l,y),filepath:l}}else p=await u.load(l);if(p==null)continue;let{config:d,filepath:m}=p;lr.info(`Loaded additional config from "${m}"`),c=d}else c=l;if(c===void 0)continue;lr.info("Merging rules into configuration object");let f=fT(c,cT);f!==void 0&&(i=jc(i,f))}}if(i.rules){let a=Object.keys(i.rules).sort().map(u=>`"${Pa.default.green(Pa.default.bold(u))}"`);lr.info(`Loaded ${Pa.default.bold(a.length)} mdat comment expansion ${vc("rule",a.length)}:`);for(let u of a)lr.info(` ${u}`)}else lr.error("No rules loaded from additional configurations or rules, using default.");return La=i,i}function fT(t,e){if(e.safeParse(t).success)return{rules:t};lr.error(`Rules object has the wrong shape. Ignoring and using default configuration:
66
+ ${JSON.stringify(t,void 0,2)}`)}function um(t,e){if(e.safeParse(t).success)return t;lr.error(`Config object has the wrong shape. Ignoring and using default configuration:
67
+ ${JSON.stringify(t,void 0,2)}`)}var La;async function _r(){return La===void 0&&(lr.warn("getConfig(): config was undefined"),La??=await bi()),La}var Uc;async function Jt(){let{packageFile:t}=await _r();if(t===void 0)throw new Error("No packageFile found or set in config");if(Uc??=await uT({cwd:lm.dirname(t)}),Uc===void 0)throw new Error("No package.json found");return Uc}var pT={};function Jr(t,e){let r=e||pT,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,i=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return fm(t,n,i)}function fm(t,e,r){if(dT(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return cm(t.children,e,r)}return Array.isArray(t)?cm(t,e,r):""}function cm(t,e,r){let n=[],i=-1;for(;++i<t.length;)n[i]=fm(t[i],e,r);return n.join("")}function dT(t){return!!(t&&typeof t=="object")}var zc={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
68
+ `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var hT={}.hasOwnProperty;function oo(t){return hT.call(zc,t)?zc[t]:!1}function it(t,e,r,n){let i=t.length,o=0,s;if(e<0?e=-e>i?0:i+e:e=e>i?i:e,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(e,r),t.splice(...s);else for(r&&t.splice(e,r);o<n.length;)s=n.slice(o,o+1e4),s.unshift(e,0),t.splice(...s),o+=1e4,e+=1e4}function Ft(t,e){return t.length>0?(it(t,t.length,0,e),t):e}var pm={}.hasOwnProperty;function Ma(t){let e={},r=-1;for(;++r<t.length;)mT(e,t[r]);return e}function mT(t,e){let r;for(r in e){let i=(pm.call(t,r)?t[r]:void 0)||(t[r]={}),o=e[r],s;if(o)for(s in o){pm.call(i,s)||(i[s]=[]);let a=o[s];gT(i[s],Array.isArray(a)?a:a?[a]:[])}}}function gT(t,e){let r=-1,n=[];for(;++r<e.length;)(e[r].add==="after"?t:n).push(e[r]);it(t,0,0,n)}function Ba(t,e){let r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"\uFFFD":String.fromCodePoint(r)}function St(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var mt=En(/[A-Za-z]/),gt=En(/[\dA-Za-z]/),dm=En(/[#-'*+\--9=?A-Z^-~]/);function Ei(t){return t!==null&&(t<32||t===127)}var ds=En(/\d/),hm=En(/[\dA-Fa-f]/),mm=En(/[!-/:-@[-`{-~]/);function z(t){return t!==null&&t<-2}function Ce(t){return t!==null&&(t<0||t===32)}function se(t){return t===-2||t===-1||t===32}var Ai=En(new RegExp("\\p{P}|\\p{S}","u")),Sr=En(/\s/);function En(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function ie(t,e,r,n){let i=n?n-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return se(u)?(t.enter(r),a(u)):e(u)}function a(u){return se(u)&&o++<i?(t.consume(u),a):(t.exit(r),e(u))}}var gm={tokenize:xT};function xT(t){let e=t.attempt(this.parser.constructs.contentInitial,n,i),r;return e;function n(a){if(a===null){t.consume(a);return}return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),ie(t,e,"linePrefix")}function i(a){return t.enter("paragraph"),o(a)}function o(a){let u=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=u),r=u,s(a)}function s(a){if(a===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(a);return}return z(a)?(t.consume(a),t.exit("chunkText"),o):(t.consume(a),s)}}var ym={tokenize:yT},xm={tokenize:bT};function yT(t){let e=this,r=[],n=0,i,o,s;return a;function a(k){if(n<r.length){let D=r[n];return e.containerState=D[1],t.attempt(D[0].continuation,u,l)(k)}return l(k)}function u(k){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,i&&w();let D=e.events.length,R=D,S;for(;R--;)if(e.events[R][0]==="exit"&&e.events[R][1].type==="chunkFlow"){S=e.events[R][1].end;break}b(n);let de=D;for(;de<e.events.length;)e.events[de][1].end={...S},de++;return it(e.events,R+1,0,e.events.slice(D)),e.events.length=de,l(k)}return a(k)}function l(k){if(n===r.length){if(!i)return p(k);if(i.currentConstruct&&i.currentConstruct.concrete)return m(k);e.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(xm,c,f)(k)}function c(k){return i&&w(),b(n),p(k)}function f(k){return e.parser.lazy[e.now().line]=n!==r.length,s=e.now().offset,m(k)}function p(k){return e.containerState={},t.attempt(xm,d,m)(k)}function d(k){return n++,r.push([e.currentConstruct,e.containerState]),p(k)}function m(k){if(k===null){i&&w(),b(0),t.consume(k);return}return i=i||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),y(k)}function y(k){if(k===null){g(t.exit("chunkFlow"),!0),b(0),t.consume(k);return}return z(k)?(t.consume(k),g(t.exit("chunkFlow")),n=0,e.interrupt=void 0,a):(t.consume(k),y)}function g(k,D){let R=e.sliceStream(k);if(D&&R.push(null),k.previous=o,o&&(o.next=k),o=k,i.defineSkip(k.start),i.write(R),e.parser.lazy[k.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;let de=e.events.length,ye=de,be,_;for(;ye--;)if(e.events[ye][0]==="exit"&&e.events[ye][1].type==="chunkFlow"){if(be){_=e.events[ye][1].end;break}be=!0}for(b(n),S=de;S<e.events.length;)e.events[S][1].end={..._},S++;it(e.events,ye+1,0,e.events.slice(de)),e.events.length=S}}function b(k){let D=r.length;for(;D-- >k;){let R=r[D];e.containerState=R[1],R[0].exit.call(e,t)}r.length=k}function w(){i.write([null]),o=void 0,i=void 0,e.containerState._closeFlow=void 0}}function bT(t,e,r){return ie(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qr(t){if(t===null||Ce(t)||Sr(t))return 1;if(Ai(t))return 2}function An(t,e,r){let n=[],i=-1;for(;++i<t.length;){let o=t[i].resolveAll;o&&!n.includes(o)&&(e=o(e,r),n.push(o))}return e}var hs={name:"attention",resolveAll:ET,tokenize:AT};function ET(t,e){let r=-1,n,i,o,s,a,u,l,c;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(n=r;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[n][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;u=t[n][1].end.offset-t[n][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;let f={...t[n][1].end},p={...t[r][1].start};bm(f,-u),bm(p,u),s={type:u>1?"strongSequence":"emphasisSequence",start:f,end:{...t[n][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},t[n][1].end={...s.start},t[r][1].start={...a.end},l=[],t[n][1].end.offset-t[n][1].start.offset&&(l=Ft(l,[["enter",t[n][1],e],["exit",t[n][1],e]])),l=Ft(l,[["enter",i,e],["enter",s,e],["exit",s,e],["enter",o,e]]),l=Ft(l,An(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),l=Ft(l,[["exit",o,e],["enter",a,e],["exit",a,e],["exit",i,e]]),t[r][1].end.offset-t[r][1].start.offset?(c=2,l=Ft(l,[["enter",t[r][1],e],["exit",t[r][1],e]])):c=0,it(t,n-1,r-n+3,l),r=n+l.length-c-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function AT(t,e){let r=this.parser.constructs.attentionMarkers.null,n=this.previous,i=Qr(n),o;return s;function s(u){return o=u,t.enter("attentionSequence"),a(u)}function a(u){if(u===o)return t.consume(u),a;let l=t.exit("attentionSequence"),c=Qr(u),f=!c||c===2&&i||r.includes(u),p=!i||i===2&&c||r.includes(n);return l._open=!!(o===42?f:f&&(i||!p)),l._close=!!(o===42?p:p&&(c||!f)),e(u)}}function bm(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}var $c={name:"autolink",tokenize:kT};function kT(t,e,r){let n=0;return i;function i(d){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),o}function o(d){return mt(d)?(t.consume(d),s):d===64?r(d):l(d)}function s(d){return d===43||d===45||d===46||gt(d)?(n=1,a(d)):l(d)}function a(d){return d===58?(t.consume(d),n=0,u):(d===43||d===45||d===46||gt(d))&&n++<32?(t.consume(d),a):(n=0,l(d))}function u(d){return d===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):d===null||d===32||d===60||Ei(d)?r(d):(t.consume(d),u)}function l(d){return d===64?(t.consume(d),c):dm(d)?(t.consume(d),l):r(d)}function c(d){return gt(d)?f(d):r(d)}function f(d){return d===46?(t.consume(d),n=0,c):d===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(d),t.exit("autolinkMarker"),t.exit("autolink"),e):p(d)}function p(d){if((d===45||gt(d))&&n++<63){let m=d===45?p:f;return t.consume(d),m}return r(d)}}var Ir={partial:!0,tokenize:wT};function wT(t,e,r){return n;function n(o){return se(o)?ie(t,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?e(o):r(o)}}var ja={continuation:{tokenize:TT},exit:_T,name:"blockQuote",tokenize:CT};function CT(t,e,r){let n=this;return i;function i(s){if(s===62){let a=n.containerState;return a.open||(t.enter("blockQuote",{_container:!0}),a.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(s),t.exit("blockQuoteMarker"),o}return r(s)}function o(s){return se(s)?(t.enter("blockQuotePrefixWhitespace"),t.consume(s),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(s))}}function TT(t,e,r){let n=this;return i;function i(s){return se(s)?ie(t,o,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return t.attempt(ja,e,r)(s)}}function _T(t){t.exit("blockQuote")}var Ua={name:"characterEscape",tokenize:ST};function ST(t,e,r){return n;function n(o){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(o),t.exit("escapeMarker"),i}function i(o){return mm(o)?(t.enter("characterEscapeValue"),t.consume(o),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(o)}}var za={name:"characterReference",tokenize:IT};function IT(t,e,r){let n=this,i=0,o,s;return a;function a(f){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),u}function u(f){return f===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(f),t.exit("characterReferenceMarkerNumeric"),l):(t.enter("characterReferenceValue"),o=31,s=gt,c(f))}function l(f){return f===88||f===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(f),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),o=6,s=hm,c):(t.enter("characterReferenceValue"),o=7,s=ds,c(f))}function c(f){if(f===59&&i){let p=t.exit("characterReferenceValue");return s===gt&&!oo(n.sliceSerialize(p))?r(f):(t.enter("characterReferenceMarker"),t.consume(f),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return s(f)&&i++<o?(t.consume(f),c):r(f)}}var Em={partial:!0,tokenize:vT},$a={concrete:!0,name:"codeFenced",tokenize:OT};function OT(t,e,r){let n=this,i={partial:!0,tokenize:R},o=0,s=0,a;return u;function u(S){return l(S)}function l(S){let de=n.events[n.events.length-1];return o=de&&de[1].type==="linePrefix"?de[2].sliceSerialize(de[1],!0).length:0,a=S,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),c(S)}function c(S){return S===a?(s++,t.consume(S),c):s<3?r(S):(t.exit("codeFencedFenceSequence"),se(S)?ie(t,f,"whitespace")(S):f(S))}function f(S){return S===null||z(S)?(t.exit("codeFencedFence"),n.interrupt?e(S):t.check(Em,y,D)(S)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),p(S))}function p(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),f(S)):se(S)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),ie(t,d,"whitespace")(S)):S===96&&S===a?r(S):(t.consume(S),p)}function d(S){return S===null||z(S)?f(S):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||z(S)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),f(S)):S===96&&S===a?r(S):(t.consume(S),m)}function y(S){return t.attempt(i,D,g)(S)}function g(S){return t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),b}function b(S){return o>0&&se(S)?ie(t,w,"linePrefix",o+1)(S):w(S)}function w(S){return S===null||z(S)?t.check(Em,y,D)(S):(t.enter("codeFlowValue"),k(S))}function k(S){return S===null||z(S)?(t.exit("codeFlowValue"),w(S)):(t.consume(S),k)}function D(S){return t.exit("codeFenced"),e(S)}function R(S,de,ye){let be=0;return _;function _(j){return S.enter("lineEnding"),S.consume(j),S.exit("lineEnding"),L}function L(j){return S.enter("codeFencedFence"),se(j)?ie(S,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):F(j)}function F(j){return j===a?(S.enter("codeFencedFenceSequence"),I(j)):ye(j)}function I(j){return j===a?(be++,S.consume(j),I):be>=s?(S.exit("codeFencedFenceSequence"),se(j)?ie(S,P,"whitespace")(j):P(j)):ye(j)}function P(j){return j===null||z(j)?(S.exit("codeFencedFence"),de(j)):ye(j)}}}function vT(t,e,r){let n=this;return i;function i(s){return s===null?r(s):(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}var ms={name:"codeIndented",tokenize:RT},DT={partial:!0,tokenize:FT};function RT(t,e,r){let n=this;return i;function i(l){return t.enter("codeIndented"),ie(t,o,"linePrefix",5)(l)}function o(l){let c=n.events[n.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):r(l)}function s(l){return l===null?u(l):z(l)?t.attempt(DT,s,u)(l):(t.enter("codeFlowValue"),a(l))}function a(l){return l===null||z(l)?(t.exit("codeFlowValue"),s(l)):(t.consume(l),a)}function u(l){return t.exit("codeIndented"),e(l)}}function FT(t,e,r){let n=this;return i;function i(s){return n.parser.lazy[n.now().line]?r(s):z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i):ie(t,o,"linePrefix",5)(s)}function o(s){let a=n.events[n.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):z(s)?i(s):r(s)}}var qc={name:"codeText",previous:PT,resolve:NT,tokenize:LT};function NT(t){let e=t.length-4,r=3,n,i;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)i===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(i=n):(n===e||t[n][1].type==="lineEnding")&&(t[i][1].type="codeTextData",n!==i+2&&(t[i][1].end=t[n-1][1].end,t.splice(i+2,n-i-2),e-=n-i-2,n=i+2),i=void 0);return t}function PT(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function LT(t,e,r){let n=this,i=0,o,s;return a;function a(p){return t.enter("codeText"),t.enter("codeTextSequence"),u(p)}function u(p){return p===96?(t.consume(p),i++,u):(t.exit("codeTextSequence"),l(p))}function l(p){return p===null?r(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),l):p===96?(s=t.enter("codeTextSequence"),o=0,f(p)):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),l):(t.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||z(p)?(t.exit("codeTextData"),l(p)):(t.consume(p),c)}function f(p){return p===96?(t.consume(p),o++,f):o===i?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(s.type="codeTextData",c(p))}}var qa=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new 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,r){let n=r??Number.POSITIVE_INFINITY;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,r,n){let i=r||0;this.setCursor(Math.trunc(e));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return n&&gs(this.left,n),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),gs(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),gs(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 r=this.left.splice(e,Number.POSITIVE_INFINITY);gs(this.right,r.reverse())}else{let r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);gs(this.left,r.reverse())}}};function gs(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function Va(t){let e={},r=-1,n,i,o,s,a,u,l,c=new qa(t);for(;++r<c.length;){for(;r in e;)r=e[r];if(n=c.get(r),r&&n[1].type==="chunkFlow"&&c.get(r-1)[1].type==="listItemPrefix"&&(u=n[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,MT(c,r)),r=e[r],l=!0);else if(n[1]._container){for(o=r,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(n[1].end={...c.get(i)[1].start},a=c.slice(i,r),a.unshift(n),c.splice(i,r-i+1,a))}}return it(t,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function MT(t,e){let r=t.get(e)[1],n=t.get(e)[2],i=e-1,o=[],s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},c,f,p=-1,d=r,m=0,y=0,g=[y];for(;d;){for(;t.get(++i)[1]!==d;);o.push(i),d._tokenizer||(c=n.sliceStream(d),d.next||c.push(null),f&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=d,d=d.next}for(d=r;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(y=p+1,g.push(y),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),p=g.length;p--;){let b=a.slice(g[p],g[p+1]),w=o.pop();u.push([w,w+b.length-1]),t.splice(w,2,b)}for(u.reverse(),p=-1;++p<u.length;)l[m+u[p][0]]=m+u[p][1],m+=u[p][1]-u[p][0]-1;return l}var Vc={resolve:jT,tokenize:UT},BT={partial:!0,tokenize:zT};function jT(t){return Va(t),t}function UT(t,e){let r;return n;function n(a){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?t.check(BT,s,o)(a):(t.consume(a),i)}function o(a){return t.exit("chunkContent"),t.exit("content"),e(a)}function s(a){return t.consume(a),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,i}}function zT(t,e,r){let n=this;return i;function i(s){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),ie(t,o,"linePrefix")}function o(s){if(s===null||z(s))return r(s);let a=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(s):t.interrupt(n.parser.constructs.flow,r,e)(s)}}function Ga(t,e,r,n,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return f;function f(b){return b===60?(t.enter(n),t.enter(i),t.enter(o),t.consume(b),t.exit(o),p):b===null||b===32||b===41||Ei(b)?r(b):(t.enter(n),t.enter(s),t.enter(a),t.enter("chunkString",{contentType:"string"}),y(b))}function p(b){return b===62?(t.enter(o),t.consume(b),t.exit(o),t.exit(i),t.exit(n),e):(t.enter(a),t.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===62?(t.exit("chunkString"),t.exit(a),p(b)):b===null||b===60||z(b)?r(b):(t.consume(b),b===92?m:d)}function m(b){return b===60||b===62||b===92?(t.consume(b),d):d(b)}function y(b){return!c&&(b===null||b===41||Ce(b))?(t.exit("chunkString"),t.exit(a),t.exit(s),t.exit(n),e(b)):c<l&&b===40?(t.consume(b),c++,y):b===41?(t.consume(b),c--,y):b===null||b===32||b===40||Ei(b)?r(b):(t.consume(b),b===92?g:y)}function g(b){return b===40||b===41||b===92?(t.consume(b),y):y(b)}}function Wa(t,e,r,n,i,o){let s=this,a=0,u;return l;function l(d){return t.enter(n),t.enter(i),t.consume(d),t.exit(i),t.enter(o),c}function c(d){return a>999||d===null||d===91||d===93&&!u||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?r(d):d===93?(t.exit(o),t.enter(i),t.consume(d),t.exit(i),t.exit(n),e):z(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),c):(t.enter("chunkString",{contentType:"string"}),f(d))}function f(d){return d===null||d===91||d===93||z(d)||a++>999?(t.exit("chunkString"),c(d)):(t.consume(d),u||(u=!se(d)),d===92?p:f)}function p(d){return d===91||d===92||d===93?(t.consume(d),a++,f):f(d)}}function Ha(t,e,r,n,i,o){let s;return a;function a(p){return p===34||p===39||p===40?(t.enter(n),t.enter(i),t.consume(p),t.exit(i),s=p===40?41:p,u):r(p)}function u(p){return p===s?(t.enter(i),t.consume(p),t.exit(i),t.exit(n),e):(t.enter(o),l(p))}function l(p){return p===s?(t.exit(o),u(s)):p===null?r(p):z(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),ie(t,l,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===s||p===null||z(p)?(t.exit("chunkString"),l(p)):(t.consume(p),p===92?f:c)}function f(p){return p===s||p===92?(t.consume(p),c):c(p)}}function ki(t,e){let r;return n;function n(i){return z(i)?(t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),r=!0,n):se(i)?ie(t,n,r?"linePrefix":"lineSuffix")(i):e(i)}}var Gc={name:"definition",tokenize:qT},$T={partial:!0,tokenize:VT};function qT(t,e,r){let n=this,i;return o;function o(d){return t.enter("definition"),s(d)}function s(d){return Wa.call(n,t,a,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=St(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),d===58?(t.enter("definitionMarker"),t.consume(d),t.exit("definitionMarker"),u):r(d)}function u(d){return Ce(d)?ki(t,l)(d):l(d)}function l(d){return Ga(t,c,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function c(d){return t.attempt($T,f,f)(d)}function f(d){return se(d)?ie(t,p,"whitespace")(d):p(d)}function p(d){return d===null||z(d)?(t.exit("definition"),n.parser.defined.push(i),e(d)):r(d)}}function VT(t,e,r){return n;function n(a){return Ce(a)?ki(t,i)(a):r(a)}function i(a){return Ha(t,o,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return se(a)?ie(t,s,"whitespace")(a):s(a)}function s(a){return a===null||z(a)?e(a):r(a)}}var Wc={name:"hardBreakEscape",tokenize:GT};function GT(t,e,r){return n;function n(o){return t.enter("hardBreakEscape"),t.consume(o),i}function i(o){return z(o)?(t.exit("hardBreakEscape"),e(o)):r(o)}}var Hc={name:"headingAtx",resolve:WT,tokenize:HT};function WT(t,e){let r=t.length-2,n=3,i,o;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(i={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},o={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},it(t,n,r-n+1,[["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e]])),t}function HT(t,e,r){let n=0;return i;function i(c){return t.enter("atxHeading"),o(c)}function o(c){return t.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&n++<6?(t.consume(c),s):c===null||Ce(c)?(t.exit("atxHeadingSequence"),a(c)):r(c)}function a(c){return c===35?(t.enter("atxHeadingSequence"),u(c)):c===null||z(c)?(t.exit("atxHeading"),e(c)):se(c)?ie(t,a,"whitespace")(c):(t.enter("atxHeadingText"),l(c))}function u(c){return c===35?(t.consume(c),u):(t.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||Ce(c)?(t.exit("atxHeadingText"),a(c)):(t.consume(c),l)}}var Am=["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"],Kc=["pre","script","style","textarea"];var Yc={concrete:!0,name:"htmlFlow",resolveTo:ZT,tokenize:XT},KT={partial:!0,tokenize:QT},YT={partial:!0,tokenize:JT};function ZT(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function XT(t,e,r){let n=this,i,o,s,a,u;return l;function l(E){return c(E)}function c(E){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(E),f}function f(E){return E===33?(t.consume(E),p):E===47?(t.consume(E),o=!0,y):E===63?(t.consume(E),i=3,n.interrupt?e:x):mt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function p(E){return E===45?(t.consume(E),i=2,d):E===91?(t.consume(E),i=5,a=0,m):mt(E)?(t.consume(E),i=4,n.interrupt?e:x):r(E)}function d(E){return E===45?(t.consume(E),n.interrupt?e:x):r(E)}function m(E){let W="CDATA[";return E===W.charCodeAt(a++)?(t.consume(E),a===W.length?n.interrupt?e:F:m):r(E)}function y(E){return mt(E)?(t.consume(E),s=String.fromCharCode(E),g):r(E)}function g(E){if(E===null||E===47||E===62||Ce(E)){let W=E===47,Ke=s.toLowerCase();return!W&&!o&&Kc.includes(Ke)?(i=1,n.interrupt?e(E):F(E)):Am.includes(s.toLowerCase())?(i=6,W?(t.consume(E),b):n.interrupt?e(E):F(E)):(i=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(E):o?w(E):k(E))}return E===45||gt(E)?(t.consume(E),s+=String.fromCharCode(E),g):r(E)}function b(E){return E===62?(t.consume(E),n.interrupt?e:F):r(E)}function w(E){return se(E)?(t.consume(E),w):_(E)}function k(E){return E===47?(t.consume(E),_):E===58||E===95||mt(E)?(t.consume(E),D):se(E)?(t.consume(E),k):_(E)}function D(E){return E===45||E===46||E===58||E===95||gt(E)?(t.consume(E),D):R(E)}function R(E){return E===61?(t.consume(E),S):se(E)?(t.consume(E),R):k(E)}function S(E){return E===null||E===60||E===61||E===62||E===96?r(E):E===34||E===39?(t.consume(E),u=E,de):se(E)?(t.consume(E),S):ye(E)}function de(E){return E===u?(t.consume(E),u=null,be):E===null||z(E)?r(E):(t.consume(E),de)}function ye(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Ce(E)?R(E):(t.consume(E),ye)}function be(E){return E===47||E===62||se(E)?k(E):r(E)}function _(E){return E===62?(t.consume(E),L):r(E)}function L(E){return E===null||z(E)?F(E):se(E)?(t.consume(E),L):r(E)}function F(E){return E===45&&i===2?(t.consume(E),ae):E===60&&i===1?(t.consume(E),ee):E===62&&i===4?(t.consume(E),Ue):E===63&&i===3?(t.consume(E),x):E===93&&i===5?(t.consume(E),rt):z(E)&&(i===6||i===7)?(t.exit("htmlFlowData"),t.check(KT,Je,I)(E)):E===null||z(E)?(t.exit("htmlFlowData"),I(E)):(t.consume(E),F)}function I(E){return t.check(YT,P,Je)(E)}function P(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),j}function j(E){return E===null||z(E)?I(E):(t.enter("htmlFlowData"),F(E))}function ae(E){return E===45?(t.consume(E),x):F(E)}function ee(E){return E===47?(t.consume(E),s="",Se):F(E)}function Se(E){if(E===62){let W=s.toLowerCase();return Kc.includes(W)?(t.consume(E),Ue):F(E)}return mt(E)&&s.length<8?(t.consume(E),s+=String.fromCharCode(E),Se):F(E)}function rt(E){return E===93?(t.consume(E),x):F(E)}function x(E){return E===62?(t.consume(E),Ue):E===45&&i===2?(t.consume(E),x):F(E)}function Ue(E){return E===null||z(E)?(t.exit("htmlFlowData"),Je(E)):(t.consume(E),Ue)}function Je(E){return t.exit("htmlFlow"),e(E)}}function JT(t,e,r){let n=this;return i;function i(s){return z(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),o):r(s)}function o(s){return n.parser.lazy[n.now().line]?r(s):e(s)}}function QT(t,e,r){return n;function n(i){return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),t.attempt(Ir,e,r)}}var Zc={name:"htmlText",tokenize:e_};function e_(t,e,r){let n=this,i,o,s;return a;function a(x){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(x),u}function u(x){return x===33?(t.consume(x),l):x===47?(t.consume(x),R):x===63?(t.consume(x),k):mt(x)?(t.consume(x),ye):r(x)}function l(x){return x===45?(t.consume(x),c):x===91?(t.consume(x),o=0,m):mt(x)?(t.consume(x),w):r(x)}function c(x){return x===45?(t.consume(x),d):r(x)}function f(x){return x===null?r(x):x===45?(t.consume(x),p):z(x)?(s=f,ee(x)):(t.consume(x),f)}function p(x){return x===45?(t.consume(x),d):f(x)}function d(x){return x===62?ae(x):x===45?p(x):f(x)}function m(x){let Ue="CDATA[";return x===Ue.charCodeAt(o++)?(t.consume(x),o===Ue.length?y:m):r(x)}function y(x){return x===null?r(x):x===93?(t.consume(x),g):z(x)?(s=y,ee(x)):(t.consume(x),y)}function g(x){return x===93?(t.consume(x),b):y(x)}function b(x){return x===62?ae(x):x===93?(t.consume(x),b):y(x)}function w(x){return x===null||x===62?ae(x):z(x)?(s=w,ee(x)):(t.consume(x),w)}function k(x){return x===null?r(x):x===63?(t.consume(x),D):z(x)?(s=k,ee(x)):(t.consume(x),k)}function D(x){return x===62?ae(x):k(x)}function R(x){return mt(x)?(t.consume(x),S):r(x)}function S(x){return x===45||gt(x)?(t.consume(x),S):de(x)}function de(x){return z(x)?(s=de,ee(x)):se(x)?(t.consume(x),de):ae(x)}function ye(x){return x===45||gt(x)?(t.consume(x),ye):x===47||x===62||Ce(x)?be(x):r(x)}function be(x){return x===47?(t.consume(x),ae):x===58||x===95||mt(x)?(t.consume(x),_):z(x)?(s=be,ee(x)):se(x)?(t.consume(x),be):ae(x)}function _(x){return x===45||x===46||x===58||x===95||gt(x)?(t.consume(x),_):L(x)}function L(x){return x===61?(t.consume(x),F):z(x)?(s=L,ee(x)):se(x)?(t.consume(x),L):be(x)}function F(x){return x===null||x===60||x===61||x===62||x===96?r(x):x===34||x===39?(t.consume(x),i=x,I):z(x)?(s=F,ee(x)):se(x)?(t.consume(x),F):(t.consume(x),P)}function I(x){return x===i?(t.consume(x),i=void 0,j):x===null?r(x):z(x)?(s=I,ee(x)):(t.consume(x),I)}function P(x){return x===null||x===34||x===39||x===60||x===61||x===96?r(x):x===47||x===62||Ce(x)?be(x):(t.consume(x),P)}function j(x){return x===47||x===62||Ce(x)?be(x):r(x)}function ae(x){return x===62?(t.consume(x),t.exit("htmlTextData"),t.exit("htmlText"),e):r(x)}function ee(x){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(x),t.exit("lineEnding"),Se}function Se(x){return se(x)?ie(t,rt,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(x):rt(x)}function rt(x){return t.enter("htmlTextData"),s(x)}}var wi={name:"labelEnd",resolveAll:i_,resolveTo:o_,tokenize:s_},t_={tokenize:a_},r_={tokenize:u_},n_={tokenize:l_};function i_(t){let e=-1,r=[];for(;++e<t.length;){let n=t[e][1];if(r.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){let i=n.type==="labelImage"?4:2;n.type="data",e+=i}}return t.length!==r.length&&it(t,0,t.length,r),t}function o_(t,e){let r=t.length,n=0,i,o,s,a;for(;r--;)if(i=t[r][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;t[r][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(t[r][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=r,i.type!=="labelLink")){n=2;break}}else i.type==="labelEnd"&&(s=r);let u={type:t[o][1].type==="labelLink"?"link":"image",start:{...t[o][1].start},end:{...t[t.length-1][1].end}},l={type:"label",start:{...t[o][1].start},end:{...t[s][1].end}},c={type:"labelText",start:{...t[o+n+2][1].end},end:{...t[s-2][1].start}};return a=[["enter",u,e],["enter",l,e]],a=Ft(a,t.slice(o+1,o+n+3)),a=Ft(a,[["enter",c,e]]),a=Ft(a,An(e.parser.constructs.insideSpan.null,t.slice(o+n+4,s-3),e)),a=Ft(a,[["exit",c,e],t[s-2],t[s-1],["exit",l,e]]),a=Ft(a,t.slice(s+1)),a=Ft(a,[["exit",u,e]]),it(t,o,t.length,a),t}function s_(t,e,r){let n=this,i=n.events.length,o,s;for(;i--;)if((n.events[i][1].type==="labelImage"||n.events[i][1].type==="labelLink")&&!n.events[i][1]._balanced){o=n.events[i][1];break}return a;function a(p){return o?o._inactive?f(p):(s=n.parser.defined.includes(St(n.sliceSerialize({start:o.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(p),t.exit("labelMarker"),t.exit("labelEnd"),u):r(p)}function u(p){return p===40?t.attempt(t_,c,s?c:f)(p):p===91?t.attempt(r_,c,s?l:f)(p):s?c(p):f(p)}function l(p){return t.attempt(n_,c,f)(p)}function c(p){return e(p)}function f(p){return o._balanced=!0,r(p)}}function a_(t,e,r){return n;function n(f){return t.enter("resource"),t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),i}function i(f){return Ce(f)?ki(t,o)(f):o(f)}function o(f){return f===41?c(f):Ga(t,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Ce(f)?ki(t,u)(f):c(f)}function a(f){return r(f)}function u(f){return f===34||f===39||f===40?Ha(t,l,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):c(f)}function l(f){return Ce(f)?ki(t,c)(f):c(f)}function c(f){return f===41?(t.enter("resourceMarker"),t.consume(f),t.exit("resourceMarker"),t.exit("resource"),e):r(f)}}function u_(t,e,r){let n=this;return i;function i(a){return Wa.call(n,t,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return n.parser.defined.includes(St(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(a):r(a)}function s(a){return r(a)}}function l_(t,e,r){return n;function n(o){return t.enter("reference"),t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),i}function i(o){return o===93?(t.enter("referenceMarker"),t.consume(o),t.exit("referenceMarker"),t.exit("reference"),e):r(o)}}var Xc={name:"labelStartImage",resolveAll:wi.resolveAll,tokenize:c_};function c_(t,e,r){let n=this;return i;function i(a){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(a),t.exit("labelImageMarker"),o}function o(a){return a===91?(t.enter("labelMarker"),t.consume(a),t.exit("labelMarker"),t.exit("labelImage"),s):r(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(a):e(a)}}var Jc={name:"labelStartLink",resolveAll:wi.resolveAll,tokenize:f_};function f_(t,e,r){let n=this;return i;function i(s){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(s),t.exit("labelMarker"),t.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):e(s)}}var xs={name:"lineEnding",tokenize:p_};function p_(t,e){return r;function r(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),ie(t,e,"linePrefix")}}var Ci={name:"thematicBreak",tokenize:d_};function d_(t,e,r){let n=0,i;return o;function o(l){return t.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(t.enter("thematicBreakSequence"),u(l)):n>=3&&(l===null||z(l))?(t.exit("thematicBreak"),e(l)):r(l)}function u(l){return l===i?(t.consume(l),n++,u):(t.exit("thematicBreakSequence"),se(l)?ie(t,a,"whitespace")(l):a(l))}}var It={continuation:{tokenize:x_},exit:b_,name:"list",tokenize:g_},h_={partial:!0,tokenize:E_},m_={partial:!0,tokenize:y_};function g_(t,e,r){let n=this,i=n.events[n.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){let m=n.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!n.containerState.marker||d===n.containerState.marker:ds(d)){if(n.containerState.type||(n.containerState.type=m,t.enter(m,{_container:!0})),m==="listUnordered")return t.enter("listItemPrefix"),d===42||d===45?t.check(Ci,r,l)(d):l(d);if(!n.interrupt||d===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),u(d)}return r(d)}function u(d){return ds(d)&&++s<10?(t.consume(d),u):(!n.interrupt||s<2)&&(n.containerState.marker?d===n.containerState.marker:d===41||d===46)?(t.exit("listItemValue"),l(d)):r(d)}function l(d){return t.enter("listItemMarker"),t.consume(d),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||d,t.check(Ir,n.interrupt?r:c,t.attempt(h_,p,f))}function c(d){return n.containerState.initialBlankLine=!0,o++,p(d)}function f(d){return se(d)?(t.enter("listItemPrefixWhitespace"),t.consume(d),t.exit("listItemPrefixWhitespace"),p):r(d)}function p(d){return n.containerState.size=o+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(d)}}function x_(t,e,r){let n=this;return n.containerState._closeFlow=void 0,t.check(Ir,i,o);function i(a){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,ie(t,e,"listItemIndent",n.containerState.size+1)(a)}function o(a){return n.containerState.furtherBlankLines||!se(a)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(a)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(m_,e,s)(a))}function s(a){return n.containerState._closeFlow=!0,n.interrupt=void 0,ie(t,t.attempt(It,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function y_(t,e,r){let n=this;return ie(t,i,"listItemIndent",n.containerState.size+1);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?e(o):r(o)}}function b_(t){t.exit(this.containerState.type)}function E_(t,e,r){let n=this;return ie(t,i,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=n.events[n.events.length-1];return!se(o)&&s&&s[1].type==="listItemPrefixWhitespace"?e(o):r(o)}}var Ka={name:"setextUnderline",resolveTo:A_,tokenize:k_};function A_(t,e){let r=t.length,n,i,o;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(i=r)}else t[r][1].type==="content"&&t.splice(r,1),!o&&t[r][1].type==="definition"&&(o=r);let s={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[i][1].type="setextHeadingText",o?(t.splice(i,0,["enter",s,e]),t.splice(o+1,0,["exit",t[n][1],e]),t[n][1].end={...t[o][1].end}):t[n][1]=s,t.push(["exit",s,e]),t}function k_(t,e,r){let n=this,i;return o;function o(l){let c=n.events.length,f;for(;c--;)if(n.events[c][1].type!=="lineEnding"&&n.events[c][1].type!=="linePrefix"&&n.events[c][1].type!=="content"){f=n.events[c][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||f)?(t.enter("setextHeadingLine"),i=l,s(l)):r(l)}function s(l){return t.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(t.consume(l),a):(t.exit("setextHeadingLineSequence"),se(l)?ie(t,u,"lineSuffix")(l):u(l))}function u(l){return l===null||z(l)?(t.exit("setextHeadingLine"),e(l)):r(l)}}var km={tokenize:w_};function w_(t){let e=this,r=t.attempt(Ir,n,t.attempt(this.parser.constructs.flowInitial,i,ie(t,t.attempt(this.parser.constructs.flow,i,t.attempt(Vc,i)),"linePrefix")));return r;function n(o){if(o===null){t.consume(o);return}return t.enter("lineEndingBlank"),t.consume(o),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function i(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),e.currentConstruct=void 0,r}}var wm={resolveAll:Sm()},Cm=_m("string"),Tm=_m("text");function _m(t){return{resolveAll:Sm(t==="text"?C_:void 0),tokenize:e};function e(r){let n=this,i=this.parser.constructs[t],o=r.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){r.consume(c);return}return r.enter("data"),r.consume(c),u}function u(c){return l(c)?(r.exit("data"),o(c)):(r.consume(c),u)}function l(c){if(c===null)return!0;let f=i[c],p=-1;if(f)for(;++p<f.length;){let d=f[p];if(!d.previous||d.previous.call(n,n.previous))return!0}return!1}}}function Sm(t){return e;function e(r,n){let i=-1,o;for(;++i<=r.length;)o===void 0?r[i]&&r[i][1].type==="data"&&(o=i,i++):(!r[i]||r[i][1].type!=="data")&&(i!==o+2&&(r[o][1].end=r[i-1][1].end,r.splice(o+2,i-o-2),i=o+2),o=void 0);return t?t(r,n):r}}function C_(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){let n=t[r-1][1],i=e.sliceStream(n),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(e._contentTypeTextTrailing&&r===t.length&&(a=0),a){let l={type:r===t.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:n.start._bufferIndex+s,_index:n.start._index+o,line:n.end.line,column:n.end.column-a,offset:n.end.offset-a},end:{...n.end}};n.end={...l.start},n.start.offset===n.end.offset?Object.assign(n,l):(t.splice(r,0,["enter",l,e],["exit",l,e]),r+=2)}r++}return t}var Qc={};Od(Qc,{attentionMarkers:()=>R_,contentInitial:()=>__,disable:()=>F_,document:()=>T_,flow:()=>I_,flowInitial:()=>S_,insideSpan:()=>D_,string:()=>O_,text:()=>v_});var T_={42:It,43:It,45:It,48:It,49:It,50:It,51:It,52:It,53:It,54:It,55:It,56:It,57:It,62:ja},__={91:Gc},S_={[-2]:ms,[-1]:ms,32:ms},I_={35:Hc,42:Ci,45:[Ka,Ci],60:Yc,61:Ka,95:Ci,96:$a,126:$a},O_={38:za,92:Ua},v_={[-5]:xs,[-4]:xs,[-3]:xs,33:Xc,38:za,42:hs,60:[$c,Zc],91:Jc,92:[Wc,Ua],93:wi,95:hs,96:qc},D_={null:[hs,wm]},R_={null:[42,95]},F_={null:[]};function Im(t,e,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:be(de),check:be(ye),consume:D,enter:R,exit:S,interrupt:be(ye,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:g,parser:t,previous:null,sliceSerialize:m,sliceStream:y,write:d},f=e.tokenize.call(c,l),p;return e.resolveAll&&o.push(e),c;function d(I){return s=Ft(s,I),w(),s[s.length-1]!==null?[]:(_(e,0),c.events=An(o,c.events,c),c.events)}function m(I,P){return P_(y(I),P)}function y(I){return N_(s,I)}function g(){let{_bufferIndex:I,_index:P,line:j,column:ae,offset:ee}=n;return{_bufferIndex:I,_index:P,line:j,column:ae,offset:ee}}function b(I){i[I.line]=I.column,F()}function w(){let I;for(;n._index<s.length;){let P=s[n._index];if(typeof P=="string")for(I=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===I&&n._bufferIndex<P.length;)k(P.charCodeAt(n._bufferIndex));else k(P)}}function k(I){u=void 0,p=I,f=f(I)}function D(I){z(I)?(n.line++,n.column=1,n.offset+=I===-3?2:1,F()):I!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=I,u=!0}function R(I,P){let j=P||{};return j.type=I,j.start=g(),c.events.push(["enter",j,c]),a.push(j),j}function S(I){let P=a.pop();return P.end=g(),c.events.push(["exit",P,c]),P}function de(I,P){_(I,P.from)}function ye(I,P){P.restore()}function be(I,P){return j;function j(ae,ee,Se){let rt,x,Ue,Je;return Array.isArray(ae)?W(ae):"tokenize"in ae?W([ae]):E(ae);function E(oe){return fe;function fe(me){let we=me!==null&&oe[me],Fe=me!==null&&oe.null,ze=[...Array.isArray(we)?we:we?[we]:[],...Array.isArray(Fe)?Fe:Fe?[Fe]:[]];return W(ze)(me)}}function W(oe){return rt=oe,x=0,oe.length===0?Se:Ke(oe[x])}function Ke(oe){return fe;function fe(me){return Je=L(),Ue=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?he(me):oe.tokenize.call(P?Object.assign(Object.create(c),P):c,l,ne,he)(me)}}function ne(oe){return u=!0,I(Ue,Je),ee}function he(oe){return u=!0,Je.restore(),++x<rt.length?Ke(rt[x]):Se}}}function _(I,P){I.resolveAll&&!o.includes(I)&&o.push(I),I.resolve&&it(c.events,P,c.events.length-P,I.resolve(c.events.slice(P),c)),I.resolveTo&&(c.events=I.resolveTo(c.events,c))}function L(){let I=g(),P=c.previous,j=c.currentConstruct,ae=c.events.length,ee=Array.from(a);return{from:ae,restore:Se};function Se(){n=I,c.previous=P,c.currentConstruct=j,c.events.length=ae,a=ee,F()}}function F(){n.line in i&&n.column<2&&(n.column=i[n.line],n.offset+=i[n.line]-1)}}function N_(t,e){let r=e.start._index,n=e.start._bufferIndex,i=e.end._index,o=e.end._bufferIndex,s;if(r===i)s=[t[r].slice(n,o)];else{if(s=t.slice(r,i),n>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(n):s.shift()}o>0&&s.push(t[i].slice(0,o))}return s}function P_(t,e){let r=-1,n=[],i;for(;++r<t.length;){let o=t[r],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
69
69
  `;break}case-3:{s=`\r
70
- `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,n.push(s)}return n.join("")}function nf(t){let n={constructs:Ba([rf,...(t||{}).extensions||[]]),content:i(Em),defined:[],document:i(wm),flow:i(_m),lazy:{},string:i(vm),text:i(Im)};return n;function i(o){return s;function s(a){return Rm(n,o,a)}}}function of(t){for(;!Ga(t););return t}var Fm=/[\0\t\n\r]/g;function sf(){let t=1,e="",r=!0,n;return i;function i(o,s,a){let u=[],l,c,f,p,d;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,e="",r&&(o.charCodeAt(0)===65279&&f++,r=void 0);f<o.length;){if(Fm.lastIndex=f,l=Fm.exec(o),p=l&&l.index!==void 0?l.index:o.length,d=o.charCodeAt(p),!l){e=o.slice(f);break}if(d===10&&f===p&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),f<p&&(u.push(o.slice(f,p)),t+=p-f),d){case 0:{u.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,u.push(-2);t++<c;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:n=!0,t=1}f=p+1}return a&&(n&&u.push(-5),e&&u.push(e),u.push(null)),u}}var B_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Za(t){return t.replace(B_,j_)}function j_(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let i=r.charCodeAt(1),o=i===120||i===88;return ja(r.slice(o?2:1),o?16:10)}return no(r)||t}function io(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?Nm(t.position):"start"in t||"end"in t?Nm(t):"line"in t||"column"in t?af(t):""}function af(t){return Pm(t&&t.line)+":"+Pm(t&&t.column)}function Nm(t){return af(t&&t.start)+"-"+af(t&&t.end)}function Pm(t){return t&&typeof t=="number"?t:1}var Mm={}.hasOwnProperty;function uf(t,e,r){return typeof e!="string"&&(r=e,e=void 0),U_(r)(of(nf(r).document().write(sf()(t,e,!0))))}function U_(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(T),autolinkProtocol:be,autolinkEmail:be,atxHeading:o(A),blockQuote:o(me),characterEscape:be,characterReference:be,codeFenced:o(Ce),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Ce,s),codeText:o(Fe,s),codeTextData:be,data:be,codeFlowValue:be,definition:o(ze),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ut),hardBreakEscape:o(k),hardBreakTrailing:o(k),htmlFlow:o(M,s),htmlFlowData:be,htmlText:o(M,s),htmlTextData:be,image:o(I),label:s,link:o(T),listItem:o($),listItemValue:p,listOrdered:o(K,f),listUnordered:o(K),paragraph:o(te),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(A),strong:o(lt),thematicBreak:o(Tw)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:ce,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:Ke,characterReferenceMarkerNumeric:Ke,characterReferenceValue:ne,characterReference:he,codeFenced:u(g),codeFencedFence:y,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:u(b),codeText:u(j),codeTextData:_,data:_,definition:u(),definitionDestinationString:D,definitionLabelString:C,definitionTitleString:w,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(v),htmlFlowData:_,htmlText:u(P),htmlTextData:_,image:u(ee),label:rt,labelText:_e,lineEnding:L,link:u(ae),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:W,resourceDestinationString:x,resourceTitleString:Ue,resource:Je,setextHeading:u(ye),setextHeadingLineSequence:de,setextHeadingText:S,strong:u(),thematicBreak:u()}};Bm(e,(t||{}).mdastExtensions||[]);let r={};return n;function n(O){let B={type:"root",children:[]},Ee={stack:[B],tokenStack:[],config:e,enter:a,exit:l,buffer:s,resume:c,data:r},ve=[],Ne=-1;for(;++Ne<O.length;)if(O[Ne][1].type==="listOrdered"||O[Ne][1].type==="listUnordered")if(O[Ne][0]==="enter")ve.push(Ne);else{let dr=ve.pop();Ne=i(O,dr,Ne)}for(Ne=-1;++Ne<O.length;){let dr=e[O[Ne][0]];Mm.call(dr,O[Ne][1].type)&&dr[O[Ne][1].type].call(Object.assign({sliceSerialize:O[Ne][2].sliceSerialize},Ee),O[Ne][1])}if(Ee.tokenStack.length>0){let dr=Ee.tokenStack[Ee.tokenStack.length-1];(dr[1]||Lm).call(Ee,void 0,dr[0])}for(B.position={start:En(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:En(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<e.transforms.length;)B=e.transforms[Ne](B)||B;return B}function i(O,B,Ee){let ve=B-1,Ne=-1,dr=!1,zn,$r,Qo,es;for(;++ve<=Ee;){let Wt=O[ve];switch(Wt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Wt[0]==="enter"?Ne++:Ne--,es=void 0;break}case"lineEndingBlank":{Wt[0]==="enter"&&(zn&&!es&&!Ne&&!Qo&&(Qo=ve),es=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:es=void 0}if(!Ne&&Wt[0]==="enter"&&Wt[1].type==="listItemPrefix"||Ne===-1&&Wt[0]==="exit"&&(Wt[1].type==="listUnordered"||Wt[1].type==="listOrdered")){if(zn){let zi=ve;for($r=void 0;zi--;){let qr=O[zi];if(qr[1].type==="lineEnding"||qr[1].type==="lineEndingBlank"){if(qr[0]==="exit")continue;$r&&(O[$r][1].type="lineEndingBlank",dr=!0),qr[1].type="lineEnding",$r=zi}else if(!(qr[1].type==="linePrefix"||qr[1].type==="blockQuotePrefix"||qr[1].type==="blockQuotePrefixWhitespace"||qr[1].type==="blockQuoteMarker"||qr[1].type==="listItemIndent"))break}Qo&&(!$r||Qo<$r)&&(zn._spread=!0),zn.end=Object.assign({},$r?O[$r][1].start:Wt[1].end),O.splice($r||ve,0,["exit",zn,Wt[2]]),ve++,Ee++}if(Wt[1].type==="listItemPrefix"){let zi={type:"listItem",_spread:!1,start:Object.assign({},Wt[1].start),end:void 0};zn=zi,O.splice(ve,0,["enter",zi,Wt[2]]),ve++,Ee++,Qo=void 0,es=!0}}}return O[B][1]._spread=dr,Ee}function o(O,B){return Ee;function Ee(ve){a.call(this,O(ve),ve),B&&B.call(this,ve)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(O,B,Ee){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([B,Ee||void 0]),O.position={start:En(B.start),end:void 0}}function u(O){return B;function B(Ee){O&&O.call(this,Ee),l.call(this,Ee)}}function l(O,B){let Ee=this.stack.pop(),ve=this.tokenStack.pop();if(ve)ve[0].type!==O.type&&(B?B.call(this,O,ve[0]):(ve[1]||Lm).call(this,O,ve[0]));else throw new Error("Cannot close `"+O.type+"` ("+io({start:O.start,end:O.end})+"): it\u2019s not open");Ee.position.end=En(O.end)}function c(){return Xr(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(O){if(this.data.expectingFirstListItemValue){let B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function d(){let O=this.resume(),B=this.stack[this.stack.length-1];B.lang=O}function m(){let O=this.resume(),B=this.stack[this.stack.length-1];B.meta=O}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O.replace(/(\r?\n|\r)$/g,"")}function C(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=_t(this.sliceSerialize(O)).toLowerCase()}function w(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function D(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function R(O){let B=this.stack[this.stack.length-1];if(!B.depth){let Ee=this.sliceSerialize(O).length;B.depth=Ee}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function de(O){let B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function ye(){this.data.setextHeadingSlurpLineEnding=void 0}function be(O){let Ee=this.stack[this.stack.length-1].children,ve=Ee[Ee.length-1];(!ve||ve.type!=="text")&&(ve=Ct(),ve.position={start:En(O.start),end:void 0},Ee.push(ve)),this.stack.push(ve)}function _(O){let B=this.stack.pop();B.value+=this.sliceSerialize(O),B.position.end=En(O.end)}function L(O){let B=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ee=B.children[B.children.length-1];Ee.position.end=En(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(B.type)&&(be.call(this,O),_.call(this,O))}function F(){this.data.atHardBreak=!0}function v(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function P(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function j(){let O=this.resume(),B=this.stack[this.stack.length-1];B.value=O}function ae(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function ee(){let O=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=B,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function _e(O){let B=this.sliceSerialize(O),Ee=this.stack[this.stack.length-2];Ee.label=Za(B),Ee.identifier=_t(B).toLowerCase()}function rt(){let O=this.stack[this.stack.length-1],B=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){let ve=O.children;Ee.children=ve}else Ee.alt=B}function x(){let O=this.resume(),B=this.stack[this.stack.length-1];B.url=O}function Ue(){let O=this.resume(),B=this.stack[this.stack.length-1];B.title=O}function Je(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function W(O){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=_t(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function Ke(O){this.data.characterReferenceType=O.type}function ne(O){let B=this.sliceSerialize(O),Ee=this.data.characterReferenceType,ve;Ee?(ve=ja(B,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ve=no(B);let Ne=this.stack[this.stack.length-1];Ne.value+=ve}function he(O){let B=this.stack.pop();B.position.end=En(O.end)}function oe(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(O)}function ce(O){_.call(this,O);let B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(O)}function me(){return{type:"blockquote",children:[]}}function Ce(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ut(){return{type:"emphasis",children:[]}}function A(){return{type:"heading",depth:0,children:[]}}function k(){return{type:"break"}}function M(){return{type:"html",value:""}}function I(){return{type:"image",title:null,url:"",alt:null}}function T(){return{type:"link",title:null,url:"",children:[]}}function K(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function $(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function te(){return{type:"paragraph",children:[]}}function lt(){return{type:"strong",children:[]}}function Ct(){return{type:"text",value:""}}function Tw(){return{type:"thematicBreak"}}}function En(t){return{line:t.line,column:t.column,offset:t.offset}}function Bm(t,e){let r=-1;for(;++r<e.length;){let n=e[r];Array.isArray(n)?Bm(t,n):z_(t,n)}}function z_(t,e){let r;for(r in e)if(Mm.call(e,r))switch(r){case"canContainEols":{let n=e[r];n&&t[r].push(...n);break}case"transforms":{let n=e[r];n&&t[r].push(...n);break}case"enter":case"exit":{let n=e[r];n&&Object.assign(t[r],n);break}}}function Lm(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+io({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+io({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+io({start:e.start,end:e.end})+") is still open")}function Xa(t){let e=this;e.parser=r;function r(n){return uf(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}var jm={}.hasOwnProperty;function Um(t,e){let r=e||{};function n(i,...o){let s=n.invalid,a=n.handlers;if(i&&jm.call(i,t)){let u=String(i[t]);s=jm.call(a,u)?a[u]:n.unknown}if(s)return s.call(this,i,...o)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}var $_={}.hasOwnProperty;function lf(t,e){let r=-1,n;if(e.extensions)for(;++r<e.extensions.length;)lf(t,e.extensions[r]);for(n in e)if($_.call(e,n))switch(n){case"extensions":break;case"unsafe":{zm(t[n],e[n]);break}case"join":{zm(t[n],e[n]);break}case"handlers":{q_(t[n],e[n]);break}default:t.options[n]=e[n]}return t}function zm(t,e){e&&t.push(...e)}function q_(t,e){e&&Object.assign(t,e)}function $m(t,e,r,n){let i=r.enter("blockquote"),o=r.createTracker(n);o.move("> "),o.shift(2);let s=r.indentLines(r.containerFlow(t,o.current()),V_);return i(),s}function V_(t,e,r){return">"+(r?"":" ")+t}function Ja(t,e){return qm(t,e.inConstruct,!0)&&!qm(t,e.notInConstruct,!1)}function qm(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++n<e.length;)if(t.includes(e[n]))return!0;return!1}function cf(t,e,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
71
- `&&Ja(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
72
- `}function Vm(t,e){let r=String(t),n=r.indexOf(e),i=n,o=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++o>s&&(s=o):o=1,i=n+e.length,n=r.indexOf(e,i);return s}function ys(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Gm(t){let e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function Wm(t,e,r,n){let i=Gm(r),o=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(ys(t,r)){let f=r.enter("codeIndented"),p=r.indentLines(o,G_);return f(),p}let a=r.createTracker(n),u=i.repeat(Math.max(Vm(o,i)+1,3)),l=r.enter("codeFenced"),c=a.move(u);if(t.lang){let f=r.enter(`codeFencedLang${s}`);c+=a.move(r.safe(t.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(t.lang&&t.meta){let f=r.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(r.safe(t.meta,{before:c,after:`
70
+ `;break}case-2:{s=e?" ":" ";break}case-1:{if(!e&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,n.push(s)}return n.join("")}function ef(t){let n={constructs:Ma([Qc,...(t||{}).extensions||[]]),content:i(gm),defined:[],document:i(ym),flow:i(km),lazy:{},string:i(Cm),text:i(Tm)};return n;function i(o){return s;function s(a){return Im(n,o,a)}}}function tf(t){for(;!Va(t););return t}var Om=/[\0\t\n\r]/g;function rf(){let t=1,e="",r=!0,n;return i;function i(o,s,a){let u=[],l,c,f,p,d;for(o=e+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),f=0,e="",r&&(o.charCodeAt(0)===65279&&f++,r=void 0);f<o.length;){if(Om.lastIndex=f,l=Om.exec(o),p=l&&l.index!==void 0?l.index:o.length,d=o.charCodeAt(p),!l){e=o.slice(f);break}if(d===10&&f===p&&n)u.push(-3),n=void 0;else switch(n&&(u.push(-5),n=void 0),f<p&&(u.push(o.slice(f,p)),t+=p-f),d){case 0:{u.push(65533),t++;break}case 9:{for(c=Math.ceil(t/4)*4,u.push(-2);t++<c;)u.push(-1);break}case 10:{u.push(-4),t=1;break}default:n=!0,t=1}f=p+1}return a&&(n&&u.push(-5),e&&u.push(e),u.push(null)),u}}var L_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ya(t){return t.replace(L_,M_)}function M_(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){let i=r.charCodeAt(1),o=i===120||i===88;return Ba(r.slice(o?2:1),o?16:10)}return oo(r)||t}function so(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?vm(t.position):"start"in t||"end"in t?vm(t):"line"in t||"column"in t?nf(t):""}function nf(t){return Dm(t&&t.line)+":"+Dm(t&&t.column)}function vm(t){return nf(t&&t.start)+"-"+nf(t&&t.end)}function Dm(t){return t&&typeof t=="number"?t:1}var Fm={}.hasOwnProperty;function of(t,e,r){return typeof e!="string"&&(r=e,e=void 0),B_(r)(tf(ef(r).document().write(rf()(t,e,!0))))}function B_(t){let e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(T),autolinkProtocol:be,autolinkEmail:be,atxHeading:o(A),blockQuote:o(me),characterEscape:be,characterReference:be,codeFenced:o(we),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(we,s),codeText:o(Fe,s),codeTextData:be,data:be,codeFlowValue:be,definition:o(ze),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Ut),hardBreakEscape:o(C),hardBreakTrailing:o(C),htmlFlow:o(M,s),htmlFlowData:be,htmlText:o(M,s),htmlTextData:be,image:o(O),label:s,link:o(T),listItem:o($),listItemValue:p,listOrdered:o(Y,f),listUnordered:o(Y),paragraph:o(te),reference:E,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(A),strong:o(lt),thematicBreak:o(kk)},exit:{atxHeading:u(),atxHeadingSequence:R,autolink:u(),autolinkEmail:fe,autolinkProtocol:oe,blockQuote:u(),characterEscapeValue:_,characterReferenceMarkerHexadecimal:Ke,characterReferenceMarkerNumeric:Ke,characterReferenceValue:ne,characterReference:he,codeFenced:u(g),codeFencedFence:y,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:_,codeIndented:u(b),codeText:u(j),codeTextData:_,data:_,definition:u(),definitionDestinationString:D,definitionLabelString:w,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(I),htmlFlowData:_,htmlText:u(P),htmlTextData:_,image:u(ee),label:rt,labelText:Se,lineEnding:L,link:u(ae),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:W,resourceDestinationString:x,resourceTitleString:Ue,resource:Je,setextHeading:u(ye),setextHeadingLineSequence:de,setextHeadingText:S,strong:u(),thematicBreak:u()}};Nm(e,(t||{}).mdastExtensions||[]);let r={};return n;function n(v){let B={type:"root",children:[]},Ee={stack:[B],tokenStack:[],config:e,enter:a,exit:l,buffer:s,resume:c,data:r},Oe=[],Ne=-1;for(;++Ne<v.length;)if(v[Ne][1].type==="listOrdered"||v[Ne][1].type==="listUnordered")if(v[Ne][0]==="enter")Oe.push(Ne);else{let dr=Oe.pop();Ne=i(v,dr,Ne)}for(Ne=-1;++Ne<v.length;){let dr=e[v[Ne][0]];Fm.call(dr,v[Ne][1].type)&&dr[v[Ne][1].type].call(Object.assign({sliceSerialize:v[Ne][2].sliceSerialize},Ee),v[Ne][1])}if(Ee.tokenStack.length>0){let dr=Ee.tokenStack[Ee.tokenStack.length-1];(dr[1]||Rm).call(Ee,void 0,dr[0])}for(B.position={start:kn(v.length>0?v[0][1].start:{line:1,column:1,offset:0}),end:kn(v.length>0?v[v.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<e.transforms.length;)B=e.transforms[Ne](B)||B;return B}function i(v,B,Ee){let Oe=B-1,Ne=-1,dr=!1,qn,qr,ts,rs;for(;++Oe<=Ee;){let Ht=v[Oe];switch(Ht[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ht[0]==="enter"?Ne++:Ne--,rs=void 0;break}case"lineEndingBlank":{Ht[0]==="enter"&&(qn&&!rs&&!Ne&&!ts&&(ts=Oe),rs=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:rs=void 0}if(!Ne&&Ht[0]==="enter"&&Ht[1].type==="listItemPrefix"||Ne===-1&&Ht[0]==="exit"&&(Ht[1].type==="listUnordered"||Ht[1].type==="listOrdered")){if(qn){let qi=Oe;for(qr=void 0;qi--;){let Vr=v[qi];if(Vr[1].type==="lineEnding"||Vr[1].type==="lineEndingBlank"){if(Vr[0]==="exit")continue;qr&&(v[qr][1].type="lineEndingBlank",dr=!0),Vr[1].type="lineEnding",qr=qi}else if(!(Vr[1].type==="linePrefix"||Vr[1].type==="blockQuotePrefix"||Vr[1].type==="blockQuotePrefixWhitespace"||Vr[1].type==="blockQuoteMarker"||Vr[1].type==="listItemIndent"))break}ts&&(!qr||ts<qr)&&(qn._spread=!0),qn.end=Object.assign({},qr?v[qr][1].start:Ht[1].end),v.splice(qr||Oe,0,["exit",qn,Ht[2]]),Oe++,Ee++}if(Ht[1].type==="listItemPrefix"){let qi={type:"listItem",_spread:!1,start:Object.assign({},Ht[1].start),end:void 0};qn=qi,v.splice(Oe,0,["enter",qi,Ht[2]]),Oe++,Ee++,ts=void 0,rs=!0}}}return v[B][1]._spread=dr,Ee}function o(v,B){return Ee;function Ee(Oe){a.call(this,v(Oe),Oe),B&&B.call(this,Oe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(v,B,Ee){this.stack[this.stack.length-1].children.push(v),this.stack.push(v),this.tokenStack.push([B,Ee||void 0]),v.position={start:kn(B.start),end:void 0}}function u(v){return B;function B(Ee){v&&v.call(this,Ee),l.call(this,Ee)}}function l(v,B){let Ee=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==v.type&&(B?B.call(this,v,Oe[0]):(Oe[1]||Rm).call(this,v,Oe[0]));else throw new Error("Cannot close `"+v.type+"` ("+so({start:v.start,end:v.end})+"): it\u2019s not open");Ee.position.end=kn(v.end)}function c(){return Jr(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(v){if(this.data.expectingFirstListItemValue){let B=this.stack[this.stack.length-2];B.start=Number.parseInt(this.sliceSerialize(v),10),this.data.expectingFirstListItemValue=void 0}}function d(){let v=this.resume(),B=this.stack[this.stack.length-1];B.lang=v}function m(){let v=this.resume(),B=this.stack[this.stack.length-1];B.meta=v}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let v=this.resume(),B=this.stack[this.stack.length-1];B.value=v.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let v=this.resume(),B=this.stack[this.stack.length-1];B.value=v.replace(/(\r?\n|\r)$/g,"")}function w(v){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=St(this.sliceSerialize(v)).toLowerCase()}function k(){let v=this.resume(),B=this.stack[this.stack.length-1];B.title=v}function D(){let v=this.resume(),B=this.stack[this.stack.length-1];B.url=v}function R(v){let B=this.stack[this.stack.length-1];if(!B.depth){let Ee=this.sliceSerialize(v).length;B.depth=Ee}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function de(v){let B=this.stack[this.stack.length-1];B.depth=this.sliceSerialize(v).codePointAt(0)===61?1:2}function ye(){this.data.setextHeadingSlurpLineEnding=void 0}function be(v){let Ee=this.stack[this.stack.length-1].children,Oe=Ee[Ee.length-1];(!Oe||Oe.type!=="text")&&(Oe=wt(),Oe.position={start:kn(v.start),end:void 0},Ee.push(Oe)),this.stack.push(Oe)}function _(v){let B=this.stack.pop();B.value+=this.sliceSerialize(v),B.position.end=kn(v.end)}function L(v){let B=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ee=B.children[B.children.length-1];Ee.position.end=kn(v.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(B.type)&&(be.call(this,v),_.call(this,v))}function F(){this.data.atHardBreak=!0}function I(){let v=this.resume(),B=this.stack[this.stack.length-1];B.value=v}function P(){let v=this.resume(),B=this.stack[this.stack.length-1];B.value=v}function j(){let v=this.resume(),B=this.stack[this.stack.length-1];B.value=v}function ae(){let v=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=B,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function ee(){let v=this.stack[this.stack.length-1];if(this.data.inReference){let B=this.data.referenceType||"shortcut";v.type+="Reference",v.referenceType=B,delete v.url,delete v.title}else delete v.identifier,delete v.label;this.data.referenceType=void 0}function Se(v){let B=this.sliceSerialize(v),Ee=this.stack[this.stack.length-2];Ee.label=Ya(B),Ee.identifier=St(B).toLowerCase()}function rt(){let v=this.stack[this.stack.length-1],B=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){let Oe=v.children;Ee.children=Oe}else Ee.alt=B}function x(){let v=this.resume(),B=this.stack[this.stack.length-1];B.url=v}function Ue(){let v=this.resume(),B=this.stack[this.stack.length-1];B.title=v}function Je(){this.data.inReference=void 0}function E(){this.data.referenceType="collapsed"}function W(v){let B=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=B,Ee.identifier=St(this.sliceSerialize(v)).toLowerCase(),this.data.referenceType="full"}function Ke(v){this.data.characterReferenceType=v.type}function ne(v){let B=this.sliceSerialize(v),Ee=this.data.characterReferenceType,Oe;Ee?(Oe=Ba(B,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=oo(B);let Ne=this.stack[this.stack.length-1];Ne.value+=Oe}function he(v){let B=this.stack.pop();B.position.end=kn(v.end)}function oe(v){_.call(this,v);let B=this.stack[this.stack.length-1];B.url=this.sliceSerialize(v)}function fe(v){_.call(this,v);let B=this.stack[this.stack.length-1];B.url="mailto:"+this.sliceSerialize(v)}function me(){return{type:"blockquote",children:[]}}function we(){return{type:"code",lang:null,meta:null,value:""}}function Fe(){return{type:"inlineCode",value:""}}function ze(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ut(){return{type:"emphasis",children:[]}}function A(){return{type:"heading",depth:0,children:[]}}function C(){return{type:"break"}}function M(){return{type:"html",value:""}}function O(){return{type:"image",title:null,url:"",alt:null}}function T(){return{type:"link",title:null,url:"",children:[]}}function Y(v){return{type:"list",ordered:v.type==="listOrdered",start:null,spread:v._spread,children:[]}}function $(v){return{type:"listItem",spread:v._spread,checked:null,children:[]}}function te(){return{type:"paragraph",children:[]}}function lt(){return{type:"strong",children:[]}}function wt(){return{type:"text",value:""}}function kk(){return{type:"thematicBreak"}}}function kn(t){return{line:t.line,column:t.column,offset:t.offset}}function Nm(t,e){let r=-1;for(;++r<e.length;){let n=e[r];Array.isArray(n)?Nm(t,n):j_(t,n)}}function j_(t,e){let r;for(r in e)if(Fm.call(e,r))switch(r){case"canContainEols":{let n=e[r];n&&t[r].push(...n);break}case"transforms":{let n=e[r];n&&t[r].push(...n);break}case"enter":case"exit":{let n=e[r];n&&Object.assign(t[r],n);break}}}function Rm(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+so({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+so({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+so({start:e.start,end:e.end})+") is still open")}function Za(t){let e=this;e.parser=r;function r(n){return of(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}var Pm={}.hasOwnProperty;function Lm(t,e){let r=e||{};function n(i,...o){let s=n.invalid,a=n.handlers;if(i&&Pm.call(i,t)){let u=String(i[t]);s=Pm.call(a,u)?a[u]:n.unknown}if(s)return s.call(this,i,...o)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}var U_={}.hasOwnProperty;function sf(t,e){let r=-1,n;if(e.extensions)for(;++r<e.extensions.length;)sf(t,e.extensions[r]);for(n in e)if(U_.call(e,n))switch(n){case"extensions":break;case"unsafe":{Mm(t[n],e[n]);break}case"join":{Mm(t[n],e[n]);break}case"handlers":{z_(t[n],e[n]);break}default:t.options[n]=e[n]}return t}function Mm(t,e){e&&t.push(...e)}function z_(t,e){e&&Object.assign(t,e)}function Bm(t,e,r,n){let i=r.enter("blockquote"),o=r.createTracker(n);o.move("> "),o.shift(2);let s=r.indentLines(r.containerFlow(t,o.current()),$_);return i(),s}function $_(t,e,r){return">"+(r?"":" ")+t}function Xa(t,e){return jm(t,e.inConstruct,!0)&&!jm(t,e.notInConstruct,!1)}function jm(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++n<e.length;)if(t.includes(e[n]))return!0;return!1}function af(t,e,r,n){let i=-1;for(;++i<r.unsafe.length;)if(r.unsafe[i].character===`
71
+ `&&Xa(r.stack,r.unsafe[i]))return/[ \t]/.test(n.before)?"":" ";return`\\
72
+ `}function Um(t,e){let r=String(t),n=r.indexOf(e),i=n,o=0,s=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===i?++o>s&&(s=o):o=1,i=n+e.length,n=r.indexOf(e,i);return s}function ys(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function zm(t){let e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function $m(t,e,r,n){let i=zm(r),o=t.value||"",s=i==="`"?"GraveAccent":"Tilde";if(ys(t,r)){let f=r.enter("codeIndented"),p=r.indentLines(o,q_);return f(),p}let a=r.createTracker(n),u=i.repeat(Math.max(Um(o,i)+1,3)),l=r.enter("codeFenced"),c=a.move(u);if(t.lang){let f=r.enter(`codeFencedLang${s}`);c+=a.move(r.safe(t.lang,{before:c,after:" ",encode:["`"],...a.current()})),f()}if(t.lang&&t.meta){let f=r.enter(`codeFencedMeta${s}`);c+=a.move(" "),c+=a.move(r.safe(t.meta,{before:c,after:`
73
73
  `,encode:["`"],...a.current()})),f()}return c+=a.move(`
74
74
  `),o&&(c+=a.move(o+`
75
- `)),c+=a.move(u),l(),c}function G_(t,e,r){return(r?"":" ")+t}function oo(t){let e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function Hm(t,e,r,n){let i=oo(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("definition"),a=r.enter("label"),u=r.createTracker(n),l=u.move("[");return l+=u.move(r.safe(r.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":`
76
- `,...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function Km(t){let e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function er(t){return"&#x"+t.toString(16).toUpperCase()+";"}function so(t,e,r){let n=Jr(t),i=Jr(e);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===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}}ff.peek=W_;function ff(t,e,r,n){let i=Km(r),o=r.enter("emphasis"),s=r.createTracker(n),a=s.move(i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=so(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=er(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=so(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+er(f));let d=s.move(i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function W_(t,e,r){return r.options.emphasis||"*"}var vr=function(t){if(t==null)return Z_;if(typeof t=="function")return Qa(t);if(typeof t=="object")return Array.isArray(t)?H_(t):K_(t);if(typeof t=="string")return Y_(t);throw new Error("Expected function, string, or object as test")};function H_(t){let e=[],r=-1;for(;++r<t.length;)e[r]=vr(t[r]);return Qa(n);function n(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function K_(t){let e=t;return Qa(r);function r(n){let i=n,o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function Y_(t){return Qa(e);function e(r){return r&&r.type===t}}function Qa(t){return e;function e(r,n,i){return!!(X_(r)&&t.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function Z_(){return!0}function X_(t){return t!==null&&typeof t=="object"&&"type"in t}function Ym(t){return"\x1B[33m"+t+"\x1B[39m"}var Zm=[],eu=!0,Ci=!1,tu="skip";function bs(t,e,r,n){let i;typeof e=="function"&&typeof r!="function"?(n=r,r=e):i=e;let o=vr(i),s=n?-1:1;a(t,void 0,[])();function a(u,l,c){let f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){let d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+Ym(u.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=Zm,m,y,g;if((!e||o(u,l,c[c.length-1]||void 0))&&(d=J_(r(u,c)),d[0]===Ci))return d;if("children"in u&&u.children){let b=u;if(b.children&&d[0]!==tu)for(y=(n?b.children.length:-1)+s,g=c.concat(b);y>-1&&y<b.children.length;){let C=b.children[y];if(m=a(C,y,g)(),m[0]===Ci)return m;y=typeof m[1]=="number"?m[1]:y+s}}return d}}}function J_(t){return Array.isArray(t)?t:typeof t=="number"?[eu,t]:t==null?Zm:[t]}function Es(t,e,r,n){let i,o,s;typeof e=="function"&&typeof r!="function"?(o=void 0,s=e,i=r):(o=e,s=r,i=n),bs(t,o,a,i);function a(u,l){let c=l[l.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}function ru(t,e){let r=!1;return Es(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,Ci}),!!((!t.depth||t.depth<3)&&Xr(t)&&(e.options.setext||r))}function Xm(t,e,r,n){let i=Math.max(Math.min(6,t.depth||1),1),o=r.createTracker(n);if(ru(t,r)){let c=r.enter("headingSetext"),f=r.enter("phrasing"),p=r.containerPhrasing(t,{...o.current(),before:`
75
+ `)),c+=a.move(u),l(),c}function q_(t,e,r){return(r?"":" ")+t}function ao(t){let e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function qm(t,e,r,n){let i=ao(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("definition"),a=r.enter("label"),u=r.createTracker(n),l=u.move("[");return l+=u.move(r.safe(r.associationId(t),{before:l,after:"]",...u.current()})),l+=u.move("]: "),a(),!t.url||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":`
76
+ `,...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),s(),l}function Vm(t){let e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function Qt(t){return"&#x"+t.toString(16).toUpperCase()+";"}function uo(t,e,r){let n=Qr(t),i=Qr(e);return n===void 0?i===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===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}}uf.peek=V_;function uf(t,e,r,n){let i=Vm(r),o=r.enter("emphasis"),s=r.createTracker(n),a=s.move(i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=uo(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=Qt(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=uo(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+Qt(f));let d=s.move(i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function V_(t,e,r){return r.options.emphasis||"*"}var Or=(function(t){if(t==null)return K_;if(typeof t=="function")return Ja(t);if(typeof t=="object")return Array.isArray(t)?G_(t):W_(t);if(typeof t=="string")return H_(t);throw new Error("Expected function, string, or object as test")});function G_(t){let e=[],r=-1;for(;++r<t.length;)e[r]=Or(t[r]);return Ja(n);function n(...i){let o=-1;for(;++o<e.length;)if(e[o].apply(this,i))return!0;return!1}}function W_(t){let e=t;return Ja(r);function r(n){let i=n,o;for(o in t)if(i[o]!==e[o])return!1;return!0}}function H_(t){return Ja(e);function e(r){return r&&r.type===t}}function Ja(t){return e;function e(r,n,i){return!!(Y_(r)&&t.call(this,r,typeof n=="number"?n:void 0,i||void 0))}}function K_(){return!0}function Y_(t){return t!==null&&typeof t=="object"&&"type"in t}function Gm(t){return"\x1B[33m"+t+"\x1B[39m"}var Wm=[],Qa=!0,Ti=!1,eu="skip";function bs(t,e,r,n){let i;typeof e=="function"&&typeof r!="function"?(n=r,r=e):i=e;let o=Or(i),s=n?-1:1;a(t,void 0,[])();function a(u,l,c){let f=u&&typeof u=="object"?u:{};if(typeof f.type=="string"){let d=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(p,"name",{value:"node ("+Gm(u.type+(d?"<"+d+">":""))+")"})}return p;function p(){let d=Wm,m,y,g;if((!e||o(u,l,c[c.length-1]||void 0))&&(d=Z_(r(u,c)),d[0]===Ti))return d;if("children"in u&&u.children){let b=u;if(b.children&&d[0]!==eu)for(y=(n?b.children.length:-1)+s,g=c.concat(b);y>-1&&y<b.children.length;){let w=b.children[y];if(m=a(w,y,g)(),m[0]===Ti)return m;y=typeof m[1]=="number"?m[1]:y+s}}return d}}}function Z_(t){return Array.isArray(t)?t:typeof t=="number"?[Qa,t]:t==null?Wm:[t]}function Es(t,e,r,n){let i,o,s;typeof e=="function"&&typeof r!="function"?(o=void 0,s=e,i=r):(o=e,s=r,i=n),bs(t,o,a,i);function a(u,l){let c=l[l.length-1],f=c?c.children.indexOf(u):void 0;return s(u,f,c)}}function tu(t,e){let r=!1;return Es(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,Ti}),!!((!t.depth||t.depth<3)&&Jr(t)&&(e.options.setext||r))}function Hm(t,e,r,n){let i=Math.max(Math.min(6,t.depth||1),1),o=r.createTracker(n);if(tu(t,r)){let c=r.enter("headingSetext"),f=r.enter("phrasing"),p=r.containerPhrasing(t,{...o.current(),before:`
77
77
  `,after:`
78
78
  `});return f(),c(),p+`
79
79
  `+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
80
80
  `))+1))}let s="#".repeat(i),a=r.enter("headingAtx"),u=r.enter("phrasing");o.move(s+" ");let l=r.containerPhrasing(t,{before:"# ",after:`
81
- `,...o.current()});return/^[\t ]/.test(l)&&(l=er(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,r.options.closeAtx&&(l+=" "+s),u(),a(),l}pf.peek=Q_;function pf(t){return t.value||""}function Q_(){return"<"}df.peek=eS;function df(t,e,r,n){let i=oo(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("image"),a=r.enter("label"),u=r.createTracker(n),l=u.move("![");return l+=u.move(r.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),s(),l}function eS(){return"!"}hf.peek=tS;function hf(t,e,r,n){let i=t.referenceType,o=r.enter("imageReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("!["),l=r.safe(t.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function tS(){return"!"}mf.peek=rS;function mf(t,e,r){let n=t.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<r.unsafe.length;){let s=r.unsafe[o],a=r.compilePattern(s),u;if(s.atBreak)for(;u=a.exec(n);){let l=u.index;n.charCodeAt(l)===10&&n.charCodeAt(l-1)===13&&l--,n=n.slice(0,l)+" "+n.slice(u.index+1)}}return i+n+i}function rS(){return"`"}function gf(t,e){let r=Xr(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}xf.peek=nS;function xf(t,e,r,n){let i=oo(r),o=i==='"'?"Quote":"Apostrophe",s=r.createTracker(n),a,u;if(gf(t,r)){let c=r.stack;r.stack=[],a=r.enter("autolink");let f=s.move("<");return f+=s.move(r.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),r.stack=c,f}a=r.enter("link"),u=r.enter("label");let l=s.move("[");return l+=s.move(r.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=r.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(r.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=r.enter("destinationRaw"),l+=s.move(r.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),u(),t.title&&(u=r.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(r.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),a(),l}function nS(t,e,r){return gf(t,r)?"<":"["}yf.peek=iS;function yf(t,e,r,n){let i=t.referenceType,o=r.enter("linkReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("["),l=r.containerPhrasing(t,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function iS(){return"["}function ao(t){let e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Jm(t){let e=ao(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Qm(t){let e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function nu(t){let e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function eg(t,e,r,n){let i=r.enter("list"),o=r.bulletCurrent,s=t.ordered?Qm(r):ao(r),a=t.ordered?s==="."?")":".":Jm(r),u=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){let c=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(u=!0),nu(r)===s&&c){let f=-1;for(;++f<t.children.length;){let p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),r.bulletCurrent=s;let l=r.containerFlow(t,n);return r.bulletLastUsed=s,r.bulletCurrent=o,i(),l}function tg(t){let e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function rg(t,e,r,n){let i=tg(r),o=r.bulletCurrent||ao(r);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);let a=r.createTracker(n);a.move(o+" ".repeat(s-o.length)),a.shift(s);let u=r.enter("listItem"),l=r.indentLines(r.containerFlow(t,a.current()),c);return u(),l;function c(f,p,d){return p?(d?"":" ".repeat(s))+f:(d?o:o+" ".repeat(s-o.length))+f}}function ng(t,e,r,n){let i=r.enter("paragraph"),o=r.enter("phrasing"),s=r.containerPhrasing(t,n);return o(),i(),s}var bf=vr(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ig(t,e,r,n){return(t.children.some(function(s){return bf(s)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function og(t){let e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}Ef.peek=oS;function Ef(t,e,r,n){let i=og(r),o=r.enter("strong"),s=r.createTracker(n),a=s.move(i+i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=so(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=er(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=so(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+er(f));let d=s.move(i+i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function oS(t,e,r){return r.options.strong||"*"}function sg(t,e,r,n){return r.safe(t.value,n)}function ag(t){let e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function ug(t,e,r){let n=(nu(r)+(r.options.ruleSpaces?" ":"")).repeat(ag(r));return r.options.ruleSpaces?n.slice(0,-1):n}var ki={blockquote:$m,break:cf,code:Wm,definition:Hm,emphasis:ff,hardBreak:cf,heading:Xm,html:pf,image:df,imageReference:hf,inlineCode:mf,link:xf,linkReference:yf,list:eg,listItem:rg,paragraph:ng,root:ig,strong:Ef,text:sg,thematicBreak:ug};var lg=[sS];function sS(t,e,r,n){if(e.type==="code"&&ys(e,n)&&(t.type==="list"||t.type===e.type&&ys(t,n)))return!1;if("spread"in r&&typeof r.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&ru(e,n))?void 0:r.spread?1:0}var Ti=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],cg=[{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:`
82
- `,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:Ti},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
83
- ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Ti},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
84
- *])`},{character:"*",inConstruct:"phrasing",notInConstruct:Ti},{atBreak:!0,character:"+",after:`(?:[ \r
81
+ `,...o.current()});return/^[\t ]/.test(l)&&(l=Qt(l.charCodeAt(0))+l.slice(1)),l=l?s+" "+l:s,r.options.closeAtx&&(l+=" "+s),u(),a(),l}lf.peek=X_;function lf(t){return t.value||""}function X_(){return"<"}cf.peek=J_;function cf(t,e,r,n){let i=ao(r),o=i==='"'?"Quote":"Apostrophe",s=r.enter("image"),a=r.enter("label"),u=r.createTracker(n),l=u.move("![");return l+=u.move(r.safe(t.alt,{before:l,after:"]",...u.current()})),l+=u.move("]("),a(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(a=r.enter("destinationLiteral"),l+=u.move("<"),l+=u.move(r.safe(t.url,{before:l,after:">",...u.current()})),l+=u.move(">")):(a=r.enter("destinationRaw"),l+=u.move(r.safe(t.url,{before:l,after:t.title?" ":")",...u.current()}))),a(),t.title&&(a=r.enter(`title${o}`),l+=u.move(" "+i),l+=u.move(r.safe(t.title,{before:l,after:i,...u.current()})),l+=u.move(i),a()),l+=u.move(")"),s(),l}function J_(){return"!"}ff.peek=Q_;function ff(t,e,r,n){let i=t.referenceType,o=r.enter("imageReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("!["),l=r.safe(t.alt,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function Q_(){return"!"}pf.peek=eS;function pf(t,e,r){let n=t.value||"",i="`",o=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(n);)i+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++o<r.unsafe.length;){let s=r.unsafe[o],a=r.compilePattern(s),u;if(s.atBreak)for(;u=a.exec(n);){let l=u.index;n.charCodeAt(l)===10&&n.charCodeAt(l-1)===13&&l--,n=n.slice(0,l)+" "+n.slice(u.index+1)}}return i+n+i}function eS(){return"`"}function df(t,e){let r=Jr(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}hf.peek=tS;function hf(t,e,r,n){let i=ao(r),o=i==='"'?"Quote":"Apostrophe",s=r.createTracker(n),a,u;if(df(t,r)){let c=r.stack;r.stack=[],a=r.enter("autolink");let f=s.move("<");return f+=s.move(r.containerPhrasing(t,{before:f,after:">",...s.current()})),f+=s.move(">"),a(),r.stack=c,f}a=r.enter("link"),u=r.enter("label");let l=s.move("[");return l+=s.move(r.containerPhrasing(t,{before:l,after:"](",...s.current()})),l+=s.move("]("),u(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(u=r.enter("destinationLiteral"),l+=s.move("<"),l+=s.move(r.safe(t.url,{before:l,after:">",...s.current()})),l+=s.move(">")):(u=r.enter("destinationRaw"),l+=s.move(r.safe(t.url,{before:l,after:t.title?" ":")",...s.current()}))),u(),t.title&&(u=r.enter(`title${o}`),l+=s.move(" "+i),l+=s.move(r.safe(t.title,{before:l,after:i,...s.current()})),l+=s.move(i),u()),l+=s.move(")"),a(),l}function tS(t,e,r){return df(t,r)?"<":"["}mf.peek=rS;function mf(t,e,r,n){let i=t.referenceType,o=r.enter("linkReference"),s=r.enter("label"),a=r.createTracker(n),u=a.move("["),l=r.containerPhrasing(t,{before:u,after:"]",...a.current()});u+=a.move(l+"]["),s();let c=r.stack;r.stack=[],s=r.enter("reference");let f=r.safe(r.associationId(t),{before:u,after:"]",...a.current()});return s(),r.stack=c,o(),i==="full"||!l||l!==f?u+=a.move(f+"]"):i==="shortcut"?u=u.slice(0,-1):u+=a.move("]"),u}function rS(){return"["}function lo(t){let e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Km(t){let e=lo(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Ym(t){let e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function ru(t){let e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Zm(t,e,r,n){let i=r.enter("list"),o=r.bulletCurrent,s=t.ordered?Ym(r):lo(r),a=t.ordered?s==="."?")":".":Km(r),u=e&&r.bulletLastUsed?s===r.bulletLastUsed:!1;if(!t.ordered){let c=t.children?t.children[0]:void 0;if((s==="*"||s==="-")&&c&&(!c.children||!c.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(u=!0),ru(r)===s&&c){let f=-1;for(;++f<t.children.length;){let p=t.children[f];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){u=!0;break}}}}u&&(s=a),r.bulletCurrent=s;let l=r.containerFlow(t,n);return r.bulletLastUsed=s,r.bulletCurrent=o,i(),l}function Xm(t){let e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function Jm(t,e,r,n){let i=Xm(r),o=r.bulletCurrent||lo(r);e&&e.type==="list"&&e.ordered&&(o=(typeof e.start=="number"&&e.start>-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(s=Math.ceil(s/4)*4);let a=r.createTracker(n);a.move(o+" ".repeat(s-o.length)),a.shift(s);let u=r.enter("listItem"),l=r.indentLines(r.containerFlow(t,a.current()),c);return u(),l;function c(f,p,d){return p?(d?"":" ".repeat(s))+f:(d?o:o+" ".repeat(s-o.length))+f}}function Qm(t,e,r,n){let i=r.enter("paragraph"),o=r.enter("phrasing"),s=r.containerPhrasing(t,n);return o(),i(),s}var gf=Or(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function eg(t,e,r,n){return(t.children.some(function(s){return gf(s)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function tg(t){let e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}xf.peek=nS;function xf(t,e,r,n){let i=tg(r),o=r.enter("strong"),s=r.createTracker(n),a=s.move(i+i),u=s.move(r.containerPhrasing(t,{after:i,before:a,...s.current()})),l=u.charCodeAt(0),c=uo(n.before.charCodeAt(n.before.length-1),l,i);c.inside&&(u=Qt(l)+u.slice(1));let f=u.charCodeAt(u.length-1),p=uo(n.after.charCodeAt(0),f,i);p.inside&&(u=u.slice(0,-1)+Qt(f));let d=s.move(i+i);return o(),r.attentionEncodeSurroundingInfo={after:p.outside,before:c.outside},a+u+d}function nS(t,e,r){return r.options.strong||"*"}function rg(t,e,r,n){return r.safe(t.value,n)}function ng(t){let e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function ig(t,e,r){let n=(ru(r)+(r.options.ruleSpaces?" ":"")).repeat(ng(r));return r.options.ruleSpaces?n.slice(0,-1):n}var _i={blockquote:Bm,break:af,code:$m,definition:qm,emphasis:uf,hardBreak:af,heading:Hm,html:lf,image:cf,imageReference:ff,inlineCode:pf,link:hf,linkReference:mf,list:Zm,listItem:Jm,paragraph:Qm,root:eg,strong:xf,text:rg,thematicBreak:ig};var og=[iS];function iS(t,e,r,n){if(e.type==="code"&&ys(e,n)&&(t.type==="list"||t.type===e.type&&ys(t,n)))return!1;if("spread"in r&&typeof r.spread=="boolean")return t.type==="paragraph"&&(t.type===e.type||e.type==="definition"||e.type==="heading"&&tu(e,n))?void 0:r.spread?1:0}var Si=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],sg=[{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:`
82
+ `,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:Si},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
83
+ ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:Si},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
84
+ *])`},{character:"*",inConstruct:"phrasing",notInConstruct:Si},{atBreak:!0,character:"+",after:`(?:[ \r
85
85
  ])`},{atBreak:!0,character:"-",after:`(?:[ \r
86
86
  -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
87
- ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Ti},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Ti},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Ti},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Ti},{atBreak:!0,character:"~"}];function fg(t){return t.label||!t.identifier?t.label||"":Za(t.identifier)}function pg(t){if(!t._compiled){let e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function dg(t,e,r){let n=e.indexStack,i=t.children||[],o=[],s=-1,a=r.before,u;n.push(-1);let l=e.createTracker(r);for(;++s<i.length;){let c=i[s],f;if(n[n.length-1]=s,s+1<i.length){let m=e.handle.handlers[i[s+1].type];m&&m.peek&&(m=m.peek),f=m?m(i[s+1],t,e,{before:"",after:"",...l.current()}).charAt(0):""}else f=r.after;o.length>0&&(a==="\r"||a===`
88
- `)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=e.createTracker(r),l.move(o.join("")));let p=e.handle(c,t,e,{...l.current(),after:f,before:a});u&&u===p.slice(0,1)&&(p=er(u.charCodeAt(0))+p.slice(1));let d=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,u=void 0,d&&(o.length>0&&d.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+er(a.charCodeAt(0))),d.after&&(u=f)),l.move(p),o.push(p),a=p.slice(-1)}return n.pop(),o.join("")}function hg(t,e,r){let n=e.indexStack,i=t.children||[],o=e.createTracker(r),s=[],a=-1;for(n.push(-1);++a<i.length;){let u=i[a];n[n.length-1]=a,s.push(o.move(e.handle(u,t,e,{before:`
87
+ ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:Si},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:Si},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:Si},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:Si},{atBreak:!0,character:"~"}];function ag(t){return t.label||!t.identifier?t.label||"":Ya(t.identifier)}function ug(t){if(!t._compiled){let e=(t.atBreak?"[\\r\\n][\\t ]*":"")+(t.before?"(?:"+t.before+")":"");t._compiled=new RegExp((e?"("+e+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(t.after?"(?:"+t.after+")":""),"g")}return t._compiled}function lg(t,e,r){let n=e.indexStack,i=t.children||[],o=[],s=-1,a=r.before,u;n.push(-1);let l=e.createTracker(r);for(;++s<i.length;){let c=i[s],f;if(n[n.length-1]=s,s+1<i.length){let m=e.handle.handlers[i[s+1].type];m&&m.peek&&(m=m.peek),f=m?m(i[s+1],t,e,{before:"",after:"",...l.current()}).charAt(0):""}else f=r.after;o.length>0&&(a==="\r"||a===`
88
+ `)&&c.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),a=" ",l=e.createTracker(r),l.move(o.join("")));let p=e.handle(c,t,e,{...l.current(),after:f,before:a});u&&u===p.slice(0,1)&&(p=Qt(u.charCodeAt(0))+p.slice(1));let d=e.attentionEncodeSurroundingInfo;e.attentionEncodeSurroundingInfo=void 0,u=void 0,d&&(o.length>0&&d.before&&a===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+Qt(a.charCodeAt(0))),d.after&&(u=f)),l.move(p),o.push(p),a=p.slice(-1)}return n.pop(),o.join("")}function cg(t,e,r){let n=e.indexStack,i=t.children||[],o=e.createTracker(r),s=[],a=-1;for(n.push(-1);++a<i.length;){let u=i[a];n[n.length-1]=a,s.push(o.move(e.handle(u,t,e,{before:`
89
89
  `,after:`
90
- `,...o.current()}))),u.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(aS(u,i[a+1],t,e)))}return n.pop(),s.join("")}function aS(t,e,r,n){let i=n.join.length;for(;i--;){let o=n.join[i](t,e,r,n);if(o===!0||o===1)break;if(typeof o=="number")return`
90
+ `,...o.current()}))),u.type!=="list"&&(e.bulletLastUsed=void 0),a<i.length-1&&s.push(o.move(oS(u,i[a+1],t,e)))}return n.pop(),s.join("")}function oS(t,e,r,n){let i=n.join.length;for(;i--;){let o=n.join[i](t,e,r,n);if(o===!0||o===1)break;if(typeof o=="number")return`
91
91
  `.repeat(1+o);if(o===!1)return`
92
92
 
93
93
  <!---->
94
94
 
95
95
  `}return`
96
96
 
97
- `}var uS=/\r?\n|\r/g;function mg(t,e){let r=[],n=0,i=0,o;for(;o=uS.exec(t);)s(t.slice(n,o.index)),r.push(o[0]),n=o.index+o[0].length,i++;return s(t.slice(n)),r.join("");function s(a){r.push(e(a,i,!a))}}function xg(t,e,r){let n=(r.before||"")+(e||"")+(r.after||""),i=[],o=[],s={},a=-1;for(;++a<t.unsafe.length;){let c=t.unsafe[a];if(!Ja(t.stack,c))continue;let f=t.compilePattern(c),p;for(;p=f.exec(n);){let d="before"in c||!!c.atBreak,m="after"in c,y=p.index+(d?p[1].length:0);i.includes(y)?(s[y].before&&!d&&(s[y].before=!1),s[y].after&&!m&&(s[y].after=!1)):(i.push(y),s[y]={before:d,after:m})}}i.sort(lS);let u=r.before?r.before.length:0,l=n.length-(r.after?r.after.length:0);for(a=-1;++a<i.length;){let c=i[a];c<u||c>=l||c+1<l&&i[a+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[a-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(u!==c&&o.push(gg(n.slice(u,c),"\\")),u=c,/[!-/:-@[-`{-~]/.test(n.charAt(c))&&(!r.encode||!r.encode.includes(n.charAt(c)))?o.push("\\"):(o.push(er(n.charCodeAt(c))),u++))}return o.push(gg(n.slice(u,l),r.after)),o.join("")}function lS(t,e){return t-e}function gg(t,e){let r=/\\(?=[!-/:-@[-`{-~])/g,n=[],i=[],o=t+e,s=-1,a=0,u;for(;u=r.exec(o);)n.push(u.index);for(;++s<n.length;)a!==n[s]&&i.push(t.slice(a,n[s])),i.push("\\"),a=n[s];return i.push(t.slice(a)),i.join("")}function yg(t){let e=t||{},r=e.now||{},n=e.lineShift||0,i=r.line||1,o=r.column||1;return{move:u,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:n}}function a(l){n+=l}function u(l){let c=l||"",f=c.split(/\r?\n|\r/g),p=f[f.length-1];return i+=f.length-1,o=f.length===1?o+p.length:1+p.length+n,c}}function Af(t,e){let r=e||{},n={associationId:fg,containerPhrasing:dS,containerFlow:hS,createTracker:yg,compilePattern:pg,enter:o,handlers:{...ki},handle:void 0,indentLines:mg,indexStack:[],join:[...lg],options:{},safe:mS,stack:[],unsafe:[...cg]};lf(n,r),n.options.tightDefinitions&&n.join.push(pS),n.handle=Um("type",{invalid:cS,unknown:fS,handlers:n.handlers});let i=n.handle(t,void 0,n,{before:`
97
+ `}var sS=/\r?\n|\r/g;function fg(t,e){let r=[],n=0,i=0,o;for(;o=sS.exec(t);)s(t.slice(n,o.index)),r.push(o[0]),n=o.index+o[0].length,i++;return s(t.slice(n)),r.join("");function s(a){r.push(e(a,i,!a))}}function dg(t,e,r){let n=(r.before||"")+(e||"")+(r.after||""),i=[],o=[],s={},a=-1;for(;++a<t.unsafe.length;){let c=t.unsafe[a];if(!Xa(t.stack,c))continue;let f=t.compilePattern(c),p;for(;p=f.exec(n);){let d="before"in c||!!c.atBreak,m="after"in c,y=p.index+(d?p[1].length:0);i.includes(y)?(s[y].before&&!d&&(s[y].before=!1),s[y].after&&!m&&(s[y].after=!1)):(i.push(y),s[y]={before:d,after:m})}}i.sort(aS);let u=r.before?r.before.length:0,l=n.length-(r.after?r.after.length:0);for(a=-1;++a<i.length;){let c=i[a];c<u||c>=l||c+1<l&&i[a+1]===c+1&&s[c].after&&!s[c+1].before&&!s[c+1].after||i[a-1]===c-1&&s[c].before&&!s[c-1].before&&!s[c-1].after||(u!==c&&o.push(pg(n.slice(u,c),"\\")),u=c,/[!-/:-@[-`{-~]/.test(n.charAt(c))&&(!r.encode||!r.encode.includes(n.charAt(c)))?o.push("\\"):(o.push(Qt(n.charCodeAt(c))),u++))}return o.push(pg(n.slice(u,l),r.after)),o.join("")}function aS(t,e){return t-e}function pg(t,e){let r=/\\(?=[!-/:-@[-`{-~])/g,n=[],i=[],o=t+e,s=-1,a=0,u;for(;u=r.exec(o);)n.push(u.index);for(;++s<n.length;)a!==n[s]&&i.push(t.slice(a,n[s])),i.push("\\"),a=n[s];return i.push(t.slice(a)),i.join("")}function hg(t){let e=t||{},r=e.now||{},n=e.lineShift||0,i=r.line||1,o=r.column||1;return{move:u,current:s,shift:a};function s(){return{now:{line:i,column:o},lineShift:n}}function a(l){n+=l}function u(l){let c=l||"",f=c.split(/\r?\n|\r/g),p=f[f.length-1];return i+=f.length-1,o=f.length===1?o+p.length:1+p.length+n,c}}function yf(t,e){let r=e||{},n={associationId:ag,containerPhrasing:fS,containerFlow:pS,createTracker:hg,compilePattern:ug,enter:o,handlers:{..._i},handle:void 0,indentLines:fg,indexStack:[],join:[...og],options:{},safe:dS,stack:[],unsafe:[...sg]};sf(n,r),n.options.tightDefinitions&&n.join.push(cS),n.handle=Lm("type",{invalid:uS,unknown:lS,handlers:n.handlers});let i=n.handle(t,void 0,n,{before:`
98
98
  `,after:`
99
99
  `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
100
- `),i;function o(s){return n.stack.push(s),a;function a(){n.stack.pop()}}}function cS(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function fS(t){let e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function pS(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function dS(t,e){return dg(t,this,e)}function hS(t,e){return hg(t,this,e)}function mS(t,e){return xg(this,t,e)}function iu(t){let e=this;e.compiler=r;function r(n){return Af(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function wf(t){if(t)throw t}var au=ts(Sg(),1);function As(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Cf(){let t=[],e={run:r,use:n};return e;function r(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=t[++o],f=-1;if(u){s(u);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,c?vg(c,a)(...l):s(null,...l)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function vg(t,e){let r;return n;function n(...s){let a=t.length>s.length,u;a&&s.push(i);try{u=t.apply(this,s)}catch(l){let c=l;if(a&&r)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){r||(r=!0,e(s,...a))}function o(s){i(null,s)}}import{VFile as gS}from"vfile";var Ig=function(t){let n=this.constructor.prototype,i=n[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,n),o};var xS={}.hasOwnProperty,Sf=class t extends Ig{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=Cf()}copy(){let e=new t,r=-1;for(;++r<this.attachers.length;){let n=this.attachers[r];e.use(...n)}return e.data((0,au.default)(!0,{},this.namespace)),e}data(e,r){return typeof e=="string"?arguments.length===2?(_f("data",this.frozen),this.namespace[e]=r,this):xS.call(this.namespace,e)&&this.namespace[e]||void 0:e?(_f("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[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let i=r.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let r=su(e),n=this.parser||this.Parser;return kf("parse",n),n(String(r),r)}process(e,r){let n=this;return this.freeze(),kf("process",this.parser||this.Parser),Tf("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(o,s){let a=su(e),u=n.parse(a);n.run(u,a,function(c,f,p){if(c||!f||!p)return l(c);let d=f,m=n.stringify(d,p);bS(m)?p.value=m:p.result=m,l(c,p)});function l(c,f){c||!f?s(c):o?o(f):r(void 0,f)}}}processSync(e){let r=!1,n;return this.freeze(),kf("processSync",this.parser||this.Parser),Tf("processSync",this.compiler||this.Compiler),this.process(e,i),Dg("processSync","process",r),n;function i(o,s){r=!0,wf(o),n=s}}run(e,r,n){Og(e),this.freeze();let i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?o(void 0,n):new Promise(o);function o(s,a){let u=su(r);i.run(e,u,l);function l(c,f,p){let d=f||e;c?a(c):s?s(d):n(void 0,d,p)}}}runSync(e,r){let n=!1,i;return this.run(e,r,o),Dg("runSync","run",n),i;function o(s,a){wf(s),i=a,n=!0}}stringify(e,r){this.freeze();let n=su(r),i=this.compiler||this.Compiler;return Tf("stringify",i),Og(e),i(e,n)}use(e,...r){let n=this.attachers,i=this.namespace;if(_f("use",this.frozen),e!=null)if(typeof e=="function")u(e,r);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;u(c,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new 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");a(l.plugins),l.settings&&(i.settings=(0,au.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,p=-1;for(;++f<n.length;)if(n[f][0]===l){p=f;break}if(p===-1)n.push([l,...c]);else if(c.length>0){let[d,...m]=c,y=n[p][1];As(y)&&As(d)&&(d=(0,au.default)(!0,y,d)),n[p]=[l,d,...m]}}}},vf=new Sf().freeze();function kf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Tf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function _f(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Og(t){if(!As(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Dg(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function su(t){return yS(t)?t:new gS(t)}function yS(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function bS(t){return typeof t=="string"||ES(t)}function ES(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var uo=vf().use(Xa).use(iu).freeze();function If(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(e);for(;i!==-1;)n++,i=r.indexOf(e,i+e.length);return n}function Of(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Df(t,e,r){let i=vr((r||{}).ignore||[]),o=AS(e),s=-1;for(;++s<o.length;)bs(t,"text",a);function a(l,c){let f=-1,p;for(;++f<c.length;){let d=c[f],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return u(l,c)}function u(l,c){let f=c[c.length-1],p=o[s][0],d=o[s][1],m=0,g=f.children.indexOf(l),b=!1,C=[];p.lastIndex=0;let w=p.exec(l.value);for(;w;){let D=w.index,R={index:w.index,input:w.input,stack:[...c,l]},S=d(...w,R);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=D+1:(m!==D&&C.push({type:"text",value:l.value.slice(m,D)}),Array.isArray(S)?C.push(...S):S&&C.push(S),m=D+w[0].length,b=!0),!p.global)break;w=p.exec(l.value)}return b?(m<l.value.length&&C.push({type:"text",value:l.value.slice(m)}),f.children.splice(g,1,...C)):C=[l],g+C.length}}function AS(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],n=-1;for(;++n<r.length;){let i=r[n];e.push([wS(i[0]),CS(i[1])])}return e}function wS(t){return typeof t=="string"?new RegExp(Of(t),"g"):t}function CS(t){return typeof t=="function"?t:function(){return t}}var Rf="phrasing",Ff=["autolink","link","image","label"];function Pf(){return{transforms:[IS],enter:{literalAutolink:kS,literalAutolinkEmail:Nf,literalAutolinkHttp:Nf,literalAutolinkWww:Nf},exit:{literalAutolink:vS,literalAutolinkEmail:SS,literalAutolinkHttp:TS,literalAutolinkWww:_S}}}function Lf(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Rf,notInConstruct:Ff},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Rf,notInConstruct:Ff},{character:":",before:"[ps]",after:"\\/",inConstruct:Rf,notInConstruct:Ff}]}}function kS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Nf(t){this.config.enter.autolinkProtocol.call(this,t)}function TS(t){this.config.exit.autolinkProtocol.call(this,t)}function _S(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function SS(t){this.config.exit.autolinkEmail.call(this,t)}function vS(t){this.exit(t)}function IS(t){Df(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,OS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),DS]],{ignore:["link","linkReference"]})}function OS(t,e,r,n,i){let o="";if(!Rg(i)||(/^w/i.test(e)&&(r=e+r,e="",o="http://"),!RS(r)))return!1;let s=FS(r+n);if(!s[0])return!1;let a={type:"link",title:null,url:o+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function DS(t,e,r,n){return!Rg(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function RS(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function FS(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")"),i=If(t,"("),o=If(t,")");for(;n!==-1&&i>o;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),o++;return[t,r]}function Rg(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||_r(r)||bi(r))&&(!e||r!==47)}Fg.peek=$S;function NS(){this.buffer()}function PS(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function LS(){this.buffer()}function MS(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function BS(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=_t(this.sliceSerialize(t)).toLowerCase(),r.label=e}function jS(t){this.exit(t)}function US(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=_t(this.sliceSerialize(t)).toLowerCase(),r.label=e}function zS(t){this.exit(t)}function $S(){return"["}function Fg(t,e,r,n){let i=r.createTracker(n),o=i.move("[^"),s=r.enter("footnoteReference"),a=r.enter("reference");return o+=i.move(r.safe(r.associationId(t),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function Mf(){return{enter:{gfmFootnoteCallString:NS,gfmFootnoteCall:PS,gfmFootnoteDefinitionLabelString:LS,gfmFootnoteDefinition:MS},exit:{gfmFootnoteCallString:BS,gfmFootnoteCall:jS,gfmFootnoteDefinitionLabelString:US,gfmFootnoteDefinition:zS}}}function Bf(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:Fg},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,o,s){let a=o.createTracker(s),u=a.move("[^"),l=o.enter("footnoteDefinition"),c=o.enter("label");return u+=a.move(o.safe(o.associationId(n),{before:u,after:"]"})),c(),u+=a.move("]:"),n.children&&n.children.length>0&&(a.shift(4),u+=a.move((e?`
101
- `:" ")+o.indentLines(o.containerFlow(n,a.current()),e?Ng:qS))),l(),u}}function qS(t,e,r){return e===0?t:Ng(t,e,r)}function Ng(t,e,r){return(r?"":" ")+t}var VS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Pg.peek=HS;function jf(){return{canContainEols:["delete"],enter:{strikethrough:GS},exit:{strikethrough:WS}}}function Uf(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VS}],handlers:{delete:Pg}}}function GS(t){this.enter({type:"delete",children:[]},t)}function WS(t){this.exit(t)}function Pg(t,e,r,n){let i=r.createTracker(n),o=r.enter("strikethrough"),s=i.move("~~");return s+=r.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function HS(){return"~"}function KS(t){return t.length}function Mg(t,e){let r=e||{},n=(r.align||[]).concat(),i=r.stringLength||KS,o=[],s=[],a=[],u=[],l=0,c=-1;for(;++c<t.length;){let y=[],g=[],b=-1;for(t[c].length>l&&(l=t[c].length);++b<t[c].length;){let C=YS(t[c][b]);if(r.alignDelimiters!==!1){let w=i(C);g[b]=w,(u[b]===void 0||w>u[b])&&(u[b]=w)}y.push(C)}s[c]=y,a[c]=g}let f=-1;if(typeof n=="object"&&"length"in n)for(;++f<l;)o[f]=Lg(n[f]);else{let y=Lg(n);for(;++f<l;)o[f]=y}f=-1;let p=[],d=[];for(;++f<l;){let y=o[f],g="",b="";y===99?(g=":",b=":"):y===108?g=":":y===114&&(b=":");let C=r.alignDelimiters===!1?1:Math.max(1,u[f]-g.length-b.length),w=g+"-".repeat(C)+b;r.alignDelimiters!==!1&&(C=g.length+C+b.length,C>u[f]&&(u[f]=C),d[f]=C),p[f]=w}s.splice(1,0,p),a.splice(1,0,d),c=-1;let m=[];for(;++c<s.length;){let y=s[c],g=a[c];f=-1;let b=[];for(;++f<l;){let C=y[f]||"",w="",D="";if(r.alignDelimiters!==!1){let R=u[f]-(g[f]||0),S=o[f];S===114?w=" ".repeat(R):S===99?R%2?(w=" ".repeat(R/2+.5),D=" ".repeat(R/2-.5)):(w=" ".repeat(R/2),D=w):D=" ".repeat(R)}r.delimiterStart!==!1&&!f&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&C==="")&&(r.delimiterStart!==!1||f)&&b.push(" "),r.alignDelimiters!==!1&&b.push(w),b.push(C),r.alignDelimiters!==!1&&b.push(D),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||f!==l-1)&&b.push("|")}m.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
102
- `)}function YS(t){return t==null?"":String(t)}function Lg(t){let e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function $f(){return{enter:{table:ZS,tableData:Bg,tableHeader:Bg,tableRow:JS},exit:{codeText:QS,table:XS,tableData:zf,tableHeader:zf,tableRow:zf}}}function ZS(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function XS(t){this.exit(t),this.data.inTable=void 0}function JS(t){this.enter({type:"tableRow",children:[]},t)}function zf(t){this.exit(t)}function Bg(t){this.enter({type:"tableCell",children:[]},t)}function QS(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,ev));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function ev(t,e){return e==="|"?e:t}function qf(t){let e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
103
- `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:u,tableRow:a}};function s(d,m,y,g){return l(c(d,y,g),d.align)}function a(d,m,y,g){let b=f(d,y,g),C=l([b]);return C.slice(0,C.indexOf(`
104
- `))}function u(d,m,y,g){let b=y.enter("tableCell"),C=y.enter("phrasing"),w=y.containerPhrasing(d,{...g,before:o,after:o});return C(),b(),w}function l(d,m){return Mg(d,{align:m,alignDelimiters:n,padding:r,stringLength:i})}function c(d,m,y){let g=d.children,b=-1,C=[],w=m.enter("table");for(;++b<g.length;)C[b]=f(g[b],m,y);return w(),C}function f(d,m,y){let g=d.children,b=-1,C=[],w=m.enter("tableRow");for(;++b<g.length;)C[b]=u(g[b],d,m,y);return w(),C}function p(d,m,y){let g=ki.inlineCode(d,m,y);return y.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function Vf(){return{exit:{taskListCheckValueChecked:jg,taskListCheckValueUnchecked:jg,paragraph:tv}}}function Gf(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:rv}}}function jg(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function tv(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let n=r.children[0];if(n&&n.type==="text"){let i=e.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function rv(t,e,r,n){let i=t.children[0],o=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",a=r.createTracker(n);o&&a.move(s);let u=ki.listItem(t,e,r,{...n,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+s}}function Wf(){return[Pf(),Mf(),jf(),$f(),Vf()]}function Hf(t){return{extensions:[Lf(),Bf(t),Uf(),qf(t),Gf()]}}var nv={tokenize:uv,partial:!0},Ug={tokenize:lv,partial:!0},zg={tokenize:cv,partial:!0},$g={tokenize:fv,partial:!0},iv={tokenize:pv,partial:!0},qg={name:"wwwAutolink",tokenize:sv,previous:Gg},Vg={name:"protocolAutolink",tokenize:av,previous:Wg},Qr={name:"emailAutolink",tokenize:ov,previous:Hg},Ir={};function Yf(){return{text:Ir}}var _i=48;for(;_i<123;)Ir[_i]=Qr,_i++,_i===58?_i=65:_i===91&&(_i=97);Ir[43]=Qr;Ir[45]=Qr;Ir[46]=Qr;Ir[95]=Qr;Ir[72]=[Qr,Vg];Ir[104]=[Qr,Vg];Ir[87]=[Qr,qg];Ir[119]=[Qr,qg];function ov(t,e,r){let n=this,i,o;return s;function s(f){return!Kf(f)||!Hg.call(n,n.previous)||Zf(n.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(f))}function a(f){return Kf(f)?(t.consume(f),a):f===64?(t.consume(f),u):r(f)}function u(f){return f===46?t.check(iv,c,l)(f):f===45||f===95||gt(f)?(o=!0,t.consume(f),u):c(f)}function l(f){return t.consume(f),i=!0,u}function c(f){return o&&i&&mt(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):r(f)}}function sv(t,e,r){let n=this;return i;function i(s){return s!==87&&s!==119||!Gg.call(n,n.previous)||Zf(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(nv,t.attempt(Ug,t.attempt(zg,o),r),r)(s))}function o(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function av(t,e,r){let n=this,i="",o=!1;return s;function s(f){return(f===72||f===104)&&Wg.call(n,n.previous)&&!Zf(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),a):r(f)}function a(f){if(mt(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),a;if(f===58){let p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),u}return r(f)}function u(f){return f===47?(t.consume(f),o?l:(o=!0,u)):r(f)}function l(f){return f===null||yi(f)||ke(f)||_r(f)||bi(f)?r(f):t.attempt(Ug,t.attempt(zg,c),r)(f)}function c(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function uv(t,e,r){let n=0;return i;function i(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),i):s===46&&n===3?(t.consume(s),o):r(s)}function o(s){return s===null?r(s):e(s)}}function lv(t,e,r){let n,i,o;return s;function s(l){return l===46||l===95?t.check($g,u,a)(l):l===null||ke(l)||_r(l)||l!==45&&bi(l)?u(l):(o=!0,t.consume(l),s)}function a(l){return l===95?n=!0:(i=n,n=void 0),t.consume(l),s}function u(l){return i||n||!o?r(l):e(l)}}function cv(t,e){let r=0,n=0;return i;function i(s){return s===40?(r++,t.consume(s),i):s===41&&n<r?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check($g,e,o)(s):s===null||ke(s)||_r(s)?e(s):(t.consume(s),i)}function o(s){return s===41&&n++,t.consume(s),i}}function fv(t,e,r){return n;function n(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),n):a===38?(t.consume(a),o):a===93?(t.consume(a),i):a===60||a===null||ke(a)||_r(a)?e(a):r(a)}function i(a){return a===null||a===40||a===91||ke(a)||_r(a)?e(a):n(a)}function o(a){return mt(a)?s(a):r(a)}function s(a){return a===59?(t.consume(a),n):mt(a)?(t.consume(a),s):r(a)}}function pv(t,e,r){return n;function n(o){return t.consume(o),i}function i(o){return gt(o)?r(o):e(o)}}function Gg(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||ke(t)}function Wg(t){return!mt(t)}function Hg(t){return!(t===47||Kf(t))}function Kf(t){return t===43||t===45||t===46||t===95||gt(t)}function Zf(t){let e=t.length,r=!1;for(;e--;){let n=t[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var dv={tokenize:Ev,partial:!0};function Xf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:xv,continuation:{tokenize:yv},exit:bv}},text:{91:{name:"gfmFootnoteCall",tokenize:gv},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:hv,resolveTo:mv}}}}function hv(t,e,r){let n=this,i=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),s;for(;i--;){let u=n.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return r(u);let l=_t(n.sliceSerialize({start:s.end,end:n.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?r(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function mv(t,e){let r=t.length,n;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){n=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[r+1],t[r+2],["enter",i,e],t[r+3],t[r+4],["enter",o,e],["exit",o,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(r,t.length-r+1,...u),t}function gv(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,s;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?r(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(o>999||f===93&&!s||f===null||f===91||ke(f))return r(f);if(f===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return i.includes(_t(n.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(f)}return ke(f)||(s=!0),o++,t.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(t.consume(f),o++,l):l(f)}}function xv(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,s=0,a;return u;function u(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):r(m)}function c(m){if(s>999||m===93&&!a||m===null||m===91||ke(m))return r(m);if(m===93){t.exit("chunkString");let y=t.exit("gfmFootnoteDefinitionLabelString");return o=_t(n.sliceSerialize(y)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return ke(m)||(a=!0),s++,t.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(t.consume(m),s++,c):c(m)}function p(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),i.includes(o)||i.push(o),ie(t,d,"gfmFootnoteDefinitionWhitespace")):r(m)}function d(m){return e(m)}}function yv(t,e,r){return t.check(Sr,e,t.attempt(dv,e,r))}function bv(t){t.exit("gfmFootnoteDefinition")}function Ev(t,e,r){let n=this;return ie(t,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(o):r(o)}}function Jf(t){let r=(t||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",f,a]],d=a.parser.constructs.insideSpan.null;d&&it(p,p.length,0,bn(d,s.slice(l+1,u),a)),it(p,p.length,0,[["exit",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",c,a]]),it(s,l-1,u-l+3,p),u=l+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){let l=this.previous,c=this.events,f=0;return p;function p(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){let y=Jr(l);if(m===126)return f>1?u(m):(s.consume(m),f++,d);if(f<2&&!r)return u(m);let g=s.exit("strikethroughSequenceTemporary"),b=Jr(m);return g._open=!b||b===2&&!!y,g._close=!y||y===2&&!!b,a(m)}}}var uu=class{constructor(){this.map=[]}add(e,r,n){Av(this,e,r,n)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let r=this.map.length,n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(let o of i)e.push(o);i=n.pop()}this.map.length=0}};function Av(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=r,t.map[i][2].push(...n);return}i+=1}t.map.push([e,r,n])}}function Kg(t,e){let r=!1,n=[];for(;e<t.length;){let i=t[e];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return n}function Qf(){return{flow:{null:{name:"table",tokenize:wv,resolveAll:Cv}}}}function wv(t,e,r){let n=this,i=0,o=0,s;return a;function a(_){let L=n.events.length-1;for(;L>-1;){let P=n.events[L][1].type;if(P==="lineEnding"||P==="linePrefix")L--;else break}let F=L>-1?n.events[L][1].type:null,v=F==="tableHead"||F==="tableRow"?S:u;return v===S&&n.parser.lazy[n.now().line]?r(_):v(_)}function u(_){return t.enter("tableHead"),t.enter("tableRow"),l(_)}function l(_){return _===124||(s=!0,o+=1),c(_)}function c(_){return _===null?r(_):z(_)?o>1?(o=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),d):r(_):se(_)?ie(t,c,"whitespace")(_):(o+=1,s&&(s=!1,i+=1),_===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),s=!0,c):(t.enter("data"),f(_)))}function f(_){return _===null||_===124||ke(_)?(t.exit("data"),c(_)):(t.consume(_),_===92?p:f)}function p(_){return _===92||_===124?(t.consume(_),f):f(_)}function d(_){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(_):(t.enter("tableDelimiterRow"),s=!1,se(_)?ie(t,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?g(_):_===124?(s=!0,t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),y):R(_)}function y(_){return se(_)?ie(t,g,"whitespace")(_):g(_)}function g(_){return _===58?(o+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),b):_===45?(o+=1,b(_)):_===null||z(_)?D(_):R(_)}function b(_){return _===45?(t.enter("tableDelimiterFiller"),C(_)):R(_)}function C(_){return _===45?(t.consume(_),C):_===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),w):(t.exit("tableDelimiterFiller"),w(_))}function w(_){return se(_)?ie(t,D,"whitespace")(_):D(_)}function D(_){return _===124?m(_):_===null||z(_)?!s||i!==o?R(_):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(_)):R(_)}function R(_){return r(_)}function S(_){return t.enter("tableRow"),de(_)}function de(_){return _===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),de):_===null||z(_)?(t.exit("tableRow"),e(_)):se(_)?ie(t,de,"whitespace")(_):(t.enter("data"),ye(_))}function ye(_){return _===null||_===124||ke(_)?(t.exit("data"),de(_)):(t.consume(_),_===92?be:ye)}function be(_){return _===92||_===124?(t.consume(_),ye):ye(_)}}function Cv(t,e){let r=-1,n=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,l,c,f,p=new uu;for(;++r<t.length;){let d=t[r],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,u!==0&&(Yg(p,e,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,f=void 0,o=[0,0,0,0],s=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",c,e]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=lu(p,e,o,i,void 0,f),o=[0,0,0,0]),s[2]=r)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(s[0]=s[1],f=lu(p,e,o,i,void 0,f)),o=s,s=[o[1],r,0,0])):m.type==="tableHead"?(a=!0,u=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=r,o[1]!==0?(s[0]=s[1],f=lu(p,e,o,i,r,f)):s[1]!==0&&(f=lu(p,e,s,i,r,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=r)}for(u!==0&&Yg(p,e,u,l,c),p.consume(e.events),r=-1;++r<e.events.length;){let d=e.events[r];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=Kg(e.events,r))}return t}function lu(t,e,r,n,i,o){let s=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(o.end=Object.assign({},lo(e.events,r[0])),t.add(r[0],0,[["exit",o,e]]));let u=lo(e.events,r[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},t.add(r[1],0,[["enter",o,e]]),r[2]!==0){let l=lo(e.events,r[2]),c=lo(e.events,r[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(t.add(r[2],0,[["enter",f,e]]),n!==2){let p=e.events[r[2]],d=e.events[r[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let m=r[2]+1,y=r[3]-r[2]-1;t.add(m,y,[])}}t.add(r[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},lo(e.events,i)),t.add(i,0,[["exit",o,e]]),o=void 0),o}function Yg(t,e,r,n,i){let o=[],s=lo(e.events,r);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),n.end=Object.assign({},s),o.push(["exit",n,e]),t.add(r+1,0,o)}function lo(t,e){let r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}var kv={name:"tasklistCheck",tokenize:Tv};function ep(){return{text:{91:kv}}}function Tv(t,e,r){let n=this;return i;function i(u){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),o)}function o(u){return ke(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),s):r(u)}function s(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):r(u)}function a(u){return z(u)?e(u):se(u)?t.check({tokenize:_v},e,r)(u):r(u)}}function _v(t,e,r){return ie(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function Zg(t){return Ba([Yf(),Xf(),Jf(t),Qf(),ep()])}var Sv={};function An(t){let e=this,r=t||Sv,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(Zg(r)),o.push(Wf()),s.push(Hf(r))}import{mdatCheck as vv,mdatClean as Xg,mdatExpand as Iv,mdatSplit as Jg}from"remark-mdat";import{VFile as Qq}from"vfile";async function wn(t,e,r,n,i,o,s){let a=await e({additionalConfig:o,additionalRules:s});o=a;let u=await um(),l=Pa(t),c=am(l,i,n,"md"),f=[],p=r(a,u);for(let{input:d,name:m,output:y}of c){let g=await ec(d),b=await p.process(g);b.dirname=y,b.basename=m,f.push(b)}return f}function cu(t,e){return uo().use({settings:{bullet:"-",emphasis:"_"}}).use(An).use(e).use(()=>async function(n,i){Jg(n,i),Xg(n,i,t),await Iv(n,i,t)})}function fu(t,e){return uo().use({settings:{bullet:"-",emphasis:"_"}}).use(An).use(e).use(()=>function(n,i){Jg(n,i),Xg(n,i,t)})}function pu(t,e){return uo().use({settings:{bullet:"-",emphasis:"_"}}).use(An).use(e).use(()=>async function(n,i){await vv(n,i,{...t,paranoid:!1})})}async function Qg(t,e,r,n,i){return wn(t,xi,cu,e,r,n,i)}async function ex(t,e,r,n,i){return wn(t,xi,pu,e,r,n,i)}async function tx(t,e,r,n,i){return wn(t,xi,fu,e,r,n,i)}var du={badges:{async content(t){let e=X.object({custom:X.record(X.object({image:X.string(),link:X.string()})).optional(),npm:X.array(X.string()).optional()}).optional().parse(t),r=await Qt(),{name:n}=r,i=[];if(!r.private&&r.publishConfig?.access==="public"&&i.push(`[![NPM Package ${n}](https://img.shields.io/npm/v/${n}.svg)](https://npmjs.com/package/${n})`),e?.npm!==void 0)for(let s of e.npm)i.push(`[![NPM Package ${s}](https://img.shields.io/npm/v/${s}.svg)](https://npmjs.com/package/${s})`);let{license:o}=r;if(o!==void 0&&i.push(`[![License: ${o}](https://img.shields.io/badge/License-${o}-yellow.svg)](https://opensource.org/licenses/${o})`),e?.custom!==void 0)for(let[s,{image:a,link:u}]of Object.entries(e.custom))i.push(`[![${s}](${a})](${u})`);return i.join(`
105
- `)},order:3}};import{globby as Dv}from"globby";import hu from"node:path";import{readPackage as Rv}from"read-pkg";var mu={banner:{async content(t){let e=X.object({alt:X.string().optional(),src:X.string().optional()}).optional().parse(t),{assetsPath:r,packageFile:n}=await Tr();if(n===void 0)throw new Error("No package.json found");let i=e?.src??await rx(r)??await rx();if(i===void 0)throw new Error("Banner image not found at any typical location, consider adding something at ./assets/banner.webp");if(!nx(i)&&!await ro(i))throw new Error(`Banner image not found at "${i}"`);let o=e?.alt??`${(await Rv({cwd:hu.dirname(n)})).name} banner`;if(o===void 0||o==="undefined banner")throw new Error("Banner image alt text not available");return`![${o}](${i})`},order:2}};async function rx(t){let{packageFile:e}=await Tr();if(e===void 0)throw new Error("No package.json found");let r=hu.dirname(e),n=t===void 0?[".","assets","media","readme-assets","readme-media","readme","images",".github/assets"]:[t],i=["banner","cover","demo","header","hero","image","logo","overview","readme","screenshot","screenshots","splash"],o=["png","gif","jpg","jpeg","svg","webp"],s=await Dv(n.map(a=>hu.join(r,a)),{deep:1,expandDirectories:{extensions:o,files:i}});if(s.length>0)return hu.relative(process.cwd(),s[0])}function nx(t,e=!0){if(typeof t!="string")throw new TypeError("Expected a string");if(t=t.trim(),t.includes(" "))return!1;try{return new URL(t),!0}catch{return e?nx(`https://${t}`,!1):!1}}import{getSoleRule as $P}from"remark-mdat";import{execaCommand as SP}from"execa";import{log as wA}from"remark-mdat";function ix(t,e=Number.MAX_SAFE_INTEGER){let r=[],n=Fv(t,e);return r.push(Nv(n)),r.push(Pv(t,n)),n.hasMultipleSubcommands&&n.canRecurse&&r.push(Lv(n.fullCommandName)),n.defaultCommand?.commandName!==void 0&&r.push(Mv(n)),r.push(Bv(t,n)),t.positionals&&!n.commandsOnly&&r.push(tp(["Positional Argument","Description","Type","Default"],t.positionals.map(i=>[i.arguments?[i.arguments.map(o=>`\`${o}\``)].join(" "):"",`${i.description??""}${i.required===void 0?"":i.required?" _(Required.)_":" _(Optional.)_"}`,i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")?i.defaultValue:`\`${i.defaultValue}\``:""]))),t.commands&&r.push(tp(["Command","Argument","Description"],t.commands.map(i=>[`\`${i.commandName??(i.default?"[default]":"")}\``,i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",`${i.description??""}${i.default?" _(Default command.)_":""}`]))),t.options&&!n.commandsOnly&&r.push(tp(["Option","Argument","Description","Type","Default"],t.options.map(i=>[i.flags!==void 0||i.aliases!==void 0?[...i.flags??[],...i.aliases??[]].map(o=>`\`${o}\``).join("<br>"):"",i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",i.description??"",i.choices?i.choices.map(o=>`\`${o}\``).join(" "):i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")&&i.choices===void 0?i.defaultValue:`\`${i.defaultValue}\``:""]))),n.canRecurse&&n.hasMultipleSubcommands&&r.push("_See the sections below for more information on each subcommand._"),r.join(`
100
+ `),i;function o(s){return n.stack.push(s),a;function a(){n.stack.pop()}}}function uS(t){throw new Error("Cannot handle value `"+t+"`, expected node")}function lS(t){let e=t;throw new Error("Cannot handle unknown node `"+e.type+"`")}function cS(t,e){if(t.type==="definition"&&t.type===e.type)return 0}function fS(t,e){return lg(t,this,e)}function pS(t,e){return cg(t,this,e)}function dS(t,e){return dg(this,t,e)}function nu(t){let e=this;e.compiler=r;function r(n){return yf(n,{...e.data("settings"),...t,extensions:e.data("toMarkdownExtensions")||[]})}}function bf(t){if(t)throw t}var su=ns(wg(),1);function As(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Ef(){let t=[],e={run:r,use:n};return e;function r(...i){let o=-1,s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(u,...l){let c=t[++o],f=-1;if(u){s(u);return}for(;++f<i.length;)(l[f]===null||l[f]===void 0)&&(l[f]=i[f]);i=l,c?Cg(c,a)(...l):s(null,...l)}}function n(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return t.push(i),e}}function Cg(t,e){let r;return n;function n(...s){let a=t.length>s.length,u;a&&s.push(i);try{u=t.apply(this,s)}catch(l){let c=l;if(a&&r)throw c;return i(c)}a||(u&&u.then&&typeof u.then=="function"?u.then(o,i):u instanceof Error?i(u):o(u))}function i(s,...a){r||(r=!0,e(s,...a))}function o(s){i(null,s)}}import{VFile as hS}from"vfile";var Tg=(function(t){let n=this.constructor.prototype,i=n[t],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,n),o});var mS={}.hasOwnProperty,Cf=class t extends Tg{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=Ef()}copy(){let e=new t,r=-1;for(;++r<this.attachers.length;){let n=this.attachers[r];e.use(...n)}return e.data((0,su.default)(!0,{},this.namespace)),e}data(e,r){return typeof e=="string"?arguments.length===2?(wf("data",this.frozen),this.namespace[e]=r,this):mS.call(this.namespace,e)&&this.namespace[e]||void 0:e?(wf("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[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let i=r.call(e,...n);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();let r=ou(e),n=this.parser||this.Parser;return Af("parse",n),n(String(r),r)}process(e,r){let n=this;return this.freeze(),Af("process",this.parser||this.Parser),kf("process",this.compiler||this.Compiler),r?i(void 0,r):new Promise(i);function i(o,s){let a=ou(e),u=n.parse(a);n.run(u,a,function(c,f,p){if(c||!f||!p)return l(c);let d=f,m=n.stringify(d,p);xS(m)?p.value=m:p.result=m,l(c,p)});function l(c,f){c||!f?s(c):o?o(f):r(void 0,f)}}}processSync(e){let r=!1,n;return this.freeze(),Af("processSync",this.parser||this.Parser),kf("processSync",this.compiler||this.Compiler),this.process(e,i),Sg("processSync","process",r),n;function i(o,s){r=!0,bf(o),n=s}}run(e,r,n){_g(e),this.freeze();let i=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?o(void 0,n):new Promise(o);function o(s,a){let u=ou(r);i.run(e,u,l);function l(c,f,p){let d=f||e;c?a(c):s?s(d):n(void 0,d,p)}}}runSync(e,r){let n=!1,i;return this.run(e,r,o),Sg("runSync","run",n),i;function o(s,a){bf(s),i=a,n=!0}}stringify(e,r){this.freeze();let n=ou(r),i=this.compiler||this.Compiler;return kf("stringify",i),_g(e),i(e,n)}use(e,...r){let n=this.attachers,i=this.namespace;if(wf("use",this.frozen),e!=null)if(typeof e=="function")u(e,r);else if(typeof e=="object")Array.isArray(e)?a(e):s(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function o(l){if(typeof l=="function")u(l,[]);else if(typeof l=="object")if(Array.isArray(l)){let[c,...f]=l;u(c,f)}else s(l);else throw new TypeError("Expected usable value, not `"+l+"`")}function s(l){if(!("plugins"in l)&&!("settings"in l))throw new 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");a(l.plugins),l.settings&&(i.settings=(0,su.default)(!0,i.settings,l.settings))}function a(l){let c=-1;if(l!=null)if(Array.isArray(l))for(;++c<l.length;){let f=l[c];o(f)}else throw new TypeError("Expected a list of plugins, not `"+l+"`")}function u(l,c){let f=-1,p=-1;for(;++f<n.length;)if(n[f][0]===l){p=f;break}if(p===-1)n.push([l,...c]);else if(c.length>0){let[d,...m]=c,y=n[p][1];As(y)&&As(d)&&(d=(0,su.default)(!0,y,d)),n[p]=[l,d,...m]}}}},Tf=new Cf().freeze();function Af(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function kf(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function wf(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _g(t){if(!As(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Sg(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function ou(t){return gS(t)?t:new hS(t)}function gS(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function xS(t){return typeof t=="string"||yS(t)}function yS(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}var co=Tf().use(Za).use(nu).freeze();function _f(t,e){let r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,i=r.indexOf(e);for(;i!==-1;)n++,i=r.indexOf(e,i+e.length);return n}function Sf(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function If(t,e,r){let i=Or((r||{}).ignore||[]),o=bS(e),s=-1;for(;++s<o.length;)bs(t,"text",a);function a(l,c){let f=-1,p;for(;++f<c.length;){let d=c[f],m=p?p.children:void 0;if(i(d,m?m.indexOf(d):void 0,p))return;p=d}if(p)return u(l,c)}function u(l,c){let f=c[c.length-1],p=o[s][0],d=o[s][1],m=0,g=f.children.indexOf(l),b=!1,w=[];p.lastIndex=0;let k=p.exec(l.value);for(;k;){let D=k.index,R={index:k.index,input:k.input,stack:[...c,l]},S=d(...k,R);if(typeof S=="string"&&(S=S.length>0?{type:"text",value:S}:void 0),S===!1?p.lastIndex=D+1:(m!==D&&w.push({type:"text",value:l.value.slice(m,D)}),Array.isArray(S)?w.push(...S):S&&w.push(S),m=D+k[0].length,b=!0),!p.global)break;k=p.exec(l.value)}return b?(m<l.value.length&&w.push({type:"text",value:l.value.slice(m)}),f.children.splice(g,1,...w)):w=[l],g+w.length}}function bS(t){let e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");let r=!t[0]||Array.isArray(t[0])?t:[t],n=-1;for(;++n<r.length;){let i=r[n];e.push([ES(i[0]),AS(i[1])])}return e}function ES(t){return typeof t=="string"?new RegExp(Sf(t),"g"):t}function AS(t){return typeof t=="function"?t:function(){return t}}var Of="phrasing",vf=["autolink","link","image","label"];function Rf(){return{transforms:[SS],enter:{literalAutolink:kS,literalAutolinkEmail:Df,literalAutolinkHttp:Df,literalAutolinkWww:Df},exit:{literalAutolink:_S,literalAutolinkEmail:TS,literalAutolinkHttp:wS,literalAutolinkWww:CS}}}function Ff(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Of,notInConstruct:vf},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Of,notInConstruct:vf},{character:":",before:"[ps]",after:"\\/",inConstruct:Of,notInConstruct:vf}]}}function kS(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function Df(t){this.config.enter.autolinkProtocol.call(this,t)}function wS(t){this.config.exit.autolinkProtocol.call(this,t)}function CS(t){this.config.exit.data.call(this,t);let e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function TS(t){this.config.exit.autolinkEmail.call(this,t)}function _S(t){this.exit(t)}function SS(t){If(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,IS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),OS]],{ignore:["link","linkReference"]})}function IS(t,e,r,n,i){let o="";if(!Ig(i)||(/^w/i.test(e)&&(r=e+r,e="",o="http://"),!vS(r)))return!1;let s=DS(r+n);if(!s[0])return!1;let a={type:"link",title:null,url:o+e+s[0],children:[{type:"text",value:e+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function OS(t,e,r,n){return!Ig(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function vS(t){let e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function DS(t){let e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")"),i=_f(t,"("),o=_f(t,")");for(;n!==-1&&i>o;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),o++;return[t,r]}function Ig(t,e){let r=t.input.charCodeAt(t.index-1);return(t.index===0||Sr(r)||Ai(r))&&(!e||r!==47)}Og.peek=US;function RS(){this.buffer()}function FS(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function NS(){this.buffer()}function PS(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function LS(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=St(this.sliceSerialize(t)).toLowerCase(),r.label=e}function MS(t){this.exit(t)}function BS(t){let e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=St(this.sliceSerialize(t)).toLowerCase(),r.label=e}function jS(t){this.exit(t)}function US(){return"["}function Og(t,e,r,n){let i=r.createTracker(n),o=i.move("[^"),s=r.enter("footnoteReference"),a=r.enter("reference");return o+=i.move(r.safe(r.associationId(t),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function Nf(){return{enter:{gfmFootnoteCallString:RS,gfmFootnoteCall:FS,gfmFootnoteDefinitionLabelString:NS,gfmFootnoteDefinition:PS},exit:{gfmFootnoteCallString:LS,gfmFootnoteCall:MS,gfmFootnoteDefinitionLabelString:BS,gfmFootnoteDefinition:jS}}}function Pf(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:Og},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,i,o,s){let a=o.createTracker(s),u=a.move("[^"),l=o.enter("footnoteDefinition"),c=o.enter("label");return u+=a.move(o.safe(o.associationId(n),{before:u,after:"]"})),c(),u+=a.move("]:"),n.children&&n.children.length>0&&(a.shift(4),u+=a.move((e?`
101
+ `:" ")+o.indentLines(o.containerFlow(n,a.current()),e?vg:zS))),l(),u}}function zS(t,e,r){return e===0?t:vg(t,e,r)}function vg(t,e,r){return(r?"":" ")+t}var $S=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Dg.peek=GS;function Lf(){return{canContainEols:["delete"],enter:{strikethrough:qS},exit:{strikethrough:VS}}}function Mf(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:$S}],handlers:{delete:Dg}}}function qS(t){this.enter({type:"delete",children:[]},t)}function VS(t){this.exit(t)}function Dg(t,e,r,n){let i=r.createTracker(n),o=r.enter("strikethrough"),s=i.move("~~");return s+=r.containerPhrasing(t,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function GS(){return"~"}function WS(t){return t.length}function Fg(t,e){let r=e||{},n=(r.align||[]).concat(),i=r.stringLength||WS,o=[],s=[],a=[],u=[],l=0,c=-1;for(;++c<t.length;){let y=[],g=[],b=-1;for(t[c].length>l&&(l=t[c].length);++b<t[c].length;){let w=HS(t[c][b]);if(r.alignDelimiters!==!1){let k=i(w);g[b]=k,(u[b]===void 0||k>u[b])&&(u[b]=k)}y.push(w)}s[c]=y,a[c]=g}let f=-1;if(typeof n=="object"&&"length"in n)for(;++f<l;)o[f]=Rg(n[f]);else{let y=Rg(n);for(;++f<l;)o[f]=y}f=-1;let p=[],d=[];for(;++f<l;){let y=o[f],g="",b="";y===99?(g=":",b=":"):y===108?g=":":y===114&&(b=":");let w=r.alignDelimiters===!1?1:Math.max(1,u[f]-g.length-b.length),k=g+"-".repeat(w)+b;r.alignDelimiters!==!1&&(w=g.length+w+b.length,w>u[f]&&(u[f]=w),d[f]=w),p[f]=k}s.splice(1,0,p),a.splice(1,0,d),c=-1;let m=[];for(;++c<s.length;){let y=s[c],g=a[c];f=-1;let b=[];for(;++f<l;){let w=y[f]||"",k="",D="";if(r.alignDelimiters!==!1){let R=u[f]-(g[f]||0),S=o[f];S===114?k=" ".repeat(R):S===99?R%2?(k=" ".repeat(R/2+.5),D=" ".repeat(R/2-.5)):(k=" ".repeat(R/2),D=k):D=" ".repeat(R)}r.delimiterStart!==!1&&!f&&b.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&w==="")&&(r.delimiterStart!==!1||f)&&b.push(" "),r.alignDelimiters!==!1&&b.push(k),b.push(w),r.alignDelimiters!==!1&&b.push(D),r.padding!==!1&&b.push(" "),(r.delimiterEnd!==!1||f!==l-1)&&b.push("|")}m.push(r.delimiterEnd===!1?b.join("").replace(/ +$/,""):b.join(""))}return m.join(`
102
+ `)}function HS(t){return t==null?"":String(t)}function Rg(t){let e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function jf(){return{enter:{table:KS,tableData:Ng,tableHeader:Ng,tableRow:ZS},exit:{codeText:XS,table:YS,tableData:Bf,tableHeader:Bf,tableRow:Bf}}}function KS(t){let e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function YS(t){this.exit(t),this.data.inTable=void 0}function ZS(t){this.enter({type:"tableRow",children:[]},t)}function Bf(t){this.exit(t)}function Ng(t){this.enter({type:"tableCell",children:[]},t)}function XS(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,JS));let r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function JS(t,e){return e==="|"?e:t}function Uf(t){let e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,i=e.stringLength,o=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
103
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:s,tableCell:u,tableRow:a}};function s(d,m,y,g){return l(c(d,y,g),d.align)}function a(d,m,y,g){let b=f(d,y,g),w=l([b]);return w.slice(0,w.indexOf(`
104
+ `))}function u(d,m,y,g){let b=y.enter("tableCell"),w=y.enter("phrasing"),k=y.containerPhrasing(d,{...g,before:o,after:o});return w(),b(),k}function l(d,m){return Fg(d,{align:m,alignDelimiters:n,padding:r,stringLength:i})}function c(d,m,y){let g=d.children,b=-1,w=[],k=m.enter("table");for(;++b<g.length;)w[b]=f(g[b],m,y);return k(),w}function f(d,m,y){let g=d.children,b=-1,w=[],k=m.enter("tableRow");for(;++b<g.length;)w[b]=u(g[b],d,m,y);return k(),w}function p(d,m,y){let g=_i.inlineCode(d,m,y);return y.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function zf(){return{exit:{taskListCheckValueChecked:Pg,taskListCheckValueUnchecked:Pg,paragraph:QS}}}function $f(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:eI}}}function Pg(t){let e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function QS(t){let e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){let r=this.stack[this.stack.length-1];r.type;let n=r.children[0];if(n&&n.type==="text"){let i=e.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function eI(t,e,r,n){let i=t.children[0],o=typeof t.checked=="boolean"&&i&&i.type==="paragraph",s="["+(t.checked?"x":" ")+"] ",a=r.createTracker(n);o&&a.move(s);let u=_i.listItem(t,e,r,{...n,...a.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),u;function l(c){return c+s}}function qf(){return[Rf(),Nf(),Lf(),jf(),zf()]}function Vf(t){return{extensions:[Ff(),Pf(t),Mf(),Uf(t),$f()]}}var tI={tokenize:sI,partial:!0},Lg={tokenize:aI,partial:!0},Mg={tokenize:uI,partial:!0},Bg={tokenize:lI,partial:!0},rI={tokenize:cI,partial:!0},jg={name:"wwwAutolink",tokenize:iI,previous:zg},Ug={name:"protocolAutolink",tokenize:oI,previous:$g},en={name:"emailAutolink",tokenize:nI,previous:qg},vr={};function Wf(){return{text:vr}}var Ii=48;for(;Ii<123;)vr[Ii]=en,Ii++,Ii===58?Ii=65:Ii===91&&(Ii=97);vr[43]=en;vr[45]=en;vr[46]=en;vr[95]=en;vr[72]=[en,Ug];vr[104]=[en,Ug];vr[87]=[en,jg];vr[119]=[en,jg];function nI(t,e,r){let n=this,i,o;return s;function s(f){return!Gf(f)||!qg.call(n,n.previous)||Hf(n.events)?r(f):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),a(f))}function a(f){return Gf(f)?(t.consume(f),a):f===64?(t.consume(f),u):r(f)}function u(f){return f===46?t.check(rI,c,l)(f):f===45||f===95||gt(f)?(o=!0,t.consume(f),u):c(f)}function l(f){return t.consume(f),i=!0,u}function c(f){return o&&i&&mt(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(f)):r(f)}}function iI(t,e,r){let n=this;return i;function i(s){return s!==87&&s!==119||!zg.call(n,n.previous)||Hf(n.events)?r(s):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(tI,t.attempt(Lg,t.attempt(Mg,o),r),r)(s))}function o(s){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(s)}}function oI(t,e,r){let n=this,i="",o=!1;return s;function s(f){return(f===72||f===104)&&$g.call(n,n.previous)&&!Hf(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(f),t.consume(f),a):r(f)}function a(f){if(mt(f)&&i.length<5)return i+=String.fromCodePoint(f),t.consume(f),a;if(f===58){let p=i.toLowerCase();if(p==="http"||p==="https")return t.consume(f),u}return r(f)}function u(f){return f===47?(t.consume(f),o?l:(o=!0,u)):r(f)}function l(f){return f===null||Ei(f)||Ce(f)||Sr(f)||Ai(f)?r(f):t.attempt(Lg,t.attempt(Mg,c),r)(f)}function c(f){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(f)}}function sI(t,e,r){let n=0;return i;function i(s){return(s===87||s===119)&&n<3?(n++,t.consume(s),i):s===46&&n===3?(t.consume(s),o):r(s)}function o(s){return s===null?r(s):e(s)}}function aI(t,e,r){let n,i,o;return s;function s(l){return l===46||l===95?t.check(Bg,u,a)(l):l===null||Ce(l)||Sr(l)||l!==45&&Ai(l)?u(l):(o=!0,t.consume(l),s)}function a(l){return l===95?n=!0:(i=n,n=void 0),t.consume(l),s}function u(l){return i||n||!o?r(l):e(l)}}function uI(t,e){let r=0,n=0;return i;function i(s){return s===40?(r++,t.consume(s),i):s===41&&n<r?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?t.check(Bg,e,o)(s):s===null||Ce(s)||Sr(s)?e(s):(t.consume(s),i)}function o(s){return s===41&&n++,t.consume(s),i}}function lI(t,e,r){return n;function n(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(t.consume(a),n):a===38?(t.consume(a),o):a===93?(t.consume(a),i):a===60||a===null||Ce(a)||Sr(a)?e(a):r(a)}function i(a){return a===null||a===40||a===91||Ce(a)||Sr(a)?e(a):n(a)}function o(a){return mt(a)?s(a):r(a)}function s(a){return a===59?(t.consume(a),n):mt(a)?(t.consume(a),s):r(a)}}function cI(t,e,r){return n;function n(o){return t.consume(o),i}function i(o){return gt(o)?r(o):e(o)}}function zg(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||Ce(t)}function $g(t){return!mt(t)}function qg(t){return!(t===47||Gf(t))}function Gf(t){return t===43||t===45||t===46||t===95||gt(t)}function Hf(t){let e=t.length,r=!1;for(;e--;){let n=t[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}var fI={tokenize:yI,partial:!0};function Kf(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:mI,continuation:{tokenize:gI},exit:xI}},text:{91:{name:"gfmFootnoteCall",tokenize:hI},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:pI,resolveTo:dI}}}}function pI(t,e,r){let n=this,i=n.events.length,o=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),s;for(;i--;){let u=n.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return r(u);let l=St(n.sliceSerialize({start:s.end,end:n.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?r(u):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(u),t.exit("gfmFootnoteCallLabelMarker"),e(u))}}function dI(t,e){let r=t.length,n;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){n=t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},t[t.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[r+1],t[r+2],["enter",i,e],t[r+3],t[r+4],["enter",o,e],["exit",o,e],["enter",s,e],["enter",a,e],["exit",a,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",i,e]];return t.splice(r,t.length-r+1,...u),t}function hI(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o=0,s;return a;function a(f){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),u}function u(f){return f!==94?r(f):(t.enter("gfmFootnoteCallMarker"),t.consume(f),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",l)}function l(f){if(o>999||f===93&&!s||f===null||f===91||Ce(f))return r(f);if(f===93){t.exit("chunkString");let p=t.exit("gfmFootnoteCallString");return i.includes(St(n.sliceSerialize(p)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(f),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(f)}return Ce(f)||(s=!0),o++,t.consume(f),f===92?c:l}function c(f){return f===91||f===92||f===93?(t.consume(f),o++,l):l(f)}}function mI(t,e,r){let n=this,i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]),o,s=0,a;return u;function u(m){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(m){return m===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",c):r(m)}function c(m){if(s>999||m===93&&!a||m===null||m===91||Ce(m))return r(m);if(m===93){t.exit("chunkString");let y=t.exit("gfmFootnoteDefinitionLabelString");return o=St(n.sliceSerialize(y)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(m),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),p}return Ce(m)||(a=!0),s++,t.consume(m),m===92?f:c}function f(m){return m===91||m===92||m===93?(t.consume(m),s++,c):c(m)}function p(m){return m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),i.includes(o)||i.push(o),ie(t,d,"gfmFootnoteDefinitionWhitespace")):r(m)}function d(m){return e(m)}}function gI(t,e,r){return t.check(Ir,e,t.attempt(fI,e,r))}function xI(t){t.exit("gfmFootnoteDefinition")}function yI(t,e,r){let n=this;return ie(t,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=n.events[n.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?e(o):r(o)}}function Yf(t){let r=(t||{}).singleTilde,n={name:"strikethrough",tokenize:o,resolveAll:i};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},f={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},p=[["enter",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",f,a]],d=a.parser.constructs.insideSpan.null;d&&it(p,p.length,0,An(d,s.slice(l+1,u),a)),it(p,p.length,0,[["exit",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",c,a]]),it(s,l-1,u-l+3,p),u=l+p.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){let l=this.previous,c=this.events,f=0;return p;function p(m){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){let y=Qr(l);if(m===126)return f>1?u(m):(s.consume(m),f++,d);if(f<2&&!r)return u(m);let g=s.exit("strikethroughSequenceTemporary"),b=Qr(m);return g._open=!b||b===2&&!!y,g._close=!y||y===2&&!!b,a(m)}}}var au=class{constructor(){this.map=[]}add(e,r,n){bI(this,e,r,n)}consume(e){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let r=this.map.length,n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let i=n.pop();for(;i;){for(let o of i)e.push(o);i=n.pop()}this.map.length=0}};function bI(t,e,r,n){let i=0;if(!(r===0&&n.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=r,t.map[i][2].push(...n);return}i+=1}t.map.push([e,r,n])}}function Vg(t,e){let r=!1,n=[];for(;e<t.length;){let i=t[e];if(r){if(i[0]==="enter")i[1].type==="tableContent"&&n.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){let o=n.length-1;n[o]=n[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return n}function Zf(){return{flow:{null:{name:"table",tokenize:EI,resolveAll:AI}}}}function EI(t,e,r){let n=this,i=0,o=0,s;return a;function a(_){let L=n.events.length-1;for(;L>-1;){let P=n.events[L][1].type;if(P==="lineEnding"||P==="linePrefix")L--;else break}let F=L>-1?n.events[L][1].type:null,I=F==="tableHead"||F==="tableRow"?S:u;return I===S&&n.parser.lazy[n.now().line]?r(_):I(_)}function u(_){return t.enter("tableHead"),t.enter("tableRow"),l(_)}function l(_){return _===124||(s=!0,o+=1),c(_)}function c(_){return _===null?r(_):z(_)?o>1?(o=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(_),t.exit("lineEnding"),d):r(_):se(_)?ie(t,c,"whitespace")(_):(o+=1,s&&(s=!1,i+=1),_===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),s=!0,c):(t.enter("data"),f(_)))}function f(_){return _===null||_===124||Ce(_)?(t.exit("data"),c(_)):(t.consume(_),_===92?p:f)}function p(_){return _===92||_===124?(t.consume(_),f):f(_)}function d(_){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(_):(t.enter("tableDelimiterRow"),s=!1,se(_)?ie(t,m,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(_):m(_))}function m(_){return _===45||_===58?g(_):_===124?(s=!0,t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),y):R(_)}function y(_){return se(_)?ie(t,g,"whitespace")(_):g(_)}function g(_){return _===58?(o+=1,s=!0,t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),b):_===45?(o+=1,b(_)):_===null||z(_)?D(_):R(_)}function b(_){return _===45?(t.enter("tableDelimiterFiller"),w(_)):R(_)}function w(_){return _===45?(t.consume(_),w):_===58?(s=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(_),t.exit("tableDelimiterMarker"),k):(t.exit("tableDelimiterFiller"),k(_))}function k(_){return se(_)?ie(t,D,"whitespace")(_):D(_)}function D(_){return _===124?m(_):_===null||z(_)?!s||i!==o?R(_):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(_)):R(_)}function R(_){return r(_)}function S(_){return t.enter("tableRow"),de(_)}function de(_){return _===124?(t.enter("tableCellDivider"),t.consume(_),t.exit("tableCellDivider"),de):_===null||z(_)?(t.exit("tableRow"),e(_)):se(_)?ie(t,de,"whitespace")(_):(t.enter("data"),ye(_))}function ye(_){return _===null||_===124||Ce(_)?(t.exit("data"),de(_)):(t.consume(_),_===92?be:ye)}function be(_){return _===92||_===124?(t.consume(_),ye):ye(_)}}function AI(t,e){let r=-1,n=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,l,c,f,p=new au;for(;++r<t.length;){let d=t[r],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,u!==0&&(Gg(p,e,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",l,e]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(n=!0,f=void 0,o=[0,0,0,0],s=[0,r+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},p.add(r,0,[["enter",c,e]])),i=m.type==="tableDelimiterRow"?2:c?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(n=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],f=uu(p,e,o,i,void 0,f),o=[0,0,0,0]),s[2]=r)):m.type==="tableCellDivider"&&(n?n=!1:(o[1]!==0&&(s[0]=s[1],f=uu(p,e,o,i,void 0,f)),o=s,s=[o[1],r,0,0])):m.type==="tableHead"?(a=!0,u=r):m.type==="tableRow"||m.type==="tableDelimiterRow"?(u=r,o[1]!==0?(s[0]=s[1],f=uu(p,e,o,i,r,f)):s[1]!==0&&(f=uu(p,e,s,i,r,f)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=r)}for(u!==0&&Gg(p,e,u,l,c),p.consume(e.events),r=-1;++r<e.events.length;){let d=e.events[r];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=Vg(e.events,r))}return t}function uu(t,e,r,n,i,o){let s=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",a="tableContent";r[0]!==0&&(o.end=Object.assign({},fo(e.events,r[0])),t.add(r[0],0,[["exit",o,e]]));let u=fo(e.events,r[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},t.add(r[1],0,[["enter",o,e]]),r[2]!==0){let l=fo(e.events,r[2]),c=fo(e.events,r[3]),f={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(t.add(r[2],0,[["enter",f,e]]),n!==2){let p=e.events[r[2]],d=e.events[r[3]];if(p[1].end=Object.assign({},d[1].end),p[1].type="chunkText",p[1].contentType="text",r[3]>r[2]+1){let m=r[2]+1,y=r[3]-r[2]-1;t.add(m,y,[])}}t.add(r[3]+1,0,[["exit",f,e]])}return i!==void 0&&(o.end=Object.assign({},fo(e.events,i)),t.add(i,0,[["exit",o,e]]),o=void 0),o}function Gg(t,e,r,n,i){let o=[],s=fo(e.events,r);i&&(i.end=Object.assign({},s),o.push(["exit",i,e])),n.end=Object.assign({},s),o.push(["exit",n,e]),t.add(r+1,0,o)}function fo(t,e){let r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}var kI={name:"tasklistCheck",tokenize:wI};function Xf(){return{text:{91:kI}}}function wI(t,e,r){let n=this;return i;function i(u){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(u):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),o)}function o(u){return Ce(u)?(t.enter("taskListCheckValueUnchecked"),t.consume(u),t.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(t.enter("taskListCheckValueChecked"),t.consume(u),t.exit("taskListCheckValueChecked"),s):r(u)}function s(u){return u===93?(t.enter("taskListCheckMarker"),t.consume(u),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),a):r(u)}function a(u){return z(u)?e(u):se(u)?t.check({tokenize:CI},e,r)(u):r(u)}}function CI(t,e,r){return ie(t,n,"whitespace");function n(i){return i===null?r(i):e(i)}}function Wg(t){return Ma([Wf(),Kf(),Yf(t),Zf(),Xf()])}var TI={};function wn(t){let e=this,r=t||TI,n=e.data(),i=n.micromarkExtensions||(n.micromarkExtensions=[]),o=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),s=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);i.push(Wg(r)),o.push(qf()),s.push(Vf(r))}import{mdatCheck as _I,mdatClean as Hg,mdatExpand as SI,mdatSplit as Kg}from"remark-mdat";import{VFile as kV}from"vfile";async function Cn(t,e,r,n,i,o,s){let a=await e({additionalConfig:o,additionalRules:s});o=a;let u=await im(),l=Na(t),c=nm(l,i,n,"md"),f=[],p=r(a,u);for(let{input:d,name:m,output:y}of c){let g=await Ql(d),b=await p.process(g);b.dirname=y,b.basename=m,f.push(b)}return f}function lu(t,e){return co().use({settings:{bullet:"-",emphasis:"_"}}).use(wn).use(e).use(()=>async function(n,i){Kg(n,i),Hg(n,i,t),await SI(n,i,t)})}function cu(t,e){return co().use({settings:{bullet:"-",emphasis:"_"}}).use(wn).use(e).use(()=>function(n,i){Kg(n,i),Hg(n,i,t)})}function fu(t,e){return co().use({settings:{bullet:"-",emphasis:"_"}}).use(wn).use(e).use(()=>async function(n,i){await _I(n,i,{...t,paranoid:!1})})}async function Yg(t,e,r,n,i){return Cn(t,bi,lu,e,r,n,i)}async function Zg(t,e,r,n,i){return Cn(t,bi,fu,e,r,n,i)}async function Xg(t,e,r,n,i){return Cn(t,bi,cu,e,r,n,i)}var pu={badges:{async content(t){let e=K.object({custom:K.record(K.object({image:K.string(),link:K.string()})).optional(),npm:K.array(K.string()).optional()}).optional().parse(t),r=await Jt(),{name:n}=r,i=[];if(!r.private&&r.publishConfig?.access==="public"&&i.push(`[![NPM Package ${n}](https://img.shields.io/npm/v/${n}.svg)](https://npmjs.com/package/${n})`),e?.npm!==void 0)for(let s of e.npm)i.push(`[![NPM Package ${s}](https://img.shields.io/npm/v/${s}.svg)](https://npmjs.com/package/${s})`);let{license:o}=r;if(o!==void 0&&i.push(`[![License: ${o}](https://img.shields.io/badge/License-${o}-yellow.svg)](https://opensource.org/licenses/${o})`),e?.custom!==void 0)for(let[s,{image:a,link:u}]of Object.entries(e.custom))i.push(`[![${s}](${a})](${u})`);return i.join(`
105
+ `)},order:3}};import{globby as OI}from"globby";import du from"path";import{readPackage as vI}from"read-pkg";var hu={banner:{async content(t){let e=K.object({alt:K.string().optional(),src:K.string().optional()}).optional().parse(t),{assetsPath:r,packageFile:n}=await _r();if(n===void 0)throw new Error("No package.json found");let i=e?.src??await Jg(r)??await Jg();if(i===void 0)throw new Error("Banner image not found at any typical location, consider adding something at ./assets/banner.webp");if(!Qg(i)&&!await io(i))throw new Error(`Banner image not found at "${i}"`);let o=e?.alt??`${(await vI({cwd:du.dirname(n)})).name} banner`;if(o===void 0||o==="undefined banner")throw new Error("Banner image alt text not available");return`![${o}](${i})`},order:2}};async function Jg(t){let{packageFile:e}=await _r();if(e===void 0)throw new Error("No package.json found");let r=du.dirname(e),n=t===void 0?[".","assets","media","readme-assets","readme-media","readme","images",".github/assets"]:[t],i=["banner","cover","demo","header","hero","image","logo","overview","readme","screenshot","screenshots","splash"],o=["png","gif","jpg","jpeg","svg","webp"],s=await OI(n.map(a=>du.join(r,a)),{deep:1,expandDirectories:{extensions:o,files:i}});if(s.length>0)return du.relative(process.cwd(),s[0])}function Qg(t,e=!0){if(typeof t!="string")throw new TypeError("Expected a string");if(t=t.trim(),t.includes(" "))return!1;try{return new URL(t),!0}catch{return e?Qg(`https://${t}`,!1):!1}}import{getSoleRule as BP}from"remark-mdat";import{execaCommand as TP}from"execa";import{log as yA}from"remark-mdat";function ex(t,e=Number.MAX_SAFE_INTEGER){let r=[],n=DI(t,e);return r.push(RI(n)),r.push(FI(t,n)),n.hasMultipleSubcommands&&n.canRecurse&&r.push(NI(n.fullCommandName)),n.defaultCommand?.commandName!==void 0&&r.push(PI(n)),r.push(LI(t,n)),t.positionals&&!n.commandsOnly&&r.push(Jf(["Positional Argument","Description","Type","Default"],t.positionals.map(i=>[i.arguments?[i.arguments.map(o=>`\`${o}\``)].join(" "):"",`${i.description??""}${i.required===void 0?"":i.required?" _(Required.)_":" _(Optional.)_"}`,i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")?i.defaultValue:`\`${i.defaultValue}\``:""]))),t.commands&&r.push(Jf(["Command","Argument","Description"],t.commands.map(i=>[`\`${i.commandName??(i.default?"[default]":"")}\``,i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",`${i.description??""}${i.default?" _(Default command.)_":""}`]))),t.options&&!n.commandsOnly&&r.push(Jf(["Option","Argument","Description","Type","Default"],t.options.map(i=>[i.flags!==void 0||i.aliases!==void 0?[...i.flags??[],...i.aliases??[]].map(o=>`\`${o}\``).join("<br>"):"",i.arguments?i.arguments.map(o=>`\`${o}\``).join(" "):"",i.description??"",i.choices?i.choices.map(o=>`\`${o}\``).join(" "):i.type?`\`${i.type}\``:"",i.defaultValue?i.defaultValue.includes(" ")&&i.choices===void 0?i.defaultValue:`\`${i.defaultValue}\``:""]))),n.canRecurse&&n.hasMultipleSubcommands&&r.push("_See the sections below for more information on each subcommand._"),r.join(`
106
106
 
107
- `)}function Fv(t,e){let r=t.subcommandName===void 0,n=t.commands?t.commands.length>1:!1,i=e>1,o=t.commands?.find(l=>l.default),s=t.commands?.find(l=>l.commandName===void 0),a=`${t.commandName}${t.subcommandName?` ${t.subcommandName}`:""}`,u=i&&n&&o?.commandName!==void 0;return{canRecurse:i,commandsOnly:u,defaultCommand:o,fullCommandName:a,hasMultipleSubcommands:n,isTopLevel:r,topLevelCommand:s}}function Nv(t){return`#### ${t.isTopLevel?"Command":"Subcommand"}: \`${t.fullCommandName}\``}function Pv(t,e){return e.isTopLevel&&e.topLevelCommand?.description?(t.commands=t.commands?.filter(r=>r!==e.topLevelCommand),e.topLevelCommand.description):t.description??""}function Lv(t){return`This section lists top-level commands for \`${t}\`.`}function Mv(t){return`If no command is provided, \`${t.defaultCommand?.parentCommandName} ${t.defaultCommand?.commandName}\` is run by default.`}function Bv(t,e){let r=e.topLevelCommand?.arguments?` ${e.topLevelCommand.arguments.join(" ")}`:t.arguments?` ${t.arguments.join(" ")}`:"";return`Usage:
107
+ `)}function DI(t,e){let r=t.subcommandName===void 0,n=t.commands?t.commands.length>1:!1,i=e>1,o=t.commands?.find(l=>l.default),s=t.commands?.find(l=>l.commandName===void 0),a=`${t.commandName}${t.subcommandName?` ${t.subcommandName}`:""}`,u=i&&n&&o?.commandName!==void 0;return{canRecurse:i,commandsOnly:u,defaultCommand:o,fullCommandName:a,hasMultipleSubcommands:n,isTopLevel:r,topLevelCommand:s}}function RI(t){return`#### ${t.isTopLevel?"Command":"Subcommand"}: \`${t.fullCommandName}\``}function FI(t,e){return e.isTopLevel&&e.topLevelCommand?.description?(t.commands=t.commands?.filter(r=>r!==e.topLevelCommand),e.topLevelCommand.description):t.description??""}function NI(t){return`This section lists top-level commands for \`${t}\`.`}function PI(t){return`If no command is provided, \`${t.defaultCommand?.parentCommandName} ${t.defaultCommand?.commandName}\` is run by default.`}function LI(t,e){let r=e.topLevelCommand?.arguments?` ${e.topLevelCommand.arguments.join(" ")}`:t.arguments?` ${t.arguments.join(" ")}`:"";return`Usage:
108
108
 
109
109
  \`\`\`txt
110
110
  ${e.fullCommandName}${r}
111
- \`\`\``}function tp(t,e){let r=jv(e);t=t.filter((i,o)=>!r.includes(o)),e=e.map(i=>i.filter((o,s)=>!r.includes(s)));let n="";n+=`| ${t.join(" | ")} |
111
+ \`\`\``}function Jf(t,e){let r=MI(e);t=t.filter((i,o)=>!r.includes(o)),e=e.map(i=>i.filter((o,s)=>!r.includes(s)));let n="";n+=`| ${t.join(" | ")} |
112
112
  `,n+=`| ${t.map(()=>"---").join(" | ")} |
113
113
  `;for(let i of e)n+=`| ${i.join(" | ")} |
114
- `;return n}function jv(t){let e=[],r=t[0]?.length||0;for(let n=0;n<r;n++){let i=!0;for(let o of t)if(o[n]!==""){i=!1;break}i&&e.push(n)}return e}import{log as pd}from"remark-mdat";var Uv=typeof global=="object"&&global&&global.Object===Object&&global,gu=Uv;var zv=typeof self=="object"&&self&&self.Object===Object&&self,$v=gu||zv||Function("return this")(),ct=$v;var qv=ct.Symbol,At=qv;var ox=Object.prototype,Vv=ox.hasOwnProperty,Gv=ox.toString,ws=At?At.toStringTag:void 0;function Wv(t){var e=Vv.call(t,ws),r=t[ws];try{t[ws]=void 0;var n=!0}catch{}var i=Gv.call(t);return n&&(e?t[ws]=r:delete t[ws]),i}var sx=Wv;var Hv=Object.prototype,Kv=Hv.toString;function Yv(t){return Kv.call(t)}var ax=Yv;var Zv="[object Null]",Xv="[object Undefined]",ux=At?At.toStringTag:void 0;function Jv(t){return t==null?t===void 0?Xv:Zv:ux&&ux in Object(t)?sx(t):ax(t)}var Nt=Jv;function Qv(t){return t!=null&&typeof t=="object"}var ot=Qv;var e0="[object Symbol]";function t0(t){return typeof t=="symbol"||ot(t)&&Nt(t)==e0}var Cn=t0;function r0(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Or=r0;var n0=Array.isArray,J=n0;var i0=1/0,lx=At?At.prototype:void 0,cx=lx?lx.toString:void 0;function fx(t){if(typeof t=="string")return t;if(J(t))return Or(t,fx)+"";if(Cn(t))return cx?cx.call(t):"";var e=t+"";return e=="0"&&1/t==-i0?"-0":e}var px=fx;var o0=/\s/;function s0(t){for(var e=t.length;e--&&o0.test(t.charAt(e)););return e}var dx=s0;var a0=/^\s+/;function u0(t){return t&&t.slice(0,dx(t)+1).replace(a0,"")}var hx=u0;function l0(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ye=l0;var mx=NaN,c0=/^[-+]0x[0-9a-f]+$/i,f0=/^0b[01]+$/i,p0=/^0o[0-7]+$/i,d0=parseInt;function h0(t){if(typeof t=="number")return t;if(Cn(t))return mx;if(Ye(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ye(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=hx(t);var r=f0.test(t);return r||p0.test(t)?d0(t.slice(2),r?2:8):c0.test(t)?mx:+t}var gx=h0;var xx=1/0,m0=17976931348623157e292;function g0(t){if(!t)return t===0?t:0;if(t=gx(t),t===xx||t===-xx){var e=t<0?-1:1;return e*m0}return t===t?t:0}var yx=g0;function x0(t){var e=yx(t),r=e%1;return e===e?r?e-r:e:0}var Dr=x0;function y0(t){return t}var cr=y0;var b0="[object AsyncFunction]",E0="[object Function]",A0="[object GeneratorFunction]",w0="[object Proxy]";function C0(t){if(!Ye(t))return!1;var e=Nt(t);return e==E0||e==A0||e==b0||e==w0}var Pt=C0;var k0=ct["__core-js_shared__"],xu=k0;var bx=function(){var t=/[^.]+$/.exec(xu&&xu.keys&&xu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function T0(t){return!!bx&&bx in t}var Ex=T0;var _0=Function.prototype,S0=_0.toString;function v0(t){if(t!=null){try{return S0.call(t)}catch{}try{return t+""}catch{}}return""}var en=v0;var I0=/[\\^$.*+?()[\]{}|]/g,O0=/^\[object .+?Constructor\]$/,D0=Function.prototype,R0=Object.prototype,F0=D0.toString,N0=R0.hasOwnProperty,P0=RegExp("^"+F0.call(N0).replace(I0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function L0(t){if(!Ye(t)||Ex(t))return!1;var e=Pt(t)?P0:O0;return e.test(en(t))}var Ax=L0;function M0(t,e){return t?.[e]}var wx=M0;function B0(t,e){var r=wx(t,e);return Ax(r)?r:void 0}var $t=B0;var j0=$t(ct,"WeakMap"),yu=j0;var Cx=Object.create,U0=function(){function t(){}return function(e){if(!Ye(e))return{};if(Cx)return Cx(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),kx=U0;function z0(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Tx=z0;function $0(){}var Ze=$0;function q0(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var _x=q0;var V0=800,G0=16,W0=Date.now;function H0(t){var e=0,r=0;return function(){var n=W0(),i=G0-(n-r);if(r=n,i>0){if(++e>=V0)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var Sx=H0;function K0(t){return function(){return t}}var vx=K0;var Y0=function(){try{var t=$t(Object,"defineProperty");return t({},"",{}),t}catch{}}(),co=Y0;var Z0=co?function(t,e){return co(t,"toString",{configurable:!0,enumerable:!1,value:vx(e),writable:!0})}:cr,Ix=Z0;var X0=Sx(Ix),Ox=X0;function J0(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var bu=J0;function Q0(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var Eu=Q0;function eI(t){return t!==t}var Dx=eI;function tI(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var Rx=tI;function rI(t,e,r){return e===e?Rx(t,e,r):Eu(t,Dx,r)}var fo=rI;function nI(t,e){var r=t==null?0:t.length;return!!r&&fo(t,e,0)>-1}var Au=nI;var iI=9007199254740991,oI=/^(?:0|[1-9]\d*)$/;function sI(t,e){var r=typeof t;return e=e??iI,!!e&&(r=="number"||r!="symbol"&&oI.test(t))&&t>-1&&t%1==0&&t<e}var kn=sI;function aI(t,e,r){e=="__proto__"&&co?co(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var po=aI;function uI(t,e){return t===e||t!==t&&e!==e}var Rr=uI;var lI=Object.prototype,cI=lI.hasOwnProperty;function fI(t,e,r){var n=t[e];(!(cI.call(t,e)&&Rr(n,r))||r===void 0&&!(e in t))&&po(t,e,r)}var Tn=fI;function pI(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;u===void 0&&(u=t[a]),i?po(r,a,u):Tn(r,a,u)}return r}var Fr=pI;var Fx=Math.max;function dI(t,e,r){return e=Fx(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Fx(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Tx(t,this,a)}}var Nx=dI;function hI(t,e){return Ox(Nx(t,e,cr),t+"")}var ho=hI;var mI=9007199254740991;function gI(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=mI}var mo=gI;function xI(t){return t!=null&&mo(t.length)&&!Pt(t)}var ft=xI;function yI(t,e,r){if(!Ye(r))return!1;var n=typeof e;return(n=="number"?ft(r)&&kn(e,r.length):n=="string"&&e in r)?Rr(r[e],t):!1}var _n=yI;function bI(t){return ho(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&_n(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}var Px=bI;var EI=Object.prototype;function AI(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||EI;return t===r}var Nr=AI;function wI(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Lx=wI;var CI="[object Arguments]";function kI(t){return ot(t)&&Nt(t)==CI}var rp=kI;var Mx=Object.prototype,TI=Mx.hasOwnProperty,_I=Mx.propertyIsEnumerable,SI=rp(function(){return arguments}())?rp:function(t){return ot(t)&&TI.call(t,"callee")&&!_I.call(t,"callee")},Sn=SI;function vI(){return!1}var Bx=vI;var zx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jx=zx&&typeof module=="object"&&module&&!module.nodeType&&module,II=jx&&jx.exports===zx,Ux=II?ct.Buffer:void 0,OI=Ux?Ux.isBuffer:void 0,DI=OI||Bx,tn=DI;var RI="[object Arguments]",FI="[object Array]",NI="[object Boolean]",PI="[object Date]",LI="[object Error]",MI="[object Function]",BI="[object Map]",jI="[object Number]",UI="[object Object]",zI="[object RegExp]",$I="[object Set]",qI="[object String]",VI="[object WeakMap]",GI="[object ArrayBuffer]",WI="[object DataView]",HI="[object Float32Array]",KI="[object Float64Array]",YI="[object Int8Array]",ZI="[object Int16Array]",XI="[object Int32Array]",JI="[object Uint8Array]",QI="[object Uint8ClampedArray]",eO="[object Uint16Array]",tO="[object Uint32Array]",Ve={};Ve[HI]=Ve[KI]=Ve[YI]=Ve[ZI]=Ve[XI]=Ve[JI]=Ve[QI]=Ve[eO]=Ve[tO]=!0;Ve[RI]=Ve[FI]=Ve[GI]=Ve[NI]=Ve[WI]=Ve[PI]=Ve[LI]=Ve[MI]=Ve[BI]=Ve[jI]=Ve[UI]=Ve[zI]=Ve[$I]=Ve[qI]=Ve[VI]=!1;function rO(t){return ot(t)&&mo(t.length)&&!!Ve[Nt(t)]}var $x=rO;function nO(t){return function(e){return t(e)}}var Pr=nO;var qx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cs=qx&&typeof module=="object"&&module&&!module.nodeType&&module,iO=Cs&&Cs.exports===qx,np=iO&&gu.process,oO=function(){try{var t=Cs&&Cs.require&&Cs.require("util").types;return t||np&&np.binding&&np.binding("util")}catch{}}(),fr=oO;var Vx=fr&&fr.isTypedArray,sO=Vx?Pr(Vx):$x,go=sO;var aO=Object.prototype,uO=aO.hasOwnProperty;function lO(t,e){var r=J(t),n=!r&&Sn(t),i=!r&&!n&&tn(t),o=!r&&!n&&!i&&go(t),s=r||n||i||o,a=s?Lx(t.length,String):[],u=a.length;for(var l in t)(e||uO.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||kn(l,u)))&&a.push(l);return a}var wu=lO;function cO(t,e){return function(r){return t(e(r))}}var Cu=cO;var fO=Cu(Object.keys,Object),Gx=fO;var pO=Object.prototype,dO=pO.hasOwnProperty;function hO(t){if(!Nr(t))return Gx(t);var e=[];for(var r in Object(t))dO.call(t,r)&&r!="constructor"&&e.push(r);return e}var ku=hO;function mO(t){return ft(t)?wu(t):ku(t)}var Pe=mO;var gO=Object.prototype,xO=gO.hasOwnProperty,yO=Px(function(t,e){if(Nr(e)||ft(e)){Fr(e,Pe(e),t);return}for(var r in e)xO.call(e,r)&&Tn(t,r,e[r])}),kt=yO;function bO(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var Wx=bO;var EO=Object.prototype,AO=EO.hasOwnProperty;function wO(t){if(!Ye(t))return Wx(t);var e=Nr(t),r=[];for(var n in t)n=="constructor"&&(e||!AO.call(t,n))||r.push(n);return r}var Hx=wO;function CO(t){return ft(t)?wu(t,!0):Hx(t)}var vn=CO;var kO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,TO=/^\w*$/;function _O(t,e){if(J(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Cn(t)?!0:TO.test(t)||!kO.test(t)||e!=null&&t in Object(e)}var xo=_O;var SO=$t(Object,"create"),rn=SO;function vO(){this.__data__=rn?rn(null):{},this.size=0}var Kx=vO;function IO(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Yx=IO;var OO="__lodash_hash_undefined__",DO=Object.prototype,RO=DO.hasOwnProperty;function FO(t){var e=this.__data__;if(rn){var r=e[t];return r===OO?void 0:r}return RO.call(e,t)?e[t]:void 0}var Zx=FO;var NO=Object.prototype,PO=NO.hasOwnProperty;function LO(t){var e=this.__data__;return rn?e[t]!==void 0:PO.call(e,t)}var Xx=LO;var MO="__lodash_hash_undefined__";function BO(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=rn&&e===void 0?MO:e,this}var Jx=BO;function yo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}yo.prototype.clear=Kx;yo.prototype.delete=Yx;yo.prototype.get=Zx;yo.prototype.has=Xx;yo.prototype.set=Jx;var ip=yo;function jO(){this.__data__=[],this.size=0}var Qx=jO;function UO(t,e){for(var r=t.length;r--;)if(Rr(t[r][0],e))return r;return-1}var In=UO;var zO=Array.prototype,$O=zO.splice;function qO(t){var e=this.__data__,r=In(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():$O.call(e,r,1),--this.size,!0}var ey=qO;function VO(t){var e=this.__data__,r=In(e,t);return r<0?void 0:e[r][1]}var ty=VO;function GO(t){return In(this.__data__,t)>-1}var ry=GO;function WO(t,e){var r=this.__data__,n=In(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var ny=WO;function bo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bo.prototype.clear=Qx;bo.prototype.delete=ey;bo.prototype.get=ty;bo.prototype.has=ry;bo.prototype.set=ny;var On=bo;var HO=$t(ct,"Map"),Dn=HO;function KO(){this.size=0,this.__data__={hash:new ip,map:new(Dn||On),string:new ip}}var iy=KO;function YO(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var oy=YO;function ZO(t,e){var r=t.__data__;return oy(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Rn=ZO;function XO(t){var e=Rn(this,t).delete(t);return this.size-=e?1:0,e}var sy=XO;function JO(t){return Rn(this,t).get(t)}var ay=JO;function QO(t){return Rn(this,t).has(t)}var uy=QO;function e1(t,e){var r=Rn(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var ly=e1;function Eo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Eo.prototype.clear=iy;Eo.prototype.delete=sy;Eo.prototype.get=ay;Eo.prototype.has=uy;Eo.prototype.set=ly;var Si=Eo;var t1="Expected a function";function op(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(t1);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(op.Cache||Si),r}op.Cache=Si;var cy=op;var r1=500;function n1(t){var e=cy(t,function(n){return r.size===r1&&r.clear(),n}),r=e.cache;return e}var fy=n1;var i1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o1=/\\(\\)?/g,s1=fy(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(i1,function(r,n,i,o){e.push(i?o.replace(o1,"$1"):n||r)}),e}),py=s1;function a1(t){return t==null?"":px(t)}var dy=a1;function u1(t,e){return J(t)?t:xo(t,e)?[t]:py(dy(t))}var Fn=u1;var l1=1/0;function c1(t){if(typeof t=="string"||Cn(t))return t;var e=t+"";return e=="0"&&1/t==-l1?"-0":e}var Lr=c1;function f1(t,e){e=Fn(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Lr(e[r++])];return r&&r==n?t:void 0}var Ao=f1;function p1(t,e,r){var n=t==null?void 0:Ao(t,e);return n===void 0?r:n}var hy=p1;function d1(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var wo=d1;var my=At?At.isConcatSpreadable:void 0;function h1(t){return J(t)||Sn(t)||!!(my&&t&&t[my])}var gy=h1;function xy(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=gy),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?xy(a,e-1,r,n,i):wo(i,a):n||(i[i.length]=a)}return i}var Co=xy;function m1(t){var e=t==null?0:t.length;return e?Co(t,1):[]}var xt=m1;var g1=Cu(Object.getPrototypeOf,Object),Tu=g1;function x1(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var _u=x1;function y1(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var yy=y1;function b1(){this.__data__=new On,this.size=0}var by=b1;function E1(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var Ey=E1;function A1(t){return this.__data__.get(t)}var Ay=A1;function w1(t){return this.__data__.has(t)}var wy=w1;var C1=200;function k1(t,e){var r=this.__data__;if(r instanceof On){var n=r.__data__;if(!Dn||n.length<C1-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Si(n)}return r.set(t,e),this.size=r.size,this}var Cy=k1;function ko(t){var e=this.__data__=new On(t);this.size=e.size}ko.prototype.clear=by;ko.prototype.delete=Ey;ko.prototype.get=Ay;ko.prototype.has=wy;ko.prototype.set=Cy;var Nn=ko;function T1(t,e){return t&&Fr(e,Pe(e),t)}var ky=T1;function _1(t,e){return t&&Fr(e,vn(e),t)}var Ty=_1;var Iy=typeof exports=="object"&&exports&&!exports.nodeType&&exports,_y=Iy&&typeof module=="object"&&module&&!module.nodeType&&module,S1=_y&&_y.exports===Iy,Sy=S1?ct.Buffer:void 0,vy=Sy?Sy.allocUnsafe:void 0;function v1(t,e){if(e)return t.slice();var r=t.length,n=vy?vy(r):new t.constructor(r);return t.copy(n),n}var Oy=v1;function I1(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var To=I1;function O1(){return[]}var Su=O1;var D1=Object.prototype,R1=D1.propertyIsEnumerable,Dy=Object.getOwnPropertySymbols,F1=Dy?function(t){return t==null?[]:(t=Object(t),To(Dy(t),function(e){return R1.call(t,e)}))}:Su,_o=F1;function N1(t,e){return Fr(t,_o(t),e)}var Ry=N1;var P1=Object.getOwnPropertySymbols,L1=P1?function(t){for(var e=[];t;)wo(e,_o(t)),t=Tu(t);return e}:Su,vu=L1;function M1(t,e){return Fr(t,vu(t),e)}var Fy=M1;function B1(t,e,r){var n=e(t);return J(t)?n:wo(n,r(t))}var Iu=B1;function j1(t){return Iu(t,Pe,_o)}var ks=j1;function U1(t){return Iu(t,vn,vu)}var Ou=U1;var z1=$t(ct,"DataView"),Du=z1;var $1=$t(ct,"Promise"),Ru=$1;var q1=$t(ct,"Set"),Pn=q1;var Ny="[object Map]",V1="[object Object]",Py="[object Promise]",Ly="[object Set]",My="[object WeakMap]",By="[object DataView]",G1=en(Du),W1=en(Dn),H1=en(Ru),K1=en(Pn),Y1=en(yu),vi=Nt;(Du&&vi(new Du(new ArrayBuffer(1)))!=By||Dn&&vi(new Dn)!=Ny||Ru&&vi(Ru.resolve())!=Py||Pn&&vi(new Pn)!=Ly||yu&&vi(new yu)!=My)&&(vi=function(t){var e=Nt(t),r=e==V1?t.constructor:void 0,n=r?en(r):"";if(n)switch(n){case G1:return By;case W1:return Ny;case H1:return Py;case K1:return Ly;case Y1:return My}return e});var gr=vi;var Z1=Object.prototype,X1=Z1.hasOwnProperty;function J1(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&X1.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var jy=J1;var Q1=ct.Uint8Array,So=Q1;function eD(t){var e=new t.constructor(t.byteLength);return new So(e).set(new So(t)),e}var vo=eD;function tD(t,e){var r=e?vo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Uy=tD;var rD=/\w*$/;function nD(t){var e=new t.constructor(t.source,rD.exec(t));return e.lastIndex=t.lastIndex,e}var zy=nD;var $y=At?At.prototype:void 0,qy=$y?$y.valueOf:void 0;function iD(t){return qy?Object(qy.call(t)):{}}var Vy=iD;function oD(t,e){var r=e?vo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var Gy=oD;var sD="[object Boolean]",aD="[object Date]",uD="[object Map]",lD="[object Number]",cD="[object RegExp]",fD="[object Set]",pD="[object String]",dD="[object Symbol]",hD="[object ArrayBuffer]",mD="[object DataView]",gD="[object Float32Array]",xD="[object Float64Array]",yD="[object Int8Array]",bD="[object Int16Array]",ED="[object Int32Array]",AD="[object Uint8Array]",wD="[object Uint8ClampedArray]",CD="[object Uint16Array]",kD="[object Uint32Array]";function TD(t,e,r){var n=t.constructor;switch(e){case hD:return vo(t);case sD:case aD:return new n(+t);case mD:return Uy(t,r);case gD:case xD:case yD:case bD:case ED:case AD:case wD:case CD:case kD:return Gy(t,r);case uD:return new n;case lD:case pD:return new n(t);case cD:return zy(t);case fD:return new n;case dD:return Vy(t)}}var Wy=TD;function _D(t){return typeof t.constructor=="function"&&!Nr(t)?kx(Tu(t)):{}}var Hy=_D;var SD="[object Map]";function vD(t){return ot(t)&&gr(t)==SD}var Ky=vD;var Yy=fr&&fr.isMap,ID=Yy?Pr(Yy):Ky,Zy=ID;var OD="[object Set]";function DD(t){return ot(t)&&gr(t)==OD}var Xy=DD;var Jy=fr&&fr.isSet,RD=Jy?Pr(Jy):Xy,Qy=RD;var FD=1,ND=2,PD=4,eb="[object Arguments]",LD="[object Array]",MD="[object Boolean]",BD="[object Date]",jD="[object Error]",tb="[object Function]",UD="[object GeneratorFunction]",zD="[object Map]",$D="[object Number]",rb="[object Object]",qD="[object RegExp]",VD="[object Set]",GD="[object String]",WD="[object Symbol]",HD="[object WeakMap]",KD="[object ArrayBuffer]",YD="[object DataView]",ZD="[object Float32Array]",XD="[object Float64Array]",JD="[object Int8Array]",QD="[object Int16Array]",eR="[object Int32Array]",tR="[object Uint8Array]",rR="[object Uint8ClampedArray]",nR="[object Uint16Array]",iR="[object Uint32Array]",Le={};Le[eb]=Le[LD]=Le[KD]=Le[YD]=Le[MD]=Le[BD]=Le[ZD]=Le[XD]=Le[JD]=Le[QD]=Le[eR]=Le[zD]=Le[$D]=Le[rb]=Le[qD]=Le[VD]=Le[GD]=Le[WD]=Le[tR]=Le[rR]=Le[nR]=Le[iR]=!0;Le[jD]=Le[tb]=Le[HD]=!1;function Fu(t,e,r,n,i,o){var s,a=e&FD,u=e&ND,l=e&PD;if(r&&(s=i?r(t,n,i,o):r(t)),s!==void 0)return s;if(!Ye(t))return t;var c=J(t);if(c){if(s=jy(t),!a)return _x(t,s)}else{var f=gr(t),p=f==tb||f==UD;if(tn(t))return Oy(t,a);if(f==rb||f==eb||p&&!i){if(s=u||p?{}:Hy(t),!a)return u?Fy(t,Ty(s,t)):Ry(t,ky(s,t))}else{if(!Le[f])return i?t:{};s=Wy(t,f,a)}}o||(o=new Nn);var d=o.get(t);if(d)return d;o.set(t,s),Qy(t)?t.forEach(function(g){s.add(Fu(g,e,r,g,t,o))}):Zy(t)&&t.forEach(function(g,b){s.set(b,Fu(g,e,r,b,t,o))});var m=l?u?Ou:ks:u?vn:Pe,y=c?void 0:m(t);return bu(y||t,function(g,b){y&&(b=g,g=t[b]),Tn(s,b,Fu(g,e,r,b,t,o))}),s}var nb=Fu;var oR=4;function sR(t){return nb(t,oR)}var Me=sR;function aR(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var Mr=aR;var uR="__lodash_hash_undefined__";function lR(t){return this.__data__.set(t,uR),this}var ib=lR;function cR(t){return this.__data__.has(t)}var ob=cR;function Nu(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Si;++e<r;)this.add(t[e])}Nu.prototype.add=Nu.prototype.push=ib;Nu.prototype.has=ob;var Io=Nu;function fR(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Pu=fR;function pR(t,e){return t.has(e)}var Oo=pR;var dR=1,hR=2;function mR(t,e,r,n,i,o){var s=r&dR,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,p=!0,d=r&hR?new Io:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var g=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(g!==void 0){if(g)continue;p=!1;break}if(d){if(!Pu(e,function(b,C){if(!Oo(d,C)&&(m===b||i(m,b,r,n,o)))return d.push(C)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,o))){p=!1;break}}return o.delete(t),o.delete(e),p}var Lu=mR;function gR(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var sb=gR;function xR(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Do=xR;var yR=1,bR=2,ER="[object Boolean]",AR="[object Date]",wR="[object Error]",CR="[object Map]",kR="[object Number]",TR="[object RegExp]",_R="[object Set]",SR="[object String]",vR="[object Symbol]",IR="[object ArrayBuffer]",OR="[object DataView]",ab=At?At.prototype:void 0,sp=ab?ab.valueOf:void 0;function DR(t,e,r,n,i,o,s){switch(r){case OR:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case IR:return!(t.byteLength!=e.byteLength||!o(new So(t),new So(e)));case ER:case AR:case kR:return Rr(+t,+e);case wR:return t.name==e.name&&t.message==e.message;case TR:case SR:return t==e+"";case CR:var a=sb;case _R:var u=n&yR;if(a||(a=Do),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=bR,s.set(t,e);var c=Lu(a(t),a(e),n,i,o,s);return s.delete(t),c;case vR:if(sp)return sp.call(t)==sp.call(e)}return!1}var ub=DR;var RR=1,FR=Object.prototype,NR=FR.hasOwnProperty;function PR(t,e,r,n,i,o){var s=r&RR,a=ks(t),u=a.length,l=ks(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var p=a[f];if(!(s?p in e:NR.call(e,p)))return!1}var d=o.get(t),m=o.get(e);if(d&&m)return d==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var g=s;++f<u;){p=a[f];var b=t[p],C=e[p];if(n)var w=s?n(C,b,p,e,t,o):n(b,C,p,t,e,o);if(!(w===void 0?b===C||i(b,C,r,n,o):w)){y=!1;break}g||(g=p=="constructor")}if(y&&!g){var D=t.constructor,R=e.constructor;D!=R&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof R=="function"&&R instanceof R)&&(y=!1)}return o.delete(t),o.delete(e),y}var lb=PR;var LR=1,cb="[object Arguments]",fb="[object Array]",Mu="[object Object]",MR=Object.prototype,pb=MR.hasOwnProperty;function BR(t,e,r,n,i,o){var s=J(t),a=J(e),u=s?fb:gr(t),l=a?fb:gr(e);u=u==cb?Mu:u,l=l==cb?Mu:l;var c=u==Mu,f=l==Mu,p=u==l;if(p&&tn(t)){if(!tn(e))return!1;s=!0,c=!1}if(p&&!c)return o||(o=new Nn),s||go(t)?Lu(t,e,r,n,i,o):ub(t,e,u,r,n,i,o);if(!(r&LR)){var d=c&&pb.call(t,"__wrapped__"),m=f&&pb.call(e,"__wrapped__");if(d||m){var y=d?t.value():t,g=m?e.value():e;return o||(o=new Nn),i(y,g,r,n,o)}}return p?(o||(o=new Nn),lb(t,e,r,n,i,o)):!1}var db=BR;function hb(t,e,r,n,i){return t===e?!0:t==null||e==null||!ot(t)&&!ot(e)?t!==t&&e!==e:db(t,e,r,n,hb,i)}var Bu=hb;var jR=1,UR=2;function zR(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new Nn;if(n)var p=n(l,c,u,t,e,f);if(!(p===void 0?Bu(c,l,jR|UR,n,f):p))return!1}}return!0}var mb=zR;function $R(t){return t===t&&!Ye(t)}var ju=$R;function qR(t){for(var e=Pe(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,ju(i)]}return e}var gb=qR;function VR(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var Uu=VR;function GR(t){var e=gb(t);return e.length==1&&e[0][2]?Uu(e[0][0],e[0][1]):function(r){return r===t||mb(r,t,e)}}var xb=GR;function WR(t,e){return t!=null&&e in Object(t)}var yb=WR;function HR(t,e,r){e=Fn(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=Lr(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&mo(i)&&kn(s,i)&&(J(t)||Sn(t)))}var zu=HR;function KR(t,e){return t!=null&&zu(t,e,yb)}var bb=KR;var YR=1,ZR=2;function XR(t,e){return xo(t)&&ju(e)?Uu(Lr(t),e):function(r){var n=hy(r,t);return n===void 0&&n===e?bb(r,t):Bu(e,n,YR|ZR)}}var Eb=XR;function JR(t){return function(e){return e?.[t]}}var Ab=JR;function QR(t){return function(e){return Ao(e,t)}}var wb=QR;function eF(t){return xo(t)?Ab(Lr(t)):wb(t)}var Cb=eF;function tF(t){return typeof t=="function"?t:t==null?cr:typeof t=="object"?J(t)?Eb(t[0],t[1]):xb(t):Cb(t)}var pt=tF;function rF(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}var kb=rF;function nF(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(r(o[u],u,o)===!1)break}return e}}var Tb=nF;var iF=Tb(),_b=iF;function oF(t,e){return t&&_b(t,e,Pe)}var Sb=oF;function sF(t,e){return function(r,n){if(r==null)return r;if(!ft(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var vb=sF;var aF=vb(Sb),qt=aF;function uF(t,e,r,n){return qt(t,function(i,o,s){e(n,i,r(i),s)}),n}var Ib=uF;function lF(t,e){return function(r,n){var i=J(r)?kb:Ib,o=e?e():{};return i(r,t,pt(n,2),o)}}var Ob=lF;var Db=Object.prototype,cF=Db.hasOwnProperty,fF=ho(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&_n(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=vn(o),a=-1,u=s.length;++a<u;){var l=s[a],c=t[l];(c===void 0||Rr(c,Db[l])&&!cF.call(t,l))&&(t[l]=o[l])}return t}),Ro=fF;function pF(t){return ot(t)&&ft(t)}var ap=pF;function dF(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var $u=dF;var hF=200;function mF(t,e,r,n){var i=-1,o=Au,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=Or(e,Pr(r))),n?(o=$u,s=!1):e.length>=hF&&(o=Oo,s=!1,e=new Io(e));e:for(;++i<a;){var c=t[i],f=r==null?c:r(c);if(c=n||c!==0?c:0,s&&f===f){for(var p=l;p--;)if(e[p]===f)continue e;u.push(c)}else o(e,f,n)||u.push(c)}return u}var Rb=mF;var gF=ho(function(t,e){return ap(t)?Rb(t,Co(e,1,ap,!0)):[]}),Ln=gF;function xF(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var Br=xF;function yF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Dr(e),_u(t,e<0?0:e,n)):[]}var st=yF;function bF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Dr(e),e=n-e,_u(t,0,e<0?0:e)):[]}var nn=bF;function EF(t){return typeof t=="function"?t:cr}var Fb=EF;function AF(t,e){var r=J(t)?bu:qt;return r(t,Fb(e))}var G=AF;function wF(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var Nb=wF;function CF(t,e){var r=!0;return qt(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var Pb=CF;function kF(t,e,r){var n=J(t)?Nb:Pb;return r&&_n(t,e,r)&&(e=void 0),n(t,pt(e,3))}var vt=kF;function TF(t,e){var r=[];return qt(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var qu=TF;function _F(t,e){var r=J(t)?To:qu;return r(t,pt(e,3))}var It=_F;function SF(t){return function(e,r,n){var i=Object(e);if(!ft(e)){var o=pt(r,3);e=Pe(e),r=function(a){return o(i[a],a,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}var Lb=SF;var vF=Math.max;function IF(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Dr(r);return i<0&&(i=vF(n+i,0)),Eu(t,pt(e,3),i)}var Mb=IF;var OF=Lb(Mb),jr=OF;function DF(t){return t&&t.length?t[0]:void 0}var wt=DF;function RF(t,e){var r=-1,n=ft(t)?Array(t.length):[];return qt(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Bb=RF;function FF(t,e){var r=J(t)?Or:Bb;return r(t,pt(e,3))}var q=FF;function NF(t,e){return Co(q(t,e),1)}var Lt=NF;var PF=Object.prototype,LF=PF.hasOwnProperty,MF=Ob(function(t,e,r){LF.call(t,r)?t[r].push(e):po(t,r,[e])}),up=MF;var BF=Object.prototype,jF=BF.hasOwnProperty;function UF(t,e){return t!=null&&jF.call(t,e)}var jb=UF;function zF(t,e){return t!=null&&zu(t,e,jb)}var Z=zF;var $F="[object String]";function qF(t){return typeof t=="string"||!J(t)&&ot(t)&&Nt(t)==$F}var yt=qF;function VF(t,e){return Or(e,function(r){return t[r]})}var Ub=VF;function GF(t){return t==null?[]:Ub(t,Pe(t))}var Re=GF;var WF=Math.max;function HF(t,e,r,n){t=ft(t)?t:Re(t),r=r&&!n?Dr(r):0;var i=t.length;return r<0&&(r=WF(i+r,0)),yt(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&fo(t,e,r)>-1}var We=HF;var KF=Math.max;function YF(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Dr(r);return i<0&&(i=KF(n+i,0)),fo(t,e,i)}var Vu=YF;var ZF="[object Map]",XF="[object Set]",JF=Object.prototype,QF=JF.hasOwnProperty;function eN(t){if(t==null)return!0;if(ft(t)&&(J(t)||typeof t=="string"||typeof t.splice=="function"||tn(t)||go(t)||Sn(t)))return!t.length;var e=gr(t);if(e==ZF||e==XF)return!t.size;if(Nr(t))return!ku(t).length;for(var r in t)if(QF.call(t,r))return!1;return!0}var Te=eN;var tN="[object RegExp]";function rN(t){return ot(t)&&Nt(t)==tN}var zb=rN;var $b=fr&&fr.isRegExp,nN=$b?Pr($b):zb,pr=nN;function iN(t){return t===void 0}var Ot=iN;var oN="Expected a function";function sN(t){if(typeof t!="function")throw new TypeError(oN);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var qb=sN;function aN(t,e,r,n){if(!Ye(t))return t;e=Fn(e,t);for(var i=-1,o=e.length,s=o-1,a=t;a!=null&&++i<o;){var u=Lr(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=a[u];l=n?n(c,u,a):void 0,l===void 0&&(l=Ye(c)?c:kn(e[i+1])?[]:{})}Tn(a,u,l),a=a[u]}return t}var Vb=aN;function uN(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=Ao(t,s);r(a,s)&&Vb(o,Fn(s,t),a)}return o}var Gb=uN;function lN(t,e){if(t==null)return{};var r=Or(Ou(t),function(n){return[n]});return e=pt(e),Gb(t,r,function(n,i){return e(n,i[0])})}var Vt=lN;function cN(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var Wb=cN;function fN(t,e,r){var n=J(t)?yy:Wb,i=arguments.length<3;return n(t,pt(e,4),r,i,qt)}var dt=fN;function pN(t,e){var r=J(t)?To:qu;return r(t,qb(pt(e,3)))}var Mn=pN;function dN(t,e){var r;return qt(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var Hb=dN;function hN(t,e,r){var n=J(t)?Pu:Hb;return r&&_n(t,e,r)&&(e=void 0),n(t,pt(e,3))}var Ts=hN;var mN=1/0,gN=Pn&&1/Do(new Pn([,-0]))[1]==mN?function(t){return new Pn(t)}:Ze,Kb=gN;var xN=200;function yN(t,e,r){var n=-1,i=Au,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=$u;else if(o>=xN){var l=e?null:Kb(t);if(l)return Do(l);s=!1,i=Oo,u=new Io}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}var Yb=yN;function bN(t){return t&&t.length?Yb(t):[]}var Fo=bN;function No(t){console&&console.error&&console.error(`Error: ${t}`)}function _s(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Ss(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function vs(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function EN(t){return AN(t)?t.LABEL:t.name}function AN(t){return yt(t.LABEL)&&t.LABEL!==""}var tr=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),G(this.definition,r=>{r.accept(e)})}},Be=class extends tr{constructor(e){super([]),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Mt=class extends tr{constructor(e){super(e.definition),this.orgText="",kt(this,Vt(e,r=>r!==void 0))}},je=class extends tr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,kt(this,Vt(e,r=>r!==void 0))}},Ge=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},at=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},ut=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},De=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},et=class extends tr{constructor(e){super(e.definition),this.idx=1,kt(this,Vt(e,r=>r!==void 0))}},tt=class extends tr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,kt(this,Vt(e,r=>r!==void 0))}},Ie=class{constructor(e){this.idx=1,kt(this,Vt(e,r=>r!==void 0))}accept(e){e.visit(this)}};function Gu(t){return q(t,Po)}function Po(t){function e(r){return q(r,Po)}if(t instanceof Be){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return yt(t.label)&&(r.label=t.label),r}else{if(t instanceof je)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ge)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof at)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ut)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Po(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof et)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Po(new Ie({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof De)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof tt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Ie){let r={type:"Terminal",name:t.terminalType.name,label:EN(t.terminalType),idx:t.idx};yt(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=pr(n)?n.source:n),r}else{if(t instanceof Mt)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var Bt=class{visit(e){let r=e;switch(r.constructor){case Be:return this.visitNonTerminal(r);case je:return this.visitAlternative(r);case Ge:return this.visitOption(r);case at:return this.visitRepetitionMandatory(r);case ut:return this.visitRepetitionMandatoryWithSeparator(r);case et:return this.visitRepetitionWithSeparator(r);case De:return this.visitRepetition(r);case tt:return this.visitAlternation(r);case Ie:return this.visitTerminal(r);case Mt:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function lp(t){return t instanceof je||t instanceof Ge||t instanceof De||t instanceof at||t instanceof ut||t instanceof et||t instanceof Ie||t instanceof Mt}function Ii(t,e=[]){return t instanceof Ge||t instanceof De||t instanceof et?!0:t instanceof tt?Ts(t.definition,n=>Ii(n,e)):t instanceof Be&&We(e,t)?!1:t instanceof tr?(t instanceof Be&&e.push(t),vt(t.definition,n=>Ii(n,e))):!1}function cp(t){return t instanceof tt}function Gt(t){if(t instanceof Be)return"SUBRULE";if(t instanceof Ge)return"OPTION";if(t instanceof tt)return"OR";if(t instanceof at)return"AT_LEAST_ONE";if(t instanceof ut)return"AT_LEAST_ONE_SEP";if(t instanceof et)return"MANY_SEP";if(t instanceof De)return"MANY";if(t instanceof Ie)return"CONSUME";throw Error("non exhaustive match")}var on=class{walk(e,r=[]){G(e.definition,(n,i)=>{let o=st(e.definition,i+1);if(n instanceof Be)this.walkProdRef(n,o,r);else if(n instanceof Ie)this.walkTerminal(n,o,r);else if(n instanceof je)this.walkFlat(n,o,r);else if(n instanceof Ge)this.walkOption(n,o,r);else if(n instanceof at)this.walkAtLeastOne(n,o,r);else if(n instanceof ut)this.walkAtLeastOneSep(n,o,r);else if(n instanceof et)this.walkManySep(n,o,r);else if(n instanceof De)this.walkMany(n,o,r);else if(n instanceof tt)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=Zb(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=Zb(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);G(e.definition,o=>{let s=new je({definition:[o]});this.walk(s,i)})}};function Zb(t,e,r){return[new Ge({definition:[new Ie({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Oi(t){if(t instanceof Be)return Oi(t.referencedRule);if(t instanceof Ie)return kN(t);if(lp(t))return wN(t);if(cp(t))return CN(t);throw Error("non exhaustive match")}function wN(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=Ii(o),e=e.concat(Oi(o)),n=n+1,i=r.length>n;return Fo(e)}function CN(t){let e=q(t.definition,r=>Oi(r));return Fo(xt(e))}function kN(t){return[t.terminalType]}var Wu="_~IN~_";var fp=class extends on{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=TN(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new je({definition:o}),a=Oi(s);this.follows[i]=a}};function Xb(t){let e={};return G(t,r=>{let n=new fp(r).startWalking();kt(e,n)}),e}function TN(t,e){return t.name+e+Wu}function ue(t){return t.charCodeAt(0)}function Hu(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Lo(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Di(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Is(){throw Error("Internal Error - Should never get here!")}function pp(t){return t.type==="Character"}var Os=[];for(let t=ue("0");t<=ue("9");t++)Os.push(t);var Ds=[ue("_")].concat(Os);for(let t=ue("a");t<=ue("z");t++)Ds.push(t);for(let t=ue("A");t<=ue("Z");t++)Ds.push(t);var dp=[ue(" "),ue("\f"),ue(`
115
- `),ue("\r"),ue(" "),ue("\v"),ue(" "),ue("\xA0"),ue("\u1680"),ue("\u2000"),ue("\u2001"),ue("\u2002"),ue("\u2003"),ue("\u2004"),ue("\u2005"),ue("\u2006"),ue("\u2007"),ue("\u2008"),ue("\u2009"),ue("\u200A"),ue("\u2028"),ue("\u2029"),ue("\u202F"),ue("\u205F"),ue("\u3000"),ue("\uFEFF")];var _N=/[0-9a-fA-F]/,Ku=/[0-9]/,SN=/[1-9]/,Rs=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Lo(n,"global");break;case"i":Lo(n,"ignoreCase");break;case"m":Lo(n,"multiLine");break;case"u":Lo(n,"unicode");break;case"y":Lo(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Di(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Is()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Di(r);break}if(!(e===!0&&r===void 0)&&Di(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Di(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Is()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[ue(`
116
- `),ue("\r"),ue("\u2028"),ue("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=Os;break;case"D":e=Os,r=!0;break;case"s":e=dp;break;case"S":e=dp,r=!0;break;case"w":e=Ds;break;case"W":e=Ds,r=!0;break}return Di(e)?{type:"Set",value:e,complement:r}:Is()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=ue("\f");break;case"n":e=ue(`
117
- `);break;case"r":e=ue("\r");break;case"t":e=ue(" ");break;case"v":e=ue("\v");break}return Di(e)?{type:"Character",value:e}:Is()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:ue("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:ue(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
118
- `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:ue(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(pp(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(pp(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else Hu(n.value,e),e.push(ue("-")),Hu(o.value,e)}else Hu(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
119
- `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:ue("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(SN.test(e)===!1)throw Error("Expecting a positive integer");for(;Ku.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Ku.test(e)===!1)throw Error("Expecting an integer");for(;Ku.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
120
- `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:ue(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Ku.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
114
+ `;return n}function MI(t){let e=[],r=t[0]?.length||0;for(let n=0;n<r;n++){let i=!0;for(let o of t)if(o[n]!==""){i=!1;break}i&&e.push(n)}return e}import{log as ld}from"remark-mdat";var BI=typeof global=="object"&&global&&global.Object===Object&&global,mu=BI;var jI=typeof self=="object"&&self&&self.Object===Object&&self,UI=mu||jI||Function("return this")(),ct=UI;var zI=ct.Symbol,At=zI;var tx=Object.prototype,$I=tx.hasOwnProperty,qI=tx.toString,ks=At?At.toStringTag:void 0;function VI(t){var e=$I.call(t,ks),r=t[ks];try{t[ks]=void 0;var n=!0}catch{}var i=qI.call(t);return n&&(e?t[ks]=r:delete t[ks]),i}var rx=VI;var GI=Object.prototype,WI=GI.toString;function HI(t){return WI.call(t)}var nx=HI;var KI="[object Null]",YI="[object Undefined]",ix=At?At.toStringTag:void 0;function ZI(t){return t==null?t===void 0?YI:KI:ix&&ix in Object(t)?rx(t):nx(t)}var Nt=ZI;function XI(t){return t!=null&&typeof t=="object"}var ot=XI;var JI="[object Symbol]";function QI(t){return typeof t=="symbol"||ot(t)&&Nt(t)==JI}var Tn=QI;function eO(t,e){for(var r=-1,n=t==null?0:t.length,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}var Dr=eO;var tO=Array.isArray,Q=tO;var rO=1/0,ox=At?At.prototype:void 0,sx=ox?ox.toString:void 0;function ax(t){if(typeof t=="string")return t;if(Q(t))return Dr(t,ax)+"";if(Tn(t))return sx?sx.call(t):"";var e=t+"";return e=="0"&&1/t==-rO?"-0":e}var ux=ax;var nO=/\s/;function iO(t){for(var e=t.length;e--&&nO.test(t.charAt(e)););return e}var lx=iO;var oO=/^\s+/;function sO(t){return t&&t.slice(0,lx(t)+1).replace(oO,"")}var cx=sO;function aO(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Ye=aO;var fx=NaN,uO=/^[-+]0x[0-9a-f]+$/i,lO=/^0b[01]+$/i,cO=/^0o[0-7]+$/i,fO=parseInt;function pO(t){if(typeof t=="number")return t;if(Tn(t))return fx;if(Ye(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ye(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=cx(t);var r=lO.test(t);return r||cO.test(t)?fO(t.slice(2),r?2:8):uO.test(t)?fx:+t}var px=pO;var dx=1/0,dO=17976931348623157e292;function hO(t){if(!t)return t===0?t:0;if(t=px(t),t===dx||t===-dx){var e=t<0?-1:1;return e*dO}return t===t?t:0}var hx=hO;function mO(t){var e=hx(t),r=e%1;return e===e?r?e-r:e:0}var Rr=mO;function gO(t){return t}var cr=gO;var xO="[object AsyncFunction]",yO="[object Function]",bO="[object GeneratorFunction]",EO="[object Proxy]";function AO(t){if(!Ye(t))return!1;var e=Nt(t);return e==yO||e==bO||e==xO||e==EO}var Pt=AO;var kO=ct["__core-js_shared__"],gu=kO;var mx=(function(){var t=/[^.]+$/.exec(gu&&gu.keys&&gu.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function wO(t){return!!mx&&mx in t}var gx=wO;var CO=Function.prototype,TO=CO.toString;function _O(t){if(t!=null){try{return TO.call(t)}catch{}try{return t+""}catch{}}return""}var tn=_O;var SO=/[\\^$.*+?()[\]{}|]/g,IO=/^\[object .+?Constructor\]$/,OO=Function.prototype,vO=Object.prototype,DO=OO.toString,RO=vO.hasOwnProperty,FO=RegExp("^"+DO.call(RO).replace(SO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function NO(t){if(!Ye(t)||gx(t))return!1;var e=Pt(t)?FO:IO;return e.test(tn(t))}var xx=NO;function PO(t,e){return t?.[e]}var yx=PO;function LO(t,e){var r=yx(t,e);return xx(r)?r:void 0}var qt=LO;var MO=qt(ct,"WeakMap"),xu=MO;var bx=Object.create,BO=(function(){function t(){}return function(e){if(!Ye(e))return{};if(bx)return bx(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})(),Ex=BO;function jO(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Ax=jO;function UO(){}var Ze=UO;function zO(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}var kx=zO;var $O=800,qO=16,VO=Date.now;function GO(t){var e=0,r=0;return function(){var n=VO(),i=qO-(n-r);if(r=n,i>0){if(++e>=$O)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var wx=GO;function WO(t){return function(){return t}}var Cx=WO;var HO=(function(){try{var t=qt(Object,"defineProperty");return t({},"",{}),t}catch{}})(),po=HO;var KO=po?function(t,e){return po(t,"toString",{configurable:!0,enumerable:!1,value:Cx(e),writable:!0})}:cr,Tx=KO;var YO=wx(Tx),_x=YO;function ZO(t,e){for(var r=-1,n=t==null?0:t.length;++r<n&&e(t[r],r,t)!==!1;);return t}var yu=ZO;function XO(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}var bu=XO;function JO(t){return t!==t}var Sx=JO;function QO(t,e,r){for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}var Ix=QO;function ev(t,e,r){return e===e?Ix(t,e,r):bu(t,Sx,r)}var ho=ev;function tv(t,e){var r=t==null?0:t.length;return!!r&&ho(t,e,0)>-1}var Eu=tv;var rv=9007199254740991,nv=/^(?:0|[1-9]\d*)$/;function iv(t,e){var r=typeof t;return e=e??rv,!!e&&(r=="number"||r!="symbol"&&nv.test(t))&&t>-1&&t%1==0&&t<e}var _n=iv;function ov(t,e,r){e=="__proto__"&&po?po(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var mo=ov;function sv(t,e){return t===e||t!==t&&e!==e}var Fr=sv;var av=Object.prototype,uv=av.hasOwnProperty;function lv(t,e,r){var n=t[e];(!(uv.call(t,e)&&Fr(n,r))||r===void 0&&!(e in t))&&mo(t,e,r)}var Sn=lv;function cv(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],u=n?n(r[a],t[a],a,r,t):void 0;u===void 0&&(u=t[a]),i?mo(r,a,u):Sn(r,a,u)}return r}var Nr=cv;var Ox=Math.max;function fv(t,e,r){return e=Ox(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=Ox(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),Ax(t,this,a)}}var vx=fv;function pv(t,e){return _x(vx(t,e,cr),t+"")}var go=pv;var dv=9007199254740991;function hv(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=dv}var xo=hv;function mv(t){return t!=null&&xo(t.length)&&!Pt(t)}var ft=mv;function gv(t,e,r){if(!Ye(r))return!1;var n=typeof e;return(n=="number"?ft(r)&&_n(e,r.length):n=="string"&&e in r)?Fr(r[e],t):!1}var In=gv;function xv(t){return go(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&In(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}var Dx=xv;var yv=Object.prototype;function bv(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||yv;return t===r}var Pr=bv;function Ev(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Rx=Ev;var Av="[object Arguments]";function kv(t){return ot(t)&&Nt(t)==Av}var Qf=kv;var Fx=Object.prototype,wv=Fx.hasOwnProperty,Cv=Fx.propertyIsEnumerable,Tv=Qf((function(){return arguments})())?Qf:function(t){return ot(t)&&wv.call(t,"callee")&&!Cv.call(t,"callee")},On=Tv;function _v(){return!1}var Nx=_v;var Mx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Px=Mx&&typeof module=="object"&&module&&!module.nodeType&&module,Sv=Px&&Px.exports===Mx,Lx=Sv?ct.Buffer:void 0,Iv=Lx?Lx.isBuffer:void 0,Ov=Iv||Nx,rn=Ov;var vv="[object Arguments]",Dv="[object Array]",Rv="[object Boolean]",Fv="[object Date]",Nv="[object Error]",Pv="[object Function]",Lv="[object Map]",Mv="[object Number]",Bv="[object Object]",jv="[object RegExp]",Uv="[object Set]",zv="[object String]",$v="[object WeakMap]",qv="[object ArrayBuffer]",Vv="[object DataView]",Gv="[object Float32Array]",Wv="[object Float64Array]",Hv="[object Int8Array]",Kv="[object Int16Array]",Yv="[object Int32Array]",Zv="[object Uint8Array]",Xv="[object Uint8ClampedArray]",Jv="[object Uint16Array]",Qv="[object Uint32Array]",Ve={};Ve[Gv]=Ve[Wv]=Ve[Hv]=Ve[Kv]=Ve[Yv]=Ve[Zv]=Ve[Xv]=Ve[Jv]=Ve[Qv]=!0;Ve[vv]=Ve[Dv]=Ve[qv]=Ve[Rv]=Ve[Vv]=Ve[Fv]=Ve[Nv]=Ve[Pv]=Ve[Lv]=Ve[Mv]=Ve[Bv]=Ve[jv]=Ve[Uv]=Ve[zv]=Ve[$v]=!1;function e0(t){return ot(t)&&xo(t.length)&&!!Ve[Nt(t)]}var Bx=e0;function t0(t){return function(e){return t(e)}}var Lr=t0;var jx=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ws=jx&&typeof module=="object"&&module&&!module.nodeType&&module,r0=ws&&ws.exports===jx,ep=r0&&mu.process,n0=(function(){try{var t=ws&&ws.require&&ws.require("util").types;return t||ep&&ep.binding&&ep.binding("util")}catch{}})(),fr=n0;var Ux=fr&&fr.isTypedArray,i0=Ux?Lr(Ux):Bx,yo=i0;var o0=Object.prototype,s0=o0.hasOwnProperty;function a0(t,e){var r=Q(t),n=!r&&On(t),i=!r&&!n&&rn(t),o=!r&&!n&&!i&&yo(t),s=r||n||i||o,a=s?Rx(t.length,String):[],u=a.length;for(var l in t)(e||s0.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||_n(l,u)))&&a.push(l);return a}var Au=a0;function u0(t,e){return function(r){return t(e(r))}}var ku=u0;var l0=ku(Object.keys,Object),zx=l0;var c0=Object.prototype,f0=c0.hasOwnProperty;function p0(t){if(!Pr(t))return zx(t);var e=[];for(var r in Object(t))f0.call(t,r)&&r!="constructor"&&e.push(r);return e}var wu=p0;function d0(t){return ft(t)?Au(t):wu(t)}var Pe=d0;var h0=Object.prototype,m0=h0.hasOwnProperty,g0=Dx(function(t,e){if(Pr(e)||ft(e)){Nr(e,Pe(e),t);return}for(var r in e)m0.call(e,r)&&Sn(t,r,e[r])}),Tt=g0;function x0(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}var $x=x0;var y0=Object.prototype,b0=y0.hasOwnProperty;function E0(t){if(!Ye(t))return $x(t);var e=Pr(t),r=[];for(var n in t)n=="constructor"&&(e||!b0.call(t,n))||r.push(n);return r}var qx=E0;function A0(t){return ft(t)?Au(t,!0):qx(t)}var vn=A0;var k0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,w0=/^\w*$/;function C0(t,e){if(Q(t))return!1;var r=typeof t;return r=="number"||r=="symbol"||r=="boolean"||t==null||Tn(t)?!0:w0.test(t)||!k0.test(t)||e!=null&&t in Object(e)}var bo=C0;var T0=qt(Object,"create"),nn=T0;function _0(){this.__data__=nn?nn(null):{},this.size=0}var Vx=_0;function S0(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Gx=S0;var I0="__lodash_hash_undefined__",O0=Object.prototype,v0=O0.hasOwnProperty;function D0(t){var e=this.__data__;if(nn){var r=e[t];return r===I0?void 0:r}return v0.call(e,t)?e[t]:void 0}var Wx=D0;var R0=Object.prototype,F0=R0.hasOwnProperty;function N0(t){var e=this.__data__;return nn?e[t]!==void 0:F0.call(e,t)}var Hx=N0;var P0="__lodash_hash_undefined__";function L0(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=nn&&e===void 0?P0:e,this}var Kx=L0;function Eo(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Eo.prototype.clear=Vx;Eo.prototype.delete=Gx;Eo.prototype.get=Wx;Eo.prototype.has=Hx;Eo.prototype.set=Kx;var tp=Eo;function M0(){this.__data__=[],this.size=0}var Yx=M0;function B0(t,e){for(var r=t.length;r--;)if(Fr(t[r][0],e))return r;return-1}var Dn=B0;var j0=Array.prototype,U0=j0.splice;function z0(t){var e=this.__data__,r=Dn(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():U0.call(e,r,1),--this.size,!0}var Zx=z0;function $0(t){var e=this.__data__,r=Dn(e,t);return r<0?void 0:e[r][1]}var Xx=$0;function q0(t){return Dn(this.__data__,t)>-1}var Jx=q0;function V0(t,e){var r=this.__data__,n=Dn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var Qx=V0;function Ao(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ao.prototype.clear=Yx;Ao.prototype.delete=Zx;Ao.prototype.get=Xx;Ao.prototype.has=Jx;Ao.prototype.set=Qx;var Rn=Ao;var G0=qt(ct,"Map"),Fn=G0;function W0(){this.size=0,this.__data__={hash:new tp,map:new(Fn||Rn),string:new tp}}var ey=W0;function H0(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var ty=H0;function K0(t,e){var r=t.__data__;return ty(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Nn=K0;function Y0(t){var e=Nn(this,t).delete(t);return this.size-=e?1:0,e}var ry=Y0;function Z0(t){return Nn(this,t).get(t)}var ny=Z0;function X0(t){return Nn(this,t).has(t)}var iy=X0;function J0(t,e){var r=Nn(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var oy=J0;function ko(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ko.prototype.clear=ey;ko.prototype.delete=ry;ko.prototype.get=ny;ko.prototype.has=iy;ko.prototype.set=oy;var Oi=ko;var Q0="Expected a function";function rp(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Q0);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(rp.Cache||Oi),r}rp.Cache=Oi;var sy=rp;var e1=500;function t1(t){var e=sy(t,function(n){return r.size===e1&&r.clear(),n}),r=e.cache;return e}var ay=t1;var r1=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n1=/\\(\\)?/g,i1=ay(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(r1,function(r,n,i,o){e.push(i?o.replace(n1,"$1"):n||r)}),e}),uy=i1;function o1(t){return t==null?"":ux(t)}var ly=o1;function s1(t,e){return Q(t)?t:bo(t,e)?[t]:uy(ly(t))}var Pn=s1;var a1=1/0;function u1(t){if(typeof t=="string"||Tn(t))return t;var e=t+"";return e=="0"&&1/t==-a1?"-0":e}var Mr=u1;function l1(t,e){e=Pn(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[Mr(e[r++])];return r&&r==n?t:void 0}var wo=l1;function c1(t,e,r){var n=t==null?void 0:wo(t,e);return n===void 0?r:n}var cy=c1;function f1(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}var Co=f1;var fy=At?At.isConcatSpreadable:void 0;function p1(t){return Q(t)||On(t)||!!(fy&&t&&t[fy])}var py=p1;function dy(t,e,r,n,i){var o=-1,s=t.length;for(r||(r=py),i||(i=[]);++o<s;){var a=t[o];e>0&&r(a)?e>1?dy(a,e-1,r,n,i):Co(i,a):n||(i[i.length]=a)}return i}var To=dy;function d1(t){var e=t==null?0:t.length;return e?To(t,1):[]}var xt=d1;var h1=ku(Object.getPrototypeOf,Object),Cu=h1;function m1(t,e,r){var n=-1,i=t.length;e<0&&(e=-e>i?0:i+e),r=r>i?i:r,r<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=Array(i);++n<i;)o[n]=t[n+e];return o}var Tu=m1;function g1(t,e,r,n){var i=-1,o=t==null?0:t.length;for(n&&o&&(r=t[++i]);++i<o;)r=e(r,t[i],i,t);return r}var hy=g1;function x1(){this.__data__=new Rn,this.size=0}var my=x1;function y1(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var gy=y1;function b1(t){return this.__data__.get(t)}var xy=b1;function E1(t){return this.__data__.has(t)}var yy=E1;var A1=200;function k1(t,e){var r=this.__data__;if(r instanceof Rn){var n=r.__data__;if(!Fn||n.length<A1-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Oi(n)}return r.set(t,e),this.size=r.size,this}var by=k1;function _o(t){var e=this.__data__=new Rn(t);this.size=e.size}_o.prototype.clear=my;_o.prototype.delete=gy;_o.prototype.get=xy;_o.prototype.has=yy;_o.prototype.set=by;var Ln=_o;function w1(t,e){return t&&Nr(e,Pe(e),t)}var Ey=w1;function C1(t,e){return t&&Nr(e,vn(e),t)}var Ay=C1;var Ty=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ky=Ty&&typeof module=="object"&&module&&!module.nodeType&&module,T1=ky&&ky.exports===Ty,wy=T1?ct.Buffer:void 0,Cy=wy?wy.allocUnsafe:void 0;function _1(t,e){if(e)return t.slice();var r=t.length,n=Cy?Cy(r):new t.constructor(r);return t.copy(n),n}var _y=_1;function S1(t,e){for(var r=-1,n=t==null?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}var So=S1;function I1(){return[]}var _u=I1;var O1=Object.prototype,v1=O1.propertyIsEnumerable,Sy=Object.getOwnPropertySymbols,D1=Sy?function(t){return t==null?[]:(t=Object(t),So(Sy(t),function(e){return v1.call(t,e)}))}:_u,Io=D1;function R1(t,e){return Nr(t,Io(t),e)}var Iy=R1;var F1=Object.getOwnPropertySymbols,N1=F1?function(t){for(var e=[];t;)Co(e,Io(t)),t=Cu(t);return e}:_u,Su=N1;function P1(t,e){return Nr(t,Su(t),e)}var Oy=P1;function L1(t,e,r){var n=e(t);return Q(t)?n:Co(n,r(t))}var Iu=L1;function M1(t){return Iu(t,Pe,Io)}var Cs=M1;function B1(t){return Iu(t,vn,Su)}var Ou=B1;var j1=qt(ct,"DataView"),vu=j1;var U1=qt(ct,"Promise"),Du=U1;var z1=qt(ct,"Set"),Mn=z1;var vy="[object Map]",$1="[object Object]",Dy="[object Promise]",Ry="[object Set]",Fy="[object WeakMap]",Ny="[object DataView]",q1=tn(vu),V1=tn(Fn),G1=tn(Du),W1=tn(Mn),H1=tn(xu),vi=Nt;(vu&&vi(new vu(new ArrayBuffer(1)))!=Ny||Fn&&vi(new Fn)!=vy||Du&&vi(Du.resolve())!=Dy||Mn&&vi(new Mn)!=Ry||xu&&vi(new xu)!=Fy)&&(vi=function(t){var e=Nt(t),r=e==$1?t.constructor:void 0,n=r?tn(r):"";if(n)switch(n){case q1:return Ny;case V1:return vy;case G1:return Dy;case W1:return Ry;case H1:return Fy}return e});var gr=vi;var K1=Object.prototype,Y1=K1.hasOwnProperty;function Z1(t){var e=t.length,r=new t.constructor(e);return e&&typeof t[0]=="string"&&Y1.call(t,"index")&&(r.index=t.index,r.input=t.input),r}var Py=Z1;var X1=ct.Uint8Array,Oo=X1;function J1(t){var e=new t.constructor(t.byteLength);return new Oo(e).set(new Oo(t)),e}var vo=J1;function Q1(t,e){var r=e?vo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}var Ly=Q1;var eD=/\w*$/;function tD(t){var e=new t.constructor(t.source,eD.exec(t));return e.lastIndex=t.lastIndex,e}var My=tD;var By=At?At.prototype:void 0,jy=By?By.valueOf:void 0;function rD(t){return jy?Object(jy.call(t)):{}}var Uy=rD;function nD(t,e){var r=e?vo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}var zy=nD;var iD="[object Boolean]",oD="[object Date]",sD="[object Map]",aD="[object Number]",uD="[object RegExp]",lD="[object Set]",cD="[object String]",fD="[object Symbol]",pD="[object ArrayBuffer]",dD="[object DataView]",hD="[object Float32Array]",mD="[object Float64Array]",gD="[object Int8Array]",xD="[object Int16Array]",yD="[object Int32Array]",bD="[object Uint8Array]",ED="[object Uint8ClampedArray]",AD="[object Uint16Array]",kD="[object Uint32Array]";function wD(t,e,r){var n=t.constructor;switch(e){case pD:return vo(t);case iD:case oD:return new n(+t);case dD:return Ly(t,r);case hD:case mD:case gD:case xD:case yD:case bD:case ED:case AD:case kD:return zy(t,r);case sD:return new n;case aD:case cD:return new n(t);case uD:return My(t);case lD:return new n;case fD:return Uy(t)}}var $y=wD;function CD(t){return typeof t.constructor=="function"&&!Pr(t)?Ex(Cu(t)):{}}var qy=CD;var TD="[object Map]";function _D(t){return ot(t)&&gr(t)==TD}var Vy=_D;var Gy=fr&&fr.isMap,SD=Gy?Lr(Gy):Vy,Wy=SD;var ID="[object Set]";function OD(t){return ot(t)&&gr(t)==ID}var Hy=OD;var Ky=fr&&fr.isSet,vD=Ky?Lr(Ky):Hy,Yy=vD;var DD=1,RD=2,FD=4,Zy="[object Arguments]",ND="[object Array]",PD="[object Boolean]",LD="[object Date]",MD="[object Error]",Xy="[object Function]",BD="[object GeneratorFunction]",jD="[object Map]",UD="[object Number]",Jy="[object Object]",zD="[object RegExp]",$D="[object Set]",qD="[object String]",VD="[object Symbol]",GD="[object WeakMap]",WD="[object ArrayBuffer]",HD="[object DataView]",KD="[object Float32Array]",YD="[object Float64Array]",ZD="[object Int8Array]",XD="[object Int16Array]",JD="[object Int32Array]",QD="[object Uint8Array]",eR="[object Uint8ClampedArray]",tR="[object Uint16Array]",rR="[object Uint32Array]",Le={};Le[Zy]=Le[ND]=Le[WD]=Le[HD]=Le[PD]=Le[LD]=Le[KD]=Le[YD]=Le[ZD]=Le[XD]=Le[JD]=Le[jD]=Le[UD]=Le[Jy]=Le[zD]=Le[$D]=Le[qD]=Le[VD]=Le[QD]=Le[eR]=Le[tR]=Le[rR]=!0;Le[MD]=Le[Xy]=Le[GD]=!1;function Ru(t,e,r,n,i,o){var s,a=e&DD,u=e&RD,l=e&FD;if(r&&(s=i?r(t,n,i,o):r(t)),s!==void 0)return s;if(!Ye(t))return t;var c=Q(t);if(c){if(s=Py(t),!a)return kx(t,s)}else{var f=gr(t),p=f==Xy||f==BD;if(rn(t))return _y(t,a);if(f==Jy||f==Zy||p&&!i){if(s=u||p?{}:qy(t),!a)return u?Oy(t,Ay(s,t)):Iy(t,Ey(s,t))}else{if(!Le[f])return i?t:{};s=$y(t,f,a)}}o||(o=new Ln);var d=o.get(t);if(d)return d;o.set(t,s),Yy(t)?t.forEach(function(g){s.add(Ru(g,e,r,g,t,o))}):Wy(t)&&t.forEach(function(g,b){s.set(b,Ru(g,e,r,b,t,o))});var m=l?u?Ou:Cs:u?vn:Pe,y=c?void 0:m(t);return yu(y||t,function(g,b){y&&(b=g,g=t[b]),Sn(s,b,Ru(g,e,r,b,t,o))}),s}var Qy=Ru;var nR=4;function iR(t){return Qy(t,nR)}var Me=iR;function oR(t){for(var e=-1,r=t==null?0:t.length,n=0,i=[];++e<r;){var o=t[e];o&&(i[n++]=o)}return i}var Br=oR;var sR="__lodash_hash_undefined__";function aR(t){return this.__data__.set(t,sR),this}var eb=aR;function uR(t){return this.__data__.has(t)}var tb=uR;function Fu(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Oi;++e<r;)this.add(t[e])}Fu.prototype.add=Fu.prototype.push=eb;Fu.prototype.has=tb;var Do=Fu;function lR(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var Nu=lR;function cR(t,e){return t.has(e)}var Ro=cR;var fR=1,pR=2;function dR(t,e,r,n,i,o){var s=r&fR,a=t.length,u=e.length;if(a!=u&&!(s&&u>a))return!1;var l=o.get(t),c=o.get(e);if(l&&c)return l==e&&c==t;var f=-1,p=!0,d=r&pR?new Do:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],y=e[f];if(n)var g=s?n(y,m,f,e,t,o):n(m,y,f,t,e,o);if(g!==void 0){if(g)continue;p=!1;break}if(d){if(!Nu(e,function(b,w){if(!Ro(d,w)&&(m===b||i(m,b,r,n,o)))return d.push(w)})){p=!1;break}}else if(!(m===y||i(m,y,r,n,o))){p=!1;break}}return o.delete(t),o.delete(e),p}var Pu=dR;function hR(t){var e=-1,r=Array(t.size);return t.forEach(function(n,i){r[++e]=[i,n]}),r}var rb=hR;function mR(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var Fo=mR;var gR=1,xR=2,yR="[object Boolean]",bR="[object Date]",ER="[object Error]",AR="[object Map]",kR="[object Number]",wR="[object RegExp]",CR="[object Set]",TR="[object String]",_R="[object Symbol]",SR="[object ArrayBuffer]",IR="[object DataView]",nb=At?At.prototype:void 0,np=nb?nb.valueOf:void 0;function OR(t,e,r,n,i,o,s){switch(r){case IR:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case SR:return!(t.byteLength!=e.byteLength||!o(new Oo(t),new Oo(e)));case yR:case bR:case kR:return Fr(+t,+e);case ER:return t.name==e.name&&t.message==e.message;case wR:case TR:return t==e+"";case AR:var a=rb;case CR:var u=n&gR;if(a||(a=Fo),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;n|=xR,s.set(t,e);var c=Pu(a(t),a(e),n,i,o,s);return s.delete(t),c;case _R:if(np)return np.call(t)==np.call(e)}return!1}var ib=OR;var vR=1,DR=Object.prototype,RR=DR.hasOwnProperty;function FR(t,e,r,n,i,o){var s=r&vR,a=Cs(t),u=a.length,l=Cs(e),c=l.length;if(u!=c&&!s)return!1;for(var f=u;f--;){var p=a[f];if(!(s?p in e:RR.call(e,p)))return!1}var d=o.get(t),m=o.get(e);if(d&&m)return d==e&&m==t;var y=!0;o.set(t,e),o.set(e,t);for(var g=s;++f<u;){p=a[f];var b=t[p],w=e[p];if(n)var k=s?n(w,b,p,e,t,o):n(b,w,p,t,e,o);if(!(k===void 0?b===w||i(b,w,r,n,o):k)){y=!1;break}g||(g=p=="constructor")}if(y&&!g){var D=t.constructor,R=e.constructor;D!=R&&"constructor"in t&&"constructor"in e&&!(typeof D=="function"&&D instanceof D&&typeof R=="function"&&R instanceof R)&&(y=!1)}return o.delete(t),o.delete(e),y}var ob=FR;var NR=1,sb="[object Arguments]",ab="[object Array]",Lu="[object Object]",PR=Object.prototype,ub=PR.hasOwnProperty;function LR(t,e,r,n,i,o){var s=Q(t),a=Q(e),u=s?ab:gr(t),l=a?ab:gr(e);u=u==sb?Lu:u,l=l==sb?Lu:l;var c=u==Lu,f=l==Lu,p=u==l;if(p&&rn(t)){if(!rn(e))return!1;s=!0,c=!1}if(p&&!c)return o||(o=new Ln),s||yo(t)?Pu(t,e,r,n,i,o):ib(t,e,u,r,n,i,o);if(!(r&NR)){var d=c&&ub.call(t,"__wrapped__"),m=f&&ub.call(e,"__wrapped__");if(d||m){var y=d?t.value():t,g=m?e.value():e;return o||(o=new Ln),i(y,g,r,n,o)}}return p?(o||(o=new Ln),ob(t,e,r,n,i,o)):!1}var lb=LR;function cb(t,e,r,n,i){return t===e?!0:t==null||e==null||!ot(t)&&!ot(e)?t!==t&&e!==e:lb(t,e,r,n,cb,i)}var Mu=cb;var MR=1,BR=2;function jR(t,e,r,n){var i=r.length,o=i,s=!n;if(t==null)return!o;for(t=Object(t);i--;){var a=r[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=r[i];var u=a[0],l=t[u],c=a[1];if(s&&a[2]){if(l===void 0&&!(u in t))return!1}else{var f=new Ln;if(n)var p=n(l,c,u,t,e,f);if(!(p===void 0?Mu(c,l,MR|BR,n,f):p))return!1}}return!0}var fb=jR;function UR(t){return t===t&&!Ye(t)}var Bu=UR;function zR(t){for(var e=Pe(t),r=e.length;r--;){var n=e[r],i=t[n];e[r]=[n,i,Bu(i)]}return e}var pb=zR;function $R(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var ju=$R;function qR(t){var e=pb(t);return e.length==1&&e[0][2]?ju(e[0][0],e[0][1]):function(r){return r===t||fb(r,t,e)}}var db=qR;function VR(t,e){return t!=null&&e in Object(t)}var hb=VR;function GR(t,e,r){e=Pn(e,t);for(var n=-1,i=e.length,o=!1;++n<i;){var s=Mr(e[n]);if(!(o=t!=null&&r(t,s)))break;t=t[s]}return o||++n!=i?o:(i=t==null?0:t.length,!!i&&xo(i)&&_n(s,i)&&(Q(t)||On(t)))}var Uu=GR;function WR(t,e){return t!=null&&Uu(t,e,hb)}var mb=WR;var HR=1,KR=2;function YR(t,e){return bo(t)&&Bu(e)?ju(Mr(t),e):function(r){var n=cy(r,t);return n===void 0&&n===e?mb(r,t):Mu(e,n,HR|KR)}}var gb=YR;function ZR(t){return function(e){return e?.[t]}}var xb=ZR;function XR(t){return function(e){return wo(e,t)}}var yb=XR;function JR(t){return bo(t)?xb(Mr(t)):yb(t)}var bb=JR;function QR(t){return typeof t=="function"?t:t==null?cr:typeof t=="object"?Q(t)?gb(t[0],t[1]):db(t):bb(t)}var pt=QR;function eF(t,e,r,n){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(n,s,r(s),t)}return n}var Eb=eF;function tF(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var u=s[t?a:++i];if(r(o[u],u,o)===!1)break}return e}}var Ab=tF;var rF=Ab(),kb=rF;function nF(t,e){return t&&kb(t,e,Pe)}var wb=nF;function iF(t,e){return function(r,n){if(r==null)return r;if(!ft(r))return t(r,n);for(var i=r.length,o=e?i:-1,s=Object(r);(e?o--:++o<i)&&n(s[o],o,s)!==!1;);return r}}var Cb=iF;var oF=Cb(wb),Vt=oF;function sF(t,e,r,n){return Vt(t,function(i,o,s){e(n,i,r(i),s)}),n}var Tb=sF;function aF(t,e){return function(r,n){var i=Q(r)?Eb:Tb,o=e?e():{};return i(r,t,pt(n,2),o)}}var _b=aF;var Sb=Object.prototype,uF=Sb.hasOwnProperty,lF=go(function(t,e){t=Object(t);var r=-1,n=e.length,i=n>2?e[2]:void 0;for(i&&In(e[0],e[1],i)&&(n=1);++r<n;)for(var o=e[r],s=vn(o),a=-1,u=s.length;++a<u;){var l=s[a],c=t[l];(c===void 0||Fr(c,Sb[l])&&!uF.call(t,l))&&(t[l]=o[l])}return t}),No=lF;function cF(t){return ot(t)&&ft(t)}var ip=cF;function fF(t,e,r){for(var n=-1,i=t==null?0:t.length;++n<i;)if(r(e,t[n]))return!0;return!1}var zu=fF;var pF=200;function dF(t,e,r,n){var i=-1,o=Eu,s=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=Dr(e,Lr(r))),n?(o=zu,s=!1):e.length>=pF&&(o=Ro,s=!1,e=new Do(e));e:for(;++i<a;){var c=t[i],f=r==null?c:r(c);if(c=n||c!==0?c:0,s&&f===f){for(var p=l;p--;)if(e[p]===f)continue e;u.push(c)}else o(e,f,n)||u.push(c)}return u}var Ib=dF;var hF=go(function(t,e){return ip(t)?Ib(t,To(e,1,ip,!0)):[]}),Bn=hF;function mF(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var jr=mF;function gF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Rr(e),Tu(t,e<0?0:e,n)):[]}var st=gF;function xF(t,e,r){var n=t==null?0:t.length;return n?(e=r||e===void 0?1:Rr(e),e=n-e,Tu(t,0,e<0?0:e)):[]}var on=xF;function yF(t){return typeof t=="function"?t:cr}var Ob=yF;function bF(t,e){var r=Q(t)?yu:Vt;return r(t,Ob(e))}var G=bF;function EF(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var vb=EF;function AF(t,e){var r=!0;return Vt(t,function(n,i,o){return r=!!e(n,i,o),r}),r}var Db=AF;function kF(t,e,r){var n=Q(t)?vb:Db;return r&&In(t,e,r)&&(e=void 0),n(t,pt(e,3))}var Ot=kF;function wF(t,e){var r=[];return Vt(t,function(n,i,o){e(n,i,o)&&r.push(n)}),r}var $u=wF;function CF(t,e){var r=Q(t)?So:$u;return r(t,pt(e,3))}var vt=CF;function TF(t){return function(e,r,n){var i=Object(e);if(!ft(e)){var o=pt(r,3);e=Pe(e),r=function(a){return o(i[a],a,i)}}var s=t(e,r,n);return s>-1?i[o?e[s]:s]:void 0}}var Rb=TF;var _F=Math.max;function SF(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Rr(r);return i<0&&(i=_F(n+i,0)),bu(t,pt(e,3),i)}var Fb=SF;var IF=Rb(Fb),Ur=IF;function OF(t){return t&&t.length?t[0]:void 0}var kt=OF;function vF(t,e){var r=-1,n=ft(t)?Array(t.length):[];return Vt(t,function(i,o,s){n[++r]=e(i,o,s)}),n}var Nb=vF;function DF(t,e){var r=Q(t)?Dr:Nb;return r(t,pt(e,3))}var V=DF;function RF(t,e){return To(V(t,e),1)}var Lt=RF;var FF=Object.prototype,NF=FF.hasOwnProperty,PF=_b(function(t,e,r){NF.call(t,r)?t[r].push(e):mo(t,r,[e])}),op=PF;var LF=Object.prototype,MF=LF.hasOwnProperty;function BF(t,e){return t!=null&&MF.call(t,e)}var Pb=BF;function jF(t,e){return t!=null&&Uu(t,e,Pb)}var X=jF;var UF="[object String]";function zF(t){return typeof t=="string"||!Q(t)&&ot(t)&&Nt(t)==UF}var yt=zF;function $F(t,e){return Dr(e,function(r){return t[r]})}var Lb=$F;function qF(t){return t==null?[]:Lb(t,Pe(t))}var Re=qF;var VF=Math.max;function GF(t,e,r,n){t=ft(t)?t:Re(t),r=r&&!n?Rr(r):0;var i=t.length;return r<0&&(r=VF(i+r,0)),yt(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&ho(t,e,r)>-1}var We=GF;var WF=Math.max;function HF(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var i=r==null?0:Rr(r);return i<0&&(i=WF(n+i,0)),ho(t,e,i)}var qu=HF;var KF="[object Map]",YF="[object Set]",ZF=Object.prototype,XF=ZF.hasOwnProperty;function JF(t){if(t==null)return!0;if(ft(t)&&(Q(t)||typeof t=="string"||typeof t.splice=="function"||rn(t)||yo(t)||On(t)))return!t.length;var e=gr(t);if(e==KF||e==YF)return!t.size;if(Pr(t))return!wu(t).length;for(var r in t)if(XF.call(t,r))return!1;return!0}var Te=JF;var QF="[object RegExp]";function eN(t){return ot(t)&&Nt(t)==QF}var Mb=eN;var Bb=fr&&fr.isRegExp,tN=Bb?Lr(Bb):Mb,pr=tN;function rN(t){return t===void 0}var Dt=rN;var nN="Expected a function";function iN(t){if(typeof t!="function")throw new TypeError(nN);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}var jb=iN;function oN(t,e,r,n){if(!Ye(t))return t;e=Pn(e,t);for(var i=-1,o=e.length,s=o-1,a=t;a!=null&&++i<o;){var u=Mr(e[i]),l=r;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=s){var c=a[u];l=n?n(c,u,a):void 0,l===void 0&&(l=Ye(c)?c:_n(e[i+1])?[]:{})}Sn(a,u,l),a=a[u]}return t}var Ub=oN;function sN(t,e,r){for(var n=-1,i=e.length,o={};++n<i;){var s=e[n],a=wo(t,s);r(a,s)&&Ub(o,Pn(s,t),a)}return o}var zb=sN;function aN(t,e){if(t==null)return{};var r=Dr(Ou(t),function(n){return[n]});return e=pt(e),zb(t,r,function(n,i){return e(n,i[0])})}var Gt=aN;function uN(t,e,r,n,i){return i(t,function(o,s,a){r=n?(n=!1,o):e(r,o,s,a)}),r}var $b=uN;function lN(t,e,r){var n=Q(t)?hy:$b,i=arguments.length<3;return n(t,pt(e,4),r,i,Vt)}var dt=lN;function cN(t,e){var r=Q(t)?So:$u;return r(t,jb(pt(e,3)))}var jn=cN;function fN(t,e){var r;return Vt(t,function(n,i,o){return r=e(n,i,o),!r}),!!r}var qb=fN;function pN(t,e,r){var n=Q(t)?Nu:qb;return r&&In(t,e,r)&&(e=void 0),n(t,pt(e,3))}var Ts=pN;var dN=1/0,hN=Mn&&1/Fo(new Mn([,-0]))[1]==dN?function(t){return new Mn(t)}:Ze,Vb=hN;var mN=200;function gN(t,e,r){var n=-1,i=Eu,o=t.length,s=!0,a=[],u=a;if(r)s=!1,i=zu;else if(o>=mN){var l=e?null:Vb(t);if(l)return Fo(l);s=!1,i=Ro,u=new Do}else u=e?[]:a;e:for(;++n<o;){var c=t[n],f=e?e(c):c;if(c=r||c!==0?c:0,s&&f===f){for(var p=u.length;p--;)if(u[p]===f)continue e;e&&u.push(f),a.push(c)}else i(u,f,r)||(u!==a&&u.push(f),a.push(c))}return a}var Gb=gN;function xN(t){return t&&t.length?Gb(t):[]}var Po=xN;function Lo(t){console&&console.error&&console.error(`Error: ${t}`)}function _s(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function Ss(t){let e=new Date().getTime(),r=t();return{time:new Date().getTime()-e,value:r}}function Is(t){function e(){}e.prototype=t;let r=new e;function n(){return typeof r.bar}return n(),n(),t;(0,eval)(t)}function yN(t){return bN(t)?t.LABEL:t.name}function bN(t){return yt(t.LABEL)&&t.LABEL!==""}var er=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),G(this.definition,r=>{r.accept(e)})}},Be=class extends er{constructor(e){super([]),this.idx=1,Tt(this,Gt(e,r=>r!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}},Mt=class extends er{constructor(e){super(e.definition),this.orgText="",Tt(this,Gt(e,r=>r!==void 0))}},je=class extends er{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Tt(this,Gt(e,r=>r!==void 0))}},Ge=class extends er{constructor(e){super(e.definition),this.idx=1,Tt(this,Gt(e,r=>r!==void 0))}},at=class extends er{constructor(e){super(e.definition),this.idx=1,Tt(this,Gt(e,r=>r!==void 0))}},ut=class extends er{constructor(e){super(e.definition),this.idx=1,Tt(this,Gt(e,r=>r!==void 0))}},De=class extends er{constructor(e){super(e.definition),this.idx=1,Tt(this,Gt(e,r=>r!==void 0))}},et=class extends er{constructor(e){super(e.definition),this.idx=1,Tt(this,Gt(e,r=>r!==void 0))}},tt=class extends er{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Tt(this,Gt(e,r=>r!==void 0))}},ve=class{constructor(e){this.idx=1,Tt(this,Gt(e,r=>r!==void 0))}accept(e){e.visit(this)}};function Vu(t){return V(t,Mo)}function Mo(t){function e(r){return V(r,Mo)}if(t instanceof Be){let r={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return yt(t.label)&&(r.label=t.label),r}else{if(t instanceof je)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ge)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof at)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof ut)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Mo(new ve({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof et)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Mo(new ve({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof De)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof tt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ve){let r={type:"Terminal",name:t.terminalType.name,label:yN(t.terminalType),idx:t.idx};yt(t.label)&&(r.terminalLabel=t.label);let n=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(r.pattern=pr(n)?n.source:n),r}else{if(t instanceof Mt)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}var Bt=class{visit(e){let r=e;switch(r.constructor){case Be:return this.visitNonTerminal(r);case je:return this.visitAlternative(r);case Ge:return this.visitOption(r);case at:return this.visitRepetitionMandatory(r);case ut:return this.visitRepetitionMandatoryWithSeparator(r);case et:return this.visitRepetitionWithSeparator(r);case De:return this.visitRepetition(r);case tt:return this.visitAlternation(r);case ve:return this.visitTerminal(r);case Mt:return this.visitRule(r);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function sp(t){return t instanceof je||t instanceof Ge||t instanceof De||t instanceof at||t instanceof ut||t instanceof et||t instanceof ve||t instanceof Mt}function Di(t,e=[]){return t instanceof Ge||t instanceof De||t instanceof et?!0:t instanceof tt?Ts(t.definition,n=>Di(n,e)):t instanceof Be&&We(e,t)?!1:t instanceof er?(t instanceof Be&&e.push(t),Ot(t.definition,n=>Di(n,e))):!1}function ap(t){return t instanceof tt}function Wt(t){if(t instanceof Be)return"SUBRULE";if(t instanceof Ge)return"OPTION";if(t instanceof tt)return"OR";if(t instanceof at)return"AT_LEAST_ONE";if(t instanceof ut)return"AT_LEAST_ONE_SEP";if(t instanceof et)return"MANY_SEP";if(t instanceof De)return"MANY";if(t instanceof ve)return"CONSUME";throw Error("non exhaustive match")}var sn=class{walk(e,r=[]){G(e.definition,(n,i)=>{let o=st(e.definition,i+1);if(n instanceof Be)this.walkProdRef(n,o,r);else if(n instanceof ve)this.walkTerminal(n,o,r);else if(n instanceof je)this.walkFlat(n,o,r);else if(n instanceof Ge)this.walkOption(n,o,r);else if(n instanceof at)this.walkAtLeastOne(n,o,r);else if(n instanceof ut)this.walkAtLeastOneSep(n,o,r);else if(n instanceof et)this.walkManySep(n,o,r);else if(n instanceof De)this.walkMany(n,o,r);else if(n instanceof tt)this.walkOr(n,o,r);else throw Error("non exhaustive match")})}walkTerminal(e,r,n){}walkProdRef(e,r,n){}walkFlat(e,r,n){let i=r.concat(n);this.walk(e,i)}walkOption(e,r,n){let i=r.concat(n);this.walk(e,i)}walkAtLeastOne(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkAtLeastOneSep(e,r,n){let i=Wb(e,r,n);this.walk(e,i)}walkMany(e,r,n){let i=[new Ge({definition:e.definition})].concat(r,n);this.walk(e,i)}walkManySep(e,r,n){let i=Wb(e,r,n);this.walk(e,i)}walkOr(e,r,n){let i=r.concat(n);G(e.definition,o=>{let s=new je({definition:[o]});this.walk(s,i)})}};function Wb(t,e,r){return[new Ge({definition:[new ve({terminalType:t.separator})].concat(t.definition)})].concat(e,r)}function Ri(t){if(t instanceof Be)return Ri(t.referencedRule);if(t instanceof ve)return kN(t);if(sp(t))return EN(t);if(ap(t))return AN(t);throw Error("non exhaustive match")}function EN(t){let e=[],r=t.definition,n=0,i=r.length>n,o,s=!0;for(;i&&s;)o=r[n],s=Di(o),e=e.concat(Ri(o)),n=n+1,i=r.length>n;return Po(e)}function AN(t){let e=V(t.definition,r=>Ri(r));return Po(xt(e))}function kN(t){return[t.terminalType]}var Gu="_~IN~_";var up=class extends sn{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,r,n){}walkProdRef(e,r,n){let i=wN(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(n),s=new je({definition:o}),a=Ri(s);this.follows[i]=a}};function Hb(t){let e={};return G(t,r=>{let n=new up(r).startWalking();Tt(e,n)}),e}function wN(t,e){return t.name+e+Gu}function le(t){return t.charCodeAt(0)}function Wu(t,e){Array.isArray(t)?t.forEach(function(r){e.push(r)}):e.push(t)}function Bo(t,e){if(t[e]===!0)throw"duplicate flag "+e;let r=t[e];t[e]=!0}function Fi(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Os(){throw Error("Internal Error - Should never get here!")}function lp(t){return t.type==="Character"}var vs=[];for(let t=le("0");t<=le("9");t++)vs.push(t);var Ds=[le("_")].concat(vs);for(let t=le("a");t<=le("z");t++)Ds.push(t);for(let t=le("A");t<=le("Z");t++)Ds.push(t);var cp=[le(" "),le("\f"),le(`
115
+ `),le("\r"),le(" "),le("\v"),le(" "),le("\xA0"),le("\u1680"),le("\u2000"),le("\u2001"),le("\u2002"),le("\u2003"),le("\u2004"),le("\u2005"),le("\u2006"),le("\u2007"),le("\u2008"),le("\u2009"),le("\u200A"),le("\u2028"),le("\u2029"),le("\u202F"),le("\u205F"),le("\u3000"),le("\uFEFF")];var CN=/[0-9a-fA-F]/,Hu=/[0-9]/,TN=/[1-9]/,Rs=class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");let r=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Bo(n,"global");break;case"i":Bo(n,"ignoreCase");break;case"m":Bo(n,"multiLine");break;case"u":Bo(n,"unicode");break;case"y":Bo(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:r,loc:this.loc(0)}}disjunction(){let e=[],r=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(r)}}alternative(){let e=[],r=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(r)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let r;switch(this.popChar()){case"=":r="Lookahead";break;case"!":r="NegativeLookahead";break}Fi(r);let n=this.disjunction();return this.consumeChar(")"),{type:r,value:n,loc:this.loc(e)}}return Os()}quantifier(e=!1){let r,n=this.idx;switch(this.popChar()){case"*":r={atLeast:0,atMost:1/0};break;case"+":r={atLeast:1,atMost:1/0};break;case"?":r={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":r={atLeast:i,atMost:i};break;case",":let o;this.isDigit()?(o=this.integerIncludingZero(),r={atLeast:i,atMost:o}):r={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&r===void 0)return;Fi(r);break}if(!(e===!0&&r===void 0)&&Fi(r))return this.peekChar(0)==="?"?(this.consumeChar("?"),r.greedy=!1):r.greedy=!0,r.type="Quantifier",r.loc=this.loc(n),r}atom(){let e,r=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Fi(e)?(e.loc=this.loc(r),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):Os()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[le(`
116
+ `),le("\r"),le("\u2028"),le("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,r=!1;switch(this.popChar()){case"d":e=vs;break;case"D":e=vs,r=!0;break;case"s":e=cp;break;case"S":e=cp,r=!0;break;case"w":e=Ds;break;case"W":e=Ds,r=!0;break}return Fi(e)?{type:"Set",value:e,complement:r}:Os()}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=le("\f");break;case"n":e=le(`
117
+ `);break;case"r":e=le("\r");break;case"t":e=le(" ");break;case"v":e=le("\v");break}return Fi(e)?{type:"Character",value:e}:Os()}controlLetterEscapeAtom(){this.consumeChar("c");let e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:le("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let e=this.popChar();return{type:"Character",value:le(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
118
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:let e=this.popChar();return{type:"Character",value:le(e)}}}characterClass(){let e=[],r=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),r=!0);this.isClassAtom();){let n=this.classAtom(),i=n.type==="Character";if(lp(n)&&this.isRangeDash()){this.consumeChar("-");let o=this.classAtom(),s=o.type==="Character";if(lp(o)){if(o.value<n.value)throw Error("Range out of order in character class");e.push({from:n.value,to:o.value})}else Wu(n.value,e),e.push(le("-")),Wu(o.value,e)}else Wu(n.value,e)}return this.consumeChar("]"),{type:"Set",complement:r,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
119
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:le("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}let r=this.disjunction();this.consumeChar(")");let n={type:"Group",capturing:e,value:r};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(TN.test(e)===!1)throw Error("Expecting a positive integer");for(;Hu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Hu.test(e)===!1)throw Error("Expecting an integer");for(;Hu.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){case`
120
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:le(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Hu.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
121
121
  `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
122
- `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(_N.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var Bn=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var Yu={},vN=new Rs;function Mo(t){let e=t.toString();if(Yu.hasOwnProperty(e))return Yu[e];{let r=vN.pattern(e);return Yu[e]=r,r}}function Jb(){Yu={}}var eE="Complement Sets are not supported for first char optimization",Fs=`Unable to use "first char" lexer optimizations:
123
- `;function tE(t,e=!1){try{let r=Mo(t);return hp(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===eE)e&&_s(`${Fs} Unable to optimize: < ${t.toString()} >
122
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let r="";for(let i=0;i<e;i++){let o=this.popChar();if(CN.test(o)===!1)throw Error("Expecting a HexDecimal digits");r+=o}return{type:"Character",value:parseInt(r,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}};var Un=class{visitChildren(e){for(let r in e){let n=e[r];e.hasOwnProperty(r)&&(n.type!==void 0?this.visit(n):Array.isArray(n)&&n.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}};var Ku={},_N=new Rs;function jo(t){let e=t.toString();if(Ku.hasOwnProperty(e))return Ku[e];{let r=_N.pattern(e);return Ku[e]=r,r}}function Kb(){Ku={}}var Zb="Complement Sets are not supported for first char optimization",Fs=`Unable to use "first char" lexer optimizations:
123
+ `;function Xb(t,e=!1){try{let r=jo(t);return fp(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===Zb)e&&_s(`${Fs} Unable to optimize: < ${t.toString()} >
124
124
  Complement Sets cannot be automatically optimized.
125
125
  This will disable the lexer's first char optimizations.
126
126
  See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n="";e&&(n=`
127
127
  This will disable the lexer's first char optimizations.
128
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),No(`${Fs}
128
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Lo(`${Fs}
129
129
  Failed parsing: < ${t.toString()} >
130
130
  Using the @chevrotain/regexp-to-ast library
131
- Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function hp(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)hp(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":Zu(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(eE);G(s.value,u=>{if(typeof u=="number")Zu(u,e,r);else{let l=u;if(r===!0)for(let c=l.from;c<=l.to;c++)Zu(c,e,r);else{for(let c=l.from;c<=l.to&&c<Bo;c++)Zu(c,e,r);if(l.to>=Bo){let c=l.from>=Bo?l.from:Bo,f=l.to,p=Ur(c),d=Ur(f);for(let m=p;m<=d;m++)e[m]=m}}}});break;case"Group":hp(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&mp(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Re(e)}function Zu(t,e,r){let n=Ur(t);e[n]=n,r===!0&&IN(t,e)}function IN(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=Ur(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=Ur(i.charCodeAt(0));e[o]=o}}}function Qb(t,e){return jr(t.value,r=>{if(typeof r=="number")return We(e,r);{let n=r;return jr(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function mp(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?J(t.value)?vt(t.value,mp):mp(t.value):!1}var gp=class extends Bn{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){We(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Qb(e,this.targetCharCodes)===void 0&&(this.found=!0):Qb(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Xu(t,e){if(e instanceof RegExp){let r=Mo(e),n=new gp(t);return n.visit(r),n.found}else return jr(e,r=>We(t,r.charCodeAt(0)))!==void 0}var Ri="PATTERN",jo="defaultMode",Ju="modes",yp=typeof new RegExp("(?:)").sticky=="boolean";function iE(t,e){e=Ro(e,{useSticky:yp,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
132
- `],tracer:(C,w)=>w()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{HN()});let n;r("Reject Lexer.NA",()=>{n=Mn(t,C=>C[Ri]===Se.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=q(n,C=>{let w=C[Ri];if(pr(w)){let D=w.source;return D.length===1&&D!=="^"&&D!=="$"&&D!=="."&&!w.ignoreCase?D:D.length===2&&D[0]==="\\"&&!We(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],D[1])?D[1]:e.useSticky?nE(w):rE(w)}else{if(Pt(w))return i=!0,{exec:w};if(typeof w=="object")return i=!0,w;if(typeof w=="string"){if(w.length===1)return w;{let D=w.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),R=new RegExp(D);return e.useSticky?nE(R):rE(R)}}else throw Error("non exhaustive match")}})});let s,a,u,l,c;r("misc mapping",()=>{s=q(n,C=>C.tokenTypeIdx),a=q(n,C=>{let w=C.GROUP;if(w!==Se.SKIPPED){if(yt(w))return w;if(Ot(w))return!1;throw Error("non exhaustive match")}}),u=q(n,C=>{let w=C.LONGER_ALT;if(w)return J(w)?q(w,R=>Vu(n,R)):[Vu(n,w)]}),l=q(n,C=>C.PUSH_MODE),c=q(n,C=>Z(C,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let C=pE(e.lineTerminatorCharacters);f=q(n,w=>!1),e.positionTracking!=="onlyOffset"&&(f=q(n,w=>Z(w,"LINE_BREAKS")?!!w.LINE_BREAKS:fE(w,C)===!1&&Xu(C,w.PATTERN)))});let p,d,m,y;r("Misc Mapping #2",()=>{p=q(n,lE),d=q(o,GN),m=dt(n,(C,w)=>{let D=w.GROUP;return yt(D)&&D!==Se.SKIPPED&&(C[D]=[]),C},{}),y=q(o,(C,w)=>({pattern:o[w],longerAlt:u[w],canLineTerminator:f[w],isCustom:p[w],short:d[w],group:a[w],push:l[w],pop:c[w],tokenTypeIdx:s[w],tokenType:n[w]}))});let g=!0,b=[];return e.safeMode||r("First Char Optimization",()=>{b=dt(n,(C,w,D)=>{if(typeof w.PATTERN=="string"){let R=w.PATTERN.charCodeAt(0),S=Ur(R);xp(C,S,y[D])}else if(J(w.START_CHARS_HINT)){let R;G(w.START_CHARS_HINT,S=>{let de=typeof S=="string"?S.charCodeAt(0):S,ye=Ur(de);R!==ye&&(R=ye,xp(C,ye,y[D]))})}else if(pr(w.PATTERN))if(w.PATTERN.unicode)g=!1,e.ensureOptimizations&&No(`${Fs} Unable to analyze < ${w.PATTERN.toString()} > pattern.
131
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function fp(t,e,r){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)fp(t.value[i],e,r);break;case"Alternative":let n=t.value;for(let i=0;i<n.length;i++){let o=n[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}let s=o;switch(s.type){case"Character":Yu(s.value,e,r);break;case"Set":if(s.complement===!0)throw Error(Zb);G(s.value,u=>{if(typeof u=="number")Yu(u,e,r);else{let l=u;if(r===!0)for(let c=l.from;c<=l.to;c++)Yu(c,e,r);else{for(let c=l.from;c<=l.to&&c<Uo;c++)Yu(c,e,r);if(l.to>=Uo){let c=l.from>=Uo?l.from:Uo,f=l.to,p=zr(c),d=zr(f);for(let m=p;m<=d;m++)e[m]=m}}}});break;case"Group":fp(s.value,e,r);break;default:throw Error("Non Exhaustive Match")}let a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&pp(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Re(e)}function Yu(t,e,r){let n=zr(t);e[n]=n,r===!0&&SN(t,e)}function SN(t,e){let r=String.fromCharCode(t),n=r.toUpperCase();if(n!==r){let i=zr(n.charCodeAt(0));e[i]=i}else{let i=r.toLowerCase();if(i!==r){let o=zr(i.charCodeAt(0));e[o]=o}}}function Yb(t,e){return Ur(t.value,r=>{if(typeof r=="number")return We(e,r);{let n=r;return Ur(e,i=>n.from<=i&&i<=n.to)!==void 0}})}function pp(t){let e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Q(t.value)?Ot(t.value,pp):pp(t.value):!1}var dp=class extends Un{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){We(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Yb(e,this.targetCharCodes)===void 0&&(this.found=!0):Yb(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Zu(t,e){if(e instanceof RegExp){let r=jo(e),n=new dp(t);return n.visit(r),n.found}else return Ur(e,r=>We(t,r.charCodeAt(0)))!==void 0}var Ni="PATTERN",zo="defaultMode",Xu="modes",mp=typeof new RegExp("(?:)").sticky=="boolean";function eE(t,e){e=No(e,{useSticky:mp,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
132
+ `],tracer:(w,k)=>k()});let r=e.tracer;r("initCharCodeToOptimizedIndexMap",()=>{GN()});let n;r("Reject Lexer.NA",()=>{n=jn(t,w=>w[Ni]===Ie.NA)});let i=!1,o;r("Transform Patterns",()=>{i=!1,o=V(n,w=>{let k=w[Ni];if(pr(k)){let D=k.source;return D.length===1&&D!=="^"&&D!=="$"&&D!=="."&&!k.ignoreCase?D:D.length===2&&D[0]==="\\"&&!We(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],D[1])?D[1]:e.useSticky?Qb(k):Jb(k)}else{if(Pt(k))return i=!0,{exec:k};if(typeof k=="object")return i=!0,k;if(typeof k=="string"){if(k.length===1)return k;{let D=k.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),R=new RegExp(D);return e.useSticky?Qb(R):Jb(R)}}else throw Error("non exhaustive match")}})});let s,a,u,l,c;r("misc mapping",()=>{s=V(n,w=>w.tokenTypeIdx),a=V(n,w=>{let k=w.GROUP;if(k!==Ie.SKIPPED){if(yt(k))return k;if(Dt(k))return!1;throw Error("non exhaustive match")}}),u=V(n,w=>{let k=w.LONGER_ALT;if(k)return Q(k)?V(k,R=>qu(n,R)):[qu(n,k)]}),l=V(n,w=>w.PUSH_MODE),c=V(n,w=>X(w,"POP_MODE"))});let f;r("Line Terminator Handling",()=>{let w=uE(e.lineTerminatorCharacters);f=V(n,k=>!1),e.positionTracking!=="onlyOffset"&&(f=V(n,k=>X(k,"LINE_BREAKS")?!!k.LINE_BREAKS:aE(k,w)===!1&&Zu(w,k.PATTERN)))});let p,d,m,y;r("Misc Mapping #2",()=>{p=V(n,oE),d=V(o,qN),m=dt(n,(w,k)=>{let D=k.GROUP;return yt(D)&&D!==Ie.SKIPPED&&(w[D]=[]),w},{}),y=V(o,(w,k)=>({pattern:o[k],longerAlt:u[k],canLineTerminator:f[k],isCustom:p[k],short:d[k],group:a[k],push:l[k],pop:c[k],tokenTypeIdx:s[k],tokenType:n[k]}))});let g=!0,b=[];return e.safeMode||r("First Char Optimization",()=>{b=dt(n,(w,k,D)=>{if(typeof k.PATTERN=="string"){let R=k.PATTERN.charCodeAt(0),S=zr(R);hp(w,S,y[D])}else if(Q(k.START_CHARS_HINT)){let R;G(k.START_CHARS_HINT,S=>{let de=typeof S=="string"?S.charCodeAt(0):S,ye=zr(de);R!==ye&&(R=ye,hp(w,ye,y[D]))})}else if(pr(k.PATTERN))if(k.PATTERN.unicode)g=!1,e.ensureOptimizations&&Lo(`${Fs} Unable to analyze < ${k.PATTERN.toString()} > pattern.
133
133
  The regexp unicode flag is not currently supported by the regexp-to-ast library.
134
134
  This will disable the lexer's first char optimizations.
135
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let R=tE(w.PATTERN,e.ensureOptimizations);Te(R)&&(g=!1),G(R,S=>{xp(C,S,y[D])})}else e.ensureOptimizations&&No(`${Fs} TokenType: <${w.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
135
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let R=Xb(k.PATTERN,e.ensureOptimizations);Te(R)&&(g=!1),G(R,S=>{hp(w,S,y[D])})}else e.ensureOptimizations&&Lo(`${Fs} TokenType: <${k.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
136
136
  This will disable the lexer's first char optimizations.
137
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return C},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:g}}function oE(t,e){let r=[],n=DN(t);r=r.concat(n.errors);let i=RN(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(ON(o)),r=r.concat(UN(o)),r=r.concat(zN(o,e)),r=r.concat($N(o)),r}function ON(t){let e=[],r=It(t,n=>pr(n[Ri]));return e=e.concat(NN(r)),e=e.concat(MN(r)),e=e.concat(BN(r)),e=e.concat(jN(r)),e=e.concat(PN(r)),e}function DN(t){let e=It(t,i=>!Z(i,Ri)),r=q(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:He.MISSING_PATTERN,tokenTypes:[i]})),n=Ln(t,e);return{errors:r,valid:n}}function RN(t){let e=It(t,i=>{let o=i[Ri];return!pr(o)&&!Pt(o)&&!Z(o,"exec")&&!yt(o)}),r=q(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:He.INVALID_PATTERN,tokenTypes:[i]})),n=Ln(t,e);return{errors:r,valid:n}}var FN=/[^\\][$]/;function NN(t){class e extends Bn{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=It(t,i=>{let o=i.PATTERN;try{let s=Mo(o),a=new e;return a.visit(s),a.found}catch{return FN.test(o.source)}});return q(r,i=>({message:`Unexpected RegExp Anchor Error:
137
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return w},[])}),{emptyGroups:m,patternIdxToConfig:y,charCodeToPatternIdxToConfig:b,hasCustom:i,canBeOptimized:g}}function tE(t,e){let r=[],n=ON(t);r=r.concat(n.errors);let i=vN(n.valid),o=i.valid;return r=r.concat(i.errors),r=r.concat(IN(o)),r=r.concat(BN(o)),r=r.concat(jN(o,e)),r=r.concat(UN(o)),r}function IN(t){let e=[],r=vt(t,n=>pr(n[Ni]));return e=e.concat(RN(r)),e=e.concat(PN(r)),e=e.concat(LN(r)),e=e.concat(MN(r)),e=e.concat(FN(r)),e}function ON(t){let e=vt(t,i=>!X(i,Ni)),r=V(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:He.MISSING_PATTERN,tokenTypes:[i]})),n=Bn(t,e);return{errors:r,valid:n}}function vN(t){let e=vt(t,i=>{let o=i[Ni];return!pr(o)&&!Pt(o)&&!X(o,"exec")&&!yt(o)}),r=V(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:He.INVALID_PATTERN,tokenTypes:[i]})),n=Bn(t,e);return{errors:r,valid:n}}var DN=/[^\\][$]/;function RN(t){class e extends Un{constructor(){super(...arguments),this.found=!1}visitEndAnchor(o){this.found=!0}}let r=vt(t,i=>{let o=i.PATTERN;try{let s=jo(o),a=new e;return a.visit(s),a.found}catch{return DN.test(o.source)}});return V(r,i=>({message:`Unexpected RegExp Anchor Error:
138
138
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
139
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:He.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function PN(t){let e=It(t,n=>n.PATTERN.test(""));return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:He.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var LN=/[^\\[][\^]|^\^/;function MN(t){class e extends Bn{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=It(t,i=>{let o=i.PATTERN;try{let s=Mo(o),a=new e;return a.visit(s),a.found}catch{return LN.test(o.source)}});return q(r,i=>({message:`Unexpected RegExp Anchor Error:
139
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:He.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function FN(t){let e=vt(t,n=>n.PATTERN.test(""));return V(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' must not match an empty string",type:He.EMPTY_MATCH_PATTERN,tokenTypes:[n]}))}var NN=/[^\\[][\^]|^\^/;function PN(t){class e extends Un{constructor(){super(...arguments),this.found=!1}visitStartAnchor(o){this.found=!0}}let r=vt(t,i=>{let o=i.PATTERN;try{let s=jo(o),a=new e;return a.visit(s),a.found}catch{return NN.test(o.source)}});return V(r,i=>({message:`Unexpected RegExp Anchor Error:
140
140
  Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
141
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:He.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function BN(t){let e=It(t,n=>{let i=n[Ri];return i instanceof RegExp&&(i.multiline||i.global)});return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:He.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function jN(t){let e=[],r=q(t,o=>dt(t,(s,a)=>(o.PATTERN.source===a.PATTERN.source&&!We(e,a)&&a.PATTERN!==Se.NA&&(e.push(a),s.push(a)),s),[]));r=Mr(r);let n=It(r,o=>o.length>1);return q(n,o=>{let s=q(o,u=>u.name);return{message:`The same RegExp pattern ->${wt(o).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:He.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function UN(t){let e=It(t,n=>{if(!Z(n,"GROUP"))return!1;let i=n.GROUP;return i!==Se.SKIPPED&&i!==Se.NA&&!yt(i)});return q(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:He.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function zN(t,e){let r=It(t,i=>i.PUSH_MODE!==void 0&&!We(e,i.PUSH_MODE));return q(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:He.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function $N(t){let e=[],r=dt(t,(n,i,o)=>{let s=i.PATTERN;return s===Se.NA||(yt(s)?n.push({str:s,idx:o,tokenType:i}):pr(s)&&VN(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return G(t,(n,i)=>{G(r,({str:o,idx:s,tokenType:a})=>{if(i<s&&qN(o,n.PATTERN)){let u=`Token: ->${a.name}<- can never be matched.
141
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:He.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function LN(t){let e=vt(t,n=>{let i=n[Ni];return i instanceof RegExp&&(i.multiline||i.global)});return V(e,n=>({message:"Token Type: ->"+n.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:He.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[n]}))}function MN(t){let e=[],r=V(t,o=>dt(t,(s,a)=>(o.PATTERN.source===a.PATTERN.source&&!We(e,a)&&a.PATTERN!==Ie.NA&&(e.push(a),s.push(a)),s),[]));r=Br(r);let n=vt(r,o=>o.length>1);return V(n,o=>{let s=V(o,u=>u.name);return{message:`The same RegExp pattern ->${kt(o).PATTERN}<-has been used in all of the following Token Types: ${s.join(", ")} <-`,type:He.DUPLICATE_PATTERNS_FOUND,tokenTypes:o}})}function BN(t){let e=vt(t,n=>{if(!X(n,"GROUP"))return!1;let i=n.GROUP;return i!==Ie.SKIPPED&&i!==Ie.NA&&!yt(i)});return V(e,n=>({message:"Token Type: ->"+n.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:He.INVALID_GROUP_TYPE_FOUND,tokenTypes:[n]}))}function jN(t,e){let r=vt(t,i=>i.PUSH_MODE!==void 0&&!We(e,i.PUSH_MODE));return V(r,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:He.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function UN(t){let e=[],r=dt(t,(n,i,o)=>{let s=i.PATTERN;return s===Ie.NA||(yt(s)?n.push({str:s,idx:o,tokenType:i}):pr(s)&&$N(s)&&n.push({str:s.source,idx:o,tokenType:i})),n},[]);return G(t,(n,i)=>{G(r,({str:o,idx:s,tokenType:a})=>{if(i<s&&zN(o,n.PATTERN)){let u=`Token: ->${a.name}<- can never be matched.
142
142
  Because it appears AFTER the Token Type ->${n.name}<-in the lexer's definition.
143
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:He.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function qN(t,e){if(pr(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(Pt(e))return e(t,0,[],{});if(Z(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function VN(t){return jr([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function rE(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function nE(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function sE(t,e,r){let n=[];return Z(t,jo)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+jo+`> property in its definition
144
- `,type:He.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Z(t,Ju)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Ju+`> property in its definition
145
- `,type:He.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Z(t,Ju)&&Z(t,jo)&&!Z(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${jo}: <${t.defaultMode}>which does not exist
146
- `,type:He.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Z(t,Ju)&&G(t.modes,(i,o)=>{G(i,(s,a)=>{if(Ot(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${a}>
147
- `,type:He.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Z(s,"LONGER_ALT")){let u=J(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];G(u,l=>{!Ot(l)&&!We(i,l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${o}>
148
- `,type:He.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function aE(t,e,r){let n=[],i=!1,o=Mr(xt(Re(t.modes))),s=Mn(o,u=>u[Ri]===Se.NA),a=pE(r);return e&&G(s,u=>{let l=fE(u,a);if(l!==!1){let f={message:WN(u,l),type:l.issue,tokenType:u};n.push(f)}else Z(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):Xu(a,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
143
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:He.UNREACHABLE_PATTERN,tokenTypes:[n,a]})}})}),e}function zN(t,e){if(pr(e)){let r=e.exec(t);return r!==null&&r.index===0}else{if(Pt(e))return e(t,0,[],{});if(X(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function $N(t){return Ur([".","\\","[","]","|","^","$","(",")","?","*","+","{"],r=>t.source.indexOf(r)!==-1)===void 0}function Jb(t){let e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function Qb(t){let e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function rE(t,e,r){let n=[];return X(t,zo)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+zo+`> property in its definition
144
+ `,type:He.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),X(t,Xu)||n.push({message:"A MultiMode Lexer cannot be initialized without a <"+Xu+`> property in its definition
145
+ `,type:He.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),X(t,Xu)&&X(t,zo)&&!X(t.modes,t.defaultMode)&&n.push({message:`A MultiMode Lexer cannot be initialized with a ${zo}: <${t.defaultMode}>which does not exist
146
+ `,type:He.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),X(t,Xu)&&G(t.modes,(i,o)=>{G(i,(s,a)=>{if(Dt(s))n.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${o}> at index: <${a}>
147
+ `,type:He.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(X(s,"LONGER_ALT")){let u=Q(s.LONGER_ALT)?s.LONGER_ALT:[s.LONGER_ALT];G(u,l=>{!Dt(l)&&!We(i,l)&&n.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${l.name}> on token <${s.name}> outside of mode <${o}>
148
+ `,type:He.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),n}function nE(t,e,r){let n=[],i=!1,o=Br(xt(Re(t.modes))),s=jn(o,u=>u[Ni]===Ie.NA),a=uE(r);return e&&G(s,u=>{let l=aE(u,a);if(l!==!1){let f={message:VN(u,l),type:l.issue,tokenType:u};n.push(f)}else X(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):Zu(a,u.PATTERN)&&(i=!0)}),e&&!i&&n.push({message:`Warning: No LINE_BREAKS Found.
149
149
  This Lexer has been defined to track line and column information,
150
150
  But none of the Token Types can be identified as matching a line terminator.
151
151
  See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
152
- for details.`,type:He.NO_LINE_BREAKS_FLAGS}),n}function uE(t){let e={},r=Pe(t);return G(r,n=>{let i=t[n];if(J(i))e[n]=[];else throw Error("non exhaustive match")}),e}function lE(t){let e=t.PATTERN;if(pr(e))return!1;if(Pt(e))return!0;if(Z(e,"exec"))return!0;if(yt(e))return!1;throw Error("non exhaustive match")}function GN(t){return yt(t)&&t.length===1?t.charCodeAt(0):!1}var cE={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function fE(t,e){if(Z(t,"LINE_BREAKS"))return!1;if(pr(t.PATTERN)){try{Xu(e,t.PATTERN)}catch(r){return{issue:He.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(yt(t.PATTERN))return!1;if(lE(t))return{issue:He.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function WN(t,e){if(e.issue===He.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
152
+ for details.`,type:He.NO_LINE_BREAKS_FLAGS}),n}function iE(t){let e={},r=Pe(t);return G(r,n=>{let i=t[n];if(Q(i))e[n]=[];else throw Error("non exhaustive match")}),e}function oE(t){let e=t.PATTERN;if(pr(e))return!1;if(Pt(e))return!0;if(X(e,"exec"))return!0;if(yt(e))return!1;throw Error("non exhaustive match")}function qN(t){return yt(t)&&t.length===1?t.charCodeAt(0):!1}var sE={test:function(t){let e=t.length;for(let r=this.lastIndex;r<e;r++){let n=t.charCodeAt(r);if(n===10)return this.lastIndex=r+1,!0;if(n===13)return t.charCodeAt(r+1)===10?this.lastIndex=r+2:this.lastIndex=r+1,!0}return!1},lastIndex:0};function aE(t,e){if(X(t,"LINE_BREAKS"))return!1;if(pr(t.PATTERN)){try{Zu(e,t.PATTERN)}catch(r){return{issue:He.IDENTIFY_TERMINATOR,errMsg:r.message}}return!1}else{if(yt(t.PATTERN))return!1;if(oE(t))return{issue:He.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function VN(t,e){if(e.issue===He.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
153
153
  The problem is in the <${t.name}> Token Type
154
154
  Root cause: ${e.errMsg}.
155
155
  For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===He.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
156
156
  The problem is in the <${t.name}> Token Type
157
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function pE(t){return q(t,r=>yt(r)?r.charCodeAt(0):r)}function xp(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Bo=256,Qu=[];function Ur(t){return t<Bo?t:Qu[t]}function HN(){if(Te(Qu)){Qu=new Array(65536);for(let t=0;t<65536;t++)Qu[t]=t>255?255+~~(t/255):t}}function sn(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function Uo(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var dE=1,mE={};function an(t){let e=KN(t);YN(e),XN(e),ZN(e),G(e,r=>{r.isParent=r.categoryMatches.length>0})}function KN(t){let e=Me(t),r=t,n=!0;for(;n;){r=Mr(xt(q(r,o=>o.CATEGORIES)));let i=Ln(r,e);e=e.concat(i),Te(i)?n=!1:r=i}return e}function YN(t){G(t,e=>{bp(e)||(mE[dE]=e,e.tokenTypeIdx=dE++),hE(e)&&!J(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),hE(e)||(e.CATEGORIES=[]),JN(e)||(e.categoryMatches=[]),QN(e)||(e.categoryMatchesMap={})})}function ZN(t){G(t,e=>{e.categoryMatches=[],G(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(mE[n].tokenTypeIdx)})})}function XN(t){G(t,e=>{gE([],e)})}function gE(t,e){G(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),G(e.CATEGORIES,r=>{let n=t.concat(e);We(n,r)||gE(n,r)})}function bp(t){return Z(t,"tokenTypeIdx")}function hE(t){return Z(t,"CATEGORIES")}function JN(t){return Z(t,"categoryMatches")}function QN(t){return Z(t,"categoryMatchesMap")}function xE(t){return Z(t,"tokenTypeIdx")}var Ep={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var He;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(He||(He={}));var Ns={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
158
- `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ep,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ns);var Se=class{constructor(e,r=Ns){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:u}=Ss(o),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,u}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
159
- a boolean 2nd argument is no longer supported`);this.config=kt({},Ns,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ns.lineTerminatorsPattern)this.config.lineTerminatorsPattern=cE;else if(this.config.lineTerminatorCharacters===Ns.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
160
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),J(e)?i={modes:{defaultMode:Me(e)},defaultMode:jo}:(o=!1,i=Me(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(sE(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(aE(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},G(i.modes,(a,u)=>{i.modes[u]=Mn(a,l=>Ot(l))});let s=Pe(i.modes);if(G(i.modes,(a,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(oE(a,s))}),Te(this.lexerDefinitionErrors)){an(a);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=iE(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=l.charCodeToPatternIdxToConfig,this.emptyGroups=kt({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Te(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let u=q(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
157
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function uE(t){return V(t,r=>yt(r)?r.charCodeAt(0):r)}function hp(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}var Uo=256,Ju=[];function zr(t){return t<Uo?t:Ju[t]}function GN(){if(Te(Ju)){Ju=new Array(65536);for(let t=0;t<65536;t++)Ju[t]=t>255?255+~~(t/255):t}}function an(t,e){let r=t.tokenTypeIdx;return r===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[r]===!0}function $o(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}var lE=1,fE={};function un(t){let e=WN(t);HN(e),YN(e),KN(e),G(e,r=>{r.isParent=r.categoryMatches.length>0})}function WN(t){let e=Me(t),r=t,n=!0;for(;n;){r=Br(xt(V(r,o=>o.CATEGORIES)));let i=Bn(r,e);e=e.concat(i),Te(i)?n=!1:r=i}return e}function HN(t){G(t,e=>{gp(e)||(fE[lE]=e,e.tokenTypeIdx=lE++),cE(e)&&!Q(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),cE(e)||(e.CATEGORIES=[]),ZN(e)||(e.categoryMatches=[]),XN(e)||(e.categoryMatchesMap={})})}function KN(t){G(t,e=>{e.categoryMatches=[],G(e.categoryMatchesMap,(r,n)=>{e.categoryMatches.push(fE[n].tokenTypeIdx)})})}function YN(t){G(t,e=>{pE([],e)})}function pE(t,e){G(t,r=>{e.categoryMatchesMap[r.tokenTypeIdx]=!0}),G(e.CATEGORIES,r=>{let n=t.concat(e);We(n,r)||pE(n,r)})}function gp(t){return X(t,"tokenTypeIdx")}function cE(t){return X(t,"CATEGORIES")}function ZN(t){return X(t,"categoryMatches")}function XN(t){return X(t,"categoryMatchesMap")}function dE(t){return X(t,"tokenTypeIdx")}var xp={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,r,n,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${r} characters.`}};var He;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(He||(He={}));var Ns={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
158
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:xp,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Ns);var Ie=class{constructor(e,r=Ns){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;let s=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${s}--> <${i}>`);let{time:a,value:u}=Ss(o),l=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&l(`${s}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,u}else return o()},typeof r=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
159
+ a boolean 2nd argument is no longer supported`);this.config=Tt({},Ns,r);let n=this.config.traceInitPerf;n===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n=="number"&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,o=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Ns.lineTerminatorsPattern)this.config.lineTerminatorsPattern=sE;else if(this.config.lineTerminatorCharacters===Ns.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
160
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(r.safeMode&&r.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Q(e)?i={modes:{defaultMode:Me(e)},defaultMode:zo}:(o=!1,i=Me(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(rE(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(nE(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},G(i.modes,(a,u)=>{i.modes[u]=jn(a,l=>Dt(l))});let s=Pe(i.modes);if(G(i.modes,(a,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(tE(a,s))}),Te(this.lexerDefinitionErrors)){un(a);let l;this.TRACE_INIT("analyzeTokenTypes",()=>{l=eE(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:r.positionTracking,ensureOptimizations:r.ensureOptimizations,safeMode:r.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=l.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=l.charCodeToPatternIdxToConfig,this.emptyGroups=Tt({},this.emptyGroups,l.emptyGroups),this.hasCustom=l.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=l.canBeOptimized}})}),this.defaultMode=i.defaultMode,!Te(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){let u=V(this.lexerDefinitionErrors,l=>l.message).join(`-----------------------
161
161
  `);throw new Error(`Errors detected in definition of Lexer:
162
- `+u)}G(this.lexerDefinitionWarning,a=>{_s(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(yp?(this.chopInput=cr,this.match=this.matchWithTest):(this.updateLastIndex=Ze,this.match=this.matchWithExec),o&&(this.handleModes=Ze),this.trackStartLines===!1&&(this.computeNewColumn=cr),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ze),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=dt(this.canModeBeOptimized,(u,l,c)=>(l===!1&&u.push(c),u),[]);if(r.ensureOptimizations&&!Te(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
162
+ `+u)}G(this.lexerDefinitionWarning,a=>{_s(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(mp?(this.chopInput=cr,this.match=this.matchWithTest):(this.updateLastIndex=Ze,this.match=this.matchWithExec),o&&(this.handleModes=Ze),this.trackStartLines===!1&&(this.computeNewColumn=cr),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ze),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{let a=dt(this.canModeBeOptimized,(u,l,c)=>(l===!1&&u.push(c),u),[]);if(r.ensureOptimizations&&!Te(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
163
163
  Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
164
- Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Jb()}),this.TRACE_INIT("toFastProperties",()=>{vs(this)})})}tokenize(e,r=this.defaultMode){if(!Te(this.lexerDefinitionErrors)){let i=q(this.lexerDefinitionErrors,o=>o.message).join(`-----------------------
164
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{Kb()}),this.TRACE_INIT("toFastProperties",()=>{Is(this)})})}tokenize(e,r=this.defaultMode){if(!Te(this.lexerDefinitionErrors)){let i=V(this.lexerDefinitionErrors,o=>o.message).join(`-----------------------
165
165
  `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
166
- `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,u,l,c,f,p,d,m,y,g,b,C,w=e,D=w.length,R=0,S=0,de=this.hasCustom?0:Math.floor(e.length/10),ye=new Array(de),be=[],_=this.trackStartLines?1:void 0,L=this.trackStartLines?1:void 0,F=uE(this.emptyGroups),v=this.trackStartLines,P=this.config.lineTerminatorsPattern,j=0,ae=[],ee=[],_e=[],rt=[];Object.freeze(rt);let x;function Ue(){return ae}function Je(he){let oe=Ur(he),ce=ee[oe];return ce===void 0?rt:ce}let E=he=>{if(_e.length===1&&he.tokenType.PUSH_MODE===void 0){let oe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(he);be.push({offset:he.startOffset,line:he.startLine,column:he.startColumn,length:he.image.length,message:oe})}else{_e.pop();let oe=Br(_e);ae=this.patternIdxToConfig[oe],ee=this.charCodeToPatternIdxToConfig[oe],j=ae.length;let ce=this.canModeBeOptimized[oe]&&this.config.safeMode===!1;ee&&ce?x=Je:x=Ue}};function W(he){_e.push(he),ee=this.charCodeToPatternIdxToConfig[he],ae=this.patternIdxToConfig[he],j=ae.length,j=ae.length;let oe=this.canModeBeOptimized[he]&&this.config.safeMode===!1;ee&&oe?x=Je:x=Ue}W.call(this,r);let Ke,ne=this.config.recoveryEnabled;for(;R<D;){u=null;let he=w.charCodeAt(R),oe=x(he),ce=oe.length;for(n=0;n<ce;n++){Ke=oe[n];let me=Ke.pattern;l=null;let Ce=Ke.short;if(Ce!==!1?he===Ce&&(u=me):Ke.isCustom===!0?(C=me.exec(w,R,ye,F),C!==null?(u=C[0],C.payload!==void 0&&(l=C.payload)):u=null):(this.updateLastIndex(me,R),u=this.match(me,e,R)),u!==null){if(a=Ke.longerAlt,a!==void 0){let Fe=a.length;for(o=0;o<Fe;o++){let ze=ae[a[o]],Ut=ze.pattern;if(c=null,ze.isCustom===!0?(C=Ut.exec(w,R,ye,F),C!==null?(s=C[0],C.payload!==void 0&&(c=C.payload)):s=null):(this.updateLastIndex(Ut,R),s=this.match(Ut,e,R)),s&&s.length>u.length){u=s,l=c,Ke=ze;break}}}break}}if(u!==null){if(f=u.length,p=Ke.group,p!==void 0&&(d=Ke.tokenTypeIdx,m=this.createTokenInstance(u,R,d,Ke.tokenType,_,L,f),this.handlePayload(m,l),p===!1?S=this.addToken(ye,S,m):F[p].push(m)),e=this.chopInput(e,f),R=R+f,L=this.computeNewColumn(L,f),v===!0&&Ke.canLineTerminator===!0){let me=0,Ce,Fe;P.lastIndex=0;do Ce=P.test(u),Ce===!0&&(Fe=P.lastIndex-1,me++);while(Ce===!0);me!==0&&(_=_+me,L=f-Fe,this.updateTokenEndLineColumnLocation(m,p,Fe,me,_,L,f))}this.handleModes(Ke,E,W,m)}else{let me=R,Ce=_,Fe=L,ze=ne===!1;for(;ze===!1&&R<D;)for(e=this.chopInput(e,1),R++,i=0;i<j;i++){let Ut=ae[i],A=Ut.pattern,k=Ut.short;if(k!==!1?w.charCodeAt(R)===k&&(ze=!0):Ut.isCustom===!0?ze=A.exec(w,R,ye,F)!==null:(this.updateLastIndex(A,R),ze=A.exec(e)!==null),ze===!0)break}if(y=R-me,L=this.computeNewColumn(L,y),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,me,y,Ce,Fe),be.push({offset:me,line:Ce,column:Fe,length:y,message:b}),ne===!1)break}}return this.hasCustom||(ye.length=S),{tokens:ye,groups:F,errors:be}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let u,l;r!==void 0&&(u=n===a-1,l=u?-1:0,i===1&&u===!0||(e.endLine=o+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Se.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Se.NA=/NOT_APPLICABLE/;function Fi(t){return Ap(t)?t.LABEL:t.name}function Ap(t){return yt(t.LABEL)&&t.LABEL!==""}var eP="parent",yE="categories",bE="label",EE="group",AE="push_mode",wE="pop_mode",CE="longer_alt",kE="line_breaks",TE="start_chars_hint";function xe(t){return tP(t)}function tP(t){let e=t.pattern,r={};if(r.name=t.name,Ot(e)||(r.PATTERN=e),Z(t,eP))throw`The parent property is no longer supported.
167
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Z(t,yE)&&(r.CATEGORIES=t[yE]),an([r]),Z(t,bE)&&(r.LABEL=t[bE]),Z(t,EE)&&(r.GROUP=t[EE]),Z(t,wE)&&(r.POP_MODE=t[wE]),Z(t,AE)&&(r.PUSH_MODE=t[AE]),Z(t,CE)&&(r.LONGER_ALT=t[CE]),Z(t,kE)&&(r.LINE_BREAKS=t[kE]),Z(t,TE)&&(r.START_CHARS_HINT=t[TE]),r}var xr=xe({name:"EOF",pattern:Se.NA});an([xr]);function Ni(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function wp(t,e){return sn(t,e)}var el={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${Ap(t)?`--> ${Fi(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
168
- but found: '`+wt(e).image+"'";if(n)return o+n+a;{let u=dt(t,(p,d)=>p.concat(d),[]),l=q(u,p=>`[${q(p,d=>Fi(d)).join(", ")}]`),f=`one of these possible Token sequences:
169
- ${q(l,(p,d)=>` ${d+1}. ${p}`).join(`
166
+ `+i)}return this.tokenizeInternal(e,r)}tokenizeInternal(e,r){let n,i,o,s,a,u,l,c,f,p,d,m,y,g,b,w,k=e,D=k.length,R=0,S=0,de=this.hasCustom?0:Math.floor(e.length/10),ye=new Array(de),be=[],_=this.trackStartLines?1:void 0,L=this.trackStartLines?1:void 0,F=iE(this.emptyGroups),I=this.trackStartLines,P=this.config.lineTerminatorsPattern,j=0,ae=[],ee=[],Se=[],rt=[];Object.freeze(rt);let x;function Ue(){return ae}function Je(he){let oe=zr(he),fe=ee[oe];return fe===void 0?rt:fe}let E=he=>{if(Se.length===1&&he.tokenType.PUSH_MODE===void 0){let oe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(he);be.push({offset:he.startOffset,line:he.startLine,column:he.startColumn,length:he.image.length,message:oe})}else{Se.pop();let oe=jr(Se);ae=this.patternIdxToConfig[oe],ee=this.charCodeToPatternIdxToConfig[oe],j=ae.length;let fe=this.canModeBeOptimized[oe]&&this.config.safeMode===!1;ee&&fe?x=Je:x=Ue}};function W(he){Se.push(he),ee=this.charCodeToPatternIdxToConfig[he],ae=this.patternIdxToConfig[he],j=ae.length,j=ae.length;let oe=this.canModeBeOptimized[he]&&this.config.safeMode===!1;ee&&oe?x=Je:x=Ue}W.call(this,r);let Ke,ne=this.config.recoveryEnabled;for(;R<D;){u=null;let he=k.charCodeAt(R),oe=x(he),fe=oe.length;for(n=0;n<fe;n++){Ke=oe[n];let me=Ke.pattern;l=null;let we=Ke.short;if(we!==!1?he===we&&(u=me):Ke.isCustom===!0?(w=me.exec(k,R,ye,F),w!==null?(u=w[0],w.payload!==void 0&&(l=w.payload)):u=null):(this.updateLastIndex(me,R),u=this.match(me,e,R)),u!==null){if(a=Ke.longerAlt,a!==void 0){let Fe=a.length;for(o=0;o<Fe;o++){let ze=ae[a[o]],Ut=ze.pattern;if(c=null,ze.isCustom===!0?(w=Ut.exec(k,R,ye,F),w!==null?(s=w[0],w.payload!==void 0&&(c=w.payload)):s=null):(this.updateLastIndex(Ut,R),s=this.match(Ut,e,R)),s&&s.length>u.length){u=s,l=c,Ke=ze;break}}}break}}if(u!==null){if(f=u.length,p=Ke.group,p!==void 0&&(d=Ke.tokenTypeIdx,m=this.createTokenInstance(u,R,d,Ke.tokenType,_,L,f),this.handlePayload(m,l),p===!1?S=this.addToken(ye,S,m):F[p].push(m)),e=this.chopInput(e,f),R=R+f,L=this.computeNewColumn(L,f),I===!0&&Ke.canLineTerminator===!0){let me=0,we,Fe;P.lastIndex=0;do we=P.test(u),we===!0&&(Fe=P.lastIndex-1,me++);while(we===!0);me!==0&&(_=_+me,L=f-Fe,this.updateTokenEndLineColumnLocation(m,p,Fe,me,_,L,f))}this.handleModes(Ke,E,W,m)}else{let me=R,we=_,Fe=L,ze=ne===!1;for(;ze===!1&&R<D;)for(e=this.chopInput(e,1),R++,i=0;i<j;i++){let Ut=ae[i],A=Ut.pattern,C=Ut.short;if(C!==!1?k.charCodeAt(R)===C&&(ze=!0):Ut.isCustom===!0?ze=A.exec(k,R,ye,F)!==null:(this.updateLastIndex(A,R),ze=A.exec(e)!==null),ze===!0)break}if(y=R-me,L=this.computeNewColumn(L,y),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(k,me,y,we,Fe),be.push({offset:me,line:we,column:Fe,length:y,message:b}),ne===!1)break}}return this.hasCustom||(ye.length=S),{tokens:ye,groups:F,errors:be}}handleModes(e,r,n,i){if(e.pop===!0){let o=e.push;r(i),o!==void 0&&n.call(this,o)}else e.push!==void 0&&n.call(this,e.push)}chopInput(e,r){return e.substring(r)}updateLastIndex(e,r){e.lastIndex=r}updateTokenEndLineColumnLocation(e,r,n,i,o,s,a){let u,l;r!==void 0&&(u=n===a-1,l=u?-1:0,i===1&&u===!0||(e.endLine=o+l,e.endColumn=s-1+-l))}computeNewColumn(e,r){return e+r}createOffsetOnlyToken(e,r,n,i){return{image:e,startOffset:r,tokenTypeIdx:n,tokenType:i}}createStartOnlyToken(e,r,n,i,o,s){return{image:e,startOffset:r,startLine:o,startColumn:s,tokenTypeIdx:n,tokenType:i}}createFullToken(e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:r+a-1,startLine:o,endLine:o,startColumn:s,endColumn:s+a-1,tokenTypeIdx:n,tokenType:i}}addTokenUsingPush(e,r,n){return e.push(n),r}addTokenUsingMemberAccess(e,r,n){return e[r]=n,r++,r}handlePayloadNoCustom(e,r){}handlePayloadWithCustom(e,r){r!==null&&(e.payload=r)}matchWithTest(e,r,n){return e.test(r)===!0?r.substring(n,e.lastIndex):null}matchWithExec(e,r){let n=e.exec(r);return n!==null?n[0]:null}};Ie.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.";Ie.NA=/NOT_APPLICABLE/;function Pi(t){return yp(t)?t.LABEL:t.name}function yp(t){return yt(t.LABEL)&&t.LABEL!==""}var JN="parent",hE="categories",mE="label",gE="group",xE="push_mode",yE="pop_mode",bE="longer_alt",EE="line_breaks",AE="start_chars_hint";function xe(t){return QN(t)}function QN(t){let e=t.pattern,r={};if(r.name=t.name,Dt(e)||(r.PATTERN=e),X(t,JN))throw`The parent property is no longer supported.
167
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return X(t,hE)&&(r.CATEGORIES=t[hE]),un([r]),X(t,mE)&&(r.LABEL=t[mE]),X(t,gE)&&(r.GROUP=t[gE]),X(t,yE)&&(r.POP_MODE=t[yE]),X(t,xE)&&(r.PUSH_MODE=t[xE]),X(t,bE)&&(r.LONGER_ALT=t[bE]),X(t,EE)&&(r.LINE_BREAKS=t[EE]),X(t,AE)&&(r.START_CHARS_HINT=t[AE]),r}var xr=xe({name:"EOF",pattern:Ie.NA});un([xr]);function Li(t,e,r,n,i,o,s,a){return{image:e,startOffset:r,endOffset:n,startLine:i,endLine:o,startColumn:s,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function bp(t,e){return an(t,e)}var Qu={buildMismatchTokenMessage({expected:t,actual:e,previous:r,ruleName:n}){return`Expecting ${yp(t)?`--> ${Pi(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:r,customUserDescription:n,ruleName:i}){let o="Expecting: ",a=`
168
+ but found: '`+kt(e).image+"'";if(n)return o+n+a;{let u=dt(t,(p,d)=>p.concat(d),[]),l=V(u,p=>`[${V(p,d=>Pi(d)).join(", ")}]`),f=`one of these possible Token sequences:
169
+ ${V(l,(p,d)=>` ${d+1}. ${p}`).join(`
170
170
  `)}`;return o+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:r,ruleName:n}){let i="Expecting: ",s=`
171
- but found: '`+wt(e).image+"'";if(r)return i+r+s;{let u=`expecting at least one iteration which starts with one of these possible Token sequences::
172
- <${q(t,l=>`[${q(l,c=>Fi(c)).join(",")}]`).join(" ,")}>`;return i+u+s}}};Object.freeze(el);var _E={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
173
- inside top level rule: ->`+t.name+"<-"}},yr={buildDuplicateFoundError(t,e){function r(c){return c instanceof Ie?c.terminalType.name:c instanceof Be?c.nonTerminalName:""}let n=t.name,i=wt(e),o=i.idx,s=Gt(i),a=r(i),u=o>0,l=`->${s}${u?o:""}<- ${a?`with argument: ->${a}<-`:""}
171
+ but found: '`+kt(e).image+"'";if(r)return i+r+s;{let u=`expecting at least one iteration which starts with one of these possible Token sequences::
172
+ <${V(t,l=>`[${V(l,c=>Pi(c)).join(",")}]`).join(" ,")}>`;return i+u+s}}};Object.freeze(Qu);var kE={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
173
+ inside top level rule: ->`+t.name+"<-"}},yr={buildDuplicateFoundError(t,e){function r(c){return c instanceof ve?c.terminalType.name:c instanceof Be?c.nonTerminalName:""}let n=t.name,i=kt(e),o=i.idx,s=Wt(i),a=r(i),u=o>0,l=`->${s}${u?o:""}<- ${a?`with argument: ->${a}<-`:""}
174
174
  appears more than once (${e.length} times) in the top level rule: ->${n}<-.
175
175
  For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
176
176
  `;return l=l.replace(/[ \t]+/g," "),l=l.replace(/\s\s+/g,`
@@ -178,67 +178,67 @@ inside top level rule: ->`+t.name+"<-"}},yr={buildDuplicateFoundError(t,e){funct
178
178
  The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
179
179
  To resolve this make sure each Terminal and Non-Terminal names are unique
180
180
  This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
181
- and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=q(t.prefixPath,i=>Fi(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
181
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){let e=V(t.prefixPath,i=>Pi(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
182
182
  in <OR${r}> inside <${t.topLevelRule.name}> Rule,
183
183
  <${e}> may appears as a prefix path in all these alternatives.
184
184
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
185
- For Further details.`},buildAlternationAmbiguityError(t){let e=q(t.prefixPath,i=>Fi(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
185
+ For Further details.`},buildAlternationAmbiguityError(t){let e=V(t.prefixPath,i=>Pi(i)).join(", "),r=t.alternation.idx===0?"":t.alternation.idx,n=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${r}> inside <${t.topLevelRule.name}> Rule,
186
186
  <${e}> may appears as a prefix path in all these alternatives.
187
187
  `;return n=n+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
188
- For Further details.`,n},buildEmptyRepetitionError(t){let e=Gt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
188
+ For Further details.`,n},buildEmptyRepetitionError(t){let e=Wt(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
189
189
  This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
190
190
  Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
191
191
  <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
192
- has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=q(t.leftRecursionPath,o=>o.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
192
+ has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){let e=t.topLevelRule.name,r=V(t.leftRecursionPath,o=>o.name),n=`${e} --> ${r.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
193
193
  rule: <${e}> can be invoked from itself (directly or indirectly)
194
194
  without consuming any Tokens. The grammar path that causes this is:
195
195
  ${n}
196
196
  To fix this refactor your grammar to remove the left recursion.
197
- see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Mt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function SE(t,e){let r=new Cp(t,e);return r.resolveRefs(),r.errors}var Cp=class extends Bt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){G(Re(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:bt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var kp=class extends on{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Me(this.path.ruleStack).reverse(),this.occurrenceStack=Me(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Te(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},tl=class extends kp{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new je({definition:i});this.possibleTokTypes=Oi(o),this.found=!0}}},zo=class extends on{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},rl=class extends zo{walkMany(e,r,n){if(e.idx===this.occurrence){let i=wt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},Ps=class extends zo{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=wt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},nl=class extends zo{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=wt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Ls=class extends zo{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=wt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof Ie&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function il(t,e,r=[]){r=Me(r);let n=[],i=0;function o(a){return a.concat(st(t,i+1))}function s(a){let u=il(o(a),e,r);return n.concat(u)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof je)return s(a.definition);if(a instanceof Be)return s(a.definition);if(a instanceof Ge)n=s(a.definition);else if(a instanceof at){let u=a.definition.concat([new De({definition:a.definition})]);return s(u)}else if(a instanceof ut){let u=[new je({definition:a.definition}),new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})];return s(u)}else if(a instanceof et){let u=a.definition.concat([new De({definition:[new Ie({terminalType:a.separator})].concat(a.definition)})]);n=s(u)}else if(a instanceof De){let u=a.definition.concat([new De({definition:a.definition})]);n=s(u)}else{if(a instanceof tt)return G(a.definition,u=>{Te(u.definition)===!1&&(n=s(u.definition))}),n;if(a instanceof Ie)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:st(t,i)}),n}function ol(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Te(f);){let p=f.pop();if(p===s){a&&Br(f).idx<=l&&f.pop();continue}let d=p.def,m=p.idx,y=p.ruleStack,g=p.occurrenceStack;if(Te(d))continue;let b=d[0];if(b===i){let C={idx:m,def:st(d),ruleStack:nn(y),occurrenceStack:nn(g)};f.push(C)}else if(b instanceof Ie)if(m<u-1){let C=m+1,w=e[C];if(r(w,b.terminalType)){let D={idx:C,def:st(d),ruleStack:y,occurrenceStack:g};f.push(D)}}else if(m===u-1)c.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:y,occurrenceStack:g}),a=!0;else throw Error("non exhaustive match");else if(b instanceof Be){let C=Me(y);C.push(b.nonTerminalName);let w=Me(g);w.push(b.idx);let D={idx:m,def:b.definition.concat(o,st(d)),ruleStack:C,occurrenceStack:w};f.push(D)}else if(b instanceof Ge){let C={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(C),f.push(s);let w={idx:m,def:b.definition.concat(st(d)),ruleStack:y,occurrenceStack:g};f.push(w)}else if(b instanceof at){let C=new De({definition:b.definition,idx:b.idx}),w=b.definition.concat([C],st(d)),D={idx:m,def:w,ruleStack:y,occurrenceStack:g};f.push(D)}else if(b instanceof ut){let C=new Ie({terminalType:b.separator}),w=new De({definition:[C].concat(b.definition),idx:b.idx}),D=b.definition.concat([w],st(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof et){let C={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(C),f.push(s);let w=new Ie({terminalType:b.separator}),D=new De({definition:[w].concat(b.definition),idx:b.idx}),R=b.definition.concat([D],st(d)),S={idx:m,def:R,ruleStack:y,occurrenceStack:g};f.push(S)}else if(b instanceof De){let C={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(C),f.push(s);let w=new De({definition:b.definition,idx:b.idx}),D=b.definition.concat([w],st(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof tt)for(let C=b.definition.length-1;C>=0;C--){let w=b.definition[C],D={idx:m,def:w.definition.concat(st(d)),ruleStack:y,occurrenceStack:g};f.push(D),f.push(s)}else if(b instanceof je)f.push({idx:m,def:b.definition.concat(st(d)),ruleStack:y,occurrenceStack:g});else if(b instanceof Mt)f.push(rP(b,m,y,g));else throw Error("non exhaustive match")}return c}function rP(t,e,r,n){let i=Me(r);i.push(t.name);let o=Me(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var Xe;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Xe||(Xe={}));function al(t){if(t instanceof Ge||t==="Option")return Xe.OPTION;if(t instanceof De||t==="Repetition")return Xe.REPETITION;if(t instanceof at||t==="RepetitionMandatory")return Xe.REPETITION_MANDATORY;if(t instanceof ut||t==="RepetitionMandatoryWithSeparator")return Xe.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof et||t==="RepetitionWithSeparator")return Xe.REPETITION_WITH_SEPARATOR;if(t instanceof tt||t==="Alternation")return Xe.ALTERNATION;throw Error("non exhaustive match")}function IE(t,e,r,n,i,o){let s=Ms(t,e,r),a=PE(s)?Uo:sn;return o(s,n,a,i)}function OE(t,e,r,n,i,o){let s=Bs(t,e,i,r),a=PE(s)?Uo:sn;return o(s[0],a,n)}function DE(t,e,r,n){let i=t.length,o=vt(t,s=>vt(s,a=>a.length===1));if(e)return function(s){let a=q(s,u=>u.GATE);for(let u=0;u<i;u++){let l=t[u],c=l.length,f=a[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<c;p++){let d=l[p],m=d.length;for(let y=0;y<m;y++){let g=this.LA(y+1);if(r(g,d[y])===!1)continue e}return u}}};if(o&&!n){let s=q(t,u=>xt(u)),a=dt(s,(u,l,c)=>(G(l,f=>{Z(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),G(f.categoryMatches,p=>{Z(u,p)||(u[p]=c)})}),u),{});return function(){let u=this.LA(1);return a[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],u=a.length;e:for(let l=0;l<u;l++){let c=a[l],f=c.length;for(let p=0;p<f;p++){let d=this.LA(p+1);if(r(d,c[p])===!1)continue e}return s}}}}function RE(t,e,r){let n=vt(t,o=>o.length===1),i=t.length;if(n&&!r){let o=xt(t);if(o.length===1&&Te(o[0].categoryMatches)){let a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let s=dt(o,(a,u,l)=>(a[u.tokenTypeIdx]=!0,G(u.categoryMatches,c=>{a[c]=!0}),a),[]);return function(){let a=this.LA(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let u=0;u<a;u++){let l=this.LA(u+1);if(e(l,s[u])===!1)continue e}return!0}return!1}}var _p=class extends on{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Xe.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Xe.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Xe.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Xe.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},sl=class extends Bt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Xe.OPTION)}visitRepetition(e){this.checkIsTarget(e,Xe.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Xe.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Xe.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Xe.ALTERNATION)}};function vE(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function Tp(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let u="_"+n.categoryMatches[a];i.push(s+u)}}e=i}return e}function nP(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function FE(t,e){let r=q(t,s=>il([s],1)),n=vE(r.length),i=q(r,s=>{let a={};return G(s,u=>{let l=Tp(u.partialPath);G(l,c=>{a[c]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=vE(a.length);for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let f=l[c].partialPath,p=l[c].suffixDef,d=Tp(f);if(nP(i,d,u)||Te(p)||f.length===e){let y=n[u];if(ul(y,f)===!1){y.push(f);for(let g=0;g<d.length;g++){let b=d[g];i[u][b]=!0}}}else{let y=il(p,s+1,f);o[u]=o[u].concat(y),G(y,g=>{let b=Tp(g.partialPath);G(b,C=>{i[u][C]=!0})})}}}}return n}function Ms(t,e,r,n){let i=new sl(t,Xe.ALTERNATION,n);return e.accept(i),FE(i.result,r)}function Bs(t,e,r,n){let i=new sl(t,r);e.accept(i);let o=i.result,a=new _p(e,t,r).startWalking(),u=new je({definition:o}),l=new je({definition:a});return FE([u,l],n)}function ul(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function NE(t,e){return t.length<e.length&&vt(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function PE(t){return vt(t,e=>vt(e,r=>vt(r,n=>Te(n.categoryMatches))))}function LE(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return q(e,r=>Object.assign({type:bt.CUSTOM_LOOKAHEAD_VALIDATION},r))}function ME(t,e,r,n){let i=Lt(t,u=>iP(u,r)),o=cP(t,e,r),s=Lt(t,u=>aP(u,r)),a=Lt(t,u=>sP(u,t,n,r));return i.concat(o,s,a)}function iP(t,e){let r=new Sp;t.accept(r);let n=r.allProductions,i=up(n,oP),o=Vt(i,a=>a.length>1);return q(Re(o),a=>{let u=wt(a),l=e.buildDuplicateFoundError(t,a),c=Gt(u),f={message:l,type:bt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:u.idx},p=BE(u);return p&&(f.parameter=p),f})}function oP(t){return`${Gt(t)}_#_${t.idx}_#_${BE(t)}`}function BE(t){return t instanceof Ie?t.terminalType.name:t instanceof Be?t.nonTerminalName:""}var Sp=class extends Bt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function sP(t,e,r,n){let i=[];if(dt(e,(s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:bt.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function jE(t,e,r){let n=[],i;return We(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:bt.INVALID_RULE_OVERRIDE,ruleName:t})),n}function Ip(t,e,r,n=[]){let i=[],o=ll(e.definition);if(Te(o))return[];{let s=t.name;We(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:bt.LEFT_RECURSION,ruleName:s});let u=Ln(o,n.concat([t])),l=Lt(u,c=>{let f=Me(n);return f.push(c),Ip(t,c,r,f)});return i.concat(l)}}function ll(t){let e=[];if(Te(t))return e;let r=wt(t);if(r instanceof Be)e.push(r.referencedRule);else if(r instanceof je||r instanceof Ge||r instanceof at||r instanceof ut||r instanceof et||r instanceof De)e=e.concat(ll(r.definition));else if(r instanceof tt)e=xt(q(r.definition,o=>ll(o.definition)));else if(!(r instanceof Ie))throw Error("non exhaustive match");let n=Ii(r),i=t.length>1;if(n&&i){let o=st(t);return e.concat(ll(o))}else return e}var js=class extends Bt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function UE(t,e){let r=new js;t.accept(r);let n=r.alternations;return Lt(n,o=>{let s=nn(o.definition);return Lt(s,(a,u)=>{let l=ol([a],[],sn,1);return Te(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:u}),type:bt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:u+1}]:[]})})}function zE(t,e,r){let n=new js;t.accept(n);let i=n.alternations;return i=Mn(i,s=>s.ignoreAmbiguities===!0),Lt(i,s=>{let a=s.idx,u=s.maxLookahead||e,l=Ms(a,t,u,s),c=uP(l,s,t,r),f=lP(l,s,t,r);return c.concat(f)})}var vp=class extends Bt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function aP(t,e){let r=new js;t.accept(r);let n=r.alternations;return Lt(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:bt.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function $E(t,e,r){let n=[];return G(t,i=>{let o=new vp;i.accept(o);let s=o.allProductions;G(s,a=>{let u=al(a),l=a.maxLookahead||e,c=a.idx,p=Bs(c,i,u,l)[0];if(Te(xt(p))){let d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:d,type:bt.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function uP(t,e,r,n){let i=[],o=dt(t,(a,u,l)=>(e.definition[l].ignoreAmbiguities===!0||G(u,c=>{let f=[l];G(t,(p,d)=>{l!==d&&ul(p,c)&&e.definition[d].ignoreAmbiguities!==!0&&f.push(d)}),f.length>1&&!ul(i,c)&&(i.push(c),a.push({alts:f,path:c}))}),a),[]);return q(o,a=>{let u=q(a.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:a.path}),type:bt.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function lP(t,e,r,n){let i=dt(t,(s,a,u)=>{let l=q(a,c=>({idx:u,path:c}));return s.concat(l)},[]);return Mr(Lt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let u=s.idx,l=s.path,c=It(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&NE(p.path,l));return q(c,p=>{let d=[p.idx+1,u+1],m=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:d,prefixPath:p.path}),type:bt.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:d}})}))}function cP(t,e,r){let n=[],i=q(e,o=>o.name);return G(t,o=>{let s=o.name;if(We(i,s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:bt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function qE(t){let e=Ro(t,{errMsgProvider:_E}),r={};return G(t.rules,n=>{r[n.name]=n}),SE(r,e.errMsgProvider)}function VE(t){return t=Ro(t,{errMsgProvider:yr}),ME(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var GE="MismatchedTokenException",WE="NoViableAltException",HE="EarlyExitException",KE="NotAllInputParsedException",YE=[GE,WE,HE,KE];Object.freeze(YE);function jn(t){return We(YE,t.name)}var $o=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Pi=class extends $o{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=GE}},Us=class extends $o{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=WE}},zs=class extends $o{constructor(e,r){super(e,r),this.name=KE}},$s=class extends $o{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=HE}};var Op={},Rp="InRuleRecoveryException",Dp=class extends Error{constructor(e){super(e),this.name=Rp}},cl=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Z(e,"recoveryEnabled")?e.recoveryEnabled:jt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=fP)}getTokenToInsert(e){let r=Ni(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],u=!1,l=this.LA(1),c=this.LA(1),f=()=>{let p=this.LA(0),d=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),m=new Pi(d,l,this.LA(0));m.resyncedTokens=nn(a),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,o)?u=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Dp("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Te(r))return!1;let n=this.LA(1);return jr(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return We(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=jr(e,o=>wp(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Op;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return q(e,(n,i)=>i===0?Op:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=q(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return xt(e)}getFollowSetFromFollowKey(e){if(e===Op)return[xr];let r=e.ruleName+e.idxInCallingRule+Wu+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,xr)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return nn(r)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Me(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return q(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function fP(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[a];if(u===void 0){let p=this.getCurrRuleFullName(),d=this.getGAstProductions()[p];u=new o(d,i).startWalking(),this.firstAfterRepMap[a]=u}let l=u.token,c=u.occurrence,f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=xr,c=1),!(l===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,c,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function fl(t,e,r){return r|e|t}var qs=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:jt.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Te(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return Lt(e,r=>Ip(r,r,yr))}validateEmptyOrAlternatives(e){return Lt(e,r=>UE(r,yr))}validateAmbiguousAlternationAlternatives(e,r){return Lt(e,n=>zE(n,r,yr))}validateSomeNonEmptyLookaheadPath(e,r){return $E(e,r,yr)}buildLookaheadForAlternation(e){return IE(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,DE)}buildLookaheadForOptional(e){return OE(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,al(e.prodType),RE)}};var dl=class{initLooksAhead(e){this.dynamicTokensEnabled=Z(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:jt.dynamicTokensEnabled,this.maxLookahead=Z(e,"maxLookahead")?e.maxLookahead:jt.maxLookahead,this.lookaheadStrategy=Z(e,"lookaheadStrategy")?e.lookaheadStrategy:new qs({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){G(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:u}=pP(r);G(n,l=>{let c=l.idx===0?"":l.idx;this.TRACE_INIT(`${Gt(l)}${c}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=fl(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(p,f)})}),G(i,l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Gt(l))}),G(o,l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Gt(l))}),G(s,l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Gt(l))}),G(a,l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Gt(l))}),G(u,l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Gt(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=fl(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return fl(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},Fp=class extends Bt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},pl=new Fp;function pP(t){pl.reset(),t.accept(pl);let e=pl.dslMethods;return pl.reset(),e}function Lp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Mp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function ZE(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function XE(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var dP="name";function Bp(t,e){Object.defineProperty(t,dP,{enumerable:!1,configurable:!0,writable:!1,value:e})}function hP(t,e){let r=Pe(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let u=0;u<a;u++){let l=s[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function JE(t,e){let r=function(){};Bp(r,t+"BaseSemantics");let n={visit:function(i,o){if(J(i)&&(i=i[0]),!Ot(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=mP(this,e);if(!Te(i)){let o=q(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
197
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Mt?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function wE(t,e){let r=new Ep(t,e);return r.resolveRefs(),r.errors}var Ep=class extends Bt{constructor(e,r){super(),this.nameToTopRule=e,this.errMsgProvider=r,this.errors=[]}resolveRefs(){G(Re(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{let n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:n,type:bt.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}};var Ap=class extends sn{constructor(e,r){super(),this.topProd=e,this.path=r,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Me(this.path.ruleStack).reverse(),this.occurrenceStack=Me(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,r=[]){this.found||super.walk(e,r)}walkProdRef(e,r,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let i=r.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){Te(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},el=class extends Ap{constructor(e,r){super(e,r),this.path=r,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,r,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let i=r.concat(n),o=new je({definition:i});this.possibleTokTypes=Ri(o),this.found=!0}}},qo=class extends sn{constructor(e,r){super(),this.topRule=e,this.occurrence=r,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},tl=class extends qo{walkMany(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ve&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,r,n)}},Ps=class extends qo{walkManySep(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ve&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,r,n)}},rl=class extends qo{walkAtLeastOne(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ve&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,r,n)}},Ls=class extends qo{walkAtLeastOneSep(e,r,n){if(e.idx===this.occurrence){let i=kt(r.concat(n));this.result.isEndOfRule=i===void 0,i instanceof ve&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,r,n)}};function nl(t,e,r=[]){r=Me(r);let n=[],i=0;function o(a){return a.concat(st(t,i+1))}function s(a){let u=nl(o(a),e,r);return n.concat(u)}for(;r.length<e&&i<t.length;){let a=t[i];if(a instanceof je)return s(a.definition);if(a instanceof Be)return s(a.definition);if(a instanceof Ge)n=s(a.definition);else if(a instanceof at){let u=a.definition.concat([new De({definition:a.definition})]);return s(u)}else if(a instanceof ut){let u=[new je({definition:a.definition}),new De({definition:[new ve({terminalType:a.separator})].concat(a.definition)})];return s(u)}else if(a instanceof et){let u=a.definition.concat([new De({definition:[new ve({terminalType:a.separator})].concat(a.definition)})]);n=s(u)}else if(a instanceof De){let u=a.definition.concat([new De({definition:a.definition})]);n=s(u)}else{if(a instanceof tt)return G(a.definition,u=>{Te(u.definition)===!1&&(n=s(u.definition))}),n;if(a instanceof ve)r.push(a.terminalType);else throw Error("non exhaustive match")}i++}return n.push({partialPath:r,suffixDef:st(t,i)}),n}function il(t,e,r,n){let i="EXIT_NONE_TERMINAL",o=[i],s="EXIT_ALTERNATIVE",a=!1,u=e.length,l=u-n-1,c=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!Te(f);){let p=f.pop();if(p===s){a&&jr(f).idx<=l&&f.pop();continue}let d=p.def,m=p.idx,y=p.ruleStack,g=p.occurrenceStack;if(Te(d))continue;let b=d[0];if(b===i){let w={idx:m,def:st(d),ruleStack:on(y),occurrenceStack:on(g)};f.push(w)}else if(b instanceof ve)if(m<u-1){let w=m+1,k=e[w];if(r(k,b.terminalType)){let D={idx:w,def:st(d),ruleStack:y,occurrenceStack:g};f.push(D)}}else if(m===u-1)c.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:y,occurrenceStack:g}),a=!0;else throw Error("non exhaustive match");else if(b instanceof Be){let w=Me(y);w.push(b.nonTerminalName);let k=Me(g);k.push(b.idx);let D={idx:m,def:b.definition.concat(o,st(d)),ruleStack:w,occurrenceStack:k};f.push(D)}else if(b instanceof Ge){let w={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let k={idx:m,def:b.definition.concat(st(d)),ruleStack:y,occurrenceStack:g};f.push(k)}else if(b instanceof at){let w=new De({definition:b.definition,idx:b.idx}),k=b.definition.concat([w],st(d)),D={idx:m,def:k,ruleStack:y,occurrenceStack:g};f.push(D)}else if(b instanceof ut){let w=new ve({terminalType:b.separator}),k=new De({definition:[w].concat(b.definition),idx:b.idx}),D=b.definition.concat([k],st(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof et){let w={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let k=new ve({terminalType:b.separator}),D=new De({definition:[k].concat(b.definition),idx:b.idx}),R=b.definition.concat([D],st(d)),S={idx:m,def:R,ruleStack:y,occurrenceStack:g};f.push(S)}else if(b instanceof De){let w={idx:m,def:st(d),ruleStack:y,occurrenceStack:g};f.push(w),f.push(s);let k=new De({definition:b.definition,idx:b.idx}),D=b.definition.concat([k],st(d)),R={idx:m,def:D,ruleStack:y,occurrenceStack:g};f.push(R)}else if(b instanceof tt)for(let w=b.definition.length-1;w>=0;w--){let k=b.definition[w],D={idx:m,def:k.definition.concat(st(d)),ruleStack:y,occurrenceStack:g};f.push(D),f.push(s)}else if(b instanceof je)f.push({idx:m,def:b.definition.concat(st(d)),ruleStack:y,occurrenceStack:g});else if(b instanceof Mt)f.push(eP(b,m,y,g));else throw Error("non exhaustive match")}return c}function eP(t,e,r,n){let i=Me(r);i.push(t.name);let o=Me(n);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}var Xe;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(Xe||(Xe={}));function sl(t){if(t instanceof Ge||t==="Option")return Xe.OPTION;if(t instanceof De||t==="Repetition")return Xe.REPETITION;if(t instanceof at||t==="RepetitionMandatory")return Xe.REPETITION_MANDATORY;if(t instanceof ut||t==="RepetitionMandatoryWithSeparator")return Xe.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof et||t==="RepetitionWithSeparator")return Xe.REPETITION_WITH_SEPARATOR;if(t instanceof tt||t==="Alternation")return Xe.ALTERNATION;throw Error("non exhaustive match")}function TE(t,e,r,n,i,o){let s=Ms(t,e,r),a=DE(s)?$o:an;return o(s,n,a,i)}function _E(t,e,r,n,i,o){let s=Bs(t,e,i,r),a=DE(s)?$o:an;return o(s[0],a,n)}function SE(t,e,r,n){let i=t.length,o=Ot(t,s=>Ot(s,a=>a.length===1));if(e)return function(s){let a=V(s,u=>u.GATE);for(let u=0;u<i;u++){let l=t[u],c=l.length,f=a[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let p=0;p<c;p++){let d=l[p],m=d.length;for(let y=0;y<m;y++){let g=this.LA(y+1);if(r(g,d[y])===!1)continue e}return u}}};if(o&&!n){let s=V(t,u=>xt(u)),a=dt(s,(u,l,c)=>(G(l,f=>{X(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=c),G(f.categoryMatches,p=>{X(u,p)||(u[p]=c)})}),u),{});return function(){let u=this.LA(1);return a[u.tokenTypeIdx]}}else return function(){for(let s=0;s<i;s++){let a=t[s],u=a.length;e:for(let l=0;l<u;l++){let c=a[l],f=c.length;for(let p=0;p<f;p++){let d=this.LA(p+1);if(r(d,c[p])===!1)continue e}return s}}}}function IE(t,e,r){let n=Ot(t,o=>o.length===1),i=t.length;if(n&&!r){let o=xt(t);if(o.length===1&&Te(o[0].categoryMatches)){let a=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{let s=dt(o,(a,u,l)=>(a[u.tokenTypeIdx]=!0,G(u.categoryMatches,c=>{a[c]=!0}),a),[]);return function(){let a=this.LA(1);return s[a.tokenTypeIdx]===!0}}}else return function(){e:for(let o=0;o<i;o++){let s=t[o],a=s.length;for(let u=0;u<a;u++){let l=this.LA(u+1);if(e(l,s[u])===!1)continue e}return!0}return!1}}var wp=class extends sn{constructor(e,r,n){super(),this.topProd=e,this.targetOccurrence=r,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,r,n,i){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=n.concat(i),!0):!1}walkOption(e,r,n){this.checkIsTarget(e,Xe.OPTION,r,n)||super.walkOption(e,r,n)}walkAtLeastOne(e,r,n){this.checkIsTarget(e,Xe.REPETITION_MANDATORY,r,n)||super.walkOption(e,r,n)}walkAtLeastOneSep(e,r,n){this.checkIsTarget(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}walkMany(e,r,n){this.checkIsTarget(e,Xe.REPETITION,r,n)||super.walkOption(e,r,n)}walkManySep(e,r,n){this.checkIsTarget(e,Xe.REPETITION_WITH_SEPARATOR,r,n)||super.walkOption(e,r,n)}},ol=class extends Bt{constructor(e,r,n){super(),this.targetOccurrence=e,this.targetProdType=r,this.targetRef=n,this.result=[]}checkIsTarget(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Xe.OPTION)}visitRepetition(e){this.checkIsTarget(e,Xe.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Xe.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Xe.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Xe.ALTERNATION)}};function CE(t){let e=new Array(t);for(let r=0;r<t;r++)e[r]=[];return e}function kp(t){let e=[""];for(let r=0;r<t.length;r++){let n=t[r],i=[];for(let o=0;o<e.length;o++){let s=e[o];i.push(s+"_"+n.tokenTypeIdx);for(let a=0;a<n.categoryMatches.length;a++){let u="_"+n.categoryMatches[a];i.push(s+u)}}e=i}return e}function tP(t,e,r){for(let n=0;n<t.length;n++){if(n===r)continue;let i=t[n];for(let o=0;o<e.length;o++){let s=e[o];if(i[s]===!0)return!1}}return!0}function OE(t,e){let r=V(t,s=>nl([s],1)),n=CE(r.length),i=V(r,s=>{let a={};return G(s,u=>{let l=kp(u.partialPath);G(l,c=>{a[c]=!0})}),a}),o=r;for(let s=1;s<=e;s++){let a=o;o=CE(a.length);for(let u=0;u<a.length;u++){let l=a[u];for(let c=0;c<l.length;c++){let f=l[c].partialPath,p=l[c].suffixDef,d=kp(f);if(tP(i,d,u)||Te(p)||f.length===e){let y=n[u];if(al(y,f)===!1){y.push(f);for(let g=0;g<d.length;g++){let b=d[g];i[u][b]=!0}}}else{let y=nl(p,s+1,f);o[u]=o[u].concat(y),G(y,g=>{let b=kp(g.partialPath);G(b,w=>{i[u][w]=!0})})}}}}return n}function Ms(t,e,r,n){let i=new ol(t,Xe.ALTERNATION,n);return e.accept(i),OE(i.result,r)}function Bs(t,e,r,n){let i=new ol(t,r);e.accept(i);let o=i.result,a=new wp(e,t,r).startWalking(),u=new je({definition:o}),l=new je({definition:a});return OE([u,l],n)}function al(t,e){e:for(let r=0;r<t.length;r++){let n=t[r];if(n.length===e.length){for(let i=0;i<n.length;i++){let o=e[i],s=n[i];if((o===s||s.categoryMatchesMap[o.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function vE(t,e){return t.length<e.length&&Ot(t,(r,n)=>{let i=e[n];return r===i||i.categoryMatchesMap[r.tokenTypeIdx]})}function DE(t){return Ot(t,e=>Ot(e,r=>Ot(r,n=>Te(n.categoryMatches))))}function RE(t){let e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return V(e,r=>Object.assign({type:bt.CUSTOM_LOOKAHEAD_VALIDATION},r))}function FE(t,e,r,n){let i=Lt(t,u=>rP(u,r)),o=uP(t,e,r),s=Lt(t,u=>oP(u,r)),a=Lt(t,u=>iP(u,t,n,r));return i.concat(o,s,a)}function rP(t,e){let r=new Cp;t.accept(r);let n=r.allProductions,i=op(n,nP),o=Gt(i,a=>a.length>1);return V(Re(o),a=>{let u=kt(a),l=e.buildDuplicateFoundError(t,a),c=Wt(u),f={message:l,type:bt.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:c,occurrence:u.idx},p=NE(u);return p&&(f.parameter=p),f})}function nP(t){return`${Wt(t)}_#_${t.idx}_#_${NE(t)}`}function NE(t){return t instanceof ve?t.terminalType.name:t instanceof Be?t.nonTerminalName:""}var Cp=class extends Bt{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function iP(t,e,r,n){let i=[];if(dt(e,(s,a)=>a.name===t.name?s+1:s,0)>1){let s=n.buildDuplicateRuleNameError({topLevelRule:t,grammarName:r});i.push({message:s,type:bt.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function PE(t,e,r){let n=[],i;return We(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${r}<-as it is not defined in any of the super grammars `,n.push({message:i,type:bt.INVALID_RULE_OVERRIDE,ruleName:t})),n}function _p(t,e,r,n=[]){let i=[],o=ul(e.definition);if(Te(o))return[];{let s=t.name;We(o,t)&&i.push({message:r.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:n}),type:bt.LEFT_RECURSION,ruleName:s});let u=Bn(o,n.concat([t])),l=Lt(u,c=>{let f=Me(n);return f.push(c),_p(t,c,r,f)});return i.concat(l)}}function ul(t){let e=[];if(Te(t))return e;let r=kt(t);if(r instanceof Be)e.push(r.referencedRule);else if(r instanceof je||r instanceof Ge||r instanceof at||r instanceof ut||r instanceof et||r instanceof De)e=e.concat(ul(r.definition));else if(r instanceof tt)e=xt(V(r.definition,o=>ul(o.definition)));else if(!(r instanceof ve))throw Error("non exhaustive match");let n=Di(r),i=t.length>1;if(n&&i){let o=st(t);return e.concat(ul(o))}else return e}var js=class extends Bt{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function LE(t,e){let r=new js;t.accept(r);let n=r.alternations;return Lt(n,o=>{let s=on(o.definition);return Lt(s,(a,u)=>{let l=il([a],[],an,1);return Te(l)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:u}),type:bt.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:u+1}]:[]})})}function ME(t,e,r){let n=new js;t.accept(n);let i=n.alternations;return i=jn(i,s=>s.ignoreAmbiguities===!0),Lt(i,s=>{let a=s.idx,u=s.maxLookahead||e,l=Ms(a,t,u,s),c=sP(l,s,t,r),f=aP(l,s,t,r);return c.concat(f)})}var Tp=class extends Bt{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function oP(t,e){let r=new js;t.accept(r);let n=r.alternations;return Lt(n,o=>o.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:bt.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}]:[])}function BE(t,e,r){let n=[];return G(t,i=>{let o=new Tp;i.accept(o);let s=o.allProductions;G(s,a=>{let u=sl(a),l=a.maxLookahead||e,c=a.idx,p=Bs(c,i,u,l)[0];if(Te(xt(p))){let d=r.buildEmptyRepetitionError({topLevelRule:i,repetition:a});n.push({message:d,type:bt.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),n}function sP(t,e,r,n){let i=[],o=dt(t,(a,u,l)=>(e.definition[l].ignoreAmbiguities===!0||G(u,c=>{let f=[l];G(t,(p,d)=>{l!==d&&al(p,c)&&e.definition[d].ignoreAmbiguities!==!0&&f.push(d)}),f.length>1&&!al(i,c)&&(i.push(c),a.push({alts:f,path:c}))}),a),[]);return V(o,a=>{let u=V(a.alts,c=>c+1);return{message:n.buildAlternationAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:u,prefixPath:a.path}),type:bt.AMBIGUOUS_ALTS,ruleName:r.name,occurrence:e.idx,alternatives:a.alts}})}function aP(t,e,r,n){let i=dt(t,(s,a,u)=>{let l=V(a,c=>({idx:u,path:c}));return s.concat(l)},[]);return Br(Lt(i,s=>{if(e.definition[s.idx].ignoreAmbiguities===!0)return[];let u=s.idx,l=s.path,c=vt(i,p=>e.definition[p.idx].ignoreAmbiguities!==!0&&p.idx<u&&vE(p.path,l));return V(c,p=>{let d=[p.idx+1,u+1],m=e.idx===0?"":e.idx;return{message:n.buildAlternationPrefixAmbiguityError({topLevelRule:r,alternation:e,ambiguityIndices:d,prefixPath:p.path}),type:bt.AMBIGUOUS_PREFIX_ALTS,ruleName:r.name,occurrence:m,alternatives:d}})}))}function uP(t,e,r){let n=[],i=V(e,o=>o.name);return G(t,o=>{let s=o.name;if(We(i,s)){let a=r.buildNamespaceConflictError(o);n.push({message:a,type:bt.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:s})}}),n}function jE(t){let e=No(t,{errMsgProvider:kE}),r={};return G(t.rules,n=>{r[n.name]=n}),wE(r,e.errMsgProvider)}function UE(t){return t=No(t,{errMsgProvider:yr}),FE(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}var zE="MismatchedTokenException",$E="NoViableAltException",qE="EarlyExitException",VE="NotAllInputParsedException",GE=[zE,$E,qE,VE];Object.freeze(GE);function zn(t){return We(GE,t.name)}var Vo=class extends Error{constructor(e,r){super(e),this.token=r,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},Mi=class extends Vo{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=zE}},Us=class extends Vo{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=$E}},zs=class extends Vo{constructor(e,r){super(e,r),this.name=VE}},$s=class extends Vo{constructor(e,r,n){super(e,r),this.previousToken=n,this.name=qE}};var Sp={},Op="InRuleRecoveryException",Ip=class extends Error{constructor(e){super(e),this.name=Op}},ll=class{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=X(e,"recoveryEnabled")?e.recoveryEnabled:jt.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=lP)}getTokenToInsert(e){let r=Li(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return r.isInsertedInRecovery=!0,r}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,r,n,i){let o=this.findReSyncTokenType(),s=this.exportLexerState(),a=[],u=!1,l=this.LA(1),c=this.LA(1),f=()=>{let p=this.LA(0),d=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:l,previous:p,ruleName:this.getCurrRuleFullName()}),m=new Mi(d,l,this.LA(0));m.resyncedTokens=on(a),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(c,i)){f();return}else if(n.call(this)){f(),e.apply(this,r);return}else this.tokenMatcher(c,o)?u=!0:(c=this.SKIP_TOKEN(),this.addToResyncTokens(c,a));this.importLexerState(s)}shouldInRepetitionRecoveryBeTried(e,r,n){return!(n===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,r)))}getFollowsForInRuleRecovery(e,r){let n=this.getCurrentGrammarPath(e,r);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,r){if(this.canRecoverWithSingleTokenInsertion(e,r))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new Ip("sad sad panda")}canPerformInRuleRecovery(e,r){return this.canRecoverWithSingleTokenInsertion(e,r)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,r){if(!this.canTokenTypeBeInsertedInRecovery(e)||Te(r))return!1;let n=this.LA(1);return Ur(r,o=>this.tokenMatcher(n,o))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){let r=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(r);return We(n,e)}findReSyncTokenType(){let e=this.flattenFollowSet(),r=this.LA(1),n=2;for(;;){let i=Ur(e,o=>bp(r,o));if(i!==void 0)return i;r=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Sp;let e=this.getLastExplicitRuleShortName(),r=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:r,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return V(e,(n,i)=>i===0?Sp:{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:r[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){let e=V(this.buildFullFollowKeyStack(),r=>this.getFollowSetFromFollowKey(r));return xt(e)}getFollowSetFromFollowKey(e){if(e===Sp)return[xr];let r=e.ruleName+e.idxInCallingRule+Gu+e.inRule;return this.resyncFollows[r]}addToResyncTokens(e,r){return this.tokenMatcher(e,xr)||r.push(e),r}reSyncTo(e){let r=[],n=this.LA(1);for(;this.tokenMatcher(n,e)===!1;)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,r);return on(r)}attemptInRepetitionRecovery(e,r,n,i,o,s,a){}getCurrentGrammarPath(e,r){let n=this.getHumanReadableRuleStack(),i=Me(this.RULE_OCCURRENCE_STACK);return{ruleStack:n,occurrenceStack:i,lastTok:e,lastTokOccurrence:r}}getHumanReadableRuleStack(){return V(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}};function lP(t,e,r,n,i,o,s){let a=this.getKeyForAutomaticLookahead(n,i),u=this.firstAfterRepMap[a];if(u===void 0){let p=this.getCurrRuleFullName(),d=this.getGAstProductions()[p];u=new o(d,i).startWalking(),this.firstAfterRepMap[a]=u}let l=u.token,c=u.occurrence,f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&l===void 0&&(l=xr,c=1),!(l===void 0||c===void 0)&&this.shouldInRepetitionRecoveryBeTried(l,c,s)&&this.tryInRepetitionRecovery(t,e,r,l)}function cl(t,e,r){return r|e|t}var qs=class{constructor(e){var r;this.maxLookahead=(r=e?.maxLookahead)!==null&&r!==void 0?r:jt.maxLookahead}validate(e){let r=this.validateNoLeftRecursion(e.rules);if(Te(r)){let n=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),o=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...r,...n,...i,...o]}return r}validateNoLeftRecursion(e){return Lt(e,r=>_p(r,r,yr))}validateEmptyOrAlternatives(e){return Lt(e,r=>LE(r,yr))}validateAmbiguousAlternationAlternatives(e,r){return Lt(e,n=>ME(n,r,yr))}validateSomeNonEmptyLookaheadPath(e,r){return BE(e,r,yr)}buildLookaheadForAlternation(e){return TE(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,SE)}buildLookaheadForOptional(e){return _E(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,sl(e.prodType),IE)}};var pl=class{initLooksAhead(e){this.dynamicTokensEnabled=X(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:jt.dynamicTokensEnabled,this.maxLookahead=X(e,"maxLookahead")?e.maxLookahead:jt.maxLookahead,this.lookaheadStrategy=X(e,"lookaheadStrategy")?e.lookaheadStrategy:new qs({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){G(e,r=>{this.TRACE_INIT(`${r.name} Rule Lookahead`,()=>{let{alternation:n,repetition:i,option:o,repetitionMandatory:s,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:u}=cP(r);G(n,l=>{let c=l.idx===0?"":l.idx;this.TRACE_INIT(`${Wt(l)}${c}`,()=>{let f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:l.idx,rule:r,maxLookahead:l.maxLookahead||this.maxLookahead,hasPredicates:l.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),p=cl(this.fullRuleNameToShort[r.name],256,l.idx);this.setLaFuncCache(p,f)})}),G(i,l=>{this.computeLookaheadFunc(r,l.idx,768,"Repetition",l.maxLookahead,Wt(l))}),G(o,l=>{this.computeLookaheadFunc(r,l.idx,512,"Option",l.maxLookahead,Wt(l))}),G(s,l=>{this.computeLookaheadFunc(r,l.idx,1024,"RepetitionMandatory",l.maxLookahead,Wt(l))}),G(a,l=>{this.computeLookaheadFunc(r,l.idx,1536,"RepetitionMandatoryWithSeparator",l.maxLookahead,Wt(l))}),G(u,l=>{this.computeLookaheadFunc(r,l.idx,1280,"RepetitionWithSeparator",l.maxLookahead,Wt(l))})})})}computeLookaheadFunc(e,r,n,i,o,s){this.TRACE_INIT(`${s}${r===0?"":r}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:r,rule:e,maxLookahead:o||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=cl(this.fullRuleNameToShort[e.name],n,r);this.setLaFuncCache(u,a)})}getKeyForAutomaticLookahead(e,r){let n=this.getLastExplicitRuleShortName();return cl(n,e,r)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,r){this.lookAheadFuncsCache.set(e,r)}},vp=class extends Bt{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}},fl=new vp;function cP(t){fl.reset(),t.accept(fl);let e=fl.dslMethods;return fl.reset(),e}function Fp(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function Np(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function WE(t,e,r){t.children[r]===void 0?t.children[r]=[e]:t.children[r].push(e)}function HE(t,e,r){t.children[e]===void 0?t.children[e]=[r]:t.children[e].push(r)}var fP="name";function Pp(t,e){Object.defineProperty(t,fP,{enumerable:!1,configurable:!0,writable:!1,value:e})}function pP(t,e){let r=Pe(t),n=r.length;for(let i=0;i<n;i++){let o=r[i],s=t[o],a=s.length;for(let u=0;u<a;u++){let l=s[u];l.tokenTypeIdx===void 0&&this[l.name](l.children,e)}}}function KE(t,e){let r=function(){};Pp(r,t+"BaseSemantics");let n={visit:function(i,o){if(Q(i)&&(i=i[0]),!Dt(i))return this[i.name](i.children,o)},validateVisitor:function(){let i=dP(this,e);if(!Te(i)){let o=V(i,s=>s.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
198
198
  ${o.join(`
199
199
 
200
200
  `).replace(/\n/g,`
201
- `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function QE(t,e,r){let n=function(){};Bp(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return G(e,o=>{i[o]=hP}),n.prototype=i,n.prototype.constructor=n,n}var jp;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(jp||(jp={}));function mP(t,e){return gP(t,e)}function gP(t,e){let r=It(e,i=>Pt(t[i])===!1),n=q(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:jp.MISSING_METHOD,methodName:i}));return Mr(n)}var xl=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Z(e,"nodeLocationTracking")?e.nodeLocationTracking:jt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ze,this.cstFinallyStateUpdate=Ze,this.cstPostTerminal=Ze,this.cstPostNonTerminal=Ze,this.cstPostRule=Ze;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Mp,this.setNodeLocationFromNode=Mp,this.cstPostRule=Ze,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Lp,this.setNodeLocationFromNode=Lp,this.cstPostRule=Ze,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=Ze,this.setInitialNodeLocation=Ze;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];ZE(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];XE(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Ot(this.baseCstVisitorConstructor)){let e=JE(this.className,Pe(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Ot(this.baseCstVisitorWithDefaultsConstructor)){let e=QE(this.className,Pe(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var yl=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):qo}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?qo:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var bl=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Vo){if(We(this.definedRulesNames,e)){let s={message:yr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:bt.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Vo){let i=jE(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(jn(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Gu(Re(this.gastProductionsCache))}};var El=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Uo,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Z(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
201
+ `)}`)}}};return r.prototype=n,r.prototype.constructor=r,r._RULE_NAMES=e,r}function YE(t,e,r){let n=function(){};Pp(n,t+"BaseSemanticsWithDefaults");let i=Object.create(r.prototype);return G(e,o=>{i[o]=pP}),n.prototype=i,n.prototype.constructor=n,n}var Lp;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(Lp||(Lp={}));function dP(t,e){return hP(t,e)}function hP(t,e){let r=vt(e,i=>Pt(t[i])===!1),n=V(r,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:Lp.MISSING_METHOD,methodName:i}));return Br(n)}var gl=class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=X(e,"nodeLocationTracking")?e.nodeLocationTracking:jt.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ze,this.cstFinallyStateUpdate=Ze,this.cstPostTerminal=Ze,this.cstPostNonTerminal=Ze,this.cstPostRule=Ze;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Np,this.setNodeLocationFromNode=Np,this.cstPostRule=Ze,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Fp,this.setNodeLocationFromNode=Fp,this.cstPostRule=Ze,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ze,this.setNodeLocationFromNode=Ze,this.cstPostRule=Ze,this.setInitialNodeLocation=Ze;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){let r=this.LA(1);e.location={startOffset:r.startOffset,startLine:r.startLine,startColumn:r.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){let r={name:e,children:Object.create(null)};this.setInitialNodeLocation(r),this.CST_STACK.push(r)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?(n.endOffset=r.endOffset,n.endLine=r.endLine,n.endColumn=r.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)}cstPostRuleOnlyOffset(e){let r=this.LA(0),n=e.location;n.startOffset<=r.startOffset?n.endOffset=r.endOffset:n.startOffset=NaN}cstPostTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];WE(n,r,e),this.setNodeLocationFromToken(n.location,r)}cstPostNonTerminal(e,r){let n=this.CST_STACK[this.CST_STACK.length-1];HE(n,r,e),this.setNodeLocationFromNode(n.location,e.location)}getBaseCstVisitorConstructor(){if(Dt(this.baseCstVisitorConstructor)){let e=KE(this.className,Pe(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(Dt(this.baseCstVisitorWithDefaultsConstructor)){let e=YE(this.className,Pe(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){let e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){let e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}};var xl=class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Go}LA(e){let r=this.currIdx+e;return r<0||this.tokVectorLength<=r?Go:this.tokVector[r]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}};var yl=class{ACTION(e){return e.call(this)}consume(e,r,n){return this.consumeInternal(r,e,n)}subrule(e,r,n){return this.subruleInternal(r,e,n)}option(e,r){return this.optionInternal(r,e)}or(e,r){return this.orInternal(r,e)}many(e,r){return this.manyInternal(e,r)}atLeastOne(e,r){return this.atLeastOneInternal(e,r)}CONSUME(e,r){return this.consumeInternal(e,0,r)}CONSUME1(e,r){return this.consumeInternal(e,1,r)}CONSUME2(e,r){return this.consumeInternal(e,2,r)}CONSUME3(e,r){return this.consumeInternal(e,3,r)}CONSUME4(e,r){return this.consumeInternal(e,4,r)}CONSUME5(e,r){return this.consumeInternal(e,5,r)}CONSUME6(e,r){return this.consumeInternal(e,6,r)}CONSUME7(e,r){return this.consumeInternal(e,7,r)}CONSUME8(e,r){return this.consumeInternal(e,8,r)}CONSUME9(e,r){return this.consumeInternal(e,9,r)}SUBRULE(e,r){return this.subruleInternal(e,0,r)}SUBRULE1(e,r){return this.subruleInternal(e,1,r)}SUBRULE2(e,r){return this.subruleInternal(e,2,r)}SUBRULE3(e,r){return this.subruleInternal(e,3,r)}SUBRULE4(e,r){return this.subruleInternal(e,4,r)}SUBRULE5(e,r){return this.subruleInternal(e,5,r)}SUBRULE6(e,r){return this.subruleInternal(e,6,r)}SUBRULE7(e,r){return this.subruleInternal(e,7,r)}SUBRULE8(e,r){return this.subruleInternal(e,8,r)}SUBRULE9(e,r){return this.subruleInternal(e,9,r)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,r,n=Wo){if(We(this.definedRulesNames,e)){let s={message:yr.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:bt.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(s)}this.definedRulesNames.push(e);let i=this.defineRule(e,r,n);return this[e]=i,i}OVERRIDE_RULE(e,r,n=Wo){let i=PE(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);let o=this.defineRule(e,r,n);return this[e]=o,o}BACKTRACK(e,r){return function(){this.isBackTrackingStack.push(1);let n=this.saveRecogState();try{return e.apply(this,r),!0}catch(i){if(zn(i))return!1;throw i}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Vu(Re(this.gastProductionsCache))}};var bl=class{initRecognizerEngine(e,r){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=$o,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},X(r,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
202
202
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
203
- For Further details.`);if(J(e)){if(Te(e))throw Error(`A Token Vocabulary cannot be empty.
203
+ For Further details.`);if(Q(e)){if(Te(e))throw Error(`A Token Vocabulary cannot be empty.
204
204
  Note that the first argument for the parser constructor
205
205
  is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
206
206
  See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
207
- For Further details.`)}if(J(e))this.tokensMap=dt(e,(o,s)=>(o[s.name]=s,o),{});else if(Z(e,"modes")&&vt(xt(Re(e.modes)),xE)){let o=xt(Re(e.modes)),s=Fo(o);this.tokensMap=dt(s,(a,u)=>(a[u.name]=u,a),{})}else if(Ye(e))this.tokensMap=Me(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=xr;let n=Z(e,"modes")?xt(Re(e.modes)):Re(e),i=vt(n,o=>Te(o.categoryMatches));this.tokenMatcher=i?Uo:sn,an(Re(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
208
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=Z(n,"resyncEnabled")?n.resyncEnabled:Vo.resyncEnabled,o=Z(n,"recoveryValueFunc")?n.recoveryValueFunc:Vo.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...c){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(jn(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,Xe.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,nl)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Ls],a,1536,e,Ls)}else throw this.raiseEarlyExitException(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let u=i;i=()=>a.call(this)&&u.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,rl,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Ps],a,1280,e,Ps)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=J(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new zs(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw jn(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Pi(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===Rp?n:o}}else throw n}saveRecogState(){let e=this.errors,r=Me(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),xr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var Al=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Z(e,"errorMessageProvider")?e.errorMessageProvider:jt.errorMessageProvider}SAVE_ERROR(e){if(jn(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Me(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Me(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=Bs(e,o,r,this.maxLookahead)[0],u=[];for(let c=1;c<=this.maxLookahead;c++)u.push(this.LA(c));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new $s(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=Ms(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));let a=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Us(u,this.LA(1),a))}};var wl=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(Ot(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return ol([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=wt(e.ruleStack),i=this.getGAstProductions()[r];return new tl(i,e).startWalking()}};var Tl={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Tl);var eA=!0,tA=Math.pow(2,8)-1,nA=xe({name:"RECORDING_PHASE_TOKEN",pattern:Se.NA});an([nA]);var iA=Ni(nA,`This IToken indicates the Parser is in Recording Phase
209
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(iA);var yP={name:`This CSTNode indicates the Parser is in Recording Phase
210
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Cl=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return qo}topLevelRuleRecord(e,r){try{let n=new Mt({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
207
+ For Further details.`)}if(Q(e))this.tokensMap=dt(e,(o,s)=>(o[s.name]=s,o),{});else if(X(e,"modes")&&Ot(xt(Re(e.modes)),dE)){let o=xt(Re(e.modes)),s=Po(o);this.tokensMap=dt(s,(a,u)=>(a[u.name]=u,a),{})}else if(Ye(e))this.tokensMap=Me(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=xr;let n=X(e,"modes")?xt(Re(e.modes)):Re(e),i=Ot(n,o=>Te(o.categoryMatches));this.tokenMatcher=i?$o:an,un(Re(this.tokensMap))}defineRule(e,r,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
208
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let i=X(n,"resyncEnabled")?n.resyncEnabled:Wo.resyncEnabled,o=X(n,"recoveryValueFunc")?n.recoveryValueFunc:Wo.recoveryValueFunc,s=this.ruleShortNameIdx<<12;this.ruleShortNameIdx++,this.shortRuleNameToFull[s]=e,this.fullRuleNameToShort[e]=s;let a;return this.outputCst===!0?a=function(...c){try{this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c);let f=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}}:a=function(...c){try{return this.ruleInvocationStateUpdate(s,e,this.subruleIdx),r.apply(this,c)}catch(f){return this.invokeRuleCatch(f,i,o)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:r})}invokeRuleCatch(e,r,n){let i=this.RULE_STACK.length===1,o=r&&!this.isBackTracking()&&this.recoveryEnabled;if(zn(e)){let s=e;if(o){let a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(s.resyncedTokens=this.reSyncTo(a),this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return n(e);else{if(this.outputCst){let u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,s.partialCstResult=u}throw s}}else{if(i)return this.moveToTerminatedState(),n(e);throw s}}else throw e}optionInternal(e,r){let n=this.getKeyForAutomaticLookahead(512,r);return this.optionInternalLogic(e,r,n)}optionInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof e!="function"){o=e.DEF;let s=e.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=e;if(i.call(this)===!0)return o.call(this)}atLeastOneInternal(e,r){let n=this.getKeyForAutomaticLookahead(1024,e);return this.atLeastOneInternalLogic(e,r,n)}atLeastOneInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let s=r.GATE;if(s!==void 0){let a=i;i=()=>s.call(this)&&a.call(this)}}else o=r;if(i.call(this)===!0){let s=this.doSingleRepetition(o);for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o)}else throw this.raiseEarlyExitException(e,Xe.REPETITION_MANDATORY,r.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,r],i,1024,e,rl)}atLeastOneSepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1536,e);this.atLeastOneSepFirstInternalLogic(e,r,n)}atLeastOneSepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Ls],a,1536,e,Ls)}else throw this.raiseEarlyExitException(e,Xe.REPETITION_MANDATORY_WITH_SEPARATOR,r.ERR_MSG)}manyInternal(e,r){let n=this.getKeyForAutomaticLookahead(768,e);return this.manyInternalLogic(e,r,n)}manyInternalLogic(e,r,n){let i=this.getLaFuncFromCache(n),o;if(typeof r!="function"){o=r.DEF;let a=r.GATE;if(a!==void 0){let u=i;i=()=>a.call(this)&&u.call(this)}}else o=r;let s=!0;for(;i.call(this)===!0&&s===!0;)s=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[e,r],i,768,e,tl,s)}manySepFirstInternal(e,r){let n=this.getKeyForAutomaticLookahead(1280,e);this.manySepFirstInternalLogic(e,r,n)}manySepFirstInternalLogic(e,r,n){let i=r.DEF,o=r.SEP;if(this.getLaFuncFromCache(n).call(this)===!0){i.call(this);let a=()=>this.tokenMatcher(this.LA(1),o);for(;this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,o,a,i,Ps],a,1280,e,Ps)}}repetitionSepSecondInternal(e,r,n,i,o){for(;n();)this.CONSUME(r),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,r,n,i,o],n,1536,e,o)}doSingleRepetition(e){let r=this.getLexerPosition();return e.call(this),this.getLexerPosition()>r}orInternal(e,r){let n=this.getKeyForAutomaticLookahead(256,r),i=Q(e)?e:e.DEF,s=this.getLaFuncFromCache(n).call(this,i);if(s!==void 0)return i[s].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){let e=this.LA(1),r=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new zs(r,e))}}subruleInternal(e,r,n){let i;try{let o=n!==void 0?n.ARGS:void 0;return this.subruleIdx=r,i=e.apply(this,o),this.cstPostNonTerminal(i,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),i}catch(o){throw this.subruleInternalError(o,n,e.ruleName)}}subruleInternalError(e,r,n){throw zn(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,r!==void 0&&r.LABEL!==void 0?r.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,r,n){let i;try{let o=this.LA(1);this.tokenMatcher(o,e)===!0?(this.consumeToken(),i=o):this.consumeInternalError(e,o,n)}catch(o){i=this.consumeInternalRecovery(e,r,o)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,i),i}consumeInternalError(e,r,n){let i,o=this.LA(0);throw n!==void 0&&n.ERR_MSG?i=n.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:r,previous:o,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Mi(i,r,o))}consumeInternalRecovery(e,r,n){if(this.recoveryEnabled&&n.name==="MismatchedTokenException"&&!this.isBackTracking()){let i=this.getFollowsForInRuleRecovery(e,r);try{return this.tryInRuleRecovery(e,i)}catch(o){throw o.name===Op?n:o}}else throw n}saveRecogState(){let e=this.errors,r=Me(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:r,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,r,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(r)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),xr)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}};var El=class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=X(e,"errorMessageProvider")?e.errorMessageProvider:jt.errorMessageProvider}SAVE_ERROR(e){if(zn(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Me(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Me(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,r,n){let i=this.getCurrRuleFullName(),o=this.getGAstProductions()[i],a=Bs(e,o,r,this.maxLookahead)[0],u=[];for(let c=1;c<=this.maxLookahead;c++)u.push(this.LA(c));let l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:u,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new $s(l,this.LA(1),this.LA(0)))}raiseNoAltException(e,r){let n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],o=Ms(e,i,this.maxLookahead),s=[];for(let l=1;l<=this.maxLookahead;l++)s.push(this.LA(l));let a=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:a,customUserDescription:r,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Us(u,this.LA(1),a))}};var Al=class{initContentAssist(){}computeContentAssist(e,r){let n=this.gastProductionsCache[e];if(Dt(n))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return il([n],r,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){let r=kt(e.ruleStack),i=this.getGAstProductions()[r];return new el(i,e).startWalking()}};var Cl={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Cl);var ZE=!0,XE=Math.pow(2,8)-1,QE=xe({name:"RECORDING_PHASE_TOKEN",pattern:Ie.NA});un([QE]);var eA=Li(QE,`This IToken indicates the Parser is in Recording Phase
209
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(eA);var gP={name:`This CSTNode indicates the Parser is in Recording Phase
210
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},kl=class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){let r=e>0?e:"";this[`CONSUME${r}`]=function(n,i){return this.consumeInternalRecord(n,e,i)},this[`SUBRULE${r}`]=function(n,i){return this.subruleInternalRecord(n,e,i)},this[`OPTION${r}`]=function(n){return this.optionInternalRecord(n,e)},this[`OR${r}`]=function(n){return this.orInternalRecord(n,e)},this[`MANY${r}`]=function(n){this.manyInternalRecord(e,n)},this[`MANY_SEP${r}`]=function(n){this.manySepFirstInternalRecord(e,n)},this[`AT_LEAST_ONE${r}`]=function(n){this.atLeastOneInternalRecord(e,n)},this[`AT_LEAST_ONE_SEP${r}`]=function(n){this.atLeastOneSepFirstInternalRecord(e,n)}}this.consume=function(e,r,n){return this.consumeInternalRecord(r,e,n)},this.subrule=function(e,r,n){return this.subruleInternalRecord(r,e,n)},this.option=function(e,r){return this.optionInternalRecord(r,e)},this.or=function(e,r){return this.orInternalRecord(r,e)},this.many=function(e,r){this.manyInternalRecord(e,r)},this.atLeastOne=function(e,r){this.atLeastOneInternalRecord(e,r)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{let e=this;for(let r=0;r<10;r++){let n=r>0?r:"";delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,r){return()=>!0}LA_RECORD(e){return Go}topLevelRuleRecord(e,r){try{let n=new Mt({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),r.call(this),this.recordingProdStack.pop(),n}catch(n){if(n.KNOWN_RECORDER_ERROR!==!0)try{n.message=n.message+`
211
211
  This error was thrown during the "grammar recording phase" For more info see:
212
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Gs.call(this,Ge,e,r)}atLeastOneInternalRecord(e,r){Gs.call(this,at,r,e)}atLeastOneSepFirstInternalRecord(e,r){Gs.call(this,ut,r,e,eA)}manyInternalRecord(e,r){Gs.call(this,De,r,e)}manySepFirstInternalRecord(e,r){Gs.call(this,et,r,e,eA)}orInternalRecord(e,r){return bP.call(this,e,r)}subruleInternalRecord(e,r,n){if(kl(r),!e||Z(e,"ruleName")===!1){let a=new Error(`<SUBRULE${rA(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
213
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=Br(this.recordingProdStack),o=e.ruleName,s=new Be({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?yP:Tl}consumeInternalRecord(e,r,n){if(kl(r),!bp(e)){let s=new Error(`<CONSUME${rA(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
214
- inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=Br(this.recordingProdStack),o=new Ie({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),iA}};function Gs(t,e,r,n=!1){kl(r);let i=Br(this.recordingProdStack),o=Pt(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),Z(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),Tl}function bP(t,e){kl(e);let r=Br(this.recordingProdStack),n=J(t)===!1,i=n===!1?t:t.DEF,o=new tt({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});Z(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=Ts(i,a=>Pt(a.GATE));return o.hasPredicates=s,r.definition.push(o),G(i,a=>{let u=new je({definition:[]});o.definition.push(u),Z(a,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Z(a,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),a.ALT.call(this),this.recordingProdStack.pop()}),Tl}function rA(t){return t===0?"":`${t}`}function kl(t){if(t<0||t>tA){let e=new Error(`Invalid DSL Method idx value: <${t}>
215
- Idx value must be a none negative value smaller than ${tA+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var _l=class{initPerformanceTracer(e){if(Z(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=jt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=Ss(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function oA(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var qo=Ni(xr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(qo);var jt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:el,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Vo=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),bt;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(bt||(bt={}));var Ws=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{vs(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),G(this.definedRulesNames,i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=qE({rules:Re(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Te(n)&&this.skipValidations===!1){let i=VE({rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),errMsgProvider:yr,grammarName:r}),o=LE({lookaheadStrategy:this.lookaheadStrategy,rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),Te(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=Xb(Re(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Re(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Re(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Te(this.definitionErrors))throw e=q(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
212
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw n}throw n}}optionInternalRecord(e,r){return Gs.call(this,Ge,e,r)}atLeastOneInternalRecord(e,r){Gs.call(this,at,r,e)}atLeastOneSepFirstInternalRecord(e,r){Gs.call(this,ut,r,e,ZE)}manyInternalRecord(e,r){Gs.call(this,De,r,e)}manySepFirstInternalRecord(e,r){Gs.call(this,et,r,e,ZE)}orInternalRecord(e,r){return xP.call(this,e,r)}subruleInternalRecord(e,r,n){if(wl(r),!e||X(e,"ruleName")===!1){let a=new Error(`<SUBRULE${JE(r)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
213
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}let i=jr(this.recordingProdStack),o=e.ruleName,s=new Be({idx:r,nonTerminalName:o,label:n?.LABEL,referencedRule:void 0});return i.definition.push(s),this.outputCst?gP:Cl}consumeInternalRecord(e,r,n){if(wl(r),!gp(e)){let s=new Error(`<CONSUME${JE(r)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
214
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw s.KNOWN_RECORDER_ERROR=!0,s}let i=jr(this.recordingProdStack),o=new ve({idx:r,terminalType:e,label:n?.LABEL});return i.definition.push(o),eA}};function Gs(t,e,r,n=!1){wl(r);let i=jr(this.recordingProdStack),o=Pt(e)?e:e.DEF,s=new t({definition:[],idx:r});return n&&(s.separator=e.SEP),X(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),i.definition.push(s),this.recordingProdStack.pop(),Cl}function xP(t,e){wl(e);let r=jr(this.recordingProdStack),n=Q(t)===!1,i=n===!1?t:t.DEF,o=new tt({definition:[],idx:e,ignoreAmbiguities:n&&t.IGNORE_AMBIGUITIES===!0});X(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);let s=Ts(i,a=>Pt(a.GATE));return o.hasPredicates=s,r.definition.push(o),G(i,a=>{let u=new je({definition:[]});o.definition.push(u),X(a,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:X(a,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),a.ALT.call(this),this.recordingProdStack.pop()}),Cl}function JE(t){return t===0?"":`${t}`}function wl(t){if(t<0||t>XE){let e=new Error(`Invalid DSL Method idx value: <${t}>
215
+ Idx value must be a none negative value smaller than ${XE+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}var Tl=class{initPerformanceTracer(e){if(X(e,"traceInitPerf")){let r=e.traceInitPerf,n=typeof r=="number";this.traceInitMaxIdent=n?r:1/0,this.traceInitPerf=n?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=jt.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,r){if(this.traceInitPerf===!0){this.traceInitIndent++;let n=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--> <${e}>`);let{time:i,value:o}=Ss(r),s=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(`${n}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,o}else return r()}};function tA(t,e){e.forEach(r=>{let n=r.prototype;Object.getOwnPropertyNames(n).forEach(i=>{if(i==="constructor")return;let o=Object.getOwnPropertyDescriptor(n,i);o&&(o.get||o.set)?Object.defineProperty(t.prototype,i,o):t.prototype[i]=r.prototype[i]})})}var Go=Li(xr,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Go);var jt=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Qu,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Wo=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0}),bt;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(bt||(bt={}));var Ws=class t{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;let r=this.className;this.TRACE_INIT("toFastProps",()=>{Is(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),G(this.definedRulesNames,i=>{let s=this[i].originalGrammarAction,a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,s)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let n=[];if(this.TRACE_INIT("Grammar Resolving",()=>{n=jE({rules:Re(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(n)}),this.TRACE_INIT("Grammar Validations",()=>{if(Te(n)&&this.skipValidations===!1){let i=UE({rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),errMsgProvider:yr,grammarName:r}),o=RE({lookaheadStrategy:this.lookaheadStrategy,rules:Re(this.gastProductionsCache),tokenTypes:Re(this.tokensMap),grammarName:r});this.definitionErrors=this.definitionErrors.concat(i,o)}}),Te(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{let i=Hb(Re(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,o;(o=(i=this.lookaheadStrategy).initialize)===null||o===void 0||o.call(i,{rules:Re(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Re(this.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!Te(this.definitionErrors))throw e=V(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
216
216
  ${e.join(`
217
217
  -------------------------------
218
- `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),Z(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
218
+ `)}`)})}constructor(e,r){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(r),n.initLexerAdapter(),n.initLooksAhead(r),n.initRecognizerEngine(e,r),n.initRecoverable(r),n.initTreeBuilder(r),n.initContentAssist(),n.initGastRecorder(r),n.initPerformanceTracer(r),X(r,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
219
219
  Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
220
220
  See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
221
- For further details.`);this.skipValidations=Z(r,"skipValidations")?r.skipValidations:jt.skipValidations}};Ws.DEFER_DEFINITION_ERRORS_HANDLING=!1;oA(Ws,[cl,dl,xl,yl,El,bl,Al,wl,Cl,_l]);var Li=class extends Ws{constructor(e,r=jt){let n=Me(r);n.outputCst=!0,super(e,n)}};var vl=xe({name:"flag",pattern:/--[\w-]+/}),qp=xe({longer_alt:vl,name:"alias",pattern:/-[A-Z]/i}),sA=xe({group:Se.SKIPPED,name:"comma",pattern:/,/}),aA=xe({group:Se.SKIPPED,name:"dollar",pattern:/\$/}),Sl=xe({group:Se.SKIPPED,name:"whiteSpace",pattern:/ /}),uA=xe({group:Se.SKIPPED,name:"newLine",pattern:/\n/}),Vp=xe({name:"word",pattern:/\S+/}),Ks=xe({name:"argument",pattern:/(<\S+>|\[.+\])/}),Gp=xe({name:"programDescription",pattern:/\w.+(?=\n\n {2}Usage)/}),lA=xe({group:Se.SKIPPED,name:"startUsage",pattern:/ {2}Usage\n/,push_mode:"USAGE_MODE"}),cA=xe({group:Se.SKIPPED,name:"endUsage",pattern:/\n/,pop_mode:!0}),Wp=xe({name:"startOptions",pattern:/ {2}Options\n/,push_mode:"OPTIONS_MODE"}),Hp=xe({name:"startRow",pattern:/ {4}/,push_mode:"ROW_MODE"}),Kp=xe({name:"rowDescription",pattern:/\w.+/}),fA=xe({group:Se.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),pA=xe({group:Se.SKIPPED,name:"endOptions",pattern:/\n/,pop_mode:!0}),AP=new Se({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[lA,Wp,Gp,uA,Sl],OPTIONS_MODE:[pA,Hp],ROW_MODE:[fA,qp,vl,sA,Ks,Kp,Sl],USAGE_MODE:[cA,aA,Ks,Vp,Sl]}}),wP=[vl,qp,sA,aA,Sl,uA,Vp,Ks,Gp,lA,cA,Wp,Hp,Kp,fA,pA],zp=class extends Li{sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(Hp),this.MANY(()=>{this.OR([{ALT:()=>this.CONSUME(Ks)},{ALT:()=>this.CONSUME(qp)},{ALT:()=>this.CONSUME(vl)},{ALT:()=>this.CONSUME(Kp,{LABEL:"description"})}])})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(Wp),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});programHelp=this.RULE("programHelp",()=>{this.CONSUME(Gp,{LABEL:"description"}),this.AT_LEAST_ONE(()=>{this.CONSUME(Vp,{LABEL:"commandName"})}),this.MANY(()=>{this.CONSUME(Ks)}),this.OPTION(()=>{this.SUBRULE(this.optionsSection)})});constructor(){super(wP),this.performSelfAnalysis()}},Hs=new zp,$p=class extends Hs.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}programHelp(e){let{command:r,subcommand:n}=Il(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,subcommandName:n}}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),description:this.getString(e.description,!0),flags:this.getArray(e.flag)}}clean(e){return e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}},CP=new $p;function dA(t){let e=AP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);Hs.input=e.tokens;let r=Hs.programHelp();if(Hs.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(Hs.errors,void 0,2)}`);let n;try{n=CP.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var Jp=xe({name:"flag",pattern:/--[\w-]+/}),Qp=xe({name:"alias",pattern:/-[A-Z]/i}),hA=xe({group:Se.SKIPPED,name:"comma",pattern:/,/}),Go=xe({name:"word",pattern:/\S+/}),Zs=xe({name:"argument",pattern:/<\S+>|\[\S+\]/}),ed=xe({name:"type",pattern:/\[(boolean|string|array|number)\]/}),td=xe({name:"defaultInfo",pattern:/\[default\]/}),rd=xe({name:"required",pattern:/\[required\]/}),nd=xe({name:"defaultInfoDescription",pattern:/\[default:\s.+\]/}),id=xe({name:"choices",pattern:/\[choices:\s.+?\]/}),Yp=xe({group:Se.SKIPPED,name:"whiteSpace",pattern:/\s/}),mA=xe({group:Se.SKIPPED,name:"startProgramDescription",pattern:/\n\n/,push_mode:"PROGRAM_DESCRIPTION_MODE"}),od=xe({name:"programDescription",pattern:/.+/}),gA=xe({group:Se.SKIPPED,name:"endProgramDescription",pattern:/\n\n/,pop_mode:!0}),sd=xe({name:"startOptionsSection",pattern:/Options:?\n/,push_mode:"SECTION_MODE"}),ad=xe({name:"startPositionalsSection",pattern:/Positionals:\n/,push_mode:"SECTION_MODE"}),ud=xe({name:"startCommandsSection",pattern:/Commands:\n/,push_mode:"SECTION_MODE"}),ld=xe({name:"startRow",pattern:/ {2,}/,push_mode:"ROW_MODE"}),cd=xe({name:"rowDescription",pattern:/ {2}\w.+ {2}/}),fd=xe({name:"rowDescriptionTerminal",pattern:/ {2}\w.+/}),xA=xe({group:Se.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),yA=xe({group:Se.SKIPPED,name:"endSection",pattern:/\n+/,pop_mode:!0}),kP=new Se({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[sd,ad,ud,mA,Zs,Go,Yp],PROGRAM_DESCRIPTION_MODE:[gA,od],ROW_MODE:[xA,hA,ed,cd,fd,nd,td,rd,id,Jp,Qp,Zs,Go,Yp],SECTION_MODE:[ld,yA]}}),TP=[Jp,Qp,hA,Go,Zs,ed,td,rd,nd,id,Yp,mA,od,gA,sd,ad,ud,ld,cd,fd,xA,yA],Zp=class extends Li{sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(ld),this.OPTION(()=>{this.CONSUME(Go,{LABEL:"parentCommandName"})}),this.MANY(()=>{this.CONSUME1(Go,{LABEL:"commandName"})}),this.MANY1(()=>{this.OR([{ALT:()=>this.CONSUME(Zs)},{ALT:()=>this.CONSUME(Qp)},{ALT:()=>this.CONSUME(Jp)},{ALT:()=>this.CONSUME(cd,{LABEL:"description"})},{ALT:()=>this.CONSUME(fd,{LABEL:"description"})},{ALT:()=>this.CONSUME(ed)},{ALT:()=>this.CONSUME(rd)},{ALT:()=>this.CONSUME(nd)},{ALT:()=>this.CONSUME(td)},{ALT:()=>this.CONSUME(id)}])})});commandsSection=this.RULE("commandsSection",()=>{this.CONSUME(ud),this.MANY1(()=>{this.SUBRULE1(this.sectionRow)})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(sd),this.MANY2(()=>{this.SUBRULE2(this.sectionRow)})});positionalsSection=this.RULE("positionalsSection",()=>{this.CONSUME(ad),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});programHelp=this.RULE("programHelp",()=>{this.AT_LEAST_ONE(()=>{this.CONSUME(Go,{LABEL:"commandName"})}),this.MANY1(()=>{this.CONSUME(Zs)}),this.OPTION(()=>{this.CONSUME(od,{LABEL:"description"})}),this.OPTION1(()=>{this.SUBRULE(this.commandsSection)}),this.OPTION2(()=>{this.SUBRULE(this.positionalsSection)}),this.OPTION3(()=>{this.SUBRULE(this.optionsSection)})});constructor(){super(TP),this.performSelfAnalysis()}},Ys=new Zp,Xp=class extends Ys.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}commandsSection(e){return e.sectionRow.map(r=>this.visit(r))}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}positionalsSection(e){return e.sectionRow.map(r=>this.positionalParentCommandToArguments(this.visit(r)))}programHelp(e){let{command:r,subcommand:n}=Il(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,commands:e.commandsSection?this.visit(e.commandsSection):void 0,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,positionals:e.positionalsSection?this.visit(e.positionalsSection):void 0,subcommandName:n}}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),choices:this.splitChoices(this.getString(e.choices)),commandName:this.getString(e.commandName),default:e.defaultInfo?!0:void 0,defaultValue:this.getString(e.defaultInfoDescription,!0),description:this.getString(e.description,!0),flags:this.getArray(e.flag),parentCommandName:this.getString(e.parentCommandName),required:e.required?!0:void 0,type:this.getString(e.type,!0)}}clean(e){return e.endsWith("]]")?e.replaceAll(/(^\[default:\s*)|(\]$)/g,""):e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}positionalParentCommandToArguments(e){let{arguments:r,parentCommandName:n,...i}=e;return n===void 0?e:{arguments:[n,...r??[]],...i}}splitChoices(e){if(e!==void 0)return this.clean(e.replaceAll(/^\[choices:\s/g,"")).split(", ")}},_P=new Xp;function bA(t){let e=kP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);Ys.input=e.tokens;let r=Ys.programHelp();if(Ys.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(Ys.errors,void 0,2)}`);let n;try{n=_P.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var EA={yargs:bA,meow:dA};function Il(t){if(t===void 0)throw new Error('Could not find "commandName" entry in help');let e=t.split(" ");if(e.length===0)throw new Error('Could not find "commandName" entry in help');if(e.length===1)return{command:e[0],subcommand:void 0};let r=e.at(-1);return{command:e.slice(0,-1).join(" "),subcommand:r}}function AA(t){for(let[e,r]of Object.entries(EA)){pd.info(`Trying to parse help string with ${e} parser...`);try{return r(t)}catch(n){n instanceof Error&&pd.info(`Error in "${e}" parser: ${String(n)}`);continue}}pd.error("Could not parse help string with any parser")}async function dd(t,e="--help",r){let n=`${t} ${e}`,i=await OP(n),o=AA(i);return o===void 0?(wA.warn("Falling back to basic cli help text output."),IP(i)):vP(t,e,r??Number.MAX_SAFE_INTEGER,o)}async function vP(t,e,r,n){if(r<=0)return wA.info("Max CLI command help depth reached, stopping recursion"),"";let i=ix(n,r),o=t.split(" ")[0];if(n.commands)for(let s of n.commands){if(!s.parentCommandName||!s.commandName)continue;let a=await dd(`${o} ${s.commandName}`,e,r-1);if(a==="")return i;i+=`
221
+ For further details.`);this.skipValidations=X(r,"skipValidations")?r.skipValidations:jt.skipValidations}};Ws.DEFER_DEFINITION_ERRORS_HANDLING=!1;tA(Ws,[ll,pl,gl,xl,bl,yl,El,Al,kl,Tl]);var Bi=class extends Ws{constructor(e,r=jt){let n=Me(r);n.outputCst=!0,super(e,n)}};var Sl=xe({name:"flag",pattern:/--[\w-]+/}),Up=xe({longer_alt:Sl,name:"alias",pattern:/-[A-Z]/i}),rA=xe({group:Ie.SKIPPED,name:"comma",pattern:/,/}),nA=xe({group:Ie.SKIPPED,name:"dollar",pattern:/\$/}),_l=xe({group:Ie.SKIPPED,name:"whiteSpace",pattern:/ /}),iA=xe({group:Ie.SKIPPED,name:"newLine",pattern:/\n/}),zp=xe({name:"word",pattern:/\S+/}),Ks=xe({name:"argument",pattern:/(<\S+>|\[.+\])/}),$p=xe({name:"programDescription",pattern:/\w.+(?=\n\n {2}Usage)/}),oA=xe({group:Ie.SKIPPED,name:"startUsage",pattern:/ {2}Usage\n/,push_mode:"USAGE_MODE"}),sA=xe({group:Ie.SKIPPED,name:"endUsage",pattern:/\n/,pop_mode:!0}),qp=xe({name:"startOptions",pattern:/ {2}Options\n/,push_mode:"OPTIONS_MODE"}),Vp=xe({name:"startRow",pattern:/ {4}/,push_mode:"ROW_MODE"}),Gp=xe({name:"rowDescription",pattern:/\w.+/}),aA=xe({group:Ie.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),uA=xe({group:Ie.SKIPPED,name:"endOptions",pattern:/\n/,pop_mode:!0}),bP=new Ie({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[oA,qp,$p,iA,_l],OPTIONS_MODE:[uA,Vp],ROW_MODE:[aA,Up,Sl,rA,Ks,Gp,_l],USAGE_MODE:[sA,nA,Ks,zp,_l]}}),EP=[Sl,Up,rA,nA,_l,iA,zp,Ks,$p,oA,sA,qp,Vp,Gp,aA,uA],Bp=class extends Bi{sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(Vp),this.MANY(()=>{this.OR([{ALT:()=>this.CONSUME(Ks)},{ALT:()=>this.CONSUME(Up)},{ALT:()=>this.CONSUME(Sl)},{ALT:()=>this.CONSUME(Gp,{LABEL:"description"})}])})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(qp),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});programHelp=this.RULE("programHelp",()=>{this.CONSUME($p,{LABEL:"description"}),this.AT_LEAST_ONE(()=>{this.CONSUME(zp,{LABEL:"commandName"})}),this.MANY(()=>{this.CONSUME(Ks)}),this.OPTION(()=>{this.SUBRULE(this.optionsSection)})});constructor(){super(EP),this.performSelfAnalysis()}},Hs=new Bp,jp=class extends Hs.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}programHelp(e){let{command:r,subcommand:n}=Il(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,subcommandName:n}}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),description:this.getString(e.description,!0),flags:this.getArray(e.flag)}}clean(e){return e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}},AP=new jp;function lA(t){let e=bP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);Hs.input=e.tokens;let r=Hs.programHelp();if(Hs.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(Hs.errors,void 0,2)}`);let n;try{n=AP.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var Yp=xe({name:"flag",pattern:/--[\w-]+/}),Zp=xe({name:"alias",pattern:/-[A-Z]/i}),cA=xe({group:Ie.SKIPPED,name:"comma",pattern:/,/}),Ho=xe({name:"word",pattern:/\S+/}),Zs=xe({name:"argument",pattern:/<\S+>|\[\S+\]/}),Xp=xe({name:"type",pattern:/\[(boolean|string|array|number)\]/}),Jp=xe({name:"defaultInfo",pattern:/\[default\]/}),Qp=xe({name:"required",pattern:/\[required\]/}),ed=xe({name:"defaultInfoDescription",pattern:/\[default:\s.+\]/}),td=xe({name:"choices",pattern:/\[choices:\s.+?\]/}),Wp=xe({group:Ie.SKIPPED,name:"whiteSpace",pattern:/\s/}),fA=xe({group:Ie.SKIPPED,name:"startProgramDescription",pattern:/\n\n/,push_mode:"PROGRAM_DESCRIPTION_MODE"}),rd=xe({name:"programDescription",pattern:/.+/}),pA=xe({group:Ie.SKIPPED,name:"endProgramDescription",pattern:/\n\n/,pop_mode:!0}),nd=xe({name:"startOptionsSection",pattern:/Options:?\n/,push_mode:"SECTION_MODE"}),id=xe({name:"startPositionalsSection",pattern:/Positionals:\n/,push_mode:"SECTION_MODE"}),od=xe({name:"startCommandsSection",pattern:/Commands:\n/,push_mode:"SECTION_MODE"}),sd=xe({name:"startRow",pattern:/ {2,}/,push_mode:"ROW_MODE"}),ad=xe({name:"rowDescription",pattern:/ {2}\w.+ {2}/}),ud=xe({name:"rowDescriptionTerminal",pattern:/ {2}\w.+/}),dA=xe({group:Ie.SKIPPED,name:"endRow",pattern:/\n/,pop_mode:!0}),hA=xe({group:Ie.SKIPPED,name:"endSection",pattern:/\n+/,pop_mode:!0}),kP=new Ie({defaultMode:"DEFAULT_MODE",modes:{DEFAULT_MODE:[nd,id,od,fA,Zs,Ho,Wp],PROGRAM_DESCRIPTION_MODE:[pA,rd],ROW_MODE:[dA,cA,Xp,ad,ud,ed,Jp,Qp,td,Yp,Zp,Zs,Ho,Wp],SECTION_MODE:[sd,hA]}}),wP=[Yp,Zp,cA,Ho,Zs,Xp,Jp,Qp,ed,td,Wp,fA,rd,pA,nd,id,od,sd,ad,ud,dA,hA],Hp=class extends Bi{sectionRow=this.RULE("sectionRow",()=>{this.CONSUME(sd),this.OPTION(()=>{this.CONSUME(Ho,{LABEL:"parentCommandName"})}),this.MANY(()=>{this.CONSUME1(Ho,{LABEL:"commandName"})}),this.MANY1(()=>{this.OR([{ALT:()=>this.CONSUME(Zs)},{ALT:()=>this.CONSUME(Zp)},{ALT:()=>this.CONSUME(Yp)},{ALT:()=>this.CONSUME(ad,{LABEL:"description"})},{ALT:()=>this.CONSUME(ud,{LABEL:"description"})},{ALT:()=>this.CONSUME(Xp)},{ALT:()=>this.CONSUME(Qp)},{ALT:()=>this.CONSUME(ed)},{ALT:()=>this.CONSUME(Jp)},{ALT:()=>this.CONSUME(td)}])})});commandsSection=this.RULE("commandsSection",()=>{this.CONSUME(od),this.MANY1(()=>{this.SUBRULE1(this.sectionRow)})});optionsSection=this.RULE("optionsSection",()=>{this.CONSUME(nd),this.MANY2(()=>{this.SUBRULE2(this.sectionRow)})});positionalsSection=this.RULE("positionalsSection",()=>{this.CONSUME(id),this.MANY(()=>{this.SUBRULE(this.sectionRow)})});programHelp=this.RULE("programHelp",()=>{this.AT_LEAST_ONE(()=>{this.CONSUME(Ho,{LABEL:"commandName"})}),this.MANY1(()=>{this.CONSUME(Zs)}),this.OPTION(()=>{this.CONSUME(rd,{LABEL:"description"})}),this.OPTION1(()=>{this.SUBRULE(this.commandsSection)}),this.OPTION2(()=>{this.SUBRULE(this.positionalsSection)}),this.OPTION3(()=>{this.SUBRULE(this.optionsSection)})});constructor(){super(wP),this.performSelfAnalysis()}},Ys=new Hp,Kp=class extends Ys.getBaseCstVisitorConstructor(){constructor(){super(),this.validateVisitor()}commandsSection(e){return e.sectionRow.map(r=>this.visit(r))}optionsSection(e){return e.sectionRow.map(r=>this.visit(r))}positionalsSection(e){return e.sectionRow.map(r=>this.positionalParentCommandToArguments(this.visit(r)))}programHelp(e){let{command:r,subcommand:n}=Il(this.getString(e.commandName));return{arguments:this.getArray(e.argument),commandName:r,commands:e.commandsSection?this.visit(e.commandsSection):void 0,description:this.getString(e.description),options:e.optionsSection?this.visit(e.optionsSection):void 0,positionals:e.positionalsSection?this.visit(e.positionalsSection):void 0,subcommandName:n}}sectionRow(e){return{aliases:this.getArray(e.alias),arguments:this.getArray(e.argument),choices:this.splitChoices(this.getString(e.choices)),commandName:this.getString(e.commandName),default:e.defaultInfo?!0:void 0,defaultValue:this.getString(e.defaultInfoDescription,!0),description:this.getString(e.description,!0),flags:this.getArray(e.flag),parentCommandName:this.getString(e.parentCommandName),required:e.required?!0:void 0,type:this.getString(e.type,!0)}}clean(e){return e.endsWith("]]")?e.replaceAll(/(^\[default:\s*)|(\]$)/g,""):e.replaceAll(/^[\s[]*(default:)?\s*|[\s\]]*$/g,"")}getArray(e){if(e!==void 0)return e.map(r=>r.image)}getString(e,r=!1){if(e!==void 0)return e.map(n=>r?this.clean(n.image):n.image).join(" ")}positionalParentCommandToArguments(e){let{arguments:r,parentCommandName:n,...i}=e;return n===void 0?e:{arguments:[n,...r??[]],...i}}splitChoices(e){if(e!==void 0)return this.clean(e.replaceAll(/^\[choices:\s/g,"")).split(", ")}},CP=new Kp;function mA(t){let e=kP.tokenize(t);if(e.errors.length>0)throw new Error(`Errors lexing CLI command: ${JSON.stringify(e.errors,void 0,2)}`);Ys.input=e.tokens;let r=Ys.programHelp();if(Ys.errors.length>0)throw new Error(`Errors parsing CLI command help text: ${JSON.stringify(Ys.errors,void 0,2)}`);let n;try{n=CP.visit(r)}catch(i){if(i instanceof Error)throw new TypeError(`Errors visiting CLI command help text: ${String(i)}`)}if(n===void 0)throw new Error("Could not parse help string");return n}var gA={yargs:mA,meow:lA};function Il(t){if(t===void 0)throw new Error('Could not find "commandName" entry in help');let e=t.split(" ");if(e.length===0)throw new Error('Could not find "commandName" entry in help');if(e.length===1)return{command:e[0],subcommand:void 0};let r=e.at(-1);return{command:e.slice(0,-1).join(" "),subcommand:r}}function xA(t){for(let[e,r]of Object.entries(gA)){ld.info(`Trying to parse help string with ${e} parser...`);try{return r(t)}catch(n){n instanceof Error&&ld.info(`Error in "${e}" parser: ${String(n)}`);continue}}ld.error("Could not parse help string with any parser")}async function cd(t,e="--help",r){let n=`${t} ${e}`,i=await IP(n),o=xA(i);return o===void 0?(yA.warn("Falling back to basic cli help text output."),SP(i)):_P(t,e,r??Number.MAX_SAFE_INTEGER,o)}async function _P(t,e,r,n){if(r<=0)return yA.info("Max CLI command help depth reached, stopping recursion"),"";let i=ex(n,r),o=t.split(" ")[0];if(n.commands)for(let s of n.commands){if(!s.parentCommandName||!s.commandName)continue;let a=await cd(`${o} ${s.commandName}`,e,r-1);if(a==="")return i;i+=`
222
222
 
223
- ${a}`}return i}function IP(t){return`\`\`\`txt
223
+ ${a}`}return i}function SP(t){return`\`\`\`txt
224
224
  ${t}
225
- \`\`\``}async function OP(t){let e;try{let{stderr:r,stdout:n}=await SP(t);e=n,(e===void 0||e==="")&&(e=r)}catch(r){if(r instanceof Error)throw new TypeError(`Error running CLI help command: "${t}"
225
+ \`\`\``}async function IP(t){let e;try{let{stderr:r,stdout:n}=await TP(t);e=n,(e===void 0||e==="")&&(e=r)}catch(r){if(r instanceof Error)throw new TypeError(`Error running CLI help command: "${t}"
226
226
  ${r.message}
227
227
  `)}if(e===void 0||e==="")throw new Error(`No result from running CLI help command: "${t}"
228
- `);return e}import CA from"node:process";import DP from"node:path";import RP from"node:fs";import FP from"node:fs/promises";var kA=CA.platform==="win32",NP=kA?new Set(CA.env.PATHEXT?.split(";").map(t=>t.toLowerCase())):[];async function TA(t){try{return await FP.access(t,RP.X_OK),kA?NP.has(DP.extname(t)):!0}catch{return!1}}import PP from"node:path";import{log as LP}from"remark-mdat";import MP from"which";async function _A(t){return t??=await BP(),UP(t)}async function BP(){let t=await Qt();if(t.bin){let e=typeof t.bin=="string"?t.bin:String(Object.values(t.bin).at(0));if(jP(e))return LP.info(`Inferred <!-- cli-help --> command to run from package.json: ${e}`),e}throw new Error(`Could not infer which command to run for the <!-- cli-help --> rule. Please pass a "cliCommand" option to the expansion comment, e.g. <!-- cli-help {cliCommand: './dist/bin.js'} -->`)}function jP(t){let e=PP.parse(t);return e.root!==""||e.dir!==""}async function UP(t){let e=await MP(t,{nothrow:!0})??void 0;if(e??=await zP(t)??void 0,e!==void 0&&await TA(e))return e;throw new Error(`The cli-help rule noticed that "${e}" is not executable.`)}async function zP(t){return(await Qt()).bin?.[t]??void 0}var Ol={"cli-help":{async content(t){let e=X.object({cliCommand:X.string().optional(),depth:X.number().optional(),helpFlag:X.string().optional()}).optional().parse(t),r=await _A(e?.cliCommand);return dd(r,e?.helpFlag,e?.depth)}}};var SA={cli:$P(Ol)};import qP from"node:fs/promises";import vA from"node:path";var IA={code:{async content(t){let e=X.object({file:X.string(),language:X.string().optional()}).parse(t),r=(vA.extname(e.file)??"").replace(/^\./,""),n=await qP.readFile(vA.join(process.cwd(),e.file),"utf8");return`\`\`\`${r}
228
+ `);return e}import DP from"path";import{log as RP}from"remark-mdat";import FP from"which";import bA from"fs/promises";import OP from"path";import EA from"process";var AA=EA.platform==="win32",vP=AA?new Set(EA.env.PATHEXT?.split(";").map(t=>t.toLowerCase())??[]):new Set;async function kA(t){try{return await bA.access(t,bA.constants.X_OK),AA?vP.has(OP.extname(t).toLowerCase()):!0}catch{return!1}}async function wA(t){return t??=await NP(),LP(t)}async function NP(){let t=await Jt();if(t.bin){let e=typeof t.bin=="string"?t.bin:String(Object.values(t.bin).at(0));if(PP(e))return RP.info(`Inferred <!-- cli-help --> command to run from package.json: ${e}`),e}throw new Error(`Could not infer which command to run for the <!-- cli-help --> rule. Please pass a "cliCommand" option to the expansion comment, e.g. <!-- cli-help {cliCommand: './dist/bin.js'} -->`)}function PP(t){let e=DP.parse(t);return e.root!==""||e.dir!==""}async function LP(t){let e=await FP(t,{nothrow:!0})??void 0;if(e??=await MP(t)??void 0,e!==void 0&&await kA(e))return e;throw new Error(`The cli-help rule noticed that "${e}" is not executable.`)}async function MP(t){return(await Jt()).bin?.[t]??void 0}var Ol={"cli-help":{async content(t){let e=K.object({cliCommand:K.string().optional(),depth:K.number().optional(),helpFlag:K.string().optional()}).optional().parse(t),r=await wA(e?.cliCommand);return cd(r,e?.helpFlag,e?.depth)}}};var CA={cli:BP(Ol)};import jP from"fs/promises";import TA from"path";var _A={code:{async content(t){let e=K.object({file:K.string(),language:K.string().optional()}).parse(t),r=(TA.extname(e.file)??"").replace(/^\./,""),n=await jP.readFile(TA.join(process.cwd(),e.file),"utf8");return`\`\`\`${r}
229
229
  ${n}
230
- \`\`\``}}};var Dl={contributing:{async content(){let e=(await Qt()).bugs?.url;if(e===void 0)throw new Error('Could not find "bugs.url" entry in package.json');return`## Contributing
231
- [Issues](${e}) and pull requests are welcome.`},order:15}};var Rl={description:{async content(){let t=await Qt();if(t.description===void 0)throw new Error('Could not find "description" entry in package.json');return`**${t.description}**`},order:4}};import{getSoleRule as OA}from"remark-mdat";var Fl={license:{async content(){let t=await Qt(),{author:e,license:r}=t;if(e?.name===void 0)throw new Error('Could not find "author.name" entry in package.json');if(r===void 0)throw new Error('Could not find "license" entry in package.json');return`## License
232
- [${r}](license.txt) \xA9 ${e.name}`},order:16}};var DA={footer:{content:[OA(Dl),OA(Fl)],order:17}};import{getSoleRule as Ll}from"remark-mdat";import{getSoleRule as VP}from"remark-mdat";var Nl={"short-description":VP(Rl)};var Pl={title:{applicationOrder:2,async content(t){let{postfix:e,prefix:r,titleCase:n}=X.object({postfix:X.string().optional().default(""),prefix:X.string().optional().default(""),titleCase:X.boolean().optional().default(!1)}).parse(t??{}),{name:i}=await Qt();return`# ${r}${n?GP(i):i}${e}`},order:1}};function GP(t){return t.split(/[ _-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var RA={header:{applicationOrder:2,content:[Ll(Pl),Ll(mu),Ll(du),Ll(Nl)],order:1}};import nL from"node:path";import JP from"node:fs/promises";import{promisify as PA}from"node:util";import{brotliCompress as QP,gzip as eL}from"node:zlib";var WP=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],HP=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],KP=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],YP=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],FA=(t,e,r)=>{let n=t;return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e,r):(e===!0||r!==void 0)&&(n=t.toLocaleString(void 0,r)),n},NA=t=>{if(typeof t=="number")return Math.log10(t);let e=t.toString(10);return e.length+Math.log10("0."+e.slice(0,15))},ZP=t=>typeof t=="number"?Math.log(t):NA(t)*Math.log(10),XP=(t,e)=>{if(typeof t=="number")return t/e;let r=t/BigInt(e),n=t%BigInt(e);return Number(r)+Number(n)/e};function hd(t,e){if(typeof t!="bigint"&&!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,...e};let r=e.bits?e.binary?YP:KP:e.binary?HP:WP,n=e.space?" ":"";if(e.signed&&(typeof t=="number"?t===0:t===0n))return` 0${n}${r[0]}`;let i=t<0,o=i?"-":e.signed?"+":"";i&&(t=-t);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),t<1){let c=FA(t,e.locale,s);return o+c+n+r[0]}let a=Math.min(Math.floor(e.binary?ZP(t)/Math.log(1024):NA(t)/3),r.length-1);t=XP(t,(e.binary?1024:1e3)**a),s||(t=t.toPrecision(3));let u=FA(Number(t),e.locale,s),l=r[a];return o+u+n+l}var tL=PA(QP),rL=PA(eL);function md(t,e){let r=e===0?0:(e-t)/e*100;return{bytes:t,bytesPretty:hd(t,{maximumFractionDigits:1}),percent:r,percentPretty:`${Math.round(r)}%`}}async function Ml(t){try{let e=await JP.readFile(t),r=e.length,[n,i]=await Promise.all([tL(e),rL(e)]);return{brotli:md(n.length,r),gzip:md(i.length,r),original:md(r,r)}}catch(e){throw new Error(`Failed to analyze file: ${e instanceof Error?e.message:"Unknown error"}`)}}var iL=X.object({compression:X.enum(["none","brotli","gzip"]).optional().default("none"),file:X.string()});function oL(t,e){switch(e){case"brotli":return t.brotli.bytesPretty;case"gzip":return t.gzip.bytesPretty;case"none":return t.original.bytesPretty}}var LA={size:{async content(t){let e=iL.parse(t),r=nL.join(process.cwd(),e.file),n=await Ml(r);return oL(n,e.compression)}}};import BA from"node:path";var MA=X.union([X.string(),X.array(X.string())]).transform(t=>Array.isArray(t)?t:[t]),sL=X.union([X.object({brotli:X.boolean().optional().default(!0),file:MA,gzip:X.boolean().optional().default(!0),original:X.boolean().optional().default(!0),showPercentage:X.boolean().optional().default(!1)}),X.object({brotli:X.boolean().optional().default(!0),files:MA,gzip:X.boolean().optional().default(!0),original:X.boolean().optional().default(!0),showPercentage:X.boolean().optional().default(!1)})]).transform(t=>{if("file"in t){let{file:e,...r}=t;return{files:e,...r}}return t});function aL(t,e){let r=["File"];e.original&&r.push("Original"),e.gzip&&r.push("Gzip"),e.brotli&&r.push("Brotli");let n=r.map(()=>"---"),i=t.map(([o,s])=>{let a=[BA.basename(o)];return e.original&&a.push(s.original.bytesPretty),e.gzip&&a.push(e.showPercentage?`${s.gzip.bytesPretty} (${s.gzip.percentPretty})`:s.gzip.bytesPretty),e.brotli&&a.push(e.showPercentage?`${s.brotli.bytesPretty} (${s.brotli.percentPretty})`:s.brotli.bytesPretty),a});return[`| ${r.join(" | ")} |`,`| ${n.join(" | ")} |`,...i.map(o=>`| ${o.join(" | ")} |`)].join(`
233
- `)}var jA={"size-table":{async content(t){let e=sL.parse(t),r=await Promise.all(e.files.map(async n=>{let i=BA.join(process.cwd(),n),o=await Ml(i);return[n,o]}));return aL(r,{brotli:e.brotli,gzip:e.gzip,original:e.original,showPercentage:e.showPercentage})}}};var UA=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var uL=Object.hasOwnProperty,Xs=class{constructor(){this.occurrences,this.reset()}slug(e,r){let n=this,i=lL(e,r===!0),o=i;for(;uL.call(n.occurrences,i);)n.occurrences[o]++,i=o+"-"+n.occurrences[o];return n.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}};function lL(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(UA,"").replace(/ /g,"-"))}function Bl(t){return new RegExp("^("+t+")$","i")}var zA=new Xs;function $A(t,e,r){let n="children"in t?t.children.length:0,i=r.skip?Bl(r.skip):void 0,o=vr(r.parents||function(c){return c===t}),s=[],a,u,l;return zA.reset(),Es(t,"heading",function(c,f,p){let d=Xr(c,{includeImageAlt:!1}),m=c.data&&c.data.hProperties&&c.data.hProperties.id,y=zA.slug(m||d);if(o(p)){if(f!==void 0&&e&&!a&&e.test(d)){a=f+1,l=c;return}f!==void 0&&l&&!u&&c.depth<=l.depth&&(u=f),(u||!e)&&(!r.minDepth||c.depth>=r.minDepth)&&(!r.maxDepth||c.depth<=r.maxDepth)&&(!i||!i.test(d))&&s.push({depth:c.depth,children:c.children,id:y})}}),{index:a===void 0?-1:a,endIndex:a===void 0?-1:u||n,map:s}}var qA=typeof self=="object"?self:globalThis,dL=(t,e)=>{let r=(i,o)=>(t.set(o,i),i),n=i=>{if(t.has(i))return t.get(i);let[o,s]=e[i];switch(o){case 0:case-1:return r(s,i);case 1:{let a=r([],i);for(let u of s)a.push(n(u));return a}case 2:{let a=r({},i);for(let[u,l]of s)a[n(u)]=n(l);return a}case 3:return r(new Date(s),i);case 4:{let{source:a,flags:u}=s;return r(new RegExp(a,u),i)}case 5:{let a=r(new Map,i);for(let[u,l]of s)a.set(n(u),n(l));return a}case 6:{let a=r(new Set,i);for(let u of s)a.add(n(u));return a}case 7:{let{name:a,message:u}=s;return r(new qA[a](u),i)}case 8:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:a}=new Uint8Array(s);return r(new DataView(a),s)}}return r(new qA[o](s),i)};return n},yd=t=>dL(new Map,t)(0);var Wo="",{toString:hL}={},{keys:mL}=Object,Js=t=>{let e=typeof t;if(e!=="object"||!t)return[0,e];let r=hL.call(t).slice(8,-1);switch(r){case"Array":return[1,Wo];case"Object":return[2,Wo];case"Date":return[3,Wo];case"RegExp":return[4,Wo];case"Map":return[5,Wo];case"Set":return[6,Wo];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},Ul=([t,e])=>t===0&&(e==="function"||e==="symbol"),gL=(t,e,r,n)=>{let i=(s,a)=>{let u=n.push(s)-1;return r.set(a,u),u},o=s=>{if(r.has(s))return r.get(s);let[a,u]=Js(s);switch(a){case 0:{let c=s;switch(u){case"bigint":a=8,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([-1],s)}return i([a,c],s)}case 1:{if(u){let p=s;return u==="DataView"?p=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(s)),i([u,[...p]],s)}let c=[],f=i([a,c],s);for(let p of s)c.push(o(p));return f}case 2:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());let c=[],f=i([a,c],s);for(let p of mL(s))(t||!Ul(Js(s[p])))&&c.push([o(p),o(s[p])]);return f}case 3:return i([a,s.toISOString()],s);case 4:{let{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case 5:{let c=[],f=i([a,c],s);for(let[p,d]of s)(t||!(Ul(Js(p))||Ul(Js(d))))&&c.push([o(p),o(d)]);return f}case 6:{let c=[],f=i([a,c],s);for(let p of s)(t||!Ul(Js(p)))&&c.push(o(p));return f}}let{message:l}=s;return i([a,{name:u,message:l}],s)};return o},bd=(t,{json:e,lossy:r}={})=>{let n=[];return gL(!(e||r),!!e,new Map,n)(t),n};var Ed=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?yd(bd(t,e)):structuredClone(t):(t,e)=>yd(bd(t,e));function KA(t,e){let{ordered:r=!1,tight:n=!1,prefix:i}=e,o={type:"list",ordered:r,spread:!1,children:[]},s=Number.POSITIVE_INFINITY,a=-1;for(;++a<t.length;)t[a].depth<s&&(s=t[a].depth);for(a=-1;++a<t.length;)t[a].depth-=s-1;for(a=-1;++a<t.length;)Qs(t[a],o,{ordered:r,tight:n,prefix:i});return o}function Qs(t,e,r){let n=-1,i=e.children[e.children.length-1];if(e.type==="list")if(t.depth===1)e.children.push({type:"listItem",spread:!1,children:[{type:"paragraph",children:[{type:"link",title:null,url:"#"+(r.prefix||"")+t.id,children:Ad(t.children)}]}]});else if(e.children.length>0){let o=e.children[e.children.length-1];Qs(t,o,r)}else{let o={type:"listItem",spread:!1,children:[]};e.children.push(o),Qs(t,o,r)}else if(i&&i.type==="list")t.depth--,Qs(t,i,r);else{let o={type:"list",ordered:r.ordered,spread:!1,children:[]};e.children.push(o),t.depth--,Qs(t,o,r)}if(e.type==="list"&&!r.tight){for(e.spread=!1;++n<e.children.length;)if(e.children[n].children.length>1){e.spread=!0;break}}else e.spread=!r.tight}function Ad(t){let e=[],r=-1;for(;++r<t.length;){let n=xL(t[r]);Array.isArray(n)?e.push(...n):e.push(n)}return e}function xL(t){if(t.type==="footnoteReference")return[];if(t.type==="link"||t.type==="linkReference")return Ad(t.children);if("children"in t){let{children:n,position:i,...o}=t;return Object.assign(Ed(o),{children:Ad(t.children)})}let{position:e,...r}=t;return Ed(r)}function wd(t,e){let r=e||{},n=r.heading?Bl(r.heading):void 0,i=$A(t,n,r);return{index:n?i.index:void 0,endIndex:n?i.endIndex:void 0,map:i.map.length>0?KA(i.map,r):void 0}}var zl={"table-of-contents":{applicationOrder:1,async content(t,e){let r=X.object({depth:X.union([X.literal(1),X.literal(2),X.literal(3),X.literal(4),X.literal(5),X.literal(6)]).optional()}).optional().parse(t),n=wd(e,{heading:null,maxDepth:r?.depth??3,tight:!0}),i="## Table of contents";if(n.map===void 0)throw new Error("Could not generate table of contents");let o={children:n.map.children,type:"root"},s=uo().use(An).stringify(o).replaceAll(`
230
+ \`\`\``}}};var vl={contributing:{async content(){let e=(await Jt()).bugs?.url;if(e===void 0)throw new Error('Could not find "bugs.url" entry in package.json');return`## Contributing
231
+ [Issues](${e}) and pull requests are welcome.`},order:15}};var Dl={description:{async content(){let t=await Jt();if(t.description===void 0)throw new Error('Could not find "description" entry in package.json');return`**${t.description}**`},order:4}};import{getSoleRule as SA}from"remark-mdat";var Rl={license:{async content(){let t=await Jt(),{author:e,license:r}=t;if(e?.name===void 0)throw new Error('Could not find "author.name" entry in package.json');if(r===void 0)throw new Error('Could not find "license" entry in package.json');return`## License
232
+ [${r}](license.txt) \xA9 ${e.name}`},order:16}};var IA={footer:{content:[SA(vl),SA(Rl)],order:17}};import{getSoleRule as Pl}from"remark-mdat";import{getSoleRule as UP}from"remark-mdat";var Fl={"short-description":UP(Dl)};var Nl={title:{applicationOrder:2,async content(t){let{postfix:e,prefix:r,titleCase:n}=K.object({postfix:K.string().optional().default(""),prefix:K.string().optional().default(""),titleCase:K.boolean().optional().default(!1)}).parse(t??{}),{name:i}=await Jt();return`# ${r}${n?zP(i):i}${e}`},order:1}};function zP(t){return t.split(/[ _-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var OA={header:{applicationOrder:2,content:[Pl(Nl),Pl(hu),Pl(pu),Pl(Fl)],order:1}};import QP from"path";import KP from"fs/promises";import{promisify as RA}from"util";import{brotliCompress as YP,gzip as ZP}from"zlib";var $P=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],qP=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],VP=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],GP=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],vA=(t,e,r)=>{let n=t;return typeof e=="string"||Array.isArray(e)?n=t.toLocaleString(e,r):(e===!0||r!==void 0)&&(n=t.toLocaleString(void 0,r)),n},DA=t=>{if(typeof t=="number")return Math.log10(t);let e=t.toString(10);return e.length+Math.log10("0."+e.slice(0,15))},WP=t=>typeof t=="number"?Math.log(t):DA(t)*Math.log(10),HP=(t,e)=>{if(typeof t=="number")return t/e;let r=t/BigInt(e),n=t%BigInt(e);return Number(r)+Number(n)/e};function fd(t,e){if(typeof t!="bigint"&&!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,...e};let r=e.bits?e.binary?GP:VP:e.binary?qP:$P,n=e.space?" ":"";if(e.signed&&(typeof t=="number"?t===0:t===0n))return` 0${n}${r[0]}`;let i=t<0,o=i?"-":e.signed?"+":"";i&&(t=-t);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),t<1){let c=vA(t,e.locale,s);return o+c+n+r[0]}let a=Math.min(Math.floor(e.binary?WP(t)/Math.log(1024):DA(t)/3),r.length-1);if(t=HP(t,(e.binary?1024:1e3)**a),!s){let c=Math.max(3,Number.parseInt(t,10).toString().length);t=t.toPrecision(c)}let u=vA(Number(t),e.locale,s),l=r[a];return o+u+n+l}var XP=RA(YP),JP=RA(ZP);function pd(t,e){let r=e===0?0:(e-t)/e*100;return{bytes:t,bytesPretty:fd(t,{maximumFractionDigits:1}),percent:r,percentPretty:`${Math.round(r)}%`}}async function Ll(t){try{let e=await KP.readFile(t),r=e.length,[n,i]=await Promise.all([XP(e),JP(e)]);return{brotli:pd(n.length,r),gzip:pd(i.length,r),original:pd(r,r)}}catch(e){throw new Error(`Failed to analyze file: ${e instanceof Error?e.message:"Unknown error"}`)}}var eL=K.object({compression:K.enum(["none","brotli","gzip"]).optional().default("none"),file:K.string()});function tL(t,e){switch(e){case"brotli":return t.brotli.bytesPretty;case"gzip":return t.gzip.bytesPretty;case"none":return t.original.bytesPretty}}var FA={size:{async content(t){let e=eL.parse(t),r=QP.join(process.cwd(),e.file),n=await Ll(r);return tL(n,e.compression)}}};import PA from"path";var NA=K.union([K.string(),K.array(K.string())]).transform(t=>Array.isArray(t)?t:[t]),rL=K.union([K.object({brotli:K.boolean().optional().default(!0),file:NA,gzip:K.boolean().optional().default(!0),original:K.boolean().optional().default(!0),showPercentage:K.boolean().optional().default(!1)}),K.object({brotli:K.boolean().optional().default(!0),files:NA,gzip:K.boolean().optional().default(!0),original:K.boolean().optional().default(!0),showPercentage:K.boolean().optional().default(!1)})]).transform(t=>{if("file"in t){let{file:e,...r}=t;return{files:e,...r}}return t});function nL(t,e){let r=["File"];e.original&&r.push("Original"),e.gzip&&r.push("Gzip"),e.brotli&&r.push("Brotli");let n=r.map(()=>"---"),i=t.map(([o,s])=>{let a=[PA.basename(o)];return e.original&&a.push(s.original.bytesPretty),e.gzip&&a.push(e.showPercentage?`${s.gzip.bytesPretty} (${s.gzip.percentPretty})`:s.gzip.bytesPretty),e.brotli&&a.push(e.showPercentage?`${s.brotli.bytesPretty} (${s.brotli.percentPretty})`:s.brotli.bytesPretty),a});return[`| ${r.join(" | ")} |`,`| ${n.join(" | ")} |`,...i.map(o=>`| ${o.join(" | ")} |`)].join(`
233
+ `)}var LA={"size-table":{async content(t){let e=rL.parse(t),r=await Promise.all(e.files.map(async n=>{let i=PA.join(process.cwd(),n),o=await Ll(i);return[n,o]}));return nL(r,{brotli:e.brotli,gzip:e.gzip,original:e.original,showPercentage:e.showPercentage})}}};var MA=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g;var iL=Object.hasOwnProperty,Xs=class{constructor(){this.occurrences,this.reset()}slug(e,r){let n=this,i=oL(e,r===!0),o=i;for(;iL.call(n.occurrences,i);)n.occurrences[o]++,i=o+"-"+n.occurrences[o];return n.occurrences[i]=0,i}reset(){this.occurrences=Object.create(null)}};function oL(t,e){return typeof t!="string"?"":(e||(t=t.toLowerCase()),t.replace(MA,"").replace(/ /g,"-"))}function Ml(t){return new RegExp("^("+t+")$","i")}var BA=new Xs;function jA(t,e,r){let n="children"in t?t.children.length:0,i=r.skip?Ml(r.skip):void 0,o=Or(r.parents||function(c){return c===t}),s=[],a,u,l;return BA.reset(),Es(t,"heading",function(c,f,p){let d=Jr(c,{includeImageAlt:!1}),m=c.data&&c.data.hProperties&&c.data.hProperties.id,y=BA.slug(m||d);if(o(p)){if(f!==void 0&&e&&!a&&e.test(d)){a=f+1,l=c;return}f!==void 0&&l&&!u&&c.depth<=l.depth&&(u=f),(u||!e)&&(!r.minDepth||c.depth>=r.minDepth)&&(!r.maxDepth||c.depth<=r.maxDepth)&&(!i||!i.test(d))&&s.push({depth:c.depth,children:c.children,id:y})}}),{index:a===void 0?-1:a,endIndex:a===void 0?-1:u||n,map:s}}var UA=typeof self=="object"?self:globalThis,lL=(t,e)=>{let r=(i,o)=>(t.set(o,i),i),n=i=>{if(t.has(i))return t.get(i);let[o,s]=e[i];switch(o){case 0:case-1:return r(s,i);case 1:{let a=r([],i);for(let u of s)a.push(n(u));return a}case 2:{let a=r({},i);for(let[u,l]of s)a[n(u)]=n(l);return a}case 3:return r(new Date(s),i);case 4:{let{source:a,flags:u}=s;return r(new RegExp(a,u),i)}case 5:{let a=r(new Map,i);for(let[u,l]of s)a.set(n(u),n(l));return a}case 6:{let a=r(new Set,i);for(let u of s)a.add(n(u));return a}case 7:{let{name:a,message:u}=s;return r(new UA[a](u),i)}case 8:return r(BigInt(s),i);case"BigInt":return r(Object(BigInt(s)),i);case"ArrayBuffer":return r(new Uint8Array(s).buffer,s);case"DataView":{let{buffer:a}=new Uint8Array(s);return r(new DataView(a),s)}}return r(new UA[o](s),i)};return n},md=t=>lL(new Map,t)(0);var Ko="",{toString:cL}={},{keys:fL}=Object,Js=t=>{let e=typeof t;if(e!=="object"||!t)return[0,e];let r=cL.call(t).slice(8,-1);switch(r){case"Array":return[1,Ko];case"Object":return[2,Ko];case"Date":return[3,Ko];case"RegExp":return[4,Ko];case"Map":return[5,Ko];case"Set":return[6,Ko];case"DataView":return[1,r]}return r.includes("Array")?[1,r]:r.includes("Error")?[7,r]:[2,r]},jl=([t,e])=>t===0&&(e==="function"||e==="symbol"),pL=(t,e,r,n)=>{let i=(s,a)=>{let u=n.push(s)-1;return r.set(a,u),u},o=s=>{if(r.has(s))return r.get(s);let[a,u]=Js(s);switch(a){case 0:{let c=s;switch(u){case"bigint":a=8,c=s.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+u);c=null;break;case"undefined":return i([-1],s)}return i([a,c],s)}case 1:{if(u){let p=s;return u==="DataView"?p=new Uint8Array(s.buffer):u==="ArrayBuffer"&&(p=new Uint8Array(s)),i([u,[...p]],s)}let c=[],f=i([a,c],s);for(let p of s)c.push(o(p));return f}case 2:{if(u)switch(u){case"BigInt":return i([u,s.toString()],s);case"Boolean":case"Number":case"String":return i([u,s.valueOf()],s)}if(e&&"toJSON"in s)return o(s.toJSON());let c=[],f=i([a,c],s);for(let p of fL(s))(t||!jl(Js(s[p])))&&c.push([o(p),o(s[p])]);return f}case 3:return i([a,s.toISOString()],s);case 4:{let{source:c,flags:f}=s;return i([a,{source:c,flags:f}],s)}case 5:{let c=[],f=i([a,c],s);for(let[p,d]of s)(t||!(jl(Js(p))||jl(Js(d))))&&c.push([o(p),o(d)]);return f}case 6:{let c=[],f=i([a,c],s);for(let p of s)(t||!jl(Js(p)))&&c.push(o(p));return f}}let{message:l}=s;return i([a,{name:u,message:l}],s)};return o},gd=(t,{json:e,lossy:r}={})=>{let n=[];return pL(!(e||r),!!e,new Map,n)(t),n};var xd=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?md(gd(t,e)):structuredClone(t):(t,e)=>md(gd(t,e));function GA(t,e){let{ordered:r=!1,tight:n=!1,prefix:i}=e,o={type:"list",ordered:r,spread:!1,children:[]},s=Number.POSITIVE_INFINITY,a=-1;for(;++a<t.length;)t[a].depth<s&&(s=t[a].depth);for(a=-1;++a<t.length;)t[a].depth-=s-1;for(a=-1;++a<t.length;)Qs(t[a],o,{ordered:r,tight:n,prefix:i});return o}function Qs(t,e,r){let n=-1,i=e.children[e.children.length-1];if(e.type==="list")if(t.depth===1)e.children.push({type:"listItem",spread:!1,children:[{type:"paragraph",children:[{type:"link",title:null,url:"#"+(r.prefix||"")+t.id,children:yd(t.children)}]}]});else if(e.children.length>0){let o=e.children[e.children.length-1];Qs(t,o,r)}else{let o={type:"listItem",spread:!1,children:[]};e.children.push(o),Qs(t,o,r)}else if(i&&i.type==="list")t.depth--,Qs(t,i,r);else{let o={type:"list",ordered:r.ordered,spread:!1,children:[]};e.children.push(o),t.depth--,Qs(t,o,r)}if(e.type==="list"&&!r.tight){for(e.spread=!1;++n<e.children.length;)if(e.children[n].children.length>1){e.spread=!0;break}}else e.spread=!r.tight}function yd(t){let e=[],r=-1;for(;++r<t.length;){let n=dL(t[r]);Array.isArray(n)?e.push(...n):e.push(n)}return e}function dL(t){if(t.type==="footnoteReference")return[];if(t.type==="link"||t.type==="linkReference")return yd(t.children);if("children"in t){let{children:n,position:i,...o}=t;return Object.assign(xd(o),{children:yd(t.children)})}let{position:e,...r}=t;return xd(r)}function bd(t,e){let r=e||{},n=r.heading?Ml(r.heading):void 0,i=jA(t,n,r);return{index:n?i.index:void 0,endIndex:n?i.endIndex:void 0,map:i.map.length>0?GA(i.map,r):void 0}}var Ul={"table-of-contents":{applicationOrder:1,async content(t,e){let r=K.object({depth:K.union([K.literal(1),K.literal(2),K.literal(3),K.literal(4),K.literal(5),K.literal(6)]).optional()}).optional().parse(t),n=bd(e,{heading:null,maxDepth:r?.depth??3,tight:!0}),i="## Table of contents";if(n.map===void 0)throw new Error("Could not generate table of contents");let o={children:n.map.children,type:"root"},s=co().use(wn).stringify(o).replaceAll(`
234
234
 
235
235
  `,`
236
236
  `);return[i,s].join(`
237
- `)},order:6}};import{tldrawToImage as YA}from"@kitschpatrol/tldraw-cli";import yL from"node:crypto";import Ho from"node:fs/promises";import br from"node:path";var QA={tldraw:{async content(t){let{alt:e="tldraw diagram",src:r}=X.object({alt:X.string().optional(),src:X.string()}).parse(t),{assetsPath:n}=await Tr();if(n===void 0)throw new Error("No assets path found");await Ho.mkdir(n,{recursive:!0});let i=await ro(r)?await XA(r):void 0;if(i!==void 0){let l=br.basename(r,br.extname(r)),c=br.join(n,`${l}-${i}-light.svg`),f=br.join(n,`${l}-${i}-dark.svg`);if(await ro(c)&&await ro(f))return ZA(c,f,e)}let[o]=await YA(r,{dark:!1,format:"svg",output:n,transparent:!0});i??=await XA(o);let s=`${JA(o)}-${i}-light.svg`;await Ho.rename(o,s);let[a]=await YA(r,{dark:!0,format:"svg",output:n,transparent:!0}),u=`${JA(a)}-${i}-dark.svg`;if(await Ho.rename(a,u),i!==void 0){let l=br.basename(u),c=br.basename(s),f=c.replace(`${i}-light.svg`,""),p=await Ho.readdir(n);for(let d of p){let m=br.basename(d);m!==l&&m!==c&&m.startsWith(f)&&m.endsWith(".svg")&&await Ho.rm(br.join(n,m))}}return ZA(s,u,e)}}};async function ZA(t,e,r){let{packageFile:n}=await Tr();if(n===void 0)throw new Error("No package file found");let i=br.dirname(n),o=br.relative(i,t);return`<picture>
237
+ `)},order:6}};import{tldrawToImage as WA}from"@kitschpatrol/tldraw-cli";import hL from"crypto";import Yo from"fs/promises";import br from"path";var ZA={tldraw:{async content(t){let{alt:e="tldraw diagram",src:r}=K.object({alt:K.string().optional(),src:K.string()}).parse(t),{assetsPath:n}=await _r();if(n===void 0)throw new Error("No assets path found");await Yo.mkdir(n,{recursive:!0});let i=await io(r)?await KA(r):void 0;if(i!==void 0){let l=br.basename(r,br.extname(r)),c=br.join(n,`${l}-${i}-light.svg`),f=br.join(n,`${l}-${i}-dark.svg`);if(await io(c)&&await io(f))return HA(c,f,e)}let[o]=await WA(r,{dark:!1,format:"svg",output:n,transparent:!0});i??=await KA(o);let s=`${YA(o)}-${i}-light.svg`;await Yo.rename(o,s);let[a]=await WA(r,{dark:!0,format:"svg",output:n,transparent:!0}),u=`${YA(a)}-${i}-dark.svg`;if(await Yo.rename(a,u),i!==void 0){let l=br.basename(u),c=br.basename(s),f=c.replace(`${i}-light.svg`,""),p=await Yo.readdir(n);for(let d of p){let m=br.basename(d);m!==l&&m!==c&&m.startsWith(f)&&m.endsWith(".svg")&&await Yo.rm(br.join(n,m))}}return HA(s,u,e)}}};async function HA(t,e,r){let{packageFile:n}=await _r();if(n===void 0)throw new Error("No package file found");let i=br.dirname(n),o=br.relative(i,t);return`<picture>
238
238
  <source media="(prefers-color-scheme: dark)" srcset="${br.relative(i,e)}">
239
239
  <source media="(prefers-color-scheme: light)" srcset="${o}">
240
240
  <img alt="${r}" src="${o}">
241
- </picture>`}async function XA(t){let e=await Ho.readFile(t),r=yL.createHash("sha1");return r.update(e),r.digest("hex").slice(0,8)}function JA(t){return t.replace(/\.[^./]+$/,"")}import{getSoleRule as bL}from"remark-mdat";var ew={toc:bL(zl)};var tw={...du,...mu,...SA,...Ol,...IA,...Dl,...Rl,...DA,...RA,...Fl,...Nl,...LA,...jA,...zl,...Pl,...QA,...ew};async function $l(t){let e={addMetaComment:!0,rules:tw},{additionalConfig:r=[],...n}=t??{},i=Array.isArray(r)?r:[r],o=await xi({additionalConfig:[e,...i],...n});if(o.packageFile===void 0)throw new Error("Package file path is required in `mdat readme` config");return o}import ta from"node:path";import wL from"node:process";import CL from"node:path";import Xoe,{promises as rw}from"node:fs";import{fileURLToPath as kL}from"node:url";var Cd=class{value;next;constructor(e){this.value=e}},ea=class{#e;#t;#r;constructor(){this.clear()}enqueue(e){let r=new Cd(e);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#r--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};function ql(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new ea,r=0,n=()=>{r--,e.size>0&&e.dequeue()()},i=async(a,u,l)=>{r++;let c=(async()=>a(...l))();u(c);try{await c}catch{}n()},o=(a,u,l)=>{e.enqueue(i.bind(void 0,a,u,l)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},s=(a,...u)=>new Promise(l=>{o(a,l,u)});return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),s}var Vl=class extends Error{constructor(e){super(),this.value=e}},EL=async(t,e)=>e(await t),AL=async t=>{let e=await Promise.all(t);if(e[1]===!0)throw new Vl(e[0]);return!1};async function kd(t,e,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:n=!0}={}){let i=ql(r),o=[...t].map(a=>[a,i(EL,a,e)]),s=ql(n?1:Number.POSITIVE_INFINITY);try{await Promise.all(o.map(a=>s(AL,a)))}catch(a){if(a instanceof Vl)return a.value;throw a}}var nw={directory:"isDirectory",file:"isFile"};function TL(t){if(!Object.hasOwnProperty.call(nw,t))throw new Error(`Invalid type specified: ${t}`)}var _L=(t,e)=>e[nw[t]](),SL=t=>t instanceof URL?kL(t):t;async function Td(t,{cwd:e=wL.cwd(),type:r="file",allowSymlinks:n=!0,concurrency:i,preserveOrder:o}={}){TL(r),e=SL(e);let s=n?rw.stat:rw.lstat;return kd(t,async a=>{try{let u=await s(CL.resolve(e,a));return _L(r,u)}catch{return!1}},{concurrency:i,preserveOrder:o})}import{fileURLToPath as vL}from"node:url";function _d(t){return t instanceof URL?vL(t):t}var IL=Symbol("findUpStop");async function OL(t,e={}){let r=ta.resolve(_d(e.cwd)??""),{root:n}=ta.parse(r),i=ta.resolve(r,_d(e.stopAt??n)),o=e.limit??Number.POSITIVE_INFINITY,s=[t].flat(),a=async l=>{if(typeof t!="function")return Td(s,l);let c=await t(l.cwd);return typeof c=="string"?Td([c],l):c},u=[];for(;;){let l=await a({...e,cwd:r});if(l===IL||(l&&u.push(ta.resolve(r,l)),r===i||u.length>=o))break;r=ta.dirname(r)}return u}async function iw(t,e={}){return(await OL(t,{...e,limit:1}))[0]}import DL from"node:path";async function ow({cwd:t}={}){let e=await Fa("package.json",{cwd:t});return e&&DL.dirname(e)}import{log as sw}from"remark-mdat";async function Sd(){sw.info("Searching for package directory...");let t=await ow()??process.cwd(),e=await iw("readme.md",{stopAt:t,type:"file"});if(e!==void 0)return sw.info(`Found closest readme at "${e}"`),e}async function Gl(){let t=await Sd();if(t===void 0)throw new Error("No readme found");return t}async function Wl(t,e,r,n,i){return t??=await Gl(),wn(t,$l,cu,e,r,n,i)}async function aw(t,e,r,n,i){return t??=await Gl(),wn(t,$l,pu,e,r,n,i)}async function uw(t,e,r,n,i){return t??=await Gl(),wn(t,$l,fu,e,r,n,i)}var zr=ts(la(),1);import{confirm as mw,group as BL,intro as jL,note as gw,outro as UL,select as vd}from"@clack/prompts";import zL from"node:fs/promises";import Hl from"node:path";import{deepMergeDefined as $L}from"remark-mdat";var lw=`<!-- header -->
241
+ </picture>`}async function KA(t){let e=await Yo.readFile(t),r=hL.createHash("sha1");return r.update(e),r.digest("hex").slice(0,8)}function YA(t){return t.replace(/\.[^./]+$/,"")}import{getSoleRule as mL}from"remark-mdat";var XA={toc:mL(Ul)};var JA={...pu,...hu,...CA,...Ol,..._A,...vl,...Dl,...IA,...OA,...Rl,...Fl,...FA,...LA,...Ul,...Nl,...ZA,...XA};async function zl(t){let e={addMetaComment:!0,rules:JA},{additionalConfig:r=[],...n}=t??{},i=Array.isArray(r)?r:[r],o=await bi({additionalConfig:[e,...i],...n});if(o.packageFile===void 0)throw new Error("Package file path is required in `mdat readme` config");return o}import ta from"path";import yL from"process";import bL from"path";import bse,{promises as QA}from"fs";import{fileURLToPath as EL}from"url";var Ed=class{value;next;constructor(e){this.value=e}},ea=class{#e;#t;#r;constructor(){this.clear()}enqueue(e){let r=new Ed(e);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let e=this.#e;if(e)return this.#e=this.#e.next,this.#r--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}*drain(){for(;this.#e;)yield this.dequeue()}};function $l(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let e=new ea,r=0,n=()=>{r--,e.size>0&&e.dequeue()()},i=async(a,u,l)=>{r++;let c=(async()=>a(...l))();u(c);try{await c}catch{}n()},o=(a,u,l)=>{e.enqueue(i.bind(void 0,a,u,l)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.dequeue()()))()},s=(a,...u)=>new Promise(l=>{o(a,l,u)});return Object.defineProperties(s,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),s}var ql=class extends Error{constructor(e){super(),this.value=e}},gL=async(t,e)=>e(await t),xL=async t=>{let e=await Promise.all(t);if(e[1]===!0)throw new ql(e[0]);return!1};async function Ad(t,e,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:n=!0}={}){let i=$l(r),o=[...t].map(a=>[a,i(gL,a,e)]),s=$l(n?1:Number.POSITIVE_INFINITY);try{await Promise.all(o.map(a=>s(xL,a)))}catch(a){if(a instanceof ql)return a.value;throw a}}var ek={directory:"isDirectory",file:"isFile"};function AL(t){if(!Object.hasOwnProperty.call(ek,t))throw new Error(`Invalid type specified: ${t}`)}var kL=(t,e)=>e[ek[t]](),wL=t=>t instanceof URL?EL(t):t;async function kd(t,{cwd:e=yL.cwd(),type:r="file",allowSymlinks:n=!0,concurrency:i,preserveOrder:o}={}){AL(r),e=wL(e);let s=n?QA.stat:QA.lstat;return Ad(t,async a=>{try{let u=await s(bL.resolve(e,a));return kL(r,u)}catch{return!1}},{concurrency:i,preserveOrder:o})}import{fileURLToPath as CL}from"url";function wd(t){return t instanceof URL?CL(t):t}import Sse,{promises as Ise}from"fs";var TL=Symbol("findUpStop");async function _L(t,e={}){let r=ta.resolve(wd(e.cwd)??""),{root:n}=ta.parse(r),i=ta.resolve(r,wd(e.stopAt??n)),o=e.limit??Number.POSITIVE_INFINITY,s=[t].flat(),a=async l=>{if(typeof t!="function")return kd(s,l);let c=await t(l.cwd);return typeof c=="string"?kd([c],l):c},u=[];for(;;){let l=await a({...e,cwd:r});if(l===TL||(l&&u.push(ta.resolve(r,l)),r===i||u.length>=o))break;r=ta.dirname(r)}return u}async function tk(t,e={}){return(await _L(t,{...e,limit:1}))[0]}import SL from"path";async function rk({cwd:t}={}){let e=await Ra("package.json",{cwd:t});return e&&SL.dirname(e)}import{log as nk}from"remark-mdat";async function Cd(){nk.info("Searching for package directory...");let t=await rk()??process.cwd(),e=await tk("readme.md",{stopAt:t,type:"file"});if(e!==void 0)return nk.info(`Found closest readme at "${e}"`),e}async function Vl(){let t=await Cd();if(t===void 0)throw new Error("No readme found");return t}async function Gl(t,e,r,n,i){return t??=await Vl(),Cn(t,zl,lu,e,r,n,i)}async function ik(t,e,r,n,i){return t??=await Vl(),Cn(t,zl,fu,e,r,n,i)}async function ok(t,e,r,n,i){return t??=await Vl(),Cn(t,zl,cu,e,r,n,i)}var $r=ns(la(),1);import{confirm as pk,group as NL,intro as PL,note as dk,outro as LL,select as Td}from"@clack/prompts";import ML from"fs/promises";import Wl from"path";import{deepMergeDefined as BL}from"remark-mdat";var sk=`<!-- header -->
242
242
 
243
243
  <!-- table-of-contents -->
244
244
 
@@ -283,7 +283,7 @@ _List maintainer(s) for a repository, along with one way of contacting them (e.g
283
283
  _State anyone or anything that significantly helped with the development of your project. State public contact hyper-links if applicable._
284
284
 
285
285
  <!-- footer -->
286
- `;var cw=`<!-- title -->
286
+ `;var ak=`<!-- title -->
287
287
 
288
288
  <!-- banner -->
289
289
 
@@ -336,7 +336,7 @@ _State anyone or anything that significantly helped with the development of your
336
336
  <!-- contributing -->
337
337
 
338
338
  <!-- license -->
339
- `;var fw=`<!-- header -->
339
+ `;var uk=`<!-- header -->
340
340
 
341
341
  ## Install
342
342
 
@@ -352,7 +352,7 @@ _State anyone or anything that significantly helped with the development of your
352
352
  \`\`\`
353
353
 
354
354
  <!-- footer -->
355
- `;var pw=`<!-- title -->
355
+ `;var lk=`<!-- title -->
356
356
 
357
357
  <!-- short-description -->
358
358
 
@@ -374,7 +374,7 @@ _State anyone or anything that significantly helped with the development of your
374
374
  <!-- contributing -->
375
375
 
376
376
  <!-- license -->
377
- `;var dw=`<!-- header -->
377
+ `;var ck=`<!-- header -->
378
378
 
379
379
  _Long description goes here._
380
380
 
@@ -437,7 +437,7 @@ _List maintainer(s) for a repository, along with one way of contacting them (e.g
437
437
  _State anyone or anything that significantly helped with the development of your project. State public contact hyper-links if applicable._
438
438
 
439
439
  <!-- footer -->
440
- `;var hw=`<!-- title -->
440
+ `;var fk=`<!-- title -->
441
441
 
442
442
  <!-- banner -->
443
443
 
@@ -508,7 +508,7 @@ _State anyone or anything that significantly helped with the development of your
508
508
  <!-- contributing -->
509
509
 
510
510
  <!-- license -->
511
- `;var Mi={"MDAT Readme":{content:{compound:lw,explicit:cw},description:"The house style. An expansive starting point. Prune to your context and taste.",exampleLink:"https://github.com/kitschpatrol/mdat/blob/main/readme.md"},"Standard Readme Basic":{content:{compound:fw,explicit:pw},description:'Includes only the "required" sections from the Standard Readme specification.',exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md"},"Standard Readme Full":{content:{compound:dw,explicit:hw},description:"Includes all sections from the Standard Readme specification.",exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md"}};async function xw(){let t=await Sd(),e=await Na();return{packageDirectory:e===void 0?void 0:Hl.dirname(Hl.resolve(e)),readmePath:t}}async function yw(){let{packageDirectory:t,readmePath:e}=await xw(),r=Hl.resolve(process.cwd());jL(`Running ${zr.default.bold("mdat readme init")} interactively`);let n=await BL({overwrite:async()=>e===void 0||await mw({message:`Found an existing readme at "${zr.default.blue(e)}". Do you want to overwrite it?`,active:"Overwrite",inactive:"Exit"})?!0:(()=>{throw new Error("`mdat readme init` was cancelled to avoid an overwrite - no changes were made")})(),output:async()=>t!==void 0&&t!==r?vd({initialValue:t,message:"There's a root package directory nearby, do you want to create the readme there instead of the current directory?",options:[{label:`Create in the current package root: "${zr.default.blue(t)}"`,value:t},{label:`Create in current working directory: "${zr.default.blue(r)}"`,value:r}]}):r,template:async()=>vd({message:"Which template would you like to use?",options:VL()}),compound:async()=>vd({message:'Do you want to use "compound comments" where possible, which combine several expansions into a single comment block?',options:[{label:`Yes: Combine things like ${zr.default.green("<!-- title -->")} and ${zr.default.green("<!-- badges -->")} in a single ${zr.default.green("<!-- header -->")} comment.`,value:!0},{label:"No: Use individual MDAT expansion comments for each section.",value:!1}]}),expand:async()=>t===void 0?!1:mw({initialValue:!0,message:"Do you want to run `mdat readme` now to expand the template with content from your package.json?"})},{onCancel(){throw new Error("`mdat readme init` was cancelled - no changes were made")}}),i=await Id(n);return t===void 0&&gw("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json."),gw(`Readme created: "${zr.default.blue(zr.default.bold(i))}"`),UL("Done!"),i}async function Id(t){let{packageDirectory:e}=await xw(),r=$L({compound:!0,output:e??process.cwd(),overwrite:!0,expand:e!==void 0,template:Object.keys(Mi)[0]},t??{}),n=qL(r.template,r.compound),i=Hl.join(r.output,"readme.md");await zL.writeFile(i,n,"utf8");let[o]=await Wl(i);return await un(o),i}function qL(t,e){let n=Mi[t].content[e?"compound":"explicit"];if(n===void 0||n==="")throw new Error(`No template found for "${t}"`);return n}function VL(){return Object.entries(Mi).map(([t,e])=>({label:t,hint:e.description,value:t}))}var Bi={config:{defaultDescription:"Configuration is loaded if found from the usual places, or defaults are used.",description:"Path(s) to files containing MDAT configuration.",string:!0,type:"array"}},ra={meta:{alias:"m",description:"Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically.",type:"boolean"}},na={name:{alias:"n",defaultDescription:"Same name as input file. Overwrites the input file.",description:"Output file name.",type:"string"}},Ko={output:{alias:"o",defaultDescription:"Same directory as input file.",description:"Output file directory.",type:"string"}},ji={prefix:{description:"Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-MDAT comments in your Markdown file, or if you're willing to trade some verbosity for safety.",type:"string"}},ia={print:{description:"Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options.",type:"boolean"}},oa={rules:{alias:"r",description:"Path(s) to files containing MDAT comment expansion rules.",string:!0,type:"array"}},Un={verbose:{describe:"Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection.",type:"boolean"}},Kl=["files",{array:!0,demandOption:!0,describe:"Markdown file(s) with MDAT placeholder comments.",type:"string"}];var Od={package:{defaultDescription:"The closest package.json file is used by default.",description:"Path to the package.json file to use to populate the readme.",string:!0}},Dd={assets:{defaultDescription:"./assets",description:"Path to find and save readme-related assets.",string:!0}},bw={interactive:{alias:"i",default:!0,description:"Run the guided interactive `init` process. Set explicitly to `false` to use default values and skip the prompt.",type:"boolean"}},Ew={overwrite:{default:!1,defaultDescription:"`false`, if an existing readme is found, don't touch it.",description:"Replace an existing readme file if one is found.",type:"boolean"}},Aw={expand:{alias:"e",default:!0,description:"Automatically run `mdat readme` immediately after creating the readme template.",type:"boolean"}},ww={template:{alias:"t",choices:Object.keys(Mi),default:Object.keys(Mi)[0],description:"Specify a template to use for the new readme.",type:"string"}},Cw={compound:{alias:"c",default:!0,description:"Use compound comment version of the template to replace several individual comment placeholders where possible. This combines things like `<!-- title -->`, `<!-- badges -->`, etc. in a single `<!-- header -->` comment. It's less clutter when you're editing, but it's also less explicit. The final readme.md output is identical.",type:"boolean"}},Yl=["files",{array:!0,demandOption:!1,describe:"Readme file(s) with MDAT placeholder comments. If not provided, the closest readme.md file is used.",type:"string"}];var Ui=performance.now(),kw=Mh(cc(process.argv));try{await kw.scriptName("mdat").usage("$0 [command]","Work with MDAT placeholder comments in any Markdown file.").command(["$0 <files..> [options]","expand <files..> [options]"],"Expand MDAT placeholder comments.",t=>t.positional(...Kl).option(Bi).option(oa).option(Ko).option(na).option(ra).option(ji).option(ia).option(Un),async({config:t,files:e,meta:r,name:n,output:i,prefix:o,print:s,rules:a,verbose:u})=>{ht.verbose=u??!1,Zl({name:n,output:i,print:s});let l=Zo(t,{addMetaComment:r,keywordPrefix:o}),c=await Qg(e,n,i,l,a);for(let f of c)s?process.stdout.write(f.toString()):await un(f);Yo(c),ht.info(`Expanded comments in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(c)}).command("check <files..> [options]","Validate a Markdown file containing MDAT placeholder comments.",t=>t.positional(...Kl).option(Bi).option(oa).option(ra).option(ji).option(Un),async({config:t,files:e,meta:r,prefix:n,rules:i,verbose:o})=>{ht.verbose=o??!1;let s=Zo(t,{addMetaComment:r,keywordPrefix:n}),a=await ex(e,void 0,void 0,s,i);Yo(a),ht.info(`Checked comments in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(a)}).command("collapse <files..> [options]","Collapse MDAT placeholder comments.",t=>t.positional(...Kl).option(Bi).option(Ko).option(na).option(ji).option(ia).option(Un),async({config:t,files:e,name:r,output:n,prefix:i,print:o,verbose:s})=>{ht.verbose=s??!1,Zl({name:r,output:n,print:o});let a=Zo(t,{keywordPrefix:i}),u=await tx(e,void 0,void 0,a);for(let l of u)o?process.stdout.write(l.toString()):await un(l);Yo(u),ht.info(`Cleaned comments in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(u)}).command("readme [command]","Work with MDAT comments in your readme.md.",t=>t.command(["$0 [files..] [options]","expand [files..] [options]"],"Expand MDAT comment placeholders in your readme.md using a collection of helpful built-in expansion rules.",e=>e.positional(...Yl).option(Bi).option(oa).option(Ko).option(na).option(Od).option(Dd).option(ji).option(ra).option(ia).option(Un),async({assets:e,config:r,files:n,meta:i,name:o,output:s,package:a,prefix:u,print:l,rules:c,verbose:f})=>{ht.verbose=f??!1,Zl({name:o,output:s,print:l});let p=Zo(r,{addMetaComment:i,assetsPath:e,keywordPrefix:u,packageFile:a}),d=await Wl(n,o,s,p,c);for(let y of d)l?process.stdout.write(y.toString()):await un(y);Yo(d);let{packageFile:m}=await Tr();ht.info(`Pulled package metadata from: ${Jo.default.blue(Jo.default.bold(m))}`),ht.info(`Expanded readme(s) in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(d)}).command("check [files..] [options]","Validate MDAT placeholder comments in your readme.md.",e=>e.positional(...Yl).option(Bi).option(oa).option(Od).option(Dd).option(ji).option(ra).option(Un),async({assets:e,config:r,files:n,meta:i,package:o,prefix:s,rules:a,verbose:u})=>{ht.verbose=u??!1;let l=Zo(r,{addMetaComment:i,assetsPath:e,keywordPrefix:s,packageFile:o}),c=await aw(n,void 0,void 0,l,a);Yo(c);let{packageFile:f}=await Tr();ht.info(`Pulled package metadata from: ${Jo.default.blue(Jo.default.bold(f))}`),ht.info(`Checked readme(s) in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(c)}).command("collapse [files..] [options]","Collapse MDAT placeholder comments in your readme.md.",e=>e.positional(...Yl).option(Ko).option(na).option(ia).option(Bi).option(ji).option(Un),async({config:e,files:r,name:n,output:i,prefix:o,print:s,verbose:a})=>{ht.verbose=a??!1,Zl({name:n,output:i,print:s});let u=Zo(e,{keywordPrefix:o}),l=await uw(r,void 0,void 0,u);for(let c of l)s?process.stdout.write(c.toString()):await un(c);Yo(l),ht.info(`Cleaned readme(s) in ${Vr(performance.now()-Ui)}.`),process.exitCode=Xo(l)}).command("init [options]","Interactively create a new readme.md file with sensible default MDAT comment placeholders.",e=>e.option(bw).option(Ew).option(Ko).option(Aw).option(ww).option(Cw).option(Un),async({compound:e,expand:r,interactive:n,output:i,overwrite:o,template:s,verbose:a})=>{if(ht.verbose=a??!1,n)await yw();else{let u=await Id({compound:e,expand:r,output:i,overwrite:o,template:s});ht.info(`Created readme at "${Jo.default.blue(u)}" in ${Vr(performance.now()-Ui)}.`)}process.exitCode=0}),()=>{ht.error("Root MDAT readme command should be unreachable.")}).help().alias("h","help").version(Bh).alias("v","version").wrap(process.stdout.isTTY?Math.min(120,kw.terminalWidth()):0).fail(!1).parse()}catch(t){t instanceof Error&&ht.error(t.message),process.exitCode=1}function Zl(t){t.print&&t.output&&ht.warn("Ignoring --output option because --print is set"),t.print&&t.name&&ht.warn("Ignoring --name option because --print is set")}function Zo(t,e){return[...Pa(t),e]}function Xo(t){return GL(t).reduce((n,i)=>n+i.errors.length,0)>0?1:0}
511
+ `;var ji={"MDAT Readme":{content:{compound:sk,explicit:ak},description:"The house style. An expansive starting point. Prune to your context and taste.",exampleLink:"https://github.com/kitschpatrol/mdat/blob/main/readme.md"},"Standard Readme Basic":{content:{compound:uk,explicit:lk},description:'Includes only the "required" sections from the Standard Readme specification.',exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/minimal-readme.md"},"Standard Readme Full":{content:{compound:ck,explicit:fk},description:"Includes all sections from the Standard Readme specification.",exampleLink:"https://github.com/RichardLitt/standard-readme/blob/main/example-readmes/maximal-readme.md"}};async function hk(){let t=await Cd(),e=await Fa();return{packageDirectory:e===void 0?void 0:Wl.dirname(Wl.resolve(e)),readmePath:t}}async function mk(){let{packageDirectory:t,readmePath:e}=await hk(),r=Wl.resolve(process.cwd());PL(`Running ${$r.default.bold("mdat readme init")} interactively`);let n=await NL({overwrite:async()=>e===void 0||await pk({message:`Found an existing readme at "${$r.default.blue(e)}". Do you want to overwrite it?`,active:"Overwrite",inactive:"Exit"})?!0:(()=>{throw new Error("`mdat readme init` was cancelled to avoid an overwrite - no changes were made")})(),output:async()=>t!==void 0&&t!==r?Td({initialValue:t,message:"There's a root package directory nearby, do you want to create the readme there instead of the current directory?",options:[{label:`Create in the current package root: "${$r.default.blue(t)}"`,value:t},{label:`Create in current working directory: "${$r.default.blue(r)}"`,value:r}]}):r,template:async()=>Td({message:"Which template would you like to use?",options:UL()}),compound:async()=>Td({message:'Do you want to use "compound comments" where possible, which combine several expansions into a single comment block?',options:[{label:`Yes: Combine things like ${$r.default.green("<!-- title -->")} and ${$r.default.green("<!-- badges -->")} in a single ${$r.default.green("<!-- header -->")} comment.`,value:!0},{label:"No: Use individual MDAT expansion comments for each section.",value:!1}]}),expand:async()=>t===void 0?!1:pk({initialValue:!0,message:"Do you want to run `mdat readme` now to expand the template with content from your package.json?"})},{onCancel(){throw new Error("`mdat readme init` was cancelled - no changes were made")}}),i=await _d(n);return t===void 0&&dk("No package.json was found. Once you've created one, you can run `mdat readme` to expand the template with content from your package.json."),dk(`Readme created: "${$r.default.blue($r.default.bold(i))}"`),LL("Done!"),i}async function _d(t){let{packageDirectory:e}=await hk(),r=BL({compound:!0,output:e??process.cwd(),overwrite:!0,expand:e!==void 0,template:Object.keys(ji)[0]},t??{}),n=jL(r.template,r.compound),i=Wl.join(r.output,"readme.md");await ML.writeFile(i,n,"utf8");let[o]=await Gl(i);return await ln(o),i}function jL(t,e){let n=ji[t].content[e?"compound":"explicit"];if(n===void 0||n==="")throw new Error(`No template found for "${t}"`);return n}function UL(){return Object.entries(ji).map(([t,e])=>({label:t,hint:e.description,value:t}))}var Ui={config:{defaultDescription:"Configuration is loaded if found from the usual places, or defaults are used.",description:"Path(s) to files containing MDAT configuration.",string:!0,type:"array"}},ra={meta:{alias:"m",description:"Embed an extra comment at the top of the generated Markdown warning editors that certain sections of the document have been generated dynamically.",type:"boolean"}},na={name:{alias:"n",defaultDescription:"Same name as input file. Overwrites the input file.",description:"Output file name.",type:"string"}},Zo={output:{alias:"o",defaultDescription:"Same directory as input file.",description:"Output file directory.",type:"string"}},zi={prefix:{description:"Require a string prefix before all comments to be considered for expansion. Useful if you have a bunch of non-MDAT comments in your Markdown file, or if you're willing to trade some verbosity for safety.",type:"string"}},ia={print:{description:"Print the expanded Markdown to stdout instead of saving to a file. Ignores `--output` and `--name` options.",type:"boolean"}},oa={rules:{alias:"r",description:"Path(s) to files containing MDAT comment expansion rules.",string:!0,type:"array"}},$n={verbose:{describe:"Enable verbose logging. All verbose logs and prefixed with their log level and are printed to stderr for ease of redirection.",type:"boolean"}},Hl=["files",{array:!0,demandOption:!0,describe:"Markdown file(s) with MDAT placeholder comments.",type:"string"}];var Sd={package:{defaultDescription:"The closest package.json file is used by default.",description:"Path to the package.json file to use to populate the readme.",string:!0}},Id={assets:{defaultDescription:"./assets",description:"Path to find and save readme-related assets.",string:!0}},gk={interactive:{alias:"i",default:!0,description:"Run the guided interactive `init` process. Set explicitly to `false` to use default values and skip the prompt.",type:"boolean"}},xk={overwrite:{default:!1,defaultDescription:"`false`, if an existing readme is found, don't touch it.",description:"Replace an existing readme file if one is found.",type:"boolean"}},yk={expand:{alias:"e",default:!0,description:"Automatically run `mdat readme` immediately after creating the readme template.",type:"boolean"}},bk={template:{alias:"t",choices:Object.keys(ji),default:Object.keys(ji)[0],description:"Specify a template to use for the new readme.",type:"string"}},Ek={compound:{alias:"c",default:!0,description:"Use compound comment version of the template to replace several individual comment placeholders where possible. This combines things like `<!-- title -->`, `<!-- badges -->`, etc. in a single `<!-- header -->` comment. It's less clutter when you're editing, but it's also less explicit. The final readme.md output is identical.",type:"boolean"}},Kl=["files",{array:!0,demandOption:!1,describe:"Readme file(s) with MDAT placeholder comments. If not provided, the closest readme.md file is used.",type:"string"}];var $i=performance.now(),Ak=Ph(lc(process.argv));try{await Ak.scriptName("mdat").usage("$0 [command]","Work with MDAT placeholder comments in any Markdown file.").command(["$0 <files..> [options]","expand <files..> [options]"],"Expand MDAT placeholder comments.",t=>t.positional(...Hl).option(Ui).option(oa).option(Zo).option(na).option(ra).option(zi).option(ia).option($n),async({config:t,files:e,meta:r,name:n,output:i,prefix:o,print:s,rules:a,verbose:u})=>{ht.verbose=u??!1,Yl({name:n,output:i,print:s});let l=Jo(t,{addMetaComment:r,keywordPrefix:o}),c=await Yg(e,n,i,l,a);for(let f of c)s?process.stdout.write(f.toString()):await ln(f);Xo(c),ht.info(`Expanded comments in ${Gr(performance.now()-$i)}.`),process.exitCode=Qo(c)}).command("check <files..> [options]","Validate a Markdown file containing MDAT placeholder comments.",t=>t.positional(...Hl).option(Ui).option(oa).option(ra).option(zi).option($n),async({config:t,files:e,meta:r,prefix:n,rules:i,verbose:o})=>{ht.verbose=o??!1;let s=Jo(t,{addMetaComment:r,keywordPrefix:n}),a=await Zg(e,void 0,void 0,s,i);Xo(a),ht.info(`Checked comments in ${Gr(performance.now()-$i)}.`),process.exitCode=Qo(a)}).command("collapse <files..> [options]","Collapse MDAT placeholder comments.",t=>t.positional(...Hl).option(Ui).option(Zo).option(na).option(zi).option(ia).option($n),async({config:t,files:e,name:r,output:n,prefix:i,print:o,verbose:s})=>{ht.verbose=s??!1,Yl({name:r,output:n,print:o});let a=Jo(t,{keywordPrefix:i}),u=await Xg(e,void 0,void 0,a);for(let l of u)o?process.stdout.write(l.toString()):await ln(l);Xo(u),ht.info(`Cleaned comments in ${Gr(performance.now()-$i)}.`),process.exitCode=Qo(u)}).command("readme [command]","Work with MDAT comments in your readme.md.",t=>t.command(["$0 [files..] [options]","expand [files..] [options]"],"Expand MDAT comment placeholders in your readme.md using a collection of helpful built-in expansion rules.",e=>e.positional(...Kl).option(Ui).option(oa).option(Zo).option(na).option(Sd).option(Id).option(zi).option(ra).option(ia).option($n),async({assets:e,config:r,files:n,meta:i,name:o,output:s,package:a,prefix:u,print:l,rules:c,verbose:f})=>{ht.verbose=f??!1,Yl({name:o,output:s,print:l});let p=Jo(r,{addMetaComment:i,assetsPath:e,keywordPrefix:u,packageFile:a}),d=await Gl(n,o,s,p,c);for(let y of d)l?process.stdout.write(y.toString()):await ln(y);Xo(d);let{packageFile:m}=await _r();ht.info(`Pulled package metadata from: ${es.default.blue(es.default.bold(m))}`),ht.info(`Expanded readme(s) in ${Gr(performance.now()-$i)}.`),process.exitCode=Qo(d)}).command("check [files..] [options]","Validate MDAT placeholder comments in your readme.md.",e=>e.positional(...Kl).option(Ui).option(oa).option(Sd).option(Id).option(zi).option(ra).option($n),async({assets:e,config:r,files:n,meta:i,package:o,prefix:s,rules:a,verbose:u})=>{ht.verbose=u??!1;let l=Jo(r,{addMetaComment:i,assetsPath:e,keywordPrefix:s,packageFile:o}),c=await ik(n,void 0,void 0,l,a);Xo(c);let{packageFile:f}=await _r();ht.info(`Pulled package metadata from: ${es.default.blue(es.default.bold(f))}`),ht.info(`Checked readme(s) in ${Gr(performance.now()-$i)}.`),process.exitCode=Qo(c)}).command("collapse [files..] [options]","Collapse MDAT placeholder comments in your readme.md.",e=>e.positional(...Kl).option(Zo).option(na).option(ia).option(Ui).option(zi).option($n),async({config:e,files:r,name:n,output:i,prefix:o,print:s,verbose:a})=>{ht.verbose=a??!1,Yl({name:n,output:i,print:s});let u=Jo(e,{keywordPrefix:o}),l=await ok(r,void 0,void 0,u);for(let c of l)s?process.stdout.write(c.toString()):await ln(c);Xo(l),ht.info(`Cleaned readme(s) in ${Gr(performance.now()-$i)}.`),process.exitCode=Qo(l)}).command("init [options]","Interactively create a new readme.md file with sensible default MDAT comment placeholders.",e=>e.option(gk).option(xk).option(Zo).option(yk).option(bk).option(Ek).option($n),async({compound:e,expand:r,interactive:n,output:i,overwrite:o,template:s,verbose:a})=>{if(ht.verbose=a??!1,n)await mk();else{let u=await _d({compound:e,expand:r,output:i,overwrite:o,template:s});ht.info(`Created readme at "${es.default.blue(u)}" in ${Gr(performance.now()-$i)}.`)}process.exitCode=0}),()=>{ht.error("Root MDAT readme command should be unreachable.")}).help().alias("h","help").version(Lh).alias("v","version").wrap(process.stdout.isTTY?Math.min(120,Ak.terminalWidth()):0).fail(!1).parse()}catch(t){t instanceof Error&&ht.error(t.message),process.exitCode=1}function Yl(t){t.print&&t.output&&ht.warn("Ignoring --output option because --print is set"),t.print&&t.name&&ht.warn("Ignoring --name option because --print is set")}function Jo(t,e){return[...Na(t),e]}function Qo(t){return zL(t).reduce((n,i)=>n+i.errors.length,0)>0?1:0}
512
512
  /*! Bundled license information:
513
513
 
514
514
  yargs-parser/build/lib/string-utils.js: